Understanding how Screen Sharing in Google Chrome

2,171 views
Skip to first unread message

Gokul vellingiri

unread,
May 5, 2017, 4:40:44 AM5/5/17
to Chromium-dev
I am a newbie to Screen Sharing in Chrome. Screen sharing seems to be using getUserMedia() API (make sure the browser is capable of  running this API --enable-usermedia-screen-capturing) by prompting permission access . By investigating the Chromium Source code i came across a file named media_stream_manager.cc. MediaStreamManager choosing the type of video stream requested by user(Say TAB / DESKTOP / SCREEN / WEBCAM sharing). But I was not able to understand what Chromium does in getting Graphical FrameBuffer (Say for DESKTOP sharing) through a MediaStream in getUserMedia() API callback. 

Any code links of this working or comments from Chromium developers are highly appreciated. 

Gaurav Srivastava

unread,
May 5, 2017, 5:19:01 AM5/5/17
to vgok...@gmail.com, Chromium-dev
Hi Gokul,

Let me first put a disclaimer I am not a google developer am just trying to help you from WebRTC point.

Screensharing is possible in chrome using webrtc , Just one has to provide the screen constraints to getUsermedia(). For getting the screen constraints, which involves streamid,domain permission i.e. which application you selected or full screen. One has to write an extension to get the id and other details.These details when passed to getusermedia() one can get the access desired screen and stream it other party using peerconnection.

There are many opensource examples are there you can check one such link

https://www.webrtc-experiment.com/screen-sharing/#9508276186947123




On Fri, May 5, 2017 at 2:10 PM, Gokul vellingiri <vgok...@gmail.com> wrote:
I am a newbie to Screen Sharing in Chrome. Screen sharing seems to be using getUserMedia() API (make sure the browser is capable of  running this API --enable-usermedia-screen-capturing) by prompting permission access . By investigating the Chromium Source code i came across a file named media_stream_manager.cc. MediaStreamManager choosing the type of video stream requested by user(Say TAB / DESKTOP / SCREEN / WEBCAM sharing). But I was not able to understand what Chromium does in getting Graphical FrameBuffer (Say for DESKTOP sharing) through a MediaStream in getUserMedia() API callback. 

Any code links of this working or comments from Chromium developers are highly appreciated. 

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/ae0e1c2c-7a53-4785-a0a8-9d159d899df6%40chromium.org.



--
Gaurav

Niklas Enbom

unread,
May 5, 2017, 11:41:12 AM5/5/17
to vgok...@gmail.com, Chromium-dev
Gokul, are you looking for the code that does the actual content scraping from a window, desktop etc? That code is located here: https://chromium.googlesource.com/external/webrtc/+/master/webrtc/modules/desktop_capture/ 

On Fri, May 5, 2017 at 1:40 AM, Gokul vellingiri <vgok...@gmail.com> wrote:
I am a newbie to Screen Sharing in Chrome. Screen sharing seems to be using getUserMedia() API (make sure the browser is capable of  running this API --enable-usermedia-screen-capturing) by prompting permission access . By investigating the Chromium Source code i came across a file named media_stream_manager.cc. MediaStreamManager choosing the type of video stream requested by user(Say TAB / DESKTOP / SCREEN / WEBCAM sharing). But I was not able to understand what Chromium does in getting Graphical FrameBuffer (Say for DESKTOP sharing) through a MediaStream in getUserMedia() API callback. 

Any code links of this working or comments from Chromium developers are highly appreciated. 

--

Gokul vellingiri

unread,
May 9, 2017, 2:37:29 AM5/9/17
to Chromium-dev, vgok...@gmail.com
Thank you Gaurav for your replay to the question. The link you provided is a kick-starter for newbie like me. But i was looking for getUserMedia() source code in native code base. Please feel free to post if you are familiar in those.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.



--
Gaurav

Gokul vellingiri

unread,
May 9, 2017, 2:40:43 AM5/9/17
to Chromium-dev, vgok...@gmail.com
Thank you Niklas for you replay. That is what the exact code i was looking for. Thank you once again for your contribution to the question.


On Friday, May 5, 2017 at 9:11:12 PM UTC+5:30, Niklas Enbom wrote:
Gokul, are you looking for the code that does the actual content scraping from a window, desktop etc? That code is located here: https://chromium.googlesource.com/external/webrtc/+/master/webrtc/modules/desktop_capture/ 
On Fri, May 5, 2017 at 1:40 AM, Gokul vellingiri <vgok...@gmail.com> wrote:
I am a newbie to Screen Sharing in Chrome. Screen sharing seems to be using getUserMedia() API (make sure the browser is capable of  running this API --enable-usermedia-screen-capturing) by prompting permission access . By investigating the Chromium Source code i came across a file named media_stream_manager.cc. MediaStreamManager choosing the type of video stream requested by user(Say TAB / DESKTOP / SCREEN / WEBCAM sharing). But I was not able to understand what Chromium does in getting Graphical FrameBuffer (Say for DESKTOP sharing) through a MediaStream in getUserMedia() API callback. 

Any code links of this working or comments from Chromium developers are highly appreciated. 

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
Reply all
Reply to author
Forward
0 new messages