How get rtcp packet using gstrtcpbuffer.h?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How get rtcp packet using gstrtcpbuffer.h?

Jek_point
I believe that using gst_rtcp_buffer_new_take_data () function I can get GstBuffer, continue using gst_rtcp_buffer_map () I get GstRTCPBuffer. But I do not understand how to apply it in practice. Who realties can set an example for the C ++ code for a buffer?
Reply | Threaded
Open this post in threaded view
|

Re: How get rtcp packet using gstrtcpbuffer.h?

Jek_point
im try this code

static gboolean cb_print_position(GstElement *pipeline)
{
        gint64 pos, len;
        gint64 time;
        guint8 pay;
        bool status;  
        GstBuffer *buf;
        GstRTCPBuffer *rtcp;
        GstRTCPPacket *rtcppacket;
       
        if (gst_element_query_position(pipeline, GST_FORMAT_TIME, &pos) && gst_element_query_duration(pipeline, GST_FORMAT_TIME, &len))
        {  
                g_print("Time: %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT  "\r", GST_TIME_ARGS(pos), GST_TIME_ARGS(len));
        }

        buf = gst_rtcp_buffer_new_copy_data(pipeline, 500);
        gst_rtcp_buffer_map(buf, GstMapFlags::GST_MAP_FLAG_LAST, rtcp);
        return TRUE;
}
but return

** (rtsp:19117): CRITICAL **: gst_rtcp_buffer_map: assertion 'rtcp->buffer == NULL' failed
Time: 0:00:14.135300363 / 99:99:99.999999999

gst_bin_add_many(GST_BIN(data.pipeline), data.source, data.queue, data.rtpbin, data.depayer, data.muxer, data.sink, NULL);
like all I have, but the buffer is empty ....
Reply | Threaded
Open this post in threaded view
|

Re: How get rtcp packet using gstrtcpbuffer.h?

Sebastian Dröge-3
On Fr, 2016-05-06 at 10:39 -0700, Jek_point wrote:


> buf = gst_rtcp_buffer_new_copy_data(pipeline, 500);
> gst_rtcp_buffer_map(buf, GstMapFlags::GST_MAP_FLAG_LAST, rtcp)

That's not how this works and you should've gotten various compiler
warnings or even errors when trying to compile this.

You need to get the data of an actual RTCP packet and pass it in there,
and also use the correct mapping flags for mapping the buffer later
then to read its content.


You can find example usage of the GstRTCPBuffer API in the rtpmanager
element here:
https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/rtpmanager


What are you trying to do exactly, why do you want to get an RTCP
packet and in which pipeline?

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How get rtcp packet using gstrtcpbuffer.h?

Jek_point
The problem is as follows. There is a network camera that synchronizes its time. It is necessary to record the video stream from the camera into files with indexation (frames / times during the camera). Next, the application request for the network in which there is a start and end time must be glued only frames with the desired me time to one video file and send it over the network .....

in common with the tag in the output debug rtspsrk prilodeniya gives and time of the GTCS package .... it's bad and the only solution that I found