[gst-devel] Fwd: no such element factory
Kapil Agrawal
kapil.agl at gmail.com
Tue Nov 7 08:10:30 CET 2006
---------- Forwarded message ----------
From: Kapil Agrawal <kapil.agl at gmail.com>
Date: Nov 7, 2006 12:33 PM
Subject: Re: [gst-devel] no such element factory
To: Benoit Fouet <benoit.fouet at purplelabs.com>
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 " ERROR 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/gstreamer- 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 <gst/gst.h>
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_error
(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 <mp3 filename>\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.10.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 <benoit.fouet at purplelabs.com> 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* <benoit.fouet at purplelabs.com
> > <mailto:benoit.fouet at purplelabs.com >> 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.*.xml
> > 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
> > <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
> > <mailto: gstreamer-devel at lists.sourceforge.net>
> > > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> > >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20061107/a8e4b4c5/attachment.htm>
More information about the gstreamer-devel
mailing list