Hi, On Thu, Jun 29, 2017 at 11:47:53AM +0200, Pavel Grunt wrote: > On Wed, 2017-06-28 at 14:43 +0200, Victor Toso wrote: > > From: Victor Toso <me@xxxxxxxxxxxxxx> > > > > On GST_MESSAGE_STREAM_START our stream is about to start and it > > seems > > a good moment to debug GStreamer pipeline if requested. > > > So this is just for the debug purpose. > > > That we can do with GST_DEBUG_BIN_TO_DOT_FILE() which iterates > > recursively in the whole pipeline and generates a dot file with all > > the information, the filename is 'spice-gtk-gst-pipeline-debug.dot'. > > When streaming is enabled there is a lot of streams, but just one > file. I'd suggest to put the stream id to the file name. That's correct. I'll also add the stream's codec-type to it. I'll send a new version for this one soon! > > Pavel > > > > > One can generate png image out of this dot file with the command: > > dot -Tpng -oimage.png spice-gtk-gst-pipeline-debug.dot > > > > Not that GST_DEBUG_BIN_TO_DOT_FILE() will only work if Gstreamer was > > configured with --gst-enable-gst-debug and the environment variable > > GST_DEBUG_DUMP_DOT_DIR was properly set. > > > > Full example: > > > > 1) GST_DEBUG_DUMP_DOT_DIR=/tmp remote-viewer ... > > 2) dot -Tpng -oimage.png spice-gtk-gst-pipeline-debug.dot > > > > Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx> > > Signed-off-by: Victor Toso <me@xxxxxxxxxxxxxx> > > --- > > src/channel-display-gst.c | 15 ++++++++++++++- > > 1 file changed, 14 insertions(+), 1 deletion(-) > > > > diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c > > index df58de3..04710e8 100644 > > --- a/src/channel-display-gst.c > > +++ b/src/channel-display-gst.c > > @@ -298,7 +298,8 @@ static gboolean handle_pipeline_message(GstBus > > *bus, GstMessage *msg, gpointer v > > { > > SpiceGstDecoder *decoder = video_decoder; > > > > - if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_ERROR) { > > + switch(GST_MESSAGE_TYPE(msg)) { > > + case GST_MESSAGE_ERROR: { > > GError *err = NULL; > > gchar *debug_info = NULL; > > gst_message_parse_error(msg, &err, &debug_info); > > @@ -312,6 +313,18 @@ static gboolean handle_pipeline_message(GstBus > > *bus, GstMessage *msg, gpointer v > > > > /* We won't be able to process any more frame anyway */ > > free_pipeline(decoder); > > + break; > > + } > > + case GST_MESSAGE_STREAM_START: > > + GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(decoder->pipeline), > > + GST_DEBUG_GRAPH_SHOW_ALL > > + | > > GST_DEBUG_GRAPH_SHOW_FULL_PARAMS > > + | GST_DEBUG_GRAPH_SHOW_STATES, > > + "spice-gtk-gst-pipeline-debug"); > > + break; > > + default: > > + /* not being handled */ > > + break; > > } > > return TRUE; > > }
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel