audio: Add gst.DEBUG_BIN_TO_DOT_FILE pipeline debuging

This commit is contained in:
Thomas Adamcik 2014-09-26 23:51:33 +02:00
parent 7856c14b26
commit 2665a5521b
2 changed files with 14 additions and 1 deletions

View File

@ -89,4 +89,12 @@ level 3, you can run::
GST_DEBUG=3 mopidy -v
This will produce a lot of output, but given some GStreamer knowledge this is
very useful for debugging GStreamer pipeline issues.
very useful for debugging GStreamer pipeline issues. Additionally
:envvar:`GST_DEBUG_FILE=gstreamer.log` can be used to redirect the debug
logging to a file instead of standard out.
Lastly :envvar:`GST_DEBUG_DUMP_DOT_DIR` can be used to get descriptions of the
current pipeline in dot format. Currently we trigger a dump of the pipeline on
every completed state change::
GST_DEBUG_DUMP_DOT_DIR=. mopidy

View File

@ -1,6 +1,7 @@
from __future__ import unicode_literals
import logging
import os
import gobject
@ -351,6 +352,10 @@ class _Handler(object):
logger.debug('Audio event: stream_changed(uri=None)')
AudioListener.send('stream_changed', uri=None)
if 'GST_DEBUG_DUMP_DOT_DIR' in os.environ:
gst.DEBUG_BIN_TO_DOT_FILE(
self._audio._playbin, gst.DEBUG_GRAPH_SHOW_ALL, 'mopidy')
def on_buffering(self, percent):
gst_logger.debug('Got buffering message: percent=%d%%', percent)