[Spice-devel] [PATCH spice-gtk v4 7/7] display-gst: Debug video pipeline on stream-start message

Victor Toso victortoso at redhat.com
Fri Jun 30 10:40:54 UTC 2017


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 at victortoso.com>
> >
> > 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.

So, the stream-id for a single stream is 49 nowadays. The number is
related to the max-num-streams value (hard coded) in Spice which is 50.

It assigns the stream-id in descenting order. I'm considering patch
spice-server to follow something like the file-xfer id which should be
always increasing and two sequential streams would never have the same
id.

For now, I've followed your suggestion and also attached 'vp8/h264/..'
to the filename (although this is easy to check from its contents, it
helped me slightly on testing all stream types with spicy).

I'll be sending it shortly.

Cheers,

>
> 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 at redhat.com>
> > Signed-off-by: Victor Toso <me at victortoso.com>
> > ---
> >  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;
> >  }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170630/cd7f441e/attachment.sig>


More information about the Spice-devel mailing list