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