Gstreamer-1.0 error with GstElementFactory

When I tried the Basic tutorial 6: Media formats and Pad Capabilities of GStreamer, I found this error: Error invalid use of incomplete type 'GstElementFactory {aka struct _GstElementFactory}'.
I used GStreamer-1.0. I think it will be useful for someone with the same error.

// factory-> numpadtemplates: error invalid use of incomplete type 'GstElementFactory {aka struct _GstElementFactory}

/* Raise error
if (!factory->numpadtemplates) {
g_print ("  none\n");
return;
}
*/

replace with this one:
gst_element_factory_get_num_pad_templates(factory)

pads = factory->staticpadtemplates // error

replace with this one:
pads = gst_element_factory_get_static_pad_templates (factory);

factory variable is in the method:
static void print_pad_templates_information (GstElementFactory * factory) {
     ...
}

Hope it help!

No comments:

Post a Comment

Blog Archive

About Me

My photo
I am a software developer with roughly 5 years of experience in developing end-to-end solutions in C#, Java, C/C++, PHP and HTML/CSS/Javascript. At the moment, I am joining the Professional Doctorate in Engineering degree program in Software Technology at Eindhoven University of Technology. My areas of particular interest include software design, data structures and algorithms, problem solving, software security, embedded system, machine learning, and data science.