From 10f4f6090aaee42b90bbc07cedd02cceb701f4cc Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Sep 2017 11:52:08 +0000 Subject: [PATCH] * force enable env var: convert "+" to "_" so it looks like an env var, ie: XPRA_SOUND_CODEC_ENABLE_SPEEX_OGG=1 * we don't support gstreamer versions older than 1.x, so remove the unnecessary matroska codec filtering * speex+ogg works fine with the new win32 builds (with the new MSYS2 gstreamer version) git-svn-id: https://xpra.org/svn/Xpra/trunk@16828 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/sound/gstreamer_util.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/xpra/sound/gstreamer_util.py b/src/xpra/sound/gstreamer_util.py index 361ba59dae..b34f85203d 100755 --- a/src/xpra/sound/gstreamer_util.py +++ b/src/xpra/sound/gstreamer_util.py @@ -45,7 +45,7 @@ def get_queue_time(default_value=450, prefix=""): ALLOW_SOUND_LOOP = envbool("XPRA_ALLOW_SOUND_LOOP", False) USE_DEFAULT_DEVICE = envbool("XPRA_USE_DEFAULT_DEVICE", True) def force_enabled(codec_name): - return os.environ.get("XPRA_SOUND_CODEC_ENABLE_%s" % codec_name.upper(), "0")=="1" + return os.environ.get("XPRA_SOUND_CODEC_ENABLE_%s" % codec_name.upper().replace("+", "_"), "0")=="1" NAME_TO_SRC_PLUGIN = { @@ -88,11 +88,10 @@ def force_enabled(codec_name): #and will populate the ones that are actually available into the "CODECS" dict CODEC_OPTIONS = [ (VORBIS_MKA , "vorbisenc", "webmmux", "vorbisdec", "matroskademux"), - #those two fail silently - no idea why: - #(VORBIS_OGG , "vorbisenc", "oggmux", "vorbisparse ! vorbisdec", "oggdemux"), - #(VORBIS , "vorbisenc", None, "vorbisparse ! vorbisdec", None), + #those two used to fail silently (older versions of gstreamer?) + (VORBIS_OGG , "vorbisenc", "oggmux", "vorbisparse ! vorbisdec", "oggdemux"), + (VORBIS , "vorbisenc", None, "vorbisparse ! vorbisdec", None), (FLAC , "flacenc", None, "flacparse ! flacdec", None), - #this only works in gstreamer 0.10 and is filtered out during initialization: (FLAC_OGG , "flacenc", "oggmux", "flacparse ! flacdec", "oggdemux"), (MP3 , "lamemp3enc", None, "mpegaudioparse ! mad", None), (MP3 , "lamemp3enc", None, "mpegaudioparse ! mpg123audiodec", None), @@ -196,7 +195,7 @@ def force_enabled(codec_name): SPEEX : 0, } -CODEC_ORDER = [MP3, OPUS_OGG, VORBIS_MKA, FLAC_OGG, AAC_MPEG4, WAV_LZ4, WAV_LZO, WAV, WAVPACK, SPEEX_OGG, OPUS, VORBIS, FLAC_OGG, OPUS_MKA, FLAC, MP3_MPEG4] +CODEC_ORDER = [MP3, OPUS_OGG, VORBIS_MKA, VORBIS_OGG, VORBIS, FLAC_OGG, AAC_MPEG4, WAV_LZ4, WAV_LZO, WAV, WAVPACK, SPEEX_OGG, OPUS, VORBIS, OPUS_MKA, FLAC, MP3_MPEG4] gst = None @@ -418,14 +417,8 @@ def validate_encoding(elements): if force_enabled(encoding): log.info("sound codec %s force enabled", encoding) return True - elif len([x for x in elements if x and (x.find("matroska")>=0)])>0 and get_gst_version()<(1, ): - #outdated versions of gstreamer cause problems with the gdp and matroskademux muxers, - #the receiver may not be able to process the data - #and we have no way of knowing what version they have at this point, so just disable those: - log("avoiding %s with gdp muxer - gstreamer version %s is too old", encoding, get_gst_version()) - return False - elif WIN32 and encoding in (SPEEX_OGG, ): - log("skipping %s on win32", encoding) + elif encoding in (VORBIS_OGG, VORBIS) and get_gst_version()<(1, 12): + log("skipping %s - not sure which GStreamer versions support it", encoding) return False elif encoding.startswith(OPUS): if encoding==OPUS_MKA and get_gst_version()<(1, 8):