How to Use webrtc::DesktopCapturer module instead of cricket::VideoCapturer for windows?

758 views
Skip to first unread message

Abraam Samy

unread,
Feb 3, 2017, 2:45:12 PM2/3/17
to discuss-webrtc
I want to use  [desktop_capture module for webrtc native](https://chromium.googlesource.com/external/webrtc.git/+/390e64d7ebe15e0e8b21fc1dc49ae3d9b5c545ef/webrtc/modules/desktop_capture/) instead of implementing a new desktop capturer so I want to set the source for peerconnection in CreateVideoSource to webrtc::DesktopCapture instead of using cricket::VideoCapturer as in CreateVideoSource you have to use cricket::VideoCapturer  

        cricket::VideoCapturer * vc = nullptr;
if (capturer_internal)
{
vc = capturer_internal.get();
}
auto v = pc_factory_->CreateVideoSource(vc, NULL);
auto video_track = pc_factory_->CreateVideoTrack(kVideoLabel, v);

even if I created a class which inherit from VideoCapturer How to convert webrtc::DesktopFrame to webrtc::VideoFrame in this [code](https://github.com/radioman/WebRtc.NET/blob/master/WebRtc.NET/src/defaults.cc#L158) ?

UT

unread,
Feb 6, 2017, 2:45:26 AM2/6/17
to discuss-webrtc
If you necessarily have to use desktop_capture module from within webrtc, instead of implementing your own externally, then you probably want to look at how Firefox does it.
It's a pretty big implementation (because cross-platform) but I believe you will be able to figure it out on your own from there.

I'd start with these two links, and connect the dots from there :


And jic if at some point you begin to doubt that this strategy won't work, I assure you that it will. Because, it has been done before.

But in the long run, I recommend to start implementing your own modules externally instead of rewiring stuff inside the webrtc source code itself, because it's not much fun when you would want to upgrade webrtc in your product and port your changes over.

Hope this helps!

Abraam Samy

unread,
Feb 10, 2017, 8:19:15 PM2/10/17
to discuss-webrtc
https://github.com/radioman/WebRtc.NET
that is useful also you can use webrtc screen capture module and pass the captured image to the encoder 
Reply all
Reply to author
Forward
0 new messages