summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2016-06-13 17:04:56 +0100
committerFrediano Ziglio <freddy77@gmail.com>2024-05-28 22:20:11 +0100
commit3f0365173b6bfb23d1e19f91094ee950a7cd9479 (patch)
treed3961e02af269ea46e3fed07c8e2ede7f98254ca
parentfe894791745ccb9e4f4d29443d22d2a5b42fca7c (diff)
Call streams_get_stream_id instead of get_stream_id
Reduce DisplayChannel dependencies Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r--server/video-stream.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/server/video-stream.cpp b/server/video-stream.cpp
index 93ec3f61..0cd06ae8 100644
--- a/server/video-stream.cpp
+++ b/server/video-stream.cpp
@@ -93,7 +93,7 @@ void video_stream_stop(DisplayChannel *display, VideoStream *stream)
{
VideoStreams *streams = &display->priv->streams_;
DisplayChannelClient *dcc;
- int stream_id = display_channel_get_video_stream_id(display, stream);
+ int stream_id = streams_get_stream_id(streams, stream);
spice_return_if_fail(ring_item_is_linked(&stream->link));
spice_return_if_fail(!stream->current);
@@ -326,6 +326,7 @@ void video_stream_detach_drawable(VideoStream *stream)
static void before_reattach_stream(DisplayChannel *display,
VideoStream *stream, Drawable *new_frame)
{
+ VideoStreams *streams = &display->priv->streams_;
DisplayChannelClient *dcc;
int index;
VideoStreamAgent *agent;
@@ -342,7 +343,7 @@ static void before_reattach_stream(DisplayChannel *display,
return;
}
- index = display_channel_get_video_stream_id(display, stream);
+ index = streams_get_stream_id(streams, stream);
for (dpi_link = stream->current->pipes; dpi_link; dpi_link = dpi_next) {
auto dpi = static_cast<RedDrawablePipeItem *>(dpi_link->data);
dpi_next = dpi_link->next;
@@ -742,7 +743,8 @@ static VideoEncoder* dcc_create_video_encoder(DisplayChannelClient *dcc,
void dcc_create_stream(DisplayChannelClient *dcc, VideoStream *stream)
{
- int stream_id = display_channel_get_video_stream_id(DCC_TO_DC(dcc), stream);
+ VideoStreams *streams = &DCC_TO_DC(dcc)->priv->streams_;
+ int stream_id = streams_get_stream_id(streams, stream);
VideoStreamAgent *agent = dcc_get_video_stream_agent(dcc, stream_id);
spice_return_if_fail(region_is_empty(&agent->vis_region));
@@ -810,7 +812,8 @@ static void dcc_detach_stream_gracefully(DisplayChannelClient *dcc,
Drawable *update_area_limit)
{
DisplayChannel *display = DCC_TO_DC(dcc);
- int stream_id = display_channel_get_video_stream_id(display, stream);
+ VideoStreams *streams = &display->priv->streams_;
+ int stream_id = streams_get_stream_id(streams, stream);
VideoStreamAgent *agent = dcc_get_video_stream_agent(dcc, stream_id);
/* stopping the client from playing older frames at once*/
@@ -892,6 +895,7 @@ void video_stream_detach_behind(DisplayChannel *display,
QRegion *region,
Drawable *drawable)
{
+ VideoStreams *streams = &display->priv->streams_;
Ring *ring = &display->priv->streams;
RingItem *item = ring_get_head(ring);
DisplayChannelClient *dcc;
@@ -901,7 +905,7 @@ void video_stream_detach_behind(DisplayChannel *display,
VideoStream *stream = SPICE_CONTAINEROF(item, VideoStream, link);
int detach = 0;
item = ring_next(ring, item);
- int stream_id = display_channel_get_video_stream_id(display, stream);
+ int stream_id = streams_get_stream_id(streams, stream);
FOREACH_DCC(display, dcc) {
VideoStreamAgent *agent = dcc_get_video_stream_agent(dcc, stream_id);