<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Kapil Agrawal</b> <<a href="mailto:kapil.agl@gmail.com">kapil.agl@gmail.com</a>><br>Date: Nov 7, 2006 12:33 PM
<br>Subject: Re: [gst-devel] no such element factory<br>To: Benoit Fouet <<a href="mailto:benoit.fouet@purplelabs.com">benoit.fouet@purplelabs.com</a>><br><br></span>i added the above mentioned code but still i am getting the error.
<br>if i use <span style="font-weight: bold;">gst_plugin_load_file("../gstreamer/gst-plugins-ugly-0.10.4/ext/mad/libgstmad.la",&error); it give me error as " ERROR loading plug-in: Opening module failed".
<br></span><br>and if use <span style="font-weight: bold;">gst_plugin_load_file("../../../usr/local/lib/gstreamer-0.10/libgst/libgstmad.so",&error); it gives me error as "ERROR loading plug-in: Problem accessing file ../../../usr/local/lib/gstreamer-
0.10/libgst/libgstmad.so: No such file or directory".<br><br></span>in both cases the path is correct and the files are present.<span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;">
</span></span><br></span>following is my code.<br><br>/***************************************************/<br>#include <gst/gst.h><br><br>GstElement *pipeline, *filesrc, *decoder, *filter, *sink;<br>static gboolean
<br>bus_call (GstBus *bus,<br> GstMessage *msg,<br> gpointer data)<br>{<br> GMainLoop *loop = data;<br> switch (GST_MESSAGE_TYPE (msg)) {<br> case GST_MESSAGE_EOS:
<br> g_print ("End-of-stream\n");<br> g_main_loop_quit (loop);<br> break;<br> case GST_MESSAGE_ERROR: {<br> gchar *debug;
<br> GError *err;<br> gst_message_parse_error (msg, &err, &debug);<br> g_free (debug);
<br> g_print ("Error: %s\n", err->message);<br> g_error_free (err);<br> g_main_loop_quit (loop);
<br> break;<br> }<br> default:<br> break;<br> }<br> return TRUE;<br>
}<br><br>gint<br>main (gint argc,<br> gchar *argv[])<br>{<br> GstPlugin* load_plugin;<br> GError* error= NULL;<br><br> GMainLoop *loop;<br> /* initialization */<br> gst_init (&argc, &argv);
<br> loop = g_main_loop_new (NULL, FALSE);<br> if (argc != 2) {<br> g_print ("Usage: %s <mp3 filename>\n", argv[0]);<br> return 01;<br> }<br> /* create elements */
<br> pipeline = gst_pipeline_new ("my_pipeline");<br> gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (pipeline)),<br> bus_call, loop);<br><br> //<span style="font-weight: bold;">
gst_plugin_load_file("../gstreamer/gst-plugins-ugly-0.10.4/ext/mad/libgstmad.la",&error);</span><br> <span style="font-weight: bold;">gst_plugin_load_file("../../../usr/local/lib/gstreamer-0.10/libgst/libgstmad.so",&error);
</span><span class="q"><br> if (error)<br> {<br> g_print ("ERROR loading plug-in: %s\n", error->message);<br> g_free (error);<br> return -1;<br> }
<br></span> filesrc = gst_element_factory_make ("filesrc", "my_filesource");
<br> <span style="font-weight: bold;">decoder = gst_element_factory_make ("mad", "my_decoder");</span><br> filter = gst_element_factory_make ("myelement", "my_filter");
<br> sink = gst_element_factory_make ("alsasink", "audiosink");<br> if (!sink || !decoder) {<br> g_print ("Decoder or output could not be found - check your install\n");
<br> return -1;<br> } else if (!filter) {<br> g_print ("Your self-written filter could not be found. Make sure it "<br> "is installed correctly in $(libdir)/gstreamer-
0.9/ and that "<br> "you've ran gst-register-0.9 to register it. Check availability "<br> "of the plugin afterwards using \"gst-inspect-0.9
my_filter\"");<br> return -1;<br> }<br> g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);<br> /* link everything together */<br> gst_element_link_many (filesrc, decoder, filter, sink, NULL);
<br> gst_bin_add_many (GST_BIN (pipeline), filesrc, decoder, filter, sink, NULL);<br> /* run */<br> gst_element_set_state (pipeline, GST_STATE_PLAYING);<br> g_main_loop_run (loop);<br> /* clean up */
<br> gst_element_set_state (pipeline, GST_STATE_NULL);<br> gst_object_unref (GST_OBJECT (pipeline));<br> return 0;<br>}<br><br><br>/***************************************************/<div><span class="e" id="q_10ec13a6cd029f11_3">
<br><br><br><div>
<span class="gmail_quote">On 11/6/06, <b class="gmail_sendername">Benoit Fouet</b> <<a href="mailto:benoit.fouet@purplelabs.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">benoit.fouet@purplelabs.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Kapil Agrawal wrote:<br>> thanks for your reply.<br>> Actually i had installed the mad plugin , and i am getting the above<br>> mentioned error using it. so do we need to use gst_plugin_load_file<br>> api whenever we add a new plugin, and can u plz brief on this api
<br>> further, since no enough description is given abt it .<br>><br>you have to load the library in which your plugin is...<br>for instance:<br>/* ........ */<br>GError *error;<br><br>/* ....... */<br><br>gst_plugin_load_file ("lib_mylib.so", &error);
<br>if (error)<br>{<br> g_print ("ERROR loading plug-in: %s\n", error->message);<br> g_free (error);<br> return -1;<br>}<br><br>/* here you can call gst_element_factory_make() */<br><br>/* ...... */<br><br>
-- Ben<br><br>> -kapil<br>><br>> On 11/6/06, *Benoit Fouet* <<a href="mailto:benoit.fouet@purplelabs.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">benoit.fouet@purplelabs.com</a>
<br>> <mailto:<a href="mailto:benoit.fouet@purplelabs.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">benoit.fouet@purplelabs.com
</a>>> wrote:<br>><br>> Kapil Agrawal wrote:<br>> > hi ,<br>> ><br>> > when i installed a new plugin , and used that in my .c file for an<br>> > application, while calling gst_element_factory_make() for that
<br>> plugin<br>> > its give me an error "no such element factory "plugin" ". But<br>> when i<br>> > use the same plugin at command line , ie gst-launch ..| plugin |
<br>
> > .....|...... it works properly. also when i did a gst-inspect<br>> plugin,<br>> > its properties are show. even the ~/.gstreamer/registry.*.xml<br>> has the<br>> > plugin entry. I am unable to find the reason, can someone give
<br>> me some<br>> > pointers what ned to be done?<br>> ><br>> > tahnks<br>> ><br>> > -kapil<br>> do you also load the library where the plugin is before trying to
<br>> call<br>> gst_element_factory_make() ?<br>> (by using gst_plugin_load_file)<br>><br>> hope that helps<br>><br>> -- Ben<br>><br>> ><br>> ------------------------------------------------------------------------
<br>> ><br>> ><br>> -------------------------------------------------------------------------<br>><br>> > Using Tomcat but need to do more? Need to support web services,<br>> security?
<br>> > Get stuff done quickly with pre-integrated technology to make<br>> your job easier<br>> > Download IBM WebSphere Application Server v.1.0.1 based on<br>> Apache Geronimo<br>> >
<br>> <a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
</a><br>> <<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642</a>><br>> ><br>> ------------------------------------------------------------------------<br>> ><br>> > _______________________________________________
<br>> > gstreamer-devel mailing list<br>> > <a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">gstreamer-devel@lists.sourceforge.net
</a><br>> <mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
gstreamer-devel@lists.sourceforge.net</a>><br>> > <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
</a><br>> ><br>>
<br>><br><br></blockquote></div><br>
</span></div>