summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Grunt <pgrunt@redhat.com>2016-01-21 12:49:21 +0100
committerPavel Grunt <pgrunt@redhat.com>2016-01-26 13:41:20 +0100
commitf84cfa3672eccfc7d9dd9cf7c4ab64f037d4e4a0 (patch)
treeb5e1653c8ae22cddbcce817ba3be38a0f9d4d9b4
parent623b306d563f5973bf8683b93a99149af3926dda (diff)
replay: Add an option to change video codecreplay_gst
-rw-r--r--server/tests/replay.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/server/tests/replay.c b/server/tests/replay.c
index 0c98168e..fad9879b 100644
--- a/server/tests/replay.c
+++ b/server/tests/replay.c
@@ -287,7 +287,7 @@ int main(int argc, char **argv)
{
GError *error = NULL;
GOptionContext *context = NULL;
- gchar *client = NULL, **file = NULL;
+ gchar *client = NULL, *codecs = NULL, **file = NULL;
gint port = 5000, compression = SPICE_IMAGE_COMPRESSION_AUTO_GLZ;
gint streaming = SPICE_STREAM_VIDEO_FILTER;
gboolean wait = FALSE;
@@ -297,6 +297,7 @@ int main(int argc, char **argv)
{ "client", 'c', 0, G_OPTION_ARG_STRING, &client, "Client", "CMD" },
{ "compression", 'C', 0, G_OPTION_ARG_INT, &compression, "Compression (default 2)", "INT" },
{ "streaming", 'S', 0, G_OPTION_ARG_INT, &streaming, "Streaming (default 3)", "INT" },
+ { "video-codecs", 'V', 0, G_OPTION_ARG_STRING, &codecs, "Video codecs", "STRING" },
{ "port", 'p', 0, G_OPTION_ARG_INT, &port, "Server port (default 5000)", "PORT" },
{ "wait", 'w', 0, G_OPTION_ARG_NONE, &wait, "Wait for client", NULL },
{ "slow", 's', 0, G_OPTION_ARG_INT, &slow, "Slow down replay. Delays USEC microseconds before each command", "USEC" },
@@ -381,6 +382,14 @@ int main(int argc, char **argv)
server = spice_server_new();
spice_server_set_image_compression(server, compression);
spice_server_set_streaming_video(server, streaming);
+
+ if (codecs != NULL) {
+ if (spice_server_set_video_codecs(server, codecs) != 0) {
+ g_warning("could not set codecs: %s", codecs);
+ }
+ g_free(codecs);
+ }
+
spice_server_set_port(server, port);
spice_server_set_noauth(server);