Hi,<br><br>can someone plz copy the following program and compile and plz check whether its working or not<br>since i am still getting the same error .<br><br><br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<br>#include <gst/gst.h><br><br>GstElement *pipeline, *filesrc, *filter, *sink;<br>GstElement *decoder;<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> 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> filesrc = gst_element_factory_make ("filesrc", "my_filesource");
<br> decoder = gst_element_factory_make ("mad", "my_decoder");<br> sink = gst_element_factory_make ("alsasink", "audiosink");<br> if (!decoder) {<br> g_print ("Decoder or output could not be found - check your install\n");
<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, 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="gmail_quote">On 11/7/06, <b class="gmail_sendername">ensonic</b> <<a href="mailto:ensonic@hora-obscura.de">ensonic@hora-obscura.de</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;">
Hi,<br><br>from the path it looks like you use gstreamer-0.10 (because of<br>gst-plugins-ugly-0.10.4). That means you don't need gst-register anymore.<br>Can you please post the gstreamer versions that you use?<br><br>If you still have a
gstreamer-0.9 around, you should remove it (make<br>uninstall).<br><br>You definitely do not need to load plgins, if you use the gst-registry. You<br>only need to manually load the plugins if you build gstreamer with<br>--disable-gst-registry.
<br><br>In your sample you try to load the mad-plugin bt below it looks like its is<br>your own filter that does not work. Try running your application as:<br>GST_DEBUG="GST_REGISTRY:4,GST_PLUGIN_LOADING:4" ./my-app 2>
debug.log<br><br>and then search the debg.log file for your plugin name. The you'll see if<br>your plgin gets loaded properly. If it get loaded, you should be able to<br>instantiate it by its name ( via gst_element_factory_make() )
<br><br>Stefan<br><br><br>On 8:10:30 am 07/11/2006 "Kapil Agrawal" <<a href="mailto:kapil.agl@gmail.com">kapil.agl@gmail.com</a>> wrote:<br>><br>><br>><br>> ---------- Forwarded message ----------
<br>> From: Kapil Agrawal<br>> Date: Nov 7, 2006 12:33 PM<br>> Subject: Re: [gst-devel] no such element factory<br>> To: Benoit Fouet<br>><br>> i added the above mentioned code but still i am getting the error.
<br>> if i use gst_plugin_load_file(&quot;../gstreamer/gst-plugins-ugly-0.10<br>> .4/ext/mad/libgstmad.la&quot;,&amp;error); it give me error as &quot; ER<br>> ROR loading plug-in: Opening module failed&quot;.
<br>><br>> and if use gst_plugin_load_file(&quot;../../../usr/local/lib/gstreamer<br>> -0.10/libgst/libgstmad.so&quot;,&amp;error); it gives me error as &quot;<br>> ERROR loading plug-in: Problem accessing file ../../../usr/local/lib/gst
<br>> reamer-0.10/libgst/libgstmad.so: No such file or directory&quot;.<br>><br>> in both cases the path is correct and the files are present.<br>> following is my code.<br>><br>> /***************************************************/
<br>> #include<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 (&quot;End-of-stream\n&quot;);
<br>> g_main_loop_quit (loop);<br>> break;<br>> case GST_MESSAGE_ERROR: {<br>> gchar *debug;<br>> GError *err;
<br>> gst_message_parse_erro<br>> r (msg, &amp;err, &amp;debug);<br>> g_free (debug);<br>> g_print (&quot;Error:
<br>> %s\n&quot;, err->message);<br>> g_error_free (err);<br>> g_main_loop_quit (loop);<br>> break; }<br>> default:<br>> break;
<br>> }<br>> return TRUE;}<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 (&amp;argc, &amp;argv);<br>> loop = g_main_loop_new (NULL, FALSE);<br>> if (argc != 2) {<br>
> g_print (&quot;Usage: %s \n&quot;, argv[0]);<br>> return 01;<br>> }<br>> /* create elements */<br>> pipeline = gst_pipeline_new (&quot;my_pipeline&quot;);
<br>> gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE<br>> (pipeline)), bus_call, loop);<br>><br>> //gst_plugin_load_file(&quot;../gstreamer/gst-plugins-ugly-0.1
<br>> 0.4/ext/mad/libgstmad.la&quot;,&amp;error);<br>> gst_plugin_load_file(&quot;../../../usr/local/lib/gstreamer-0.<br>> 10/libgst/libgstmad.so&quot;,&amp;error);<br>> if (error)
<br>> {<br>> g_print (&quot;ERROR loading plug-in: %s\n&quot;,<br>> error->message); g_free (error);<br>> return -1;<br>> }<br>> filesrc = gst_element_factory_make (&quot;filesrc&quot;,
<br>> &quot;my_filesource&quot;); decoder = gst_element_factory_make<br>> (&quot;mad&quot;, &quot;my_decoder&quot;);<br>> filter = gst_element_factory_make (&quot;myelement&quot;,
<br>> &quot;my_filter&quot;); sink = gst_element_factory_make<br>> (&quot;alsasink&quot;, &quot;audiosink&quot;); if (!sink ||<br>> !decoder) { g_print (&quot;Decoder or output could
<br>> not be found - check your install\n&quot;); return -1;<br>> } else if (!filter) {<br>> g_print (&quot;Your self-written filter could not be<br>> found. Make sure it &quot; &quot;is
<br>> installed correctly in $(libdir)/gstreamer-0.9/ and that &quot;<br>> &quot;you've ran gst-register-0.9 to register<br>> it. Check availability &quot;<br>> &quot;of the plugin afterwards using \&quot;gst-
inspect-0.9<br>> my_filter\&quot;&quot;); return -1;<br>> }<br>> g_object_set (G_OBJECT (filesrc), &quot;location&quot;,<br>> argv[1], NULL); /* link everything together */
<br>> gst_element_link_many (filesrc, decoder, filter, sink, NULL);<br>> gst_bin_add_many (GST_BIN (pipeline), filesrc, decoder,<br>> filter, sink, NULL); /* 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>> /***************************************************/<br>><br>><br>> On 11/6/06, Benoit Fouet wrote:Kapil Agrawal wrote:<br>> > thanks for your reply.<br>> > Actually i had installed the mad plugin , and i am getting the
<br>> > above mentioned error using it. so do we need to use<br>> > gst_plugin_load_file api whenever we add a new plugin, and can u<br>> > plz brief on this api further, since no enough description is
<br>> > given abt it .<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 (&quot;lib_mylib.so&quot;, &amp;error);
<br>> if (error)<br>> {<br>> g_print (&quot;ERROR loading plug-in: %s\n&quot;, 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* > wrote:<br>> ><br>> > Kapil Agrawal wrote:<br>> > > hi ,
<br>> > ><br>> > > when i installed a new plugin , and used that in my .c file<br>> > > for an application, while calling gst_element_factory_make()<br>> > for that plugin
<br>> > > its give me an error &quot;no such element factory<br>> > &quot;plugin&quot; &quot;. But when i<br>> > > use the same plugin at command line , ie gst-launch ..|
<br>> > > plugin | .....|...... it works properly. also when i did a<br>> > gst-inspect plugin,<br>> > > its properties are show. even the ~/.gstreamer/registry.*.xm<br>> l<br>> > has the
<br>> > > plugin entry. I am unable to find the reason, can someone<br>> > give 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<br>> > to 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>> ----------<br>> ><br>> > > Using Tomcat but need to do more? Need to support web
<br>> > services, 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&amp;kid=120709&amp;bid=">http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=120709&amp;bid=
</a><br>> 263057&amp;dat=121642<br>> ><br>> > ><br>> > ---------------------------------------------------------------<br>> ---------<br>> > ><br>> > > _______________________________________________
<br>> > > gstreamer-devel mailing list<br>> > > <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>> ><br>> > > <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel">
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>> > ><br><br><br>-------------------------------------------------------------------------<br>Using Tomcat but need to do more? Need to support web services, security?
<br>Get stuff done quickly with pre-integrated technology to make your job easier<br>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo<br><a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642">
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642</a><br>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.sourceforge.net">
gstreamer-devel@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br></blockquote></div><br>