Close VcmCapturer will pop-up abort dialog

75 views
Skip to first unread message

Woody Chiu

unread,
Mar 25, 2019, 7:06:27 AM3/25/19
to discuss-webrtc
Hi,

I have one problem of VcmCapturer.

I have update the code base to latest version.
My platform is windows.
I try to streaming video/audio between pc and web.
But, it will pop-up an abort dialog when close the web.

After tracing the code, it looks like doesn't call VideoCaptureDS::StopCapture() on main thread when destruct VideoTrack

Following is the error log:
#
# Fatal error in: ../../modules/video_capture/windows/sink_filter_ds.cc, line 795
# last system error: 0
# Check failed: rtc::internal::AnnounceOnThread::IsCurrent(&main_checker_)

Niels Moller

unread,
Mar 25, 2019, 7:49:19 AM3/25/19
to discuss...@googlegroups.com
On Mon, Mar 25, 2019 at 12:06 PM Woody Chiu <a548...@gmail.com> wrote:
Hi,

I have one problem of VcmCapturer.

I have update the code base to latest version.
My platform is windows.
I try to streaming video/audio between pc and web.
But, it will pop-up an abort dialog when close the web.

After tracing the code, it looks like doesn't call VideoCaptureDS::StopCapture() on main thread when destruct VideoTrack

How is the VcmCapturer connected to the VideoTrack, I would guess that's via some VideoTrackSource class in your windows 
application, not in webrtc? 

Following is the error log:
#
# Fatal error in: ../../modules/video_capture/windows/sink_filter_ds.cc, line 795
# last system error: 0
# Check failed: rtc::internal::AnnounceOnThread::IsCurrent(&main_checker_)
#

This looks like the CaptureSinkFilter::Pause method, and that seems to be an implementation of a windows interface IMediaFilter, with which I'm not familiar at all. 

The use of thread checkers seems to indicate that all these interface methods are expected to be called on the same thread, and in addition, that should be the same thread as the constructor and destructor. Constructor is called from VideoCaptureDS::Init, same thread as VcmCapturer::Create. It's not clear to me whether or not that is a reasonable requirement.

If you can get some more information on involved threads, maybe you can post a bug on bugs.webrtc.org with those details?

Woody Chiu

unread,
Mar 25, 2019, 11:18:14 AM3/25/19
to discuss-webrtc
Thanks for your reply

[Test environment]
PC application: Unity application(Load webrtc_unity_plugin.dll)
Web: Chrome

PC will streaming video/audio with web.
If close the web while streaming video/audio, the pc application will pop-up the dialog.


I'm reference this example to implement webrtc on Unity

For construct time,
I will call AddStream() from Unity main thread.
In the AddStream() function, it will construct the VcmCapture. 

For deconstruct time, it's not control by me
I try to attach the application by visual studio to debug.
After trace the call stack,
It will deconstruct by another thread when web close.

I'm not sure this information is enough or not to post bug.
Or, is there any sample to use the webrtc_unity_plugin.dll on Unity?


Niels Moller於 2019年3月25日星期一 UTC+8下午7時49分19秒寫道:

Woody Chiu

unread,
Mar 26, 2019, 6:53:33 AM3/26/19
to discuss-webrtc
Update more info

It looks like constructor and destructor on different thread. 
After trace the code.
The root cause should be relate with CapturerTrackSource::Create().
It doesn't call by signaling_thread_.

When I call the SimplePeerConnection::AddStreams from Unity main thread, the video track will construct by this main thread.
But, when close peer connection. It will destruct by signaling_thread_

Juan Garcia

unread,
Jul 26, 2021, 3:49:22 AM7/26/21
to discuss-webrtc
Hi,

any solution for this?? I'm having the same issue when trying to stop the capture thread. I'm using M90.

thanks!
Reply all
Reply to author
Forward
0 new messages