[Spice-devel] [PATCH 17/18] worker: move stream_clip_item_unref()

Fabiano Fidêncio fabiano at fidencio.org
Thu Nov 19 01:52:20 PST 2015


On Wed, Nov 18, 2015 at 5:17 PM, Frediano Ziglio <fziglio at redhat.com> wrote:
> From: Marc-André Lureau <marcandre.lureau at gmail.com>
>
> ---
>  server/red_worker.c | 14 ++------------
>  server/stream.c     | 12 ++++++++++++
>  server/stream.h     |  6 ++++--
>  3 files changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/server/red_worker.c b/server/red_worker.c
> index aab3c73..e31dd08 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -192,16 +192,6 @@ static void red_create_surface(DisplayChannel *display, uint32_t surface_id, uin
>                                 uint32_t height, int32_t stride, uint32_t format,
>                                 void *line_0, int data_is_valid, int send_client);
>
> -static void display_stream_clip_unref(DisplayChannel *display, StreamClipItem *item)
> -{
> -    if (--item->refs != 0)
> -        return;
> -
> -    stream_agent_unref(display, item->stream_agent);
> -    free(item->rects);
> -    free(item);
> -}
> -
>  void attach_stream(DisplayChannel *display, Drawable *drawable, Stream *stream)
>  {
>      DisplayChannelClient *dcc;
> @@ -5416,7 +5406,7 @@ static void display_channel_client_release_item_after_push(DisplayChannelClient
>          drawable_pipe_item_unref(SPICE_CONTAINEROF(item, DrawablePipeItem, dpi_pipe_item));
>          break;
>      case PIPE_ITEM_TYPE_STREAM_CLIP:
> -        display_stream_clip_unref(display, (StreamClipItem *)item);
> +        stream_clip_item_unref(dcc, (StreamClipItem *)item);
>          break;
>      case PIPE_ITEM_TYPE_UPGRADE:
>          upgrade_item_unref(display, (UpgradeItem *)item);
> @@ -5459,7 +5449,7 @@ static void display_channel_client_release_item_before_push(DisplayChannelClient
>          break;
>      }
>      case PIPE_ITEM_TYPE_STREAM_CLIP:
> -        display_stream_clip_unref(display, (StreamClipItem *)item);
> +        stream_clip_item_unref(dcc, (StreamClipItem *)item);
>          break;
>      case PIPE_ITEM_TYPE_STREAM_DESTROY: {
>          StreamAgent *agent = SPICE_CONTAINEROF(item, StreamAgent, destroy_item);
> diff --git a/server/stream.c b/server/stream.c
> index f242da7..a2acd3a 100644
> --- a/server/stream.c
> +++ b/server/stream.c
> @@ -145,6 +145,18 @@ StreamClipItem *stream_clip_item_new(DisplayChannelClient* dcc, StreamAgent *age
>      return item;
>  }
>
> +void stream_clip_item_unref(DisplayChannelClient *dcc, StreamClipItem *item)
> +{
> +    DisplayChannel *display = DCC_TO_DC(dcc);
> +
> +    if (--item->refs != 0)
> +        return;
> +
> +    stream_agent_unref(display, item->stream_agent);
> +    free(item->rects);
> +    free(item);
> +}
> +
>  static int is_stream_start(Drawable *drawable)
>  {
>      return ((drawable->frames_count >= RED_STREAM_FRAMES_START_CONDITION) &&
> diff --git a/server/stream.h b/server/stream.h
> index 5d95ae6..4964a8c 100644
> --- a/server/stream.h
> +++ b/server/stream.h
> @@ -108,8 +108,10 @@ typedef struct StreamClipItem {
>      SpiceClipRects *rects;
>  } StreamClipItem;
>
> -StreamClipItem *stream_clip_item_new(DisplayChannelClient* dcc,
> -                                     StreamAgent *agent);
> +StreamClipItem *      stream_clip_item_new                          (DisplayChannelClient* dcc,
> +                                                                     StreamAgent *agent);
> +void                  stream_clip_item_unref                        (DisplayChannelClient *dcc,
> +                                                                     StreamClipItem *item);
>
>  typedef struct ItemTrace {
>      red_time_t time;
> --
> 2.4.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel

Looks good, ACK!


-- 
Fabiano Fidêncio


More information about the Spice-devel mailing list