Using Desktop Capture with C++

2,681 views
Skip to first unread message

jeanfranc...@equipecdrin.com

unread,
May 12, 2014, 5:08:37 PM5/12/14
to discuss...@googlegroups.com
Hi, I managed to compile WebRTC under Windows 7 and Visual Studio 2013. My goal is to stream the desktop from a native program. 

So far I get to this point:

cricket::VideoCapturer* videoCapturer = 0;
videoCapturer = deviceManager->CreateDesktopCapturer(primaryDesktop.id());
if (videoCapturer == 0)
{
cerr << "No video capturer" << endl;
return -1;
}

CreateDesktopCapturer will always return NULL because the macro DESKTOP_CAPTURER_NAME is not defined in my build.

How do I get this macro defined?

Do I have to do it my self or there is compile option for it?




Paula zwerky

unread,
May 13, 2014, 3:34:54 AM5/13/14
to discuss...@googlegroups.com
I'm also interested here. As far as I see there is no DESKTOP_CAPTURER_NAME defined in the framework. Just look for the DestopCapture module in the webrtc.sln file. It has something called ScreenCapturerWin there. I feel we have intelligently connect these two together. If you have more findings on this, please share.

Thanks and Regards,
Paula.

Francois Temasys

unread,
May 14, 2014, 12:38:48 AM5/14/14
to discuss...@googlegroups.com
I'm also interested in this issue. I already had opened a subject on that some time ago:

Regards,
Francois

jeanfranc...@equipecdrin.com

unread,
May 15, 2014, 1:40:07 PM5/15/14
to discuss...@googlegroups.com
I think we have to implement our own VideoCapturer subclass. I did not find anything in the code base that fit there.

Also, desktop capture is not working for me in Chrome 34.0.1847.131 m or 37.0.1993.0 canary. 

I try it on uberconference.com wich use a plugin as dicussed here (http://youtu.be/DvzDzIXoncg)



jeanfranc...@equipecdrin.com

unread,
May 15, 2014, 3:00:44 PM5/15/14
to discuss...@googlegroups.com
Update: Screen sharing work in chome: need to use https 

Jiayang Liu

unread,
May 16, 2014, 1:35:12 PM5/16/14
to discuss...@googlegroups.com
The desktop capturing implementation is in webrtc/modules/desktop_capture/

You can look into Chromium as an example of how to use it:

Benjamin Hamrick

unread,
Dec 7, 2015, 5:16:55 PM12/7/15
to discuss-webrtc
Did you end up getting this to work? I am trying to do something similar.

William Cheung

unread,
Dec 7, 2015, 8:12:41 PM12/7/15
to discuss-webrtc
I've been trying to get this interface to work in windows but with no luck so far. Has anyone had any success?

Benjamin Hamrick

unread,
Dec 11, 2015, 8:50:06 AM12/11/15
to discuss-webrtc
I am instead going to use electron and simple-peer to get webrtc screen capturing in a native app. Here is an example.

Sebastian Kunz

unread,
Jul 12, 2019, 8:57:32 AM7/12/19
to discuss-webrtc
Hello, I'm also interested in this topic, so I'm bumping it.
Reply all
Reply to author
Forward
0 new messages