appsrc and GMainloop problem

Deepak Jain jain1982 at gmail.com
Wed Aug 21 07:08:26 PDT 2013


Hi,

I am having a audio/video application providing interfaces for audio video
playback.
I am using GStreamer framework for actual playback.
In my application, I get elementary streams from the network(demuxed
streams).
Elementary Audio and Video in separate threads.

Now there is problem when I create pipeline and use appsrc.
I am creating pipeline for video elementary stream as:

appsrc->h264parse->ffdec_h264->ffmpegcolorconverter->videoconvert->xvimagesink

My class is C++ and I am creating and doing gst_init in my class function
like:

    gst_init (NULL, NULL);


    loop = g_main_loop_new (NULL, TRUE);

 /* creating pipeline here */
--------------
---------------
--------------

    /* go to playing and wait in a mainloop. */
    gst_element_set_state (playbin, GST_STATE_PLAYING);


Now if I use g_main_loop_run (loop); after setting the pipeline to play
state above, my code don’t work. My audio and video threads(which are
bringing audio video elementary data) don't work at all.

if I call g_main_loop_run (loop); after getting first video packet, the
idle handler callback works too fast then my feeding thread due to which
same data gets pushed to app_src repeatedly and therefore the pipeline
fails.

The problem to me seems to be where to call g_main_loop_run (loop);

Also since my code is c++ and gstreamer is C, is that can be a issue?

Plz help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130821/b19f0ac4/attachment.html>


More information about the gstreamer-devel mailing list