[gst-devel] appsrc element creation error

arnabsamanta arnabsamanta at tataelxsi.co.in
Mon Mar 1 05:12:26 CET 2010


Thanks Wim and Tim.


Now I have installed the new glib, gstreamer and gts-plugin-base versions
as follows
glib - glib-2.22.4
gstreamer - gstreamer-0.10.26
gst-plugin-base - gst-plugins-base-0.10.26

Still I am getting the error as follows

GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' 
failed
GStreamer-CRITICAL **: gst_bin_add_many: assertion `GST_IS_ELEMENT 
(element_1)' failed
GStreamer-CRITICAL **: gst_element_link_many: assertion `GST_IS_ELEMENT 
(element_1)' failed
symbol lookup error: /lib/libgstapp-0.10.so.0: undefined symbol: 
g_once_init_enter_impl

However when I am creating the pipeline
gst-launch appsrc name=testsource ! jpegenc ! fakesink

the pipeline states are setting as follows
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...

The same through the application is giving the errors as mentioned above.

Please suggest if I am doing any thing wrong still.
And thanks in advance for going through this long mail.

For reference, I am attaching the application below

__________________________________/* start of  application */

int main(int argc, char *argv[])
{
        /* Initialize Gstreamer */
        gst_init(&argc, &argv);

        /* Declare elements and variables */
        GstElement *pipeline = NULL;
        GstElement *src = NULL ;
        GstElement *sink = NULL;
        GstElement *encoder = NULL;
        char *data = NULL;
        FILE *fp = NULL;
        int FileSize = 0;

        /* Create elements */
        pipeline = gst_pipeline_new("testing appsrc");
        if(!pipeline){
                g_printf("pipeline could not be created\n");
        }
        src = gst_element_factory_make("appsrc", "testsource");
        if(!src){
                g_printf("source element could not be created\n");
        }
        sink = gst_element_factory_make("filesink", "file sink");
        if(!sink){
                g_printf("source element could not be created\n");
        }
        encoder = gst_element_factory_make("jpegenc", "jpeg encoder");
        if(!encoder){
                g_printf("source element could not be created\n");
        }

        /*set properties of the elements */
        g_object_set(G_OBJECT(src), "caps", "ANY", NULL);
        g_object_set(G_OBJECT(sink), "location", "/root/image01.jpg", NULL);

        /* link the elements */
        gst_bin_add_many(GST_BIN(pipeline), src, encoder, sink, NULL);
        gst_element_link_many(src, encoder, sink, NULL);

        /* set them to play */
        gst_element_set_state(pipeline, GST_STATE_PLAYING);

        /* create buffer */
        data = XXX;

        /* pass the buffer */
        send_buffer_to_application(pipeline, data, FileSize);

        /* stop the pipeline */
        gst_element_set_state(pipeline, GST_STATE_NULL);

        g_object_unref(pipeline);

        return 0;
}
_______________________________/* end of application */

regards,
Arnab 








More information about the gstreamer-devel mailing list