CalledOnValidThread assertion

65 views
Skip to first unread message

Luca Carlon

unread,
Mar 20, 2016, 5:06:35 PM3/20/16
to discuss-webrtc
Hello,
I'm trying to use the webrtc C++ API to send video frames. After I set up the peer connection and call CreateOffer I get a Start call in the cricket::VideoCapturer. If I try to send frames through SignalFrameCaptured I get an assertion:

#
# Fatal error in ../../webrtc/media/base/videobroadcaster.cc, line 54
# Check failed: thread_checker_.CalledOnValidThread()
#

I suppose I'm trying to call that from the wrong thread. I tried to call it then from the same exact thread the instantiated the cricket::VideoCapturer object, but still no luck. I inspected with gdb the value in thread_checker_ in VideoBroadcaster, but I don't exactly understand what thread it is expecting to be run. Anyone who knows what is the expected thread in that assertion? From where am I supposed to call SignalFrameCaptured?
Thank you!

Luca

radioman . lt

unread,
Mar 21, 2016, 7:05:02 AM3/21/16
to discuss-webrtc
if (startThread_->IsCurrent())
{
SignalFrameCaptured(this, &captured_frame_);
}
else
{
startThread_->Invoke<void>(rtc::Bind(&YuvFramesCapturer2::SignalFrameCapturedOnStartThread, this, &captured_frame_));
}

Luca Carlon

unread,
Mar 21, 2016, 2:38:56 PM3/21/16
to discuss-webrtc
It seems to be working properly now! Thanks!

Luca
Reply all
Reply to author
Forward
0 new messages