mirror of
https://github.com/X11Libre/xf86-video-qxl.git
synced 2026-03-24 01:24:24 +00:00
spiceqxl: Add SpiceVideoCodecs to specify video codec preference
Signed-off-by: Francois Gouget <fgouget@codeweavers.com> Signed-off-by: Jeremy White <jwhite@codeweavers.com>
This commit is contained in:
committed by
Jeremy White
parent
edd1a409f8
commit
14ff3c26e2
@@ -52,6 +52,13 @@ Section "Device"
|
||||
# default: filter
|
||||
#Option "SpiceStreamingVideo" ""
|
||||
|
||||
# Set video codecs to use. Provide a semicolon list of
|
||||
# codecs, in preference order. Each codec requires an encoder
|
||||
# which can be one of spice or gstreamer, and then a codec type,
|
||||
# for instance mjpeg or vp8. The default is spice:mjpeg,
|
||||
# which uses the builtin mjpeg encoder.
|
||||
#Option "SpiceVideoCodecs" ""
|
||||
|
||||
# Set zlib glz wan compression. Options are auto, never, always.
|
||||
# default: auto
|
||||
#Option "SpiceZlibGlzWanCompression" ""
|
||||
|
||||
@@ -158,6 +158,7 @@ enum {
|
||||
OPTION_SURFACE_BUFFER_SIZE,
|
||||
OPTION_COMMAND_BUFFER_SIZE,
|
||||
OPTION_SPICE_SMARTCARD_FILE,
|
||||
OPTION_SPICE_VIDEO_CODECS,
|
||||
#endif
|
||||
OPTION_COUNT,
|
||||
};
|
||||
|
||||
@@ -154,6 +154,8 @@ const OptionInfoRec DefaultOptions[] =
|
||||
"CommandBufferSize", OPTV_INTEGER, {DEFAULT_COMMAND_BUFFER_SIZE}, FALSE},
|
||||
{ OPTION_SPICE_SMARTCARD_FILE,
|
||||
"SpiceSmartcardFile", OPTV_STRING, {0}, FALSE},
|
||||
{ OPTION_SPICE_VIDEO_CODECS,
|
||||
"SpiceVideoCodecs", OPTV_STRING, {0}, FALSE},
|
||||
#endif
|
||||
|
||||
{ -1, NULL, OPTV_NONE, {0}, FALSE }
|
||||
|
||||
@@ -173,6 +173,9 @@ void xspice_set_spice_server_options(OptionInfoPtr options)
|
||||
const char *streaming_video =
|
||||
get_str_option(options, OPTION_SPICE_STREAMING_VIDEO,
|
||||
"XSPICE_STREAMING_VIDEO");
|
||||
const char *video_codecs =
|
||||
get_str_option(options, OPTION_SPICE_VIDEO_CODECS,
|
||||
"XSPICE_VIDEO_CODECS");
|
||||
int agent_mouse =
|
||||
get_bool_option(options, OPTION_SPICE_AGENT_MOUSE,
|
||||
"XSPICE_AGENT_MOUSE");
|
||||
@@ -294,6 +297,18 @@ void xspice_set_spice_server_options(OptionInfoPtr options)
|
||||
spice_server_set_streaming_video(spice_server, streaming_video_opt);
|
||||
}
|
||||
|
||||
if (video_codecs) {
|
||||
#if SPICE_SERVER_VERSION >= 0x000d02 /* 0.13.2 */
|
||||
if (spice_server_set_video_codecs(spice_server, video_codecs)) {
|
||||
fprintf(stderr, "spice: invalid video encoder %s\n", video_codecs);
|
||||
exit(1);
|
||||
}
|
||||
#else
|
||||
fprintf(stderr, "spice: video_codecs are not available (spice >= 0.13.2 required)\n");
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
spice_server_set_agent_mouse(spice_server, agent_mouse);
|
||||
spice_server_set_playback_compression(spice_server, playback_compression);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user