1

I would like to print out the pipeline of a gstreamer-0.10 element. How can this be done?

The code that a external developer wrote for us:

static GstElement* jpgPipeline  = NULL;
pipedef = g_strdup_printf("appsrc name=jpgsrc ! ffmpegcolorspace %s %s %s %s %s  ! ffmpegcolorspace ! jpegenc quality=%i ! multifilesink name=jpgsink location=\"image.jpg\"",cropStr, scaleStr, sharpenStr,vbStr,gammaStr,quality);
jpgPipeline = gst_parse_launch (pipedef, &error);
bus = gst_pipeline_get_bus(GST_PIPELINE(jpgPipeline));
gst_element_set_state (jpgPipeline, GST_STATE_PLAYING);

I'm trying to see the pipeline with:

g_print(gst_element_info(jpgPipeline));

But I get many warnings when I try to compile it.

main.c:331:2: warning: implicit declaration of function ‘gst_element_info’ [-Wimplicit-function-declaration]
  g_print(gst_element_info(jpgPipeline));
  ^
main.c:331:2: warning: passing argument 1 of ‘g_print’ makes pointer from integer without a cast [enabled by default]
In file included from /usr/include/glib-2.0/glib.h:62:0,
                 from /usr/include/gstreamer-0.10/gst/gst.h:27,
                 from main.c:5:
/usr/include/glib-2.0/glib/gmessages.h:265:17: note: expected ‘const gchar *’ but argument is of type ‘int’
 void            g_print                 (const gchar    *format,
                 ^
main.c:331:2: warning: format not a string literal and no format arguments [-Wformat-security]
  g_print(gst_element_info(jpgPipeline));
main.c:(.text.startup+0x651): undefined reference to `gst_element_info'
Ohad Eytan
  • 8,114
  • 1
  • 22
  • 31
Kingalione
  • 4,237
  • 6
  • 49
  • 84

1 Answers1

2

1st and most important: please use 1.0, 0.10 is obsolete for years now.

This gst_element_info doesn't exist AFAIK. What do you expect to be printed as a string about the pipeline? The elements in it? How do you want to represent links?

Maybe using the dot representation would be better. Found some instructions here: https://developer.ridgerun.com/wiki/index.php/How_to_generate_a_Gstreamer_pipeline_diagram_%28graph%29 or https://www.freedesktop.org/software/gstreamer-sdk/data/docs/latest/gstreamer-0.10/gstreamer-GstInfo.html#GST-DEBUG-BIN-TO-DOT-FILE:CAPS

thiagoss
  • 2,034
  • 13
  • 8