Re: [spice v16 01/23] streaming: Better check for sized frames

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

 



> Usually the RedDrawable bbox dimensions match the src_area dimensions
> so that checking that the bbox matches the stream's original dest_area
> should be enough to determine if sized stream support is needed to
> send the frame.
> But making the bbox different could be used to have the scaling be
> performed on the client side. So it's better not to assume the bbox and
> src_area have the same dimensions.
> 
> Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
> ---
>  server/stream.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/server/stream.c b/server/stream.c
> index 2aa13d1..d8be148 100644
> --- a/server/stream.c
> +++ b/server/stream.c
> @@ -252,6 +252,7 @@ static int is_next_stream_frame(DisplayChannel *display,
>          }
>      } else {
>          if (rect_contains(&red_drawable->bbox, other_dest)) {
> +            SpiceRect* candidate_src;
>              int candidate_area = rect_get_area(&red_drawable->bbox);
>              int other_area = rect_get_area(other_dest);
>              /* do not stream drawables that are significantly
> @@ -265,7 +266,10 @@ static int is_next_stream_frame(DisplayChannel *display,
>                  return STREAM_FRAME_NONE;
>              }
>  
> -            if (candidate_area > other_area) {
> +            candidate_src = &red_drawable->u.copy.src_area;
> +            if (candidate_area > other_area ||
> +                candidate_src->right - candidate_src->left !=
> other_src_width ||
> +                candidate_src->bottom - candidate_src->top !=
> other_src_height) {
>                  is_frame_container = TRUE;
>              }
>          } else {

Not a problem of this patch but this code is confusing.
It's not clear that other_area is not the area or "other_src",
perhaps would be better renamed to other_dest_area (I was
going to suggest to remove the first test on the if as
a result).

Frediano
_______________________________________________
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]