<p dir="ltr"><br>
On Mar 11, 2014 11:36 AM, "Andrew Wedgbury" <<a href="mailto:andrew.wedgbury@realvnc.com">andrew.wedgbury@realvnc.com</a>> wrote:<br>
><br>
> Hi Jason,<br>
><br>
><br>
> On Wed, 26 Feb 2014, Jason Ekstrand wrote:<br>
><br>
>> 4) Screen sharing and recording. The security discussion on how to allow<br>
>> clients to request screen sharing and things of the like is still going<br>
>> on and I have no intention of solving that question here. Most<br>
>> proposals for screen sharing and capture have been based on weston's<br>
>> screenshooter protocol which allows the screenshooter client to hand a<br>
>> surface to weston that weston then fills with the contents of the<br>
>> screen. While this works for screenshots, there are a lot of race<br>
>> conditions involved in doing it this way. People have also suggested<br>
>> screen sharing protocols. However, these usually involve re-writing<br>
>> most of the wayland protocol in the other (client -> server) direction.<br>
>><br>
>> For this reason, I propose that, instead of having complicated screen<br>
>> sharing protocols, the screen sharing or recording program simply act<br>
>> as a wayland compositor supporting the fullscreen shell protocol. The<br>
>> primary compositor (the DE) can then spawn the sharing program and<br>
>> connect to it as a client. This way we can use the normal Wayland<br>
>> protocol for communication rather than re-writing it in reverse.<br>
><br>
><br>
> Thanks for this. I've been putting together a prototype using our VNC server - I've implemented the required interfaces along with your new fullscreen shell, and I'm launching it in place of weston from your screen-share module. It appears to be working well.</p>
<p dir="ltr">Glad to hear it! Not sure if it's helpful, but you might want to checkout libwlb:</p>
<p dir="ltr"><a href="https://github.com/jekstrand/libwlb">https://github.com/jekstrand/libwlb</a></p>
<p dir="ltr">I'm currently in the process of getting the latest version of wl_fullscreen_shell implemented in it. Unfortunately, it's not API-stable yet, but I think it's getting close.</p>
<p dir="ltr">> One query - I notice you've added a "sprawl" option in compositor-wayland,<br>
> which creates an output for every output in the fullscreen shell<br>
> compositor. This makes sense in the "system compositor" use cases. But for<br>
> screen capture you really want the opposite - i.e. the fullscreen shell<br>
> compositor needs to create an output for each output of the real<br>
> compositor. I guess we could just connect back to the real compositor and<br>
> get the output configuration, but there still needs to be some way of<br>
> connecting this up in screen-share. (At the moment I'm simply creating a<br>
> single output in my fullscreen shell compositor)</p>
<p dir="ltr">Yes, this is an issue. The wl_fullscreen_shell protocol only solves half of the problem. The other half is, as you've mentioned, is setting up everything. There are multiple reasons why this is a challenge. First is the question of how slave compositor (RDP or VNC server) gets launched connected to. One way to do this would be to develop a priviledged client interface whereby a client can ask the server to connect to it for screen-sharing and hand it the connection fd. However, that's kind of out of the scope for the fullscreen shell. For the sake of my little demo, I've made weston launch it. (Note that the --width and --height parameters that get passed should not be needed. I have those in there because the RDP backend for weston can't properly resize without crashing. Ideally, they would not be there)</p>
<p dir="ltr">The second issue is configuring outputs. I don't know much about VNC or RDP but I know that they have some mechanism for multiple outputs and we would like to expose this. One option would be to have the VNC server connect as a client to the compositor. If we go this route, you have to be very careful that it doesn't dead-lock anyware because of the client-server loop. There are also a lot of race conditions there between the server creating an output and the slave compositor creating one. Even if we solve those problems, this doesn't immediatly provide a mechanism for associating the outputs that the VNC server sees as a client with the ones it provides as a server.</p>
<p dir="ltr">Another possible way to solve this is to have an "add_output" request. Obviously, many compositors won't allow this. However, I am already planning to add a set of capabilities flags so the compositor could easily advertise whether or not this is supported. If we did this, we would probably also want to add some sort of move_output request to allow the server to tell the slave compositor where the outputs are. I talked to Jasper a bit about this and I'm not 100% sure what I think of it.</p>
<p dir="ltr">I would be very glad to hear your input on this.<br>
Thanks,<br>
--Jason Ekstrand</p>
<p dir="ltr">> Andrew<br>
><br>
> ---<br>
> Andrew Wedgbury <<a href="mailto:andrew.wedgbury@realvnc.com">andrew.wedgbury@realvnc.com</a>><br>
><br>
</p>