stop image formation

prkhr4u prakhargupta at
Mon Feb 17 00:50:03 PST 2014

I have tried to insert a loop,but the loop is running continuously and hence
no output is being displayed.
I only want to take 1 image and quit.
Here is how I have implemented:

    GMainLoop *loop;
    loop = g_main_loop_new (NULL, FALSE);

    GstElement *pipeline = gst_pipeline_new ("xvoverlay");
    GstElement *src = gst_element_factory_make ("souphttpsrc",NULL);
    g_object_set (src, "location", "",
    GstElement *jpegdec = gst_element_factory_make("jpegdec",NULL);
    GstElement *ffmpeg= gst_element_factory_make("ffmpegcolorspace",NULL);
    GstElement *ffenc_bmp = gst_element_factory_make("ffenc_bmp",NULL);
    GstElement *sink = gst_element_factory_make ("multifilesink", NULL);
    g_object_set (sink, "location", "/home/hls/abc.bmp", NULL);
    g_main_loop_quit (loop);
    gst_element_set_state(sink, GST_STATE_READY);

    gst_bin_add_many (GST_BIN (pipeline), src,jpegdec,ffmpeg,ffenc_bmp,sink,
    gst_element_link_many(src,jpegdec,ffmpeg,ffenc_bmp, sink);    


    g_main_loop_run (loop);
    gst_element_set_state (pipeline, GST_STATE_NULL);
    gst_object_unref (pipeline);    
    g_main_loop_unref (loop);

I do not want to add any message handler.
What is the correct loop order and how to run it?

View this message in context:
Sent from the GStreamer-devel mailing list archive at

More information about the gstreamer-devel mailing list