mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-09 14:11:47 +00:00
video-stream: Initialise VideoStreamClipItem directly
Instead of just allocating in video_stream_clip_item_new and than have to setup properly in dcc_video_stream_agent_clip do all in video_stream_clip_item_new which is more consistent with other part of the code. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
2d0d872775
commit
0c5ff195ad
@ -630,14 +630,6 @@ static void dcc_stop(DisplayChannelClient *dcc)
|
||||
void dcc_video_stream_agent_clip(DisplayChannelClient* dcc, VideoStreamAgent *agent)
|
||||
{
|
||||
VideoStreamClipItem *item = video_stream_clip_item_new(agent);
|
||||
int n_rects;
|
||||
|
||||
item->clip_type = SPICE_CLIP_TYPE_RECTS;
|
||||
|
||||
n_rects = pixman_region32_n_rects(&agent->clip);
|
||||
item->rects = g_malloc(sizeof(SpiceClipRects) + n_rects * sizeof(SpiceRect));
|
||||
item->rects->num_rects = n_rects;
|
||||
region_ret_rects(&agent->clip, item->rects->rects, n_rects);
|
||||
|
||||
red_channel_client_pipe_add(RED_CHANNEL_CLIENT(dcc), &item->base);
|
||||
}
|
||||
|
||||
@ -184,6 +184,14 @@ VideoStreamClipItem *video_stream_clip_item_new(VideoStreamAgent *agent)
|
||||
|
||||
item->stream_agent = agent;
|
||||
agent->stream->refs++;
|
||||
|
||||
item->clip_type = SPICE_CLIP_TYPE_RECTS;
|
||||
|
||||
int n_rects = pixman_region32_n_rects(&agent->clip);
|
||||
item->rects = g_malloc(sizeof(SpiceClipRects) + n_rects * sizeof(SpiceRect));
|
||||
item->rects->num_rects = n_rects;
|
||||
region_ret_rects(&agent->clip, item->rects->rects, n_rects);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user