On Fri, Apr 6, 2018 at 10:59 AM, Rıza Arda Kırmızıoğlu
<
rkirmi...@ku.edu.tr> wrote:
> Hello Moller,
> First of all thank you for your answer. How should I call these classes in
> order to create a fake video_track?
These classes don't implement reading frames from a file. You'd need
to do that yourself, interfacing to the video pipeline in the same
way. I'd suggest starting with the FakePeriodicVideoSource, and add
code to read your frames from the right file.
See this line,
https://cs.chromium.org/chromium/src/third_party/webrtc/pc/test/fakeperiodicvideosource.h?q=FakePeriodic&sq=package:chromium&l=54
sink_->OnFrame(frame_source_.GetFrame());
Here, frame_source_ is a test class that just produces blank frames
with appropriate size and time stamps. You'd need to substitute code
to get your frame data.
Also the TaskQueue thing is an internal webrtc facility, for your code
it might be better to spawn a normal thread to do this work.
You can use the VideoTrackSource class to wrap any
VideoSourceInterface, which is how FakePeriodicVideoSource is used,
there's one example in
https://cs.chromium.org/chromium/src/third_party/webrtc/ortc/ortcfactory_integrationtest.cc?type=cs&q=FakePeriodicVideoSource&sq=package:chromium&l=227
(this uses OrtcFactory, but PeerConnectionFactory is the same in this
respect). The VideoTrackSource is then passed to
PeerConnectionFactory::CreateVideoTrack.
That might be one more layer than you need; you can also choose to let
your code implement VideoTrackSourceInterface directly, rather than
the more generic VideoSourceInterface. Then you don't need the
VideoTrackSource class.
Regards,
/Niels