summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy White <jwhite@codeweavers.com>2019-08-22 14:00:26 -0500
committerFrediano Ziglio <freddy77@gmail.com>2020-05-06 13:35:06 +0100
commit4a54542ca12918ea7df2485c727ef7d02c794741 (patch)
treeebc47793a803ec1e6da342f78fbc99729a1338ea
parent942391f354e45720a2d508c2b9c66d3762e636b7 (diff)
Provide a way to specify the video codecs.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r--src/options.c2
-rw-r--r--src/options.h1
-rw-r--r--src/spice.c3
-rw-r--r--src/xdg/x11spice/x11spice.conf13
4 files changed, 19 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c
index 90442f8..866cb11 100644
--- a/src/options.c
+++ b/src/options.c
@@ -80,6 +80,7 @@ void options_free(options_t *options)
str_replace(&options->on_connect, NULL);
str_replace(&options->on_disconnect, NULL);
str_replace(&options->user_config_file, NULL);
+ str_replace(&options->codecs, NULL);
}
@@ -396,6 +397,7 @@ static void options_from_config(options_t *options)
g_free(trust_damage);
options->full_screen_fps = int_option(userkey, systemkey, "spice", "full-screen-fps");
+ string_option(&options->codecs, userkey, systemkey, "spice", "codecs");
#if defined(HAVE_LIBAUDIT_H)
/* Pick an arbitrary default in the user range. CodeWeavers was founed in 1996, so 1196 it is... */
diff --git a/src/options.h b/src/options.h
index 343da2c..06fe859 100644
--- a/src/options.h
+++ b/src/options.h
@@ -62,6 +62,7 @@ typedef struct {
char *uinput_path;
char *on_connect;
char *on_disconnect;
+ char *codecs;
int audit;
int audit_message_type;
damage_trust_t trust_damage;
diff --git a/src/spice.c b/src/spice.c
index 8bb55b2..ec24b26 100644
--- a/src/spice.c
+++ b/src/spice.c
@@ -565,6 +565,9 @@ static void set_options(spice_t *s, options_t *options)
if (options->spice_password)
spice_server_set_ticket(s->server, options->spice_password, 0, 0, 0);
+ if (options->codecs)
+ spice_server_set_video_codecs(s->server, options->codecs);
+
spice_server_set_exit_on_disconnect(s->server, options->exit_on_disconnect);
}
diff --git a/src/xdg/x11spice/x11spice.conf b/src/xdg/x11spice/x11spice.conf
index 8bb2996..eecce68 100644
--- a/src/xdg/x11spice/x11spice.conf
+++ b/src/xdg/x11spice/x11spice.conf
@@ -112,6 +112,19 @@
#full-screen-fps=0
#-----------------------------------------------------------------------------
+# codecs
+# This configuration field allows you to specify which
+# spice codecs to use. An example specification is:
+# gstreamer:vp8;gstreamer:h264;spice:mjpeg
+# which specifies vp8 first, followed by h264, and then by
+# traditional spice mjpeg encoding.
+# If no codecs are given, we will allow Spice to choose
+# a reasonable default, which is usually spice:mjpeg.
+# Default blank.
+#-----------------------------------------------------------------------------
+#codecs=spice:mjpeg
+
+#-----------------------------------------------------------------------------
# minimize Starts the x11spice gui minimized. Default false.
#-----------------------------------------------------------------------------
#minimize=false