Hi,On Fri, Feb 10, 2017 at 07:51:05AM -0500, Frediano Ziglio wrote:[0] SPICE_MSGC_DISPLAY_PREFERRED_VIDEO_CODEC_TYPE
This message provides a list of video codecs based on client's order of preference.
We duplicate the video codecs array from reds.c and sort it using the order of codecs as reference.
This message will not change an ongoing streaming but it could change newly created streams depending the rank value of each video codec that can be set by spice_server_set_video_codecs()
Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx> --- server/dcc-private.h | 5 ++ server/dcc.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++ server/dcc.h | 1 + server/display-channel.c | 2 + server/stream.c | 5 +- 5 files changed, 138 insertions(+), 1 deletion(-)
diff --git a/server/dcc-private.h b/server/dcc-private.h index 64b32a7..dd54c70 100644 --- a/server/dcc-private.h +++ b/server/dcc-private.h @@ -51,6 +51,11 @@ struct DisplayChannelClientPrivate int num_pixmap_cache_items; } send_data;
+ /* Host prefererred video-codec order sorted with client preferred */ + GArray *preferred_video_codecs;
I know this patch is important but every time I arrive here I ask "array of what?" and I close the email.
Ah :( C has type[] or type*... GArray is an array of everything you want... I don't like it!
I used GArray here to keep consistency as we already use GArray for thisRedVideoCodec struct in other places and this code actually interactwith it.
GArray and type[] are not identical. GArray is dynamically allocated and can grow/shrink. It is closer to calloc/realloc than to type[].
In that case, I think that the number of codecs is fixed within the lifetime of the array. However, GArray naturally includes a size (the len field), whereas we don’t have the information for a plain array or pointer. So in that specific case, as we pass arrays around, even if they have a fixed size, I think GArray is the right choice.
|
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel