Re: [spice v15 02/21] streaming: Remove the width/height encode_frame() parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 27 May 2016, Christophe Fergeau wrote:

> Hey,
> 
> On Thu, May 26, 2016 at 05:15:56PM +0200, Francois Gouget wrote:
> > encode_frame() needs the QXL_DRAW_COPY operation's SpiceCopy.src_area
> > field anyway, so the width and height parameters were redundant.
> > 
> > Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
> > ---
> >  server/dcc-send.c      | 26 ++++++++------------------
> >  server/mjpeg-encoder.c |  1 -
> >  server/video-encoder.h |  2 +-
> >  3 files changed, 9 insertions(+), 20 deletions(-)
> > 
> > diff --git a/server/dcc-send.c b/server/dcc-send.c
> > index 5171f9a..9ece37e 100644
> > --- a/server/dcc-send.c
> > +++ b/server/dcc-send.c
> > @@ -1660,7 +1660,6 @@ static int red_marshall_stream_data(RedChannelClient *rcc,
> >      SpiceImage *image;
> >      uint32_t frame_mm_time;
> >      uint32_t n;
> > -    int width, height;
> >      int ret;
> >  
> >      if (!stream) {
> > @@ -1675,21 +1674,13 @@ static int red_marshall_stream_data(RedChannelClient *rcc,
> >          return FALSE;
> >      }
> >  
> > -    if (drawable->sized_stream) {
> > -        if (red_channel_client_test_remote_cap(rcc, SPICE_DISPLAY_CAP_SIZED_STREAM)) {
> > -            SpiceRect *src_rect = &drawable->red_drawable->u.copy.src_area;
> > -
> > -            width = src_rect->right - src_rect->left;
> > -            height = src_rect->bottom - src_rect->top;
> > -        } else {
> > -            return FALSE;
> > -        }
> > -    } else {
> > -        width = stream->width;
> > -        height = stream->height;
> > +    if (drawable->sized_stream &&
> > +        !red_channel_client_test_remote_cap(rcc, SPICE_DISPLAY_CAP_SIZED_STREAM)) {
> > +        return FALSE;
> >      }
> 
> I'm afraid this bit is not going to work as expected with older clients
> (ones not supporting SPICE_DISPLAY_CAP_SIZED_STREAM).

This chunk does not change whether we send a SpiceMsgDisplayStreamData 
or a SpiceMsgDisplayStreamDataSized message. Furthermore, the width / 
height we computed here are only used in the DataSized case and in 
that case we still send the frame's width / height of course:

@@ -1750,8 +1740,8 @@ static int 
red_marshall_stream_data(RedChannelClient *rcc,
         stream_data.base.id = get_stream_id(display, stream);
         stream_data.base.multi_media_time = frame_mm_time;
         stream_data.data_size = n;
-        stream_data.width = width;
-        stream_data.height = height;
+        stream_data.width = src_area->right - src_area->left;
+        stream_data.height = src_area->bottom - src_area->top;
         stream_data.dest = drawable->red_drawable->bbox;


> If we want to keep supporting the !sized_stream case, I believe we need
> both src_area, and the width/height that were used when the stream
> started.

There is no src_area in SpiceMsgDisplayStreamDataSized so it was never 
sent to the clients. Maybe you're thinking of the dest field but that's 
unchanged by this patch.



-- 
Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]