mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-08 11:33:03 +00:00
Simplify sending stream report activation message
Store information directly in the RedStreamActivateReportItem making easier to marshall the message. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
7ed7686de1
commit
b2ade6e996
@ -2308,15 +2308,13 @@ static void marshall_monitors_config(RedChannelClient *rcc, SpiceMarshaller *bas
|
||||
|
||||
static void marshall_stream_activate_report(RedChannelClient *rcc,
|
||||
SpiceMarshaller *base_marshaller,
|
||||
uint32_t stream_id)
|
||||
RedStreamActivateReportItem *report_item)
|
||||
{
|
||||
DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
|
||||
VideoStreamAgent *agent = &dcc->priv->stream_agents[stream_id];
|
||||
SpiceMsgDisplayStreamActivateReport msg;
|
||||
|
||||
red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_STREAM_ACTIVATE_REPORT);
|
||||
msg.stream_id = stream_id;
|
||||
msg.unique_id = agent->report_id;
|
||||
msg.stream_id = report_item->stream_id;
|
||||
msg.unique_id = report_item->report_id;
|
||||
msg.max_window_size = RED_STREAM_CLIENT_REPORT_WINDOW;
|
||||
msg.timeout_ms = RED_STREAM_CLIENT_REPORT_TIMEOUT;
|
||||
spice_marshall_msg_display_stream_activate_report(base_marshaller, &msg);
|
||||
@ -2454,7 +2452,7 @@ void dcc_send_item(RedChannelClient *rcc, RedPipeItem *pipe_item)
|
||||
RedStreamActivateReportItem *report_item = SPICE_CONTAINEROF(pipe_item,
|
||||
RedStreamActivateReportItem,
|
||||
pipe_item);
|
||||
marshall_stream_activate_report(rcc, m, report_item->stream_id);
|
||||
marshall_stream_activate_report(rcc, m, report_item);
|
||||
break;
|
||||
}
|
||||
case RED_PIPE_ITEM_TYPE_GL_SCANOUT:
|
||||
|
||||
@ -759,6 +759,7 @@ void dcc_create_stream(DisplayChannelClient *dcc, VideoStream *stream)
|
||||
red_pipe_item_init(&report_pipe_item->pipe_item,
|
||||
RED_PIPE_ITEM_TYPE_STREAM_ACTIVATE_REPORT);
|
||||
report_pipe_item->stream_id = stream_id;
|
||||
report_pipe_item->report_id = agent->report_id;
|
||||
red_channel_client_pipe_add(RED_CHANNEL_CLIENT(dcc), &report_pipe_item->pipe_item);
|
||||
}
|
||||
#ifdef STREAM_STATS
|
||||
|
||||
@ -48,6 +48,7 @@ typedef struct VideoStream VideoStream;
|
||||
typedef struct RedStreamActivateReportItem {
|
||||
RedPipeItem pipe_item;
|
||||
uint32_t stream_id;
|
||||
uint32_t report_id;
|
||||
} RedStreamActivateReportItem;
|
||||
|
||||
#ifdef STREAM_STATS
|
||||
|
||||
Loading…
Reference in New Issue
Block a user