Skip to content

Commit

Permalink
#1276 / #1075: remove all gdp options
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@13451 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Aug 24, 2016
1 parent 0caaf2c commit 24442c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 46 deletions.
10 changes: 0 additions & 10 deletions src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ def __init__(self):
self.sound_out_bytecount = 0
self.server_pulseaudio_id = None
self.server_pulseaudio_server = None
self.server_gstreamer_version = None
self.server_sound_decoders = []
self.server_sound_encoders = []
self.server_sound_receive = False
Expand Down Expand Up @@ -1891,7 +1890,6 @@ def process_ui_capabilities(self):
from xpra.sound.common import legacy_to_new
self.server_sound_decoders = legacy_to_new(c.strlistget("sound.decoders", []))
self.server_sound_encoders = legacy_to_new(c.strlistget("sound.encoders", []))
self.server_gstreamer_version = c.strlistget("sound.gst.version")
except:
soundlog("cannot parse server sound codecs", exc_info=True)
self.server_codec_full_names = c.boolget("codec-full-names")
Expand Down Expand Up @@ -2255,14 +2253,6 @@ def send_webcam_frame(self):

def get_matching_codecs(self, local_codecs, server_codecs):
matching_codecs = [x for x in local_codecs if x in server_codecs]
#gdp has compatibility issues from one version to another..
gstreamer_version = self.sound_properties.get("gst.version")
soundlog("local gstreamer version=%s, server version=%s", gstreamer_version, self.server_gstreamer_version)
try:
assert gstreamer_version[:2]==self.server_gstreamer_version[:2]
except Exception as e:
soundlog("incompatible gstreamer versions: %s", e)
matching_codecs = [x for x in matching_codecs if x.lower().find("gdp")<0]
soundlog("get_matching_codecs(%s, %s)=%s", local_codecs, server_codecs, matching_codecs)
return matching_codecs

Expand Down
10 changes: 0 additions & 10 deletions src/xpra/sound/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
SPEEX = "speex"
WAVPACK = "wavpack"

GDP = "gdp"
OGG = "ogg"
MKA = "mka"
MPEG4 = "mpeg4"
Expand All @@ -30,31 +29,22 @@
LZ4 = "lz4"
LZO = "lzo"

FLAC_GDP = FLAC+"+"+GDP
FLAC_OGG = FLAC+"+"+OGG
OPUS_GDP = OPUS+"+"+GDP
OPUS_OGG = OPUS+"+"+OGG
SPEEX_GDP = SPEEX+"+"+GDP
SPEEX_OGG = SPEEX+"+"+OGG
VORBIS_OGG = VORBIS+"+"+OGG
VORBIS_GDP = VORBIS+"+"+GDP
#OPUS_WEBM = OPUS+"+"+WEBM
#OPUS_RTP = OPUS+"+"+RTP
VORBIS_MKA = VORBIS+"+"+MKA
AAC_GDP = AAC+"+"+GDP
AAC_MPEG4 = AAC+"+"+MPEG4
RAW_GDP = RAW+"+"+GDP
WAV_LZ4 = WAV+"+"+LZ4
WAV_LZO = WAV+"+"+LZO
RAW_GDP_LZ4 = RAW+"+"+GDP+"+"+LZ4
RAW_GDP_LZO = RAW+"+"+GDP+"+"+LZO

