<div>I am studying red_send_stream_data() function. I have the stable version of spice 0.8.1. A the end of this function there are some line that I don't understand totally:</div><div><br></div><div>red_channel_init_send_data(channel, SPICE_MSG_DISPLAY_STREAM_DATA, NULL);<br>
SpiceMsgDisplayStreamData stream_data;<br> <a href="http://stream_data.id">stream_data.id</a> = stream - worker->streams_buf;<br> stream_data.multi_media_time = drawable->red_drawable->mm_time;<br> stream_data.data_size = n;<br>
spice_marshall_msg_display_stream_data(base_marshaller, &stream_data);<br>spice_marshaller_add_ref(base_marshaller, display_channel->send_data.stream_outbuf, n);<br></div><div><br></div><div><br></div><div>I would like to know what does these lines do. I have encoded a frame with mjpeg, but how this frame is transmitted to the client?</div>
<div><br></div><div>Thanks.</div><div>Regards.</div><div><br></div><div><br></div><div><br></div><br><div class="gmail_quote">2011/7/6 Christophe Fergeau <span dir="ltr"><<a href="mailto:cfergeau@redhat.com">cfergeau@redhat.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Tue, Jul 05, 2011 at 12:30:29PM +0200, Andrea Celestino wrote:<br>
> I have read the document "spice_for_newbies.pdf", that describes how spice<br>
> works.<br>
> When I play a video on the guest, the video is decoded then the user<br>
> application requests the OS graphic engine (X in linux), to perform a<br>
> rendering operation. X passes the command to the QXL driver which translates<br>
> the OS commands to QXL commands and push them into a command ring. libspice<br>
> pulls this command and adds them to the graphic command tree. The command<br>
> tree is used to detect video stream, so starts mjpegencoder, encode each<br>
> frame indipendently and send it to the client as image(because each frame is<br>
> a jpeg image) with a spice protocol message.<br>
> Is it correct?<br>
<br>
</div>I'm not 100% sure about the part where you talk about the QXL command<br>
ring/command tree since I don't know this part well, but the rest of your<br>
description is correct. The video detection is done by detecting areas of<br>
the screen that are modified often. This detection (among lots of other<br>
things) is done in server/red_worker.c<br>
<font color="#888888"><br>
Christophe<br>
</font></blockquote></div><br>