I compiled the WebRTC native code (C++) and I'm playing with peerconnection server and client examples (under `src\talk\examples\peerconnection`). In particular I am trying to change the client sample to stream a custom sequence of images rather than the webcam video. I used something similar to
as a starting point, where a custom `VideoCapturerFactory` returns a custom `VideoCapturer` that I can use to generate custom image frames. Every time I have a new image to stream, I call `SignalFrameCaptured(this, &frame)` on the `VideoCapturer`.
My problem is that, in debug mode, I get this crash:
#
# Fatal error in e:\webrtc\webrtc checkout\src\webrtc\modules\video_coding\main\source\video_sender.cc, line 90
# Check failed: main_thread_.CalledOnValidThread()
#
And my understanding is that it has something to do with an inconsistency between the thread which started the video stream and the thread which is pushing these individual frames. It seems as though the former is an internal WebRTC thread, while the latter is currently the main thread of the application.
Things work in Release mode because this thread check is disabled.
Any idea how to properly fix this?
Thank you.