[Spice-devel] [PATCH spice-server 1/2] Rename Stream to VideoStream
Frediano Ziglio
fziglio at redhat.com
Mon Nov 20 16:58:33 UTC 2017
>
> To prevent confusion between Stream (a video stream) and RedStream (a
> generic data stream between client and server), change the name to
> VideoStream to be more explicit about what it is.
>
> Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
> ---
> server/Makefile.am | 4 +-
> server/dcc-private.h | 2 +-
> server/dcc-send.c | 16 ++--
> server/dcc.c | 4 +-
> server/dcc.h | 4 +-
> server/display-channel-private.h | 8 +-
> server/display-channel.c | 42 +++++-----
> server/display-channel.h | 4 +-
> server/red-worker.c | 6 +-
> server/stream-channel.c | 2 +-
> server/stream-device.c | 6 ++
> server/{stream.c => video-stream.c} | 148
> ++++++++++++++++++------------------
> server/{stream.h => video-stream.h} | 38 ++++-----
> 13 files changed, 146 insertions(+), 138 deletions(-)
> rename server/{stream.c => video-stream.c} (86%)
> rename server/{stream.h => video-stream.h} (85%)
>
> diff --git a/server/Makefile.am b/server/Makefile.am
> index 20f0f1925..8ea258db3 100644
> --- a/server/Makefile.am
> +++ b/server/Makefile.am
> @@ -164,8 +164,6 @@ libserver_la_SOURCES = \
> stat-file.c \
> stat-file.h \
> stat.h \
> - stream.c \
> - stream.h \
> stream-channel.c \
> stream-channel.h \
> stream-device.c \
> @@ -175,6 +173,8 @@ libserver_la_SOURCES = \
> utils.c \
> utils.h \
> video-encoder.h \
> + video-stream.c \
> + video-stream.h \
> zlib-encoder.c \
> zlib-encoder.h \
> $(NULL)
> diff --git a/server/dcc-private.h b/server/dcc-private.h
> index c4662202d..76e194fe3 100644
> --- a/server/dcc-private.h
> +++ b/server/dcc-private.h
> @@ -22,7 +22,7 @@
> #include "cache-item.h"
> #include "dcc.h"
> #include "image-encoders.h"
> -#include "stream.h"
> +#include "video-stream.h"
> #include "red-channel-client.h"
>
> typedef struct DisplayChannelClientPrivate DisplayChannelClientPrivate;
> diff --git a/server/dcc-send.c b/server/dcc-send.c
> index 84c109680..271c97801 100644
> --- a/server/dcc-send.c
> +++ b/server/dcc-send.c
> @@ -1686,7 +1686,7 @@ static bool red_marshall_stream_data(RedChannelClient
> *rcc,
> {
> DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> DisplayChannel *display = DCC_TO_DC(dcc);
> - Stream *stream = drawable->stream;
> + VideoStream *stream = drawable->stream;
> SpiceCopy *copy;
> uint32_t frame_mm_time;
> int is_sized;
> @@ -1708,7 +1708,7 @@ static bool red_marshall_stream_data(RedChannelClient
> *rcc,
> return FALSE;
> }
>
> - StreamAgent *agent =
> &dcc->priv->stream_agents[display_channel_get_stream_id(display, stream)];
> + StreamAgent *agent =
> &dcc->priv->stream_agents[display_channel_get_video_stream_id(display,
> stream)];
This is more that 100 columns, should be reindended.
There are other lines too long in this patch.
> VideoBuffer *outbuf;
> /* workaround for vga streams */
> frame_mm_time = drawable->red_drawable->mm_time ?
> @@ -1741,7 +1741,7 @@ static bool red_marshall_stream_data(RedChannelClient
> *rcc,
>
> red_channel_client_init_send_data(rcc,
> SPICE_MSG_DISPLAY_STREAM_DATA);
>
> - stream_data.base.id = display_channel_get_stream_id(display,
> stream);
> + stream_data.base.id = display_channel_get_video_stream_id(display,
> stream);
> stream_data.base.multi_media_time = frame_mm_time;
> stream_data.data_size = outbuf->size;
>
> @@ -1751,7 +1751,7 @@ static bool red_marshall_stream_data(RedChannelClient
> *rcc,
>
> red_channel_client_init_send_data(rcc,
> SPICE_MSG_DISPLAY_STREAM_DATA_SIZED);
>
> - stream_data.base.id = display_channel_get_stream_id(display,
> stream);
> + stream_data.base.id = display_channel_get_video_stream_id(display,
> stream);
> stream_data.base.multi_media_time = frame_mm_time;
> stream_data.data_size = outbuf->size;
> stream_data.width = copy->src_area.right - copy->src_area.left;
... omissis ...
>
> diff --git a/server/stream.h b/server/video-stream.h
> similarity index 85%
> rename from server/stream.h
> rename to server/video-stream.h
> index 6f194618d..48f13f52b 100644
> --- a/server/stream.h
> +++ b/server/video-stream.h
> @@ -16,8 +16,8 @@
> License along with this library; if not, see
> <http://www.gnu.org/licenses/>.
> */
>
> -#ifndef STREAM_H_
> -#define STREAM_H_
> +#ifndef VIDEO_STREAM_H_
> +#define VIDEO_STREAM_H_
>
> #include <glib.h>
> #include <common/region.h>
> @@ -43,7 +43,7 @@
> #define RED_STREAM_DEFAULT_LOW_START_BIT_RATE (2.5 * 1024 * 1024) // 2.5Mbps
> #define MAX_FPS 30
>
> -typedef struct Stream Stream;
> +typedef struct VideoStream VideoStream;
>
> typedef struct RedStreamActivateReportItem {
> RedPipeItem pipe_item;
> @@ -73,7 +73,7 @@ typedef struct StreamAgent {
> vis_region will contain c2 and also the part of
> c1/c2 that still
> displays fragments of the video */
>
> - Stream *stream;
> + VideoStream *stream;
> VideoEncoder *video_encoder;
> DisplayChannelClient *dcc;
>
> @@ -111,7 +111,7 @@ typedef struct ItemTrace {
> SpiceRect dest_area;
> } ItemTrace;
>
> -struct Stream {
> +struct VideoStream {
> uint8_t refs;
> Drawable *current;
> red_time_t last_time;
> @@ -119,7 +119,7 @@ struct Stream {
> int height;
> SpiceRect dest_area;
> int top_down;
> - Stream *next;
> + VideoStream *next;
> RingItem link;
>
> uint32_t num_input_frames;
> @@ -127,21 +127,21 @@ struct Stream {
> uint32_t input_fps;
> };
>
> -void display_channel_init_streams
> (DisplayChannel *display);
> -void stream_stop
> (DisplayChannel *display,
> - Stream
> *stream);
> -void stream_unref
> (DisplayChannel *display,
> - Stream
> *stream);
> -void stream_trace_update
> (DisplayChannel *display,
> +void display_channel_init_video_streams
> (DisplayChannel *display);
> +void video_stream_stop
> (DisplayChannel *display,
> +
> VideoStream
> *stream);
> +void video_stream_unref
> (DisplayChannel *display,
> +
> VideoStream
> *stream);
> +void video_stream_trace_update
> (DisplayChannel *display,
> Drawable
> *drawable);
> -void stream_maintenance
> (DisplayChannel *display,
> +void video_stream_maintenance
> (DisplayChannel *display,
> Drawable
> *candidate,
> Drawable
> *prev);
> -void stream_timeout
> (DisplayChannel *display);
> -void stream_detach_and_stop
> (DisplayChannel *display);
> -void stream_trace_add_drawable
> (DisplayChannel *display,
> +void video_stream_timeout
> (DisplayChannel *display);
> +void video_stream_detach_and_stop
> (DisplayChannel *display);
> +void video_stream_trace_add_drawable
> (DisplayChannel *display,
> Drawable
> *item);
> -void stream_detach_behind
> (DisplayChannel *display,
> +void video_stream_detach_behind
> (DisplayChannel *display,
> QRegion
> *region,
> Drawable
> *drawable);
>
As you are basically changing mostly declarations I would change style to
our style.
> @@ -149,6 +149,6 @@ void stream_agent_unref
> (DisplayChan
> StreamAgent
> *agent);
> void stream_agent_stop
> (StreamAgent *agent);
>
> -void stream_detach_drawable(Stream *stream);
> +void video_stream_detach_drawable(VideoStream *stream);
>
> -#endif /* STREAM_H_ */
> +#endif /* VIDEO_STREAM_H_ */
Otherwise the patch is good. There are similar issues in 2/2.
Frediano
More information about the Spice-devel
mailing list