#when codecs were first added, there was no support for multiple muxers,
#but now there is...
#since it makes sense to use the full specification including the muxer in the codec name,
#this maps it back to the original names
LEGACY_CODEC_NAMES = {
VORBIS_GDP : VORBIS,
FLAC_OGG : FLAC,
OPUS_OGG : OPUS,
SPEEX_OGG : SPEEX,
Expand Down
32 changes: 6 additions & 26 deletions src/xpra/sound/gstreamer_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import sys
import os

from xpra.sound.common import FLAC_GDP, FLAC_OGG, OPUS_GDP, OPUS_OGG, SPEEX_GDP, SPEEX_OGG, VORBIS_OGG, VORBIS_GDP, VORBIS_MKA, \
AAC_GDP, AAC_MPEG4, RAW_GDP, WAV_LZ4, WAV_LZO, RAW_GDP_LZ4, RAW_GDP_LZO, \
from xpra.sound.common import FLAC_OGG, OPUS_OGG, SPEEX_OGG, VORBIS_OGG, VORBIS_MKA, \
AAC_MPEG4, WAV_LZ4, WAV_LZO, \
VORBIS, FLAC, MP3, OPUS, SPEEX, WAV, WAVPACK, \
MPEG4, GDP, MKA, OGG
MPEG4, MKA, OGG

from xpra.util import csv, engs, parse_simple_dict
from xpra.log import Logger
Expand Down Expand Up @@ -89,42 +89,32 @@ def force_enabled(codec_name):
#we keep multiple options here for the same encoding
#and will populate the ones that are actually available into the "CODECS" dict
CODEC_OPTIONS = [
(VORBIS_GDP , "vorbisenc", "gdppay", "vorbisdec", "gdpdepay", None),
(VORBIS_MKA , "vorbisenc", "webmmux", "vorbisdec", "matroskademux", None),
#fails silently - no idea why:
#(VORBIS_OGG , "vorbisenc", "oggmux", "vorbisparse ! vorbisdec", "oggdemux"),
#does not work - no idea why:
#(FLAC , "flacenc", "oggmux", "flacparse ! flacdec", "oggdemux"),
#this only works in gstreamer 0.10 and is filtered out during initialization:
(FLAC_OGG , "flacenc", "oggmux", "flacdec", "oggdemux", None),
(FLAC_GDP , "flacenc", "gdppay", "flacparse ! flacdec", "gdpdepay", None),
(MP3 , "lamemp3enc", None, "mp3parse ! mad", None, None),
(MP3 , "lamemp3enc", None, "mpegaudioparse ! mad", None, None),
(WAV , "wavenc", None, "wavparse", None, None),
(WAV_LZ4 , "wavenc", None, "wavparse", None, "lz4"),
(WAV_LZO , "wavenc", None, "wavparse", None, "lzo"),
(OPUS_OGG , "opusenc", "oggmux", "opusdec", "oggdemux", None),
(OPUS_GDP , "opusenc", "gdppay", "opusdec", "gdpdepay", None),
#for rtp, we would need to send the caps:
#(OPUS_RTP , "opusenc", "rtpopuspay", "opusdec", "rtpopusdepay"),
#(OPUS_RTP , "opusenc", "rtpopuspay", "opusparse ! opusdec", "rtpopusdepay"),
#this causes "could not link opusenc0 to webmmux0"
#(OPUS_WEBM , "opusenc", "webmmux", "opusdec", "matroskademux"),
#(OPUS_WEBM , "opusenc", "webmmux", "opusparse ! opusdec", "matroskademux"),
(SPEEX_OGG , "speexenc", "oggmux", "speexdec", "oggdemux", None),
(SPEEX_GDP , "speexenc", "gdppay", "speexdec", "gdpdepay", None),
(WAVPACK , "wavpackenc", None, "wavpackparse ! wavpackdec", None, None),
(AAC_GDP , "faac", "gdppay", "faad", "gdpdepay", None),
(AAC_GDP , "avenc_aac", "gdppay", "avdec_aac", "gdpdepay", None),
(AAC_MPEG4 , "faac", "mp4mux", "faad", "qtdemux", None),
(AAC_MPEG4 , "avenc_aac", "mp4mux", "avdec_aac", "qtdemux", None),
(RAW_GDP , None, "gdppay", None, "gdpdepay", None),
(RAW_GDP_LZ4, None, "gdppay", None, "gdpdepay", "lz4"),
(RAW_GDP_LZO, None, "gdppay", None, "gdpdepay", "lzo"),
]

MUX_OPTIONS = [
(GDP, "gdppay", "gdpdepay"),
(OGG, "oggmux", "oggdemux"),
(MKA, "webmmux", "matroskademux"),
(MPEG4, "mp4mux", "qtdemux"),
Expand Down Expand Up @@ -173,14 +163,10 @@ def force_enabled(codec_name):
},
}
#we may want to review this if/when we implement UDP transport:
GDPPAY_CRC = False
MUXER_DEFAULT_OPTIONS = {
"oggmux" : {"max-delay" : OGG_DELAY,
"max-page-delay" : OGG_DELAY,
},
"gdppay" : {"crc-header" : int(GDPPAY_CRC),
"crc-payload" : int(GDPPAY_CRC),
},
"webmmux" : {"writing-app" : "Xpra"},
"mp4mux" : {
"faststart" : 1,
Expand All @@ -197,16 +183,13 @@ def force_enabled(codec_name):
VORBIS_MKA : 0,
MP3 : 250,
FLAC : 50,
FLAC_GDP : 50,
WAV : 0,
WAVPACK : 600,
OPUS : 0,
OPUS_GDP : 0,
SPEEX : 0,
SPEEX_GDP : 0,
}

CODEC_ORDER = [OPUS_OGG, VORBIS_MKA, FLAC_OGG, MP3, AAC_MPEG4, WAV_LZ4, WAV_LZO, WAV, WAVPACK, SPEEX_OGG, OPUS_GDP, VORBIS_GDP, FLAC_GDP, SPEEX_GDP, AAC_GDP, RAW_GDP_LZ4, RAW_GDP_LZO, RAW_GDP]
CODEC_ORDER = [OPUS_OGG, VORBIS_MKA, FLAC_OGG, MP3, AAC_MPEG4, WAV_LZ4, WAV_LZO, WAV, WAVPACK, SPEEX_OGG]


gst = None
Expand Down Expand Up @@ -472,10 +455,7 @@ def add_encoder(encoding, encoder, payloader, stream_compressor):
global ENCODERS
if encoding in ENCODERS:
return
if WIN32 and encoding in (OPUS_GDP, ):
log("avoiding %s on win32", encoding)
return
if OSX and encoding in (OPUS_GDP, OPUS_OGG):
if OSX and encoding in (OPUS_OGG, ):
log("avoiding %s on Mac OS X", encoding)
return
if has_plugins(encoder, payloader):
Expand Down Expand Up @@ -515,7 +495,7 @@ def validate_encoding(elements):
elif encoding==FLAC_OGG:
log("skipping %s to avoid obscure 'not-negotiated' errors", encoding)
return False
elif WIN32 and encoding in (AAC_GDP, SPEEX_GDP, SPEEX_OGG):
elif WIN32 and encoding in (SPEEX_OGG, ):
log("skipping %s on win32", encoding)
return False
elif encoding.startswith(OPUS):
Expand Down

0 comments on commit 24442c2

Please sign in to comment.