gstrtpbin bug? - pipeline 'plays' in PAUSED state when RTCP is used

Paddy pat.blanchon at gmail.com
Thu Jun 27 11:11:41 PDT 2013


This is a continuation of  this post
<http://gstreamer-devel.966125.n4.nabble.com/playbin2-gt-gstrtpbin-stalls-when-using-RTCP-but-fine-without-td4660621.html>  
which contains my ramblings & isn't accurate - hence this new thread.

The issue that I'm up against is that when I have RTCP on the gstrtpbin
element, setting the pipeline's state to paused results in the pipeline src
being consumed (at a great rate) & buffers are sent into the gstrtpbin, but
are never transmitted (I think since the rtpbin & udpsrc/sinks are in the
paused state, not the playing state). Using playbin2 about-to-finish feature
- it is possible to 'play' hours of files without ever getting to the
PLAYING state or seeing output.

Every element in the pipeline is in the paused state. Moreover 
gst_element_set_state(pipeline, GST_STATE_PAUSED);
gst_element_get_state(pipeline, NULL, NULL, -1);
never returns.

Take out RTCP & it works as expected

I'm hoping I've just not configured something correctly - any comments are
invited.

Beneath is some code that demonstrates this issue; remove RTCP_STR from
gst_parse_bin_from_description() & it works fine - with it in it behaves as
above.


#include  <gst/gst.h>
#include  <glib.h>

#define  LAUNCH_STR "playbin2
uri=file:///mnt/hgfs/Temp/Transfer/video/130514/cam03-130514-0824.mkv"
#define  BIN_STR    "gstrtpbin name=rtpbin videorate name=video_path
skip-to-first=true"\
                    " ! capsfilter caps=\"video/x-raw-yuv,
framerate=25/1\""\
                    " ! ffmpegcolorspace"\
                    " ! queue max-size-bytes=0 max-size-buffers=0
max-size-time=0"\
                    " ! x264enc tune=zerolatency option-string=\"fps=25\""\
                    " ! capsfilter caps=\"video/x-h264, width=640,
height=480, framerate=25/1\""\
                    " ! rtph264pay config-interval=1"\
                    " ! rtpbin.send_rtp_sink_0 "\
                    " rtpbin.send_rtp_src_0 ! udpsink port=5000
host=192.168.10.90"
#define  RTCP_STR   " rtpbin.send_rtcp_src_0 ! udpsink port=5001
host=192.168.10.90 sync=false async=false"\
                    " udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0"


static gboolean  buffer_handler(GstPad  *pad, GstBuffer  *buffer, gpointer 
user_data)
{
    (void)pad;
    (void)user_data;
    g_message(" buffer rx'd on %s. timestamp:%lfsec duration:%lfsec",
              GST_PAD_NAME(pad),
              GST_BUFFER_TIMESTAMP(buffer)/(gdouble)GST_SECOND,
              GST_BUFFER_DURATION(buffer)/(gdouble)GST_SECOND);
    return TRUE;
}

static gboolean  bus_msg_handler(GstBus  *bus, GstMessage  *message,
gpointer  user_data)
{
    (void)bus;
    (void)user_data;
    g_message(" %s message recieved from %s",
              GST_MESSAGE_TYPE_NAME(message),
              GST_STR_NULL(GST_ELEMENT_NAME(GST_MESSAGE_SRC(message))));
    return  TRUE;
}

int  main(int  argc, char  *argv[])
{
    GstElement  *pipeline = NULL;
    GstElement  *bin = NULL;
    GstBus  *bus = NULL;
    GError  *err = NULL;

    if (((pipeline = gst_parse_launch(LAUNCH_STR, NULL)) == NULL) ||
        ((bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline))) == NULL))
    {
        g_warning(" cannot create gstreamer pipeline");
    }
    else
    {
        (void)gst_bus_add_watch_full(bus, G_PRIORITY_HIGH,
                                     (GstBusFunc)bus_msg_handler,
                                     pipeline, NULL);
        // Add more handlers here ....
        gst_object_unref(GST_OBJECT(bus));
        if ((bin = gst_parse_bin_from_description(BIN_STR RTCP_STR, TRUE,
&err)) == NULL)
        {
            g_warning("could not create sink: %s",
GST_STR_NULL(err->message));
            g_error_free(err);
        }
        else
        {
            GstPad  *sinkpad = gst_element_get_static_pad(bin, "sink");
            (void)gst_pad_add_buffer_probe(sinkpad,
                                           G_CALLBACK(buffer_handler),
                                           NULL);
            gst_object_unref(GST_OBJECT(sinkpad));

            g_object_set(GST_OBJECT(pipeline), "video-sink", bin, NULL);
            g_message(" pre-rolling pipeline ...");
            if ((gst_element_set_state(pipeline,
                                       GST_STATE_PAUSED) ==
GST_STATE_CHANGE_FAILURE) ||
                (gst_element_get_state(pipeline,
                                       NULL, NULL, -1) ==
GST_STATE_CHANGE_FAILURE))
            {
                g_warning(" cannot pre-roll");
            }
            g_message(" ... pre-rolled");
        }
    }

    return  0;
}




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/gstrtpbin-bug-pipeline-plays-in-PAUSED-state-when-RTCP-is-used-tp4660775.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list