[Spice-devel] [spice v15 02/21] streaming: Remove the width/height encode_frame() parameters
Francois Gouget
fgouget at codeweavers.com
Mon May 30 17:12:48 UTC 2016
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 at codeweavers.com>
> > ---
> > 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 at codeweavers.com>
More information about the Spice-devel
mailing list