2007-10-17 12:58:23 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2007 Stefan Kost <ensonic@users.sf.net>
|
|
|
|
*
|
|
|
|
* gstdebugutils.h: debugging and analysis utillities
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 20:44:48 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2007-10-17 12:58:23 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GSTDEBUGUTILS_H__
|
|
|
|
#define __GSTDEBUGUTILS_H__
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include <gst/gstconfig.h>
|
|
|
|
#include <gst/gstbin.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstDebugGraphDetails:
|
|
|
|
* @GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE: show caps-name on edges
|
|
|
|
* @GST_DEBUG_GRAPH_SHOW_CAPS_DETAILS: show caps-details on edges
|
2014-10-25 11:46:25 +00:00
|
|
|
* @GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS: show modified parameters on
|
|
|
|
* elements
|
2007-10-17 12:58:23 +00:00
|
|
|
* @GST_DEBUG_GRAPH_SHOW_STATES: show element states
|
2014-10-25 11:46:25 +00:00
|
|
|
* @GST_DEBUG_GRAPH_SHOW_FULL_PARAMS: show full element parameter values even
|
|
|
|
* if they are very long
|
|
|
|
* @GST_DEBUG_GRAPH_SHOW_ALL: show all the typical details that one might want
|
|
|
|
* @GST_DEBUG_GRAPH_SHOW_VERBOSE: show all details regardless of how large or
|
|
|
|
* verbose they make the resulting output
|
2007-10-17 12:58:23 +00:00
|
|
|
*
|
|
|
|
* Available details for pipeline graphs produced by GST_DEBUG_BIN_TO_DOT_FILE()
|
|
|
|
* and GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS().
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE = (1<<0),
|
|
|
|
GST_DEBUG_GRAPH_SHOW_CAPS_DETAILS = (1<<1),
|
|
|
|
GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS = (1<<2),
|
|
|
|
GST_DEBUG_GRAPH_SHOW_STATES = (1<<3),
|
2014-10-25 11:46:25 +00:00
|
|
|
GST_DEBUG_GRAPH_SHOW_FULL_PARAMS = (1<<4),
|
|
|
|
GST_DEBUG_GRAPH_SHOW_ALL = ((1<<4)-1),
|
|
|
|
GST_DEBUG_GRAPH_SHOW_VERBOSE = (-1)
|
2007-10-17 12:58:23 +00:00
|
|
|
} GstDebugGraphDetails;
|
|
|
|
|
|
|
|
|
|
|
|
/********** pipeline graphs **********/
|
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2014-12-12 07:45:02 +00:00
|
|
|
gchar * gst_debug_bin_to_dot_data (GstBin *bin, GstDebugGraphDetails details);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-01-09 15:58:45 +00:00
|
|
|
void gst_debug_bin_to_dot_file (GstBin *bin, GstDebugGraphDetails details, const gchar *file_name);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-01-09 15:58:45 +00:00
|
|
|
void gst_debug_bin_to_dot_file_with_ts (GstBin *bin, GstDebugGraphDetails details, const gchar *file_name);
|
2007-10-17 12:58:23 +00:00
|
|
|
|
2010-03-28 10:14:06 +00:00
|
|
|
#ifndef GST_DISABLE_GST_DEBUG
|
|
|
|
|
2007-10-17 12:58:23 +00:00
|
|
|
/**
|
|
|
|
* GST_DEBUG_BIN_TO_DOT_FILE:
|
|
|
|
* @bin: the top-level pipeline that should be analyzed
|
2008-04-10 19:13:46 +00:00
|
|
|
* @details: details to show in the graph, e.g. #GST_DEBUG_GRAPH_SHOW_ALL or
|
|
|
|
* one or more other #GstDebugGraphDetails flags.
|
2007-10-29 13:46:25 +00:00
|
|
|
* @file_name: output base filename (e.g. "myplayer")
|
2007-10-17 12:58:23 +00:00
|
|
|
*
|
|
|
|
* To aid debugging applications one can use this method to write out the whole
|
|
|
|
* network of gstreamer elements that form the pipeline into an dot file.
|
2015-10-16 14:59:49 +00:00
|
|
|
* This file can be processed with graphviz to get an image, like this:
|
2017-01-16 14:26:16 +00:00
|
|
|
* |[
|
2007-10-17 12:58:23 +00:00
|
|
|
* dot -Tpng -oimage.png graph_lowlevel.dot
|
2017-01-16 14:26:16 +00:00
|
|
|
* ]|
|
2015-10-16 14:59:49 +00:00
|
|
|
* There is also a utility called xdot which allows you to view the dot file
|
|
|
|
* directly without converting it first.
|
2007-10-17 12:58:23 +00:00
|
|
|
*
|
|
|
|
* The macro is only active if gstreamer is configured with
|
|
|
|
* "--gst-enable-gst-debug" and the environment variable
|
2007-10-29 13:46:25 +00:00
|
|
|
* GST_DEBUG_DUMP_DOT_DIR is set to a basepath (e.g. /tmp).
|
2007-10-17 12:58:23 +00:00
|
|
|
*/
|
2012-01-09 15:58:45 +00:00
|
|
|
#define GST_DEBUG_BIN_TO_DOT_FILE(bin, details, file_name) gst_debug_bin_to_dot_file (bin, details, file_name)
|
2007-10-17 12:58:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS:
|
|
|
|
* @bin: the top-level pipeline that should be analyzed
|
2008-04-10 19:13:46 +00:00
|
|
|
* @details: details to show in the graph, e.g. #GST_DEBUG_GRAPH_SHOW_ALL or
|
|
|
|
* one or more other #GstDebugGraphDetails flags.
|
2007-10-29 13:46:25 +00:00
|
|
|
* @file_name: output base filename (e.g. "myplayer")
|
2007-10-17 12:58:23 +00:00
|
|
|
*
|
2009-11-25 14:44:05 +00:00
|
|
|
* This works like GST_DEBUG_BIN_TO_DOT_FILE(), but adds the current timestamp
|
2007-10-29 13:46:25 +00:00
|
|
|
* to the filename, so that it can be used to take multiple snapshots.
|
2007-10-17 12:58:23 +00:00
|
|
|
*/
|
2012-01-09 15:58:45 +00:00
|
|
|
#define GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(bin, details, file_name) gst_debug_bin_to_dot_file_with_ts (bin, details, file_name)
|
2007-10-17 12:58:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
#else /* GST_DISABLE_GST_DEBUG */
|
|
|
|
|
|
|
|
|
|
|
|
#define GST_DEBUG_BIN_TO_DOT_FILE(bin, details, file_name)
|
2007-11-22 15:59:01 +00:00
|
|
|
#define GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(bin, details, file_name)
|
2007-10-17 12:58:23 +00:00
|
|
|
|
|
|
|
#endif /* GST_DISABLE_GST_DEBUG */
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GSTDEBUGUTILS_H__ */
|
|
|
|
|