Re: <gstmm.h> include errors



Milosz Derezynski wrote:
Hey José,

Sorry for getting back so late.

No problem Milosz.

As for the problem with instantiating an element, i'm not sure where
the actual problem lies; the code for doing that is very simple, and
unless there is a reference counting problem it should just work;
could you try whether creating an element the C way on your box in the
same program works? E.g.

GstElement * element = gst_element_factory_make("filesrc", NULL);


The following code (taken from Section 5.2 of the GStreamer Application Development Manual) runs reporting that the creation was successful:

-----------------------------gstreamer-test.c-------------------------------------
#include <gst/gst.h>

int
main (int   argc,
     char *argv[])
{
 GstElement *element;

 /* init GStreamer */
 gst_init (&argc, &argv);

 /* create element */
 element = gst_element_factory_make ("fakesrc", "source");
 if (element) {
   g_print ("Successfully created element of type 'fakesrc'\n");
 }
 else {
   g_print ("Failed to create element of type 'fakesrc'\n");
   return -1;
 }

 gst_object_unref (GST_OBJECT (element));

 return 0;
}
-----------------------------gstreamer-test.c-------------------------------------

Here's the compilation, execution and output:

[06:25][jose sweety:~/Projects/Programming/C++/Tests]$ gcc -g gstreamer-test.c `pkg-config --cflags --libs gstreamer-0.10`
[06:29][jose sweety:~/Projects/Programming/C++/Tests]$ ./a.out
Successfully created element of type 'fakesrc'
[06:29][jose sweety:~/Projects/Programming/C++/Tests]$

-Jose


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]