stop image formation

prkhr4u prakhargupta at bel.co.in
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", "http://169.254.126.124/video2.mjpg",
NULL);
    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,
NULL);
    gst_element_link_many(src,jpegdec,ffmpeg,ffenc_bmp, sink);    

    gst_element_set_state(pipeline,GST_STATE_PLAYING);

    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: http://gstreamer-devel.966125.n4.nabble.com/stop-image-formation-tp4665268p4665308.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list