Exemplo n.º 1
0
gchar * owr_media_renderer_get_dot_data(OwrMediaRenderer *renderer)
{
    g_return_val_if_fail(OWR_IS_MEDIA_RENDERER(renderer), NULL);
    g_return_val_if_fail(renderer->priv->pipeline, NULL);

#if GST_CHECK_VERSION(1, 5, 0)
    return gst_debug_bin_to_dot_data(GST_BIN(renderer->priv->pipeline), GST_DEBUG_GRAPH_SHOW_ALL);
#else
    return g_strdup("");
#endif
}
Exemplo n.º 2
0
std::string
generateDotGraph (GstBin *bin, std::shared_ptr<GstreamerDotDetails> details)
{
  std::string retString;
  gchar *data = gst_debug_bin_to_dot_data (bin, convert_details (details) );

  retString = std::string (data);
  g_free (data);

  return retString;
}
Exemplo n.º 3
0
gchar * owr_media_source_get_dot_data(OwrMediaSource *source)
{
    g_return_val_if_fail(OWR_IS_MEDIA_SOURCE(source), NULL);

    if (!source->priv->source_bin)
        return g_strdup("");

#if GST_CHECK_VERSION(1, 5, 0)
    return gst_debug_bin_to_dot_data(GST_BIN(source->priv->source_bin), GST_DEBUG_GRAPH_SHOW_ALL);
#else
    return g_strdup("");
#endif
}
/*
 * gst_debug_bin_to_dot_file:
 * @bin: the top-level pipeline that should be analyzed
 * @file_name: output base filename (e.g. "myplayer")
 *
 * 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.
 * This file can be processed with graphviz to get an image.
 * <informalexample><programlisting>
 *  dot -Tpng -oimage.png graph_lowlevel.dot
 * </programlisting></informalexample>
 */
void
gst_debug_bin_to_dot_file (GstBin * bin, GstDebugGraphDetails details,
    const gchar * file_name)
{
  gchar *full_file_name = NULL;
  FILE *out;

  g_return_if_fail (GST_IS_BIN (bin));

  if (G_LIKELY (priv_gst_dump_dot_dir == NULL))
    return;

  if (!file_name) {
    file_name = g_get_application_name ();
    if (!file_name)
      file_name = "unnamed";
  }

  full_file_name = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.dot",
      priv_gst_dump_dot_dir, file_name);

  if ((out = fopen (full_file_name, "wb"))) {
    gchar *buf;

    buf = gst_debug_bin_to_dot_data (bin, details);
    fputs (buf, out);

    g_free (buf);
    fclose (out);

    GST_INFO ("wrote bin graph to : '%s'", full_file_name);
  } else {
    GST_WARNING ("Failed to open file '%s' for writing: %s", full_file_name,
        g_strerror (errno));
  }
  g_free (full_file_name);
}