mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-30 17:49:02 +00:00
display-channel: Make video-codecs property read-write
This patch creates display_channel_get_video_codecs() helper to let stream.c get the video-codecs without accessing the internal structure of DisplayChannel. As video-codecs is a property of DisplayChannel, this change means making this property readable as well. Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
6c33b69e15
commit
f007c0a991
@ -44,6 +44,9 @@ display_channel_get_property(GObject *object,
|
||||
case PROP_N_SURFACES:
|
||||
g_value_set_uint(value, self->priv->n_surfaces);
|
||||
break;
|
||||
case PROP_VIDEO_CODECS:
|
||||
g_value_set_static_boxed(value, self->priv->video_codecs);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
|
||||
}
|
||||
@ -213,6 +216,13 @@ void display_channel_set_video_codecs(DisplayChannel *display, GArray *video_cod
|
||||
display->priv->video_codecs = g_array_ref(video_codecs);
|
||||
}
|
||||
|
||||
GArray *display_channel_get_video_codecs(DisplayChannel *display)
|
||||
{
|
||||
spice_return_val_if_fail(display, NULL);
|
||||
|
||||
return display->priv->video_codecs;
|
||||
}
|
||||
|
||||
int display_channel_get_stream_video(DisplayChannel *display)
|
||||
{
|
||||
return display->priv->stream_video;
|
||||
@ -2247,7 +2257,7 @@ display_channel_class_init(DisplayChannelClass *klass)
|
||||
"Video Codecs",
|
||||
G_TYPE_ARRAY,
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_WRITABLE |
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
|
||||
|
||||
@ -229,6 +229,7 @@ void display_channel_set_stream_video (DisplayCha
|
||||
int stream_video);
|
||||
void display_channel_set_video_codecs (DisplayChannel *display,
|
||||
GArray *video_codecs);
|
||||
GArray* display_channel_get_video_codecs (DisplayChannel *display);
|
||||
int display_channel_get_stream_video (DisplayChannel *display);
|
||||
int display_channel_get_streams_timeout (DisplayChannel *display);
|
||||
void display_channel_compress_stats_print (DisplayChannel *display);
|
||||
|
||||
@ -691,9 +691,11 @@ static VideoEncoder* dcc_create_video_encoder(DisplayChannelClient *dcc,
|
||||
RedChannelClient *rcc = RED_CHANNEL_CLIENT(dcc);
|
||||
int client_has_multi_codec = red_channel_client_test_remote_cap(rcc, SPICE_DISPLAY_CAP_MULTI_CODEC);
|
||||
int i;
|
||||
GArray *video_codecs;
|
||||
|
||||
for (i = 0; i < display->priv->video_codecs->len; i++) {
|
||||
RedVideoCodec* video_codec = &g_array_index (display->priv->video_codecs, RedVideoCodec, i);
|
||||
video_codecs = display_channel_get_video_codecs(display);
|
||||
for (i = 0; i < video_codecs->len; i++) {
|
||||
RedVideoCodec* video_codec = &g_array_index (video_codecs, RedVideoCodec, i);
|
||||
|
||||
if (!client_has_multi_codec &&
|
||||
video_codec->type != SPICE_VIDEO_CODEC_TYPE_MJPEG) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user