Hi everybody,
I'm using a TI board and I need to implement a #C streaming video pipeline. The pipe is : gst-launch -v v4l2src ! TIVidenc1 codecName=mpeg4enc engineName=encode contiguousInputFrame=TRUE ! rtpmp4vpay ! udpsink host=<HOST IP ADDRESS> port=5000 I'm new with the #C implementation of the pipes. I tried to implement it in this way: ################################################################## GstElement *pipeline, *source,*sink,*encoder,*payloader;//dichiarazione dei plugin utilizzati GMainLoop *loop=g_main_loop_new(NULL,FALSE); gst_init (&argc, &argv); pipeline = gst_pipeline_new ("pipe_prova"); source = gst_element_factory_make ("v4l2src", "video_source"); encoder = gst_element_factory_make ("TIVidenc1", "encoder_mpeg4"); payloader= gst_element_factory_make ("rtpmp4vpay", "payloader_mpeg4"); sink = gst_element_factory_make ("udpsink", "output"); videorate = gst_element_factory_make ("videorate", "videorate"); . . . . /* we add all elements into the pipeline */ gst_bin_add_many (GST_BIN (pipeline), source, videorate, filter, encoder, payloader, sink, NULL); gst_element_link_many (source, videorate, filter, encoder, payloader, sink, NULL); /* Set the pipeline to "playing" state*/ gst_element_set_state (pipeline, GST_STATE_PLAYING); g_main_loop_run(loop); ########################################################## This is my simple program,without caps settings. I want to control its state from an external program,but I saw that g_main_loop_run() blocks the execution of the pipe. I thought 2 solutions: -1) Control the state of the pipe: when I want to stop stream I set the pipe to the READY state; when I want to stream I set it to PLAY. I think that in this way I reduce the launch time of the pipe. Is it exactly? Have I to add a bus? Can anyone suggest me a possible solution? 2) Launch a g_main_loop_quit. What do you think about? Is it possible to do that? Thank you for your attention Regards Lorenzo |
|
In reply to this post by djlorenzoc
Hi,
What is the role of the "filter" element here? By external program you mean from a different process launched from the same application, or a completely different program, or a different thread?? Plz Explain. You can add a bus watch as follows: gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data) { } . . . bus = gst_pipeline_get_bus (GST_PIPELINE(pipeline)); gst_bus_add_watch (bus, bus_call, NULL); gst_object_unref (bus); Not sure what is "Launching a g_main_loop_quit" is? Plz Explain. Regards, Sandeep |
g_main_loop_quit can be used inside the bus callback handler , once you get the NULL state of pipeline .
On Mon, Jul 19, 2010 at 10:38 AM, Sandeep Prakash <[hidden email]> wrote:
-- Regards, Sudarshan Bisht ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |