From d712551c3f346eb17b42e0000c6197d3e340a00c Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sat, 1 Sep 2012 00:16:39 +0200 Subject: [PATCH] Add list of Gstreamer elements to checck in --list-deps --- mopidy/utils/deps.py | 57 ++++++++++++++++++++++++++++++++++++++-- tests/utils/deps_test.py | 1 + 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/mopidy/utils/deps.py b/mopidy/utils/deps.py index f2b89840..13b48dc0 100644 --- a/mopidy/utils/deps.py +++ b/mopidy/utils/deps.py @@ -68,15 +68,68 @@ def python_info(): def gstreamer_info(): + other = [] + other.append('Python wrapper: gst-python %s' % ( + '.'.join(map(str, gst.get_pygst_version())))) + other.append('Elements:') + for name, status in _gstreamer_check_elements(): + other.append(' %s: %s' % (name, status)) return { 'name': 'Gstreamer', 'version': '.'.join(map(str, gst.get_gst_version())), 'path': gst.__file__, - 'other': 'Python wrapper: gst-python %s' % ( - '.'.join(map(str, gst.get_pygst_version()))), + 'other': '\n'.join(other), } +def _gstreamer_check_elements(): + elements_to_check = [ + # Core playback + 'uridecodebin', + + # External HTTP streams + 'souphttpsrc', + + # Spotify + 'appsrc', + + # Mixers and sinks + 'alsamixer', + 'alsasink', + 'ossmixer', + 'osssink', + 'oss4mixer', + 'oss4sink', + 'pulsemixer', + 'pulsesink', + + # MP3 encoding and decoding + 'mp3parse', + 'mad', + 'id3demux', + 'id3v2mux', + 'lame', + + # Ogg Vorbis encoding and decoding + 'vorbisdec', + 'vorbisenc', + 'vorbisparse', + 'oggdemux', + 'oggmux', + 'oggparse', + + # Flac decoding + 'flacdec', + 'flacparse', + + # Shoutcast output + 'shout2send', + ] + known_elements = [factory.get_name() for factory in + gst.registry_get_default().get_feature_list(gst.TYPE_ELEMENT_FACTORY)] + return [(element, element in known_elements) for element in elements_to_check] + + def pykka_info(): if hasattr(pykka, '__version__'): # Pykka >= 0.14 diff --git a/tests/utils/deps_test.py b/tests/utils/deps_test.py index 26ef7c5c..9c623da0 100644 --- a/tests/utils/deps_test.py +++ b/tests/utils/deps_test.py @@ -69,6 +69,7 @@ class DepsTest(unittest.TestCase): self.assertIn('gst', result['path']) self.assertIn('Python wrapper: gst-python', result['other']) self.assertIn('.'.join(map(str, gst.get_pygst_version())), result['other']) + self.assertIn('Elements:', result['other']) def test_pykka_info(self): result = deps.pykka_info()