rtp: Use GST_BUFFER_PTS() instead of GST_BUFFER_TIMESTAMP()
The mix between all these in the RTP code is confusing, let's try to be consistent.
This commit is contained in:
parent
c7e168ec70
commit
dc059efa60
@ -169,7 +169,7 @@ gst_asteriskh263_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||||||
|
|
||||||
gst_buffer_unmap (outbuf, &map);
|
gst_buffer_unmap (outbuf, &map);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
GST_BUFFER_PTS (outbuf) = timestamp;
|
||||||
if (!gst_pad_has_current_caps (asteriskh263->srcpad)) {
|
if (!gst_pad_has_current_caps (asteriskh263->srcpad)) {
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ gst_rtp_ac3_pay_flush (GstRtpAC3Pay * rtpac3pay)
|
|||||||
gst_rtp_buffer_set_marker (&rtp, TRUE);
|
gst_rtp_buffer_set_marker (&rtp, TRUE);
|
||||||
gst_rtp_buffer_unmap (&rtp);
|
gst_rtp_buffer_unmap (&rtp);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = rtpac3pay->first_ts;
|
GST_BUFFER_PTS (outbuf) = rtpac3pay->first_ts;
|
||||||
GST_BUFFER_DURATION (outbuf) = rtpac3pay->duration;
|
GST_BUFFER_DURATION (outbuf) = rtpac3pay->duration;
|
||||||
|
|
||||||
ret = gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtpac3pay), outbuf);
|
ret = gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtpac3pay), outbuf);
|
||||||
@ -347,7 +347,7 @@ gst_rtp_ac3_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
|
|
||||||
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
||||||
duration = GST_BUFFER_DURATION (buffer);
|
duration = GST_BUFFER_DURATION (buffer);
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
|
|
||||||
if (GST_BUFFER_IS_DISCONT (buffer)) {
|
if (GST_BUFFER_IS_DISCONT (buffer)) {
|
||||||
GST_DEBUG_OBJECT (rtpac3pay, "DISCONT");
|
GST_DEBUG_OBJECT (rtpac3pay, "DISCONT");
|
||||||
|
@ -259,7 +259,7 @@ gst_rtp_amr_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
|
|
||||||
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
duration = GST_BUFFER_DURATION (buffer);
|
duration = GST_BUFFER_DURATION (buffer);
|
||||||
|
|
||||||
/* setup frame size pointer */
|
/* setup frame size pointer */
|
||||||
@ -315,7 +315,7 @@ gst_rtp_amr_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
|
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
|
||||||
|
|
||||||
/* copy timestamp */
|
/* copy timestamp */
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
GST_BUFFER_PTS (outbuf) = timestamp;
|
||||||
|
|
||||||
if (duration != GST_CLOCK_TIME_NONE)
|
if (duration != GST_CLOCK_TIME_NONE)
|
||||||
GST_BUFFER_DURATION (outbuf) = duration;
|
GST_BUFFER_DURATION (outbuf) = duration;
|
||||||
|
@ -210,7 +210,7 @@ gst_rtp_celt_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
frame_size = rtpceltdepay->frame_size;
|
frame_size = rtpceltdepay->frame_size;
|
||||||
framesize_ns = gst_util_uint64_scale_int (frame_size, GST_SECOND, clock_rate);
|
framesize_ns = gst_util_uint64_scale_int (frame_size, GST_SECOND, clock_rate);
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buf);
|
timestamp = GST_BUFFER_PTS (buf);
|
||||||
|
|
||||||
gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
|
gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
|
||||||
|
|
||||||
@ -253,12 +253,12 @@ gst_rtp_celt_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
offset += size;
|
offset += size;
|
||||||
|
|
||||||
if (frame_size != -1 && clock_rate != -1) {
|
if (frame_size != -1 && clock_rate != -1) {
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp + framesize_ns * n;
|
GST_BUFFER_PTS (outbuf) = timestamp + framesize_ns * n;
|
||||||
GST_BUFFER_DURATION (outbuf) = framesize_ns;
|
GST_BUFFER_DURATION (outbuf) = framesize_ns;
|
||||||
}
|
}
|
||||||
GST_LOG_OBJECT (depayload, "push timestamp=%"
|
GST_LOG_OBJECT (depayload, "push timestamp=%"
|
||||||
GST_TIME_FORMAT ", duration=%" GST_TIME_FORMAT,
|
GST_TIME_FORMAT ", duration=%" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)),
|
GST_TIME_ARGS (GST_BUFFER_PTS (outbuf)),
|
||||||
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)));
|
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)));
|
||||||
|
|
||||||
gst_rtp_base_depayload_push (depayload, outbuf);
|
gst_rtp_base_depayload_push (depayload, outbuf);
|
||||||
|
@ -334,8 +334,8 @@ gst_rtp_celt_pay_flush_queued (GstRtpCELTPay * rtpceltpay)
|
|||||||
guint size;
|
guint size;
|
||||||
|
|
||||||
/* copy first timestamp to output */
|
/* copy first timestamp to output */
|
||||||
if (GST_BUFFER_TIMESTAMP (outbuf) == -1)
|
if (GST_BUFFER_PTS (outbuf) == -1)
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
|
GST_BUFFER_PTS (outbuf) = GST_BUFFER_PTS (buf);
|
||||||
|
|
||||||
/* write the size to the header */
|
/* write the size to the header */
|
||||||
size = gst_buffer_get_size (buf);
|
size = gst_buffer_get_size (buf);
|
||||||
|
@ -313,7 +313,7 @@ gst_rtp_dv_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
"DV RTP payloader got buffer of %" G_GSIZE_FORMAT
|
"DV RTP payloader got buffer of %" G_GSIZE_FORMAT
|
||||||
" bytes, splitting in %u byte " "payload fragments, at time %"
|
" bytes, splitting in %u byte " "payload fragments, at time %"
|
||||||
GST_TIME_FORMAT, size, max_payload_size,
|
GST_TIME_FORMAT, size, max_payload_size,
|
||||||
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)));
|
GST_TIME_ARGS (GST_BUFFER_PTS (buffer)));
|
||||||
|
|
||||||
if (!rtpdvpay->negotiated) {
|
if (!rtpdvpay->negotiated) {
|
||||||
gst_dv_pay_negotiate (rtpdvpay, data, size);
|
gst_dv_pay_negotiate (rtpdvpay, data, size);
|
||||||
@ -330,7 +330,7 @@ gst_rtp_dv_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
/* Allocate a new buffer, set the timestamp */
|
/* Allocate a new buffer, set the timestamp */
|
||||||
if (outbuf == NULL) {
|
if (outbuf == NULL) {
|
||||||
outbuf = gst_rtp_buffer_new_allocate (max_payload_size, 0, 0);
|
outbuf = gst_rtp_buffer_new_allocate (max_payload_size, 0, 0);
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buffer);
|
GST_BUFFER_PTS (outbuf) = GST_BUFFER_PTS (buffer);
|
||||||
|
|
||||||
if (!gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp)) {
|
if (!gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp)) {
|
||||||
gst_buffer_unref (outbuf);
|
gst_buffer_unref (outbuf);
|
||||||
|
@ -159,7 +159,7 @@ gst_rtp_g723_pay_flush (GstRTPG723Pay * pay)
|
|||||||
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
|
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
|
||||||
payload = gst_rtp_buffer_get_payload (&rtp);
|
payload = gst_rtp_buffer_get_payload (&rtp);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = pay->timestamp;
|
GST_BUFFER_PTS (outbuf) = pay->timestamp;
|
||||||
GST_BUFFER_DURATION (outbuf) = pay->duration;
|
GST_BUFFER_DURATION (outbuf) = pay->duration;
|
||||||
|
|
||||||
/* copy G723 data as payload */
|
/* copy G723 data as payload */
|
||||||
@ -204,7 +204,7 @@ gst_rtp_g723_pay_handle_buffer (GstRTPBasePayload * payload, GstBuffer * buf)
|
|||||||
pay = GST_RTP_G723_PAY (payload);
|
pay = GST_RTP_G723_PAY (payload);
|
||||||
|
|
||||||
gst_buffer_map (buf, &map, GST_MAP_READ);
|
gst_buffer_map (buf, &map, GST_MAP_READ);
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buf);
|
timestamp = GST_BUFFER_PTS (buf);
|
||||||
|
|
||||||
if (GST_BUFFER_IS_DISCONT (buf)) {
|
if (GST_BUFFER_IS_DISCONT (buf)) {
|
||||||
/* flush everything on discont */
|
/* flush everything on discont */
|
||||||
|
@ -185,7 +185,7 @@ gst_rtp_g729_pay_push (GstRTPG729Pay * rtpg729pay,
|
|||||||
frames =
|
frames =
|
||||||
(payload_len / G729_FRAME_SIZE) + ((payload_len % G729_FRAME_SIZE) >> 1);
|
(payload_len / G729_FRAME_SIZE) + ((payload_len % G729_FRAME_SIZE) >> 1);
|
||||||
duration = frames * G729_FRAME_DURATION;
|
duration = frames * G729_FRAME_DURATION;
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = rtpg729pay->next_ts;
|
GST_BUFFER_PTS (outbuf) = rtpg729pay->next_ts;
|
||||||
GST_BUFFER_DURATION (outbuf) = duration;
|
GST_BUFFER_DURATION (outbuf) = duration;
|
||||||
GST_BUFFER_OFFSET (outbuf) = rtpg729pay->next_rtp_time;
|
GST_BUFFER_OFFSET (outbuf) = rtpg729pay->next_rtp_time;
|
||||||
rtpg729pay->next_ts += duration;
|
rtpg729pay->next_ts += duration;
|
||||||
@ -314,7 +314,7 @@ gst_rtp_g729_pay_handle_buffer (GstRTPBasePayload * payload, GstBuffer * buf)
|
|||||||
adapter = rtpg729pay->adapter;
|
adapter = rtpg729pay->adapter;
|
||||||
available = gst_adapter_available (adapter);
|
available = gst_adapter_available (adapter);
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buf);
|
timestamp = GST_BUFFER_PTS (buf);
|
||||||
|
|
||||||
/* resync rtp time on discont or a discontinuous cn packet */
|
/* resync rtp time on discont or a discontinuous cn packet */
|
||||||
if (GST_BUFFER_IS_DISCONT (buf)) {
|
if (GST_BUFFER_IS_DISCONT (buf)) {
|
||||||
|
@ -137,7 +137,7 @@ gst_rtp_gsm_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
|
|
||||||
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
duration = GST_BUFFER_DURATION (buffer);
|
duration = GST_BUFFER_DURATION (buffer);
|
||||||
|
|
||||||
/* FIXME, only one GSM frame per RTP packet for now */
|
/* FIXME, only one GSM frame per RTP packet for now */
|
||||||
@ -150,7 +150,7 @@ gst_rtp_gsm_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
outbuf = gst_rtp_buffer_new_allocate (payload_len, 0, 0);
|
outbuf = gst_rtp_buffer_new_allocate (payload_len, 0, 0);
|
||||||
|
|
||||||
/* copy timestamp and duration */
|
/* copy timestamp and duration */
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
GST_BUFFER_PTS (outbuf) = timestamp;
|
||||||
GST_BUFFER_DURATION (outbuf) = duration;
|
GST_BUFFER_DURATION (outbuf) = duration;
|
||||||
|
|
||||||
/* get payload */
|
/* get payload */
|
||||||
|
@ -338,7 +338,7 @@ gst_rtp_gst_pay_create_from_adapter (GstRtpGSTPay * rtpgstpay,
|
|||||||
/* create a new group to hold the rtp header and the payload */
|
/* create a new group to hold the rtp header and the payload */
|
||||||
gst_buffer_append (outbuf, paybuf);
|
gst_buffer_append (outbuf, paybuf);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
GST_BUFFER_PTS (outbuf) = timestamp;
|
||||||
|
|
||||||
/* and add to list */
|
/* and add to list */
|
||||||
gst_buffer_list_insert (list, -1, outbuf);
|
gst_buffer_list_insert (list, -1, outbuf);
|
||||||
@ -614,7 +614,7 @@ gst_rtp_gst_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
|
|
||||||
rtpgstpay = GST_RTP_GST_PAY (basepayload);
|
rtpgstpay = GST_RTP_GST_PAY (basepayload);
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
|
|
||||||
/* check if we need to send the caps and taglist now */
|
/* check if we need to send the caps and taglist now */
|
||||||
if (rtpgstpay->config_interval > 0) {
|
if (rtpgstpay->config_interval > 0) {
|
||||||
|
@ -1303,7 +1303,7 @@ gst_rtp_h263_pay_push (GstRtpH263Pay * rtph263pay,
|
|||||||
/*
|
/*
|
||||||
* timestamp the buffer
|
* timestamp the buffer
|
||||||
*/
|
*/
|
||||||
GST_BUFFER_TIMESTAMP (package->outbuf) = rtph263pay->first_ts;
|
GST_BUFFER_PTS (package->outbuf) = rtph263pay->first_ts;
|
||||||
|
|
||||||
gst_rtp_buffer_set_marker (&rtp, package->marker);
|
gst_rtp_buffer_set_marker (&rtp, package->marker);
|
||||||
if (package->marker)
|
if (package->marker)
|
||||||
@ -1820,7 +1820,7 @@ gst_rtp_h263_pay_handle_buffer (GstRTPBasePayload * payload, GstBuffer * buffer)
|
|||||||
GST_DEBUG ("-------------------- NEW FRAME ---------------");
|
GST_DEBUG ("-------------------- NEW FRAME ---------------");
|
||||||
rtph263pay = GST_RTP_H263_PAY (payload);
|
rtph263pay = GST_RTP_H263_PAY (payload);
|
||||||
|
|
||||||
rtph263pay->first_ts = GST_BUFFER_TIMESTAMP (buffer);
|
rtph263pay->first_ts = GST_BUFFER_PTS (buffer);
|
||||||
|
|
||||||
/* we always encode and flush a full picture */
|
/* we always encode and flush a full picture */
|
||||||
gst_adapter_push (rtph263pay->adapter, buffer);
|
gst_adapter_push (rtph263pay->adapter, buffer);
|
||||||
|
@ -734,7 +734,7 @@ gst_rtp_h263p_pay_flush (GstRtpH263PPay * rtph263ppay)
|
|||||||
payload[0] = (fragmented && !found_gob) ? 0x00 : 0x04;
|
payload[0] = (fragmented && !found_gob) ? 0x00 : 0x04;
|
||||||
payload[1] = 0;
|
payload[1] = 0;
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = rtph263ppay->first_timestamp;
|
GST_BUFFER_PTS (outbuf) = rtph263ppay->first_timestamp;
|
||||||
GST_BUFFER_DURATION (outbuf) = rtph263ppay->first_duration;
|
GST_BUFFER_DURATION (outbuf) = rtph263ppay->first_duration;
|
||||||
gst_rtp_buffer_unmap (&rtp);
|
gst_rtp_buffer_unmap (&rtp);
|
||||||
|
|
||||||
@ -759,7 +759,7 @@ gst_rtp_h263p_pay_handle_buffer (GstRTPBasePayload * payload,
|
|||||||
|
|
||||||
rtph263ppay = GST_RTP_H263P_PAY (payload);
|
rtph263ppay = GST_RTP_H263P_PAY (payload);
|
||||||
|
|
||||||
rtph263ppay->first_timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
rtph263ppay->first_timestamp = GST_BUFFER_PTS (buffer);
|
||||||
rtph263ppay->first_duration = GST_BUFFER_DURATION (buffer);
|
rtph263ppay->first_duration = GST_BUFFER_DURATION (buffer);
|
||||||
|
|
||||||
/* we always encode and flush a full picture */
|
/* we always encode and flush a full picture */
|
||||||
|
@ -770,7 +770,7 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal,
|
|||||||
}
|
}
|
||||||
outbuf = gst_buffer_make_writable (outbuf);
|
outbuf = gst_buffer_make_writable (outbuf);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = out_timestamp;
|
GST_BUFFER_PTS (outbuf) = out_timestamp;
|
||||||
|
|
||||||
if (out_keyframe)
|
if (out_keyframe)
|
||||||
GST_BUFFER_FLAG_UNSET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
|
GST_BUFFER_FLAG_UNSET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
|
||||||
@ -854,7 +854,7 @@ gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
GstClockTime timestamp;
|
GstClockTime timestamp;
|
||||||
gboolean marker;
|
gboolean marker;
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buf);
|
timestamp = GST_BUFFER_PTS (buf);
|
||||||
|
|
||||||
gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
|
gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ gst_rtp_j2k_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
mtu = GST_RTP_BASE_PAYLOAD_MTU (pay);
|
mtu = GST_RTP_BASE_PAYLOAD_MTU (pay);
|
||||||
|
|
||||||
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
offset = pos = end = 0;
|
offset = pos = end = 0;
|
||||||
|
|
||||||
GST_LOG_OBJECT (pay,
|
GST_LOG_OBJECT (pay,
|
||||||
@ -427,7 +427,7 @@ gst_rtp_j2k_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
/* make buffer for header */
|
/* make buffer for header */
|
||||||
outbuf = gst_rtp_buffer_new_allocate (HEADER_SIZE, 0, 0);
|
outbuf = gst_rtp_buffer_new_allocate (HEADER_SIZE, 0, 0);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
GST_BUFFER_PTS (outbuf) = timestamp;
|
||||||
|
|
||||||
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
|
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
|
||||||
|
|
||||||
|
@ -689,7 +689,7 @@ gst_rtp_jpeg_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
||||||
data = map.data;
|
data = map.data;
|
||||||
size = map.size;
|
size = map.size;
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
offset = 0;
|
offset = 0;
|
||||||
discont = GST_BUFFER_IS_DISCONT (buffer);
|
discont = GST_BUFFER_IS_DISCONT (buffer);
|
||||||
|
|
||||||
@ -888,7 +888,7 @@ gst_rtp_jpeg_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
/* join memory parts */
|
/* join memory parts */
|
||||||
outbuf = gst_buffer_append (outbuf, paybuf);
|
outbuf = gst_buffer_append (outbuf, paybuf);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
GST_BUFFER_PTS (outbuf) = timestamp;
|
||||||
|
|
||||||
if (discont) {
|
if (discont) {
|
||||||
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
|
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
|
||||||
|
@ -157,7 +157,7 @@ gst_rtp_mp2t_pay_flush (GstRTPMP2TPay * rtpmp2tpay)
|
|||||||
outbuf = gst_buffer_append (outbuf, paybuf);
|
outbuf = gst_buffer_append (outbuf, paybuf);
|
||||||
avail -= payload_len;
|
avail -= payload_len;
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = rtpmp2tpay->first_ts;
|
GST_BUFFER_PTS (outbuf) = rtpmp2tpay->first_ts;
|
||||||
GST_BUFFER_DURATION (outbuf) = rtpmp2tpay->duration;
|
GST_BUFFER_DURATION (outbuf) = rtpmp2tpay->duration;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (rtpmp2tpay, "pushing buffer of size %u",
|
GST_DEBUG_OBJECT (rtpmp2tpay, "pushing buffer of size %u",
|
||||||
@ -181,7 +181,7 @@ gst_rtp_mp2t_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
rtpmp2tpay = GST_RTP_MP2T_PAY (basepayload);
|
rtpmp2tpay = GST_RTP_MP2T_PAY (basepayload);
|
||||||
|
|
||||||
size = gst_buffer_get_size (buffer);
|
size = gst_buffer_get_size (buffer);
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
duration = GST_BUFFER_DURATION (buffer);
|
duration = GST_BUFFER_DURATION (buffer);
|
||||||
|
|
||||||
again:
|
again:
|
||||||
|
@ -311,7 +311,7 @@ gst_rtp_mp4a_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
|
outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
|
||||||
|
|
||||||
outbuf = gst_buffer_make_writable (outbuf);
|
outbuf = gst_buffer_make_writable (outbuf);
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
|
GST_BUFFER_PTS (outbuf) = GST_BUFFER_PTS (buf);
|
||||||
gst_adapter_push (rtpmp4adepay->adapter, outbuf);
|
gst_adapter_push (rtpmp4adepay->adapter, outbuf);
|
||||||
|
|
||||||
/* RTP marker bit indicates the last packet of the AudioMuxElement => create
|
/* RTP marker bit indicates the last packet of the AudioMuxElement => create
|
||||||
@ -372,7 +372,7 @@ gst_rtp_mp4a_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
data += skip;
|
data += skip;
|
||||||
avail -= skip;
|
avail -= skip;
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (tmp) = timestamp;
|
GST_BUFFER_PTS (tmp) = timestamp;
|
||||||
gst_rtp_base_depayload_push (depayload, tmp);
|
gst_rtp_base_depayload_push (depayload, tmp);
|
||||||
|
|
||||||
/* shift ts for next buffers */
|
/* shift ts for next buffers */
|
||||||
|
@ -366,7 +366,7 @@ gst_rtp_mp4a_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
size = map.size;
|
size = map.size;
|
||||||
data = map.data;
|
data = map.data;
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
|
|
||||||
fragmented = FALSE;
|
fragmented = FALSE;
|
||||||
mtu = GST_RTP_BASE_PAYLOAD_MTU (rtpmp4apay);
|
mtu = GST_RTP_BASE_PAYLOAD_MTU (rtpmp4apay);
|
||||||
@ -431,7 +431,7 @@ gst_rtp_mp4a_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
gst_rtp_buffer_unmap (&rtp);
|
gst_rtp_buffer_unmap (&rtp);
|
||||||
|
|
||||||
/* copy incomming timestamp (if any) to outgoing buffers */
|
/* copy incomming timestamp (if any) to outgoing buffers */
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
GST_BUFFER_PTS (outbuf) = timestamp;
|
||||||
|
|
||||||
ret = gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtpmp4apay), outbuf);
|
ret = gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtpmp4apay), outbuf);
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ gst_rtp_mp4g_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
gst_adapter_clear (rtpmp4gdepay->adapter);
|
gst_adapter_clear (rtpmp4gdepay->adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buf);
|
timestamp = GST_BUFFER_PTS (buf);
|
||||||
|
|
||||||
{
|
{
|
||||||
gint payload_len, payload_AU;
|
gint payload_len, payload_AU;
|
||||||
@ -663,7 +663,7 @@ gst_rtp_mp4g_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
|
|
||||||
/* copy some of the fields we calculated above on the buffer. We also
|
/* copy some of the fields we calculated above on the buffer. We also
|
||||||
* copy the AU_index so that we can sort the packets in our queue. */
|
* copy the AU_index so that we can sort the packets in our queue. */
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
GST_BUFFER_PTS (outbuf) = timestamp;
|
||||||
GST_BUFFER_OFFSET (outbuf) = AU_index;
|
GST_BUFFER_OFFSET (outbuf) = AU_index;
|
||||||
|
|
||||||
/* make sure we don't use the timestamp again for other AUs in this
|
/* make sure we don't use the timestamp again for other AUs in this
|
||||||
|
@ -535,7 +535,7 @@ gst_rtp_mp4g_pay_flush (GstRtpMP4GPay * rtpmp4gpay)
|
|||||||
paybuf = gst_adapter_take_buffer_fast (rtpmp4gpay->adapter, payload_len);
|
paybuf = gst_adapter_take_buffer_fast (rtpmp4gpay->adapter, payload_len);
|
||||||
outbuf = gst_buffer_append (outbuf, paybuf);
|
outbuf = gst_buffer_append (outbuf, paybuf);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = rtpmp4gpay->first_timestamp;
|
GST_BUFFER_PTS (outbuf) = rtpmp4gpay->first_timestamp;
|
||||||
GST_BUFFER_DURATION (outbuf) = rtpmp4gpay->first_duration;
|
GST_BUFFER_DURATION (outbuf) = rtpmp4gpay->first_duration;
|
||||||
|
|
||||||
if (rtpmp4gpay->frame_len) {
|
if (rtpmp4gpay->frame_len) {
|
||||||
@ -567,7 +567,7 @@ gst_rtp_mp4g_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
|
|
||||||
rtpmp4gpay = GST_RTP_MP4G_PAY (basepayload);
|
rtpmp4gpay = GST_RTP_MP4G_PAY (basepayload);
|
||||||
|
|
||||||
rtpmp4gpay->first_timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
rtpmp4gpay->first_timestamp = GST_BUFFER_PTS (buffer);
|
||||||
rtpmp4gpay->first_duration = GST_BUFFER_DURATION (buffer);
|
rtpmp4gpay->first_duration = GST_BUFFER_DURATION (buffer);
|
||||||
rtpmp4gpay->discont = GST_BUFFER_IS_DISCONT (buffer);
|
rtpmp4gpay->discont = GST_BUFFER_IS_DISCONT (buffer);
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ gst_rtp_mp4v_pay_flush (GstRtpMP4VPay * rtpmp4vpay)
|
|||||||
|
|
||||||
outbuf = gst_buffer_append (outbuf, outbuf_data);
|
outbuf = gst_buffer_append (outbuf, outbuf_data);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = rtpmp4vpay->first_timestamp;
|
GST_BUFFER_PTS (outbuf) = rtpmp4vpay->first_timestamp;
|
||||||
|
|
||||||
/* add to list */
|
/* add to list */
|
||||||
gst_buffer_list_insert (list, -1, outbuf);
|
gst_buffer_list_insert (list, -1, outbuf);
|
||||||
@ -434,7 +434,7 @@ gst_rtp_mp4v_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
|
|
||||||
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
||||||
size = map.size;
|
size = map.size;
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
duration = GST_BUFFER_DURATION (buffer);
|
duration = GST_BUFFER_DURATION (buffer);
|
||||||
avail = gst_adapter_available (rtpmp4vpay->adapter);
|
avail = gst_adapter_available (rtpmp4vpay->adapter);
|
||||||
|
|
||||||
@ -464,7 +464,7 @@ gst_rtp_mp4v_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
/* strip off header */
|
/* strip off header */
|
||||||
subbuf = gst_buffer_copy_region (buffer, GST_BUFFER_COPY_MEMORY, strip,
|
subbuf = gst_buffer_copy_region (buffer, GST_BUFFER_COPY_MEMORY, strip,
|
||||||
size - strip);
|
size - strip);
|
||||||
GST_BUFFER_TIMESTAMP (subbuf) = timestamp;
|
GST_BUFFER_PTS (subbuf) = timestamp;
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
buffer = subbuf;
|
buffer = subbuf;
|
||||||
|
|
||||||
@ -513,7 +513,7 @@ gst_rtp_mp4v_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
/* insert header */
|
/* insert header */
|
||||||
buffer = gst_buffer_append (gst_buffer_ref (rtpmp4vpay->config), buffer);
|
buffer = gst_buffer_append (gst_buffer_ref (rtpmp4vpay->config), buffer);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (buffer) = timestamp;
|
GST_BUFFER_PTS (buffer) = timestamp;
|
||||||
size = gst_buffer_get_size (buffer);
|
size = gst_buffer_get_size (buffer);
|
||||||
|
|
||||||
if (timestamp != -1) {
|
if (timestamp != -1) {
|
||||||
|
@ -233,7 +233,7 @@ gst_rtp_mpa_pay_flush (GstRtpMPAPay * rtpmpapay)
|
|||||||
paybuf = gst_adapter_take_buffer_fast (rtpmpapay->adapter, payload_len);
|
paybuf = gst_adapter_take_buffer_fast (rtpmpapay->adapter, payload_len);
|
||||||
outbuf = gst_buffer_append (outbuf, paybuf);
|
outbuf = gst_buffer_append (outbuf, paybuf);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = rtpmpapay->first_ts;
|
GST_BUFFER_PTS (outbuf) = rtpmpapay->first_ts;
|
||||||
GST_BUFFER_DURATION (outbuf) = rtpmpapay->duration;
|
GST_BUFFER_DURATION (outbuf) = rtpmpapay->duration;
|
||||||
|
|
||||||
ret = gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtpmpapay), outbuf);
|
ret = gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtpmpapay), outbuf);
|
||||||
@ -256,7 +256,7 @@ gst_rtp_mpa_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
|
|
||||||
size = gst_buffer_get_size (buffer);
|
size = gst_buffer_get_size (buffer);
|
||||||
duration = GST_BUFFER_DURATION (buffer);
|
duration = GST_BUFFER_DURATION (buffer);
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
|
|
||||||
if (GST_BUFFER_IS_DISCONT (buffer)) {
|
if (GST_BUFFER_IS_DISCONT (buffer)) {
|
||||||
GST_DEBUG_OBJECT (rtpmpapay, "DISCONT");
|
GST_DEBUG_OBJECT (rtpmpapay, "DISCONT");
|
||||||
|
@ -290,7 +290,7 @@ gst_rtp_mpa_robust_depay_generate_dummy_frame (GstRtpMPARobustDepay *
|
|||||||
GST_WRITE_UINT32_BE (map.data, dummy->header);
|
GST_WRITE_UINT32_BE (map.data, dummy->header);
|
||||||
gst_buffer_unmap (dummy->buffer, &map);
|
gst_buffer_unmap (dummy->buffer, &map);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (dummy->buffer) = GST_BUFFER_TIMESTAMP (frame->buffer);
|
GST_BUFFER_PTS (dummy->buffer) = GST_BUFFER_PTS (frame->buffer);
|
||||||
|
|
||||||
return dummy;
|
return dummy;
|
||||||
}
|
}
|
||||||
@ -609,7 +609,7 @@ gst_rtp_mpa_robust_depay_push_mp3_frames (GstRtpMPARobustDepay * rtpmpadepay)
|
|||||||
flush:
|
flush:
|
||||||
buf = gst_byte_writer_free_and_get_buffer (rtpmpadepay->mp3_frame);
|
buf = gst_byte_writer_free_and_get_buffer (rtpmpadepay->mp3_frame);
|
||||||
rtpmpadepay->mp3_frame = NULL;
|
rtpmpadepay->mp3_frame = NULL;
|
||||||
GST_BUFFER_TIMESTAMP (buf) = GST_BUFFER_TIMESTAMP (head->buffer);
|
GST_BUFFER_PTS (buf) = GST_BUFFER_PTS (head->buffer);
|
||||||
/* no longer need head ADU frame header and side info */
|
/* no longer need head ADU frame header and side info */
|
||||||
/* NOTE maybe head == current, then size and offset go off a bit,
|
/* NOTE maybe head == current, then size and offset go off a bit,
|
||||||
* but current gets reset to NULL, and then also offset and size */
|
* but current gets reset to NULL, and then also offset and size */
|
||||||
@ -653,7 +653,7 @@ gst_rtp_mpa_robust_depay_process (GstRTPBaseDepayload * depayload,
|
|||||||
|
|
||||||
rtpmpadepay = GST_RTP_MPA_ROBUST_DEPAY (depayload);
|
rtpmpadepay = GST_RTP_MPA_ROBUST_DEPAY (depayload);
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buf);
|
timestamp = GST_BUFFER_PTS (buf);
|
||||||
|
|
||||||
gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
|
gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
|
||||||
|
|
||||||
@ -716,7 +716,7 @@ gst_rtp_mpa_robust_depay_process (GstRTPBaseDepayload * depayload,
|
|||||||
if (av == size) {
|
if (av == size) {
|
||||||
timestamp = gst_adapter_prev_pts (rtpmpadepay->adapter, NULL);
|
timestamp = gst_adapter_prev_pts (rtpmpadepay->adapter, NULL);
|
||||||
buf = gst_adapter_take_buffer (rtpmpadepay->adapter, size);
|
buf = gst_adapter_take_buffer (rtpmpadepay->adapter, size);
|
||||||
GST_BUFFER_TIMESTAMP (buf) = timestamp;
|
GST_BUFFER_PTS (buf) = timestamp;
|
||||||
gst_rtp_mpa_robust_depay_submit_adu (rtpmpadepay, buf);
|
gst_rtp_mpa_robust_depay_submit_adu (rtpmpadepay, buf);
|
||||||
} else if (av > size) {
|
} else if (av > size) {
|
||||||
GST_DEBUG_OBJECT (rtpmpadepay,
|
GST_DEBUG_OBJECT (rtpmpadepay,
|
||||||
@ -730,7 +730,7 @@ gst_rtp_mpa_robust_depay_process (GstRTPBaseDepayload * depayload,
|
|||||||
/* not continuation, first fragment or whole ADU */
|
/* not continuation, first fragment or whole ADU */
|
||||||
if (payload_len == size) {
|
if (payload_len == size) {
|
||||||
/* whole ADU */
|
/* whole ADU */
|
||||||
GST_BUFFER_TIMESTAMP (buf) = timestamp;
|
GST_BUFFER_PTS (buf) = timestamp;
|
||||||
gst_rtp_mpa_robust_depay_submit_adu (rtpmpadepay, buf);
|
gst_rtp_mpa_robust_depay_submit_adu (rtpmpadepay, buf);
|
||||||
} else if (payload_len < size) {
|
} else if (payload_len < size) {
|
||||||
/* first fragment */
|
/* first fragment */
|
||||||
|
@ -216,7 +216,7 @@ gst_rtp_mpv_pay_flush (GstRTPMPVPay * rtpmpvpay)
|
|||||||
paybuf = gst_adapter_take_buffer_fast (rtpmpvpay->adapter, payload_len);
|
paybuf = gst_adapter_take_buffer_fast (rtpmpvpay->adapter, payload_len);
|
||||||
outbuf = gst_buffer_append (outbuf, paybuf);
|
outbuf = gst_buffer_append (outbuf, paybuf);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = rtpmpvpay->first_ts;
|
GST_BUFFER_PTS (outbuf) = rtpmpvpay->first_ts;
|
||||||
|
|
||||||
ret = gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtpmpvpay), outbuf);
|
ret = gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtpmpvpay), outbuf);
|
||||||
}
|
}
|
||||||
@ -235,7 +235,7 @@ gst_rtp_mpv_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
|
|
||||||
rtpmpvpay = GST_RTP_MPV_PAY (basepayload);
|
rtpmpvpay = GST_RTP_MPV_PAY (basepayload);
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
duration = GST_BUFFER_DURATION (buffer);
|
duration = GST_BUFFER_DURATION (buffer);
|
||||||
|
|
||||||
if (GST_BUFFER_IS_DISCONT (buffer)) {
|
if (GST_BUFFER_IS_DISCONT (buffer)) {
|
||||||
|
@ -267,7 +267,7 @@ gst_rtp_qcelp_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
if (payload_len < 2)
|
if (payload_len < 2)
|
||||||
goto too_small;
|
goto too_small;
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buf);
|
timestamp = GST_BUFFER_PTS (buf);
|
||||||
|
|
||||||
payload = gst_rtp_buffer_get_payload (&rtp);
|
payload = gst_rtp_buffer_get_payload (&rtp);
|
||||||
|
|
||||||
@ -354,7 +354,7 @@ gst_rtp_qcelp_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
outbuf = gst_rtp_buffer_get_payload_subbuffer (&rtp, offset, frame_len);
|
outbuf = gst_rtp_buffer_get_payload_subbuffer (&rtp, offset, frame_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
GST_BUFFER_PTS (outbuf) = timestamp;
|
||||||
GST_BUFFER_DURATION (outbuf) = FRAME_DURATION;
|
GST_BUFFER_DURATION (outbuf) = FRAME_DURATION;
|
||||||
|
|
||||||
if (!depay->interleaved || index == 0) {
|
if (!depay->interleaved || index == 0) {
|
||||||
|
@ -251,7 +251,7 @@ gst_rtp_qdm2_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
flush_data (rtpqdm2depay);
|
flush_data (rtpqdm2depay);
|
||||||
/* And store new timestamp */
|
/* And store new timestamp */
|
||||||
rtpqdm2depay->ptimestamp = rtpqdm2depay->timestamp;
|
rtpqdm2depay->ptimestamp = rtpqdm2depay->timestamp;
|
||||||
rtpqdm2depay->timestamp = GST_BUFFER_TIMESTAMP (buf);
|
rtpqdm2depay->timestamp = GST_BUFFER_PTS (buf);
|
||||||
/* And that previous data will be pushed at the bottom */
|
/* And that previous data will be pushed at the bottom */
|
||||||
}
|
}
|
||||||
rtpqdm2depay->nextseq = seq + 1;
|
rtpqdm2depay->nextseq = seq + 1;
|
||||||
@ -273,7 +273,7 @@ gst_rtp_qdm2_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
GST_DEBUG ("Headers");
|
GST_DEBUG ("Headers");
|
||||||
/* Store the incoming timestamp */
|
/* Store the incoming timestamp */
|
||||||
rtpqdm2depay->ptimestamp = rtpqdm2depay->timestamp;
|
rtpqdm2depay->ptimestamp = rtpqdm2depay->timestamp;
|
||||||
rtpqdm2depay->timestamp = GST_BUFFER_TIMESTAMP (buf);
|
rtpqdm2depay->timestamp = GST_BUFFER_PTS (buf);
|
||||||
/* flush the internal data if needed */
|
/* flush the internal data if needed */
|
||||||
flush_data (rtpqdm2depay);
|
flush_data (rtpqdm2depay);
|
||||||
if (G_UNLIKELY (!rtpqdm2depay->configured)) {
|
if (G_UNLIKELY (!rtpqdm2depay->configured)) {
|
||||||
@ -356,7 +356,7 @@ gst_rtp_qdm2_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
if (G_UNLIKELY (avail)) {
|
if (G_UNLIKELY (avail)) {
|
||||||
GST_DEBUG ("Pushing out %d bytes of collected data", avail);
|
GST_DEBUG ("Pushing out %d bytes of collected data", avail);
|
||||||
outbuf = gst_adapter_take_buffer (rtpqdm2depay->adapter, avail);
|
outbuf = gst_adapter_take_buffer (rtpqdm2depay->adapter, avail);
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = rtpqdm2depay->ptimestamp;
|
GST_BUFFER_PTS (outbuf) = rtpqdm2depay->ptimestamp;
|
||||||
GST_DEBUG ("Outgoing buffer timestamp %" GST_TIME_FORMAT,
|
GST_DEBUG ("Outgoing buffer timestamp %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (rtpqdm2depay->ptimestamp));
|
GST_TIME_ARGS (rtpqdm2depay->ptimestamp));
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ gst_rtp_sbc_pay_flush_buffers (GstRtpSBCPay * sbcpay)
|
|||||||
gst_adapter_flush (sbcpay->adapter, payload_length);
|
gst_adapter_flush (sbcpay->adapter, payload_length);
|
||||||
|
|
||||||
/* FIXME: what about duration? */
|
/* FIXME: what about duration? */
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = sbcpay->timestamp;
|
GST_BUFFER_PTS (outbuf) = sbcpay->timestamp;
|
||||||
GST_DEBUG_OBJECT (sbcpay, "Pushing %d bytes", payload_length);
|
GST_DEBUG_OBJECT (sbcpay, "Pushing %d bytes", payload_length);
|
||||||
|
|
||||||
return gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (sbcpay), outbuf);
|
return gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (sbcpay), outbuf);
|
||||||
@ -220,7 +220,7 @@ gst_rtp_sbc_pay_handle_buffer (GstRTPBasePayload * payload, GstBuffer * buffer)
|
|||||||
/* FIXME check for negotiation */
|
/* FIXME check for negotiation */
|
||||||
|
|
||||||
sbcpay = GST_RTP_SBC_PAY (payload);
|
sbcpay = GST_RTP_SBC_PAY (payload);
|
||||||
sbcpay->timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
sbcpay->timestamp = GST_BUFFER_PTS (buffer);
|
||||||
|
|
||||||
gst_adapter_push (sbcpay->adapter, buffer);
|
gst_adapter_push (sbcpay->adapter, buffer);
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ gst_rtp_speex_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
duration = GST_BUFFER_DURATION (buffer);
|
duration = GST_BUFFER_DURATION (buffer);
|
||||||
|
|
||||||
/* FIXME, only one SPEEX frame per RTP packet for now */
|
/* FIXME, only one SPEEX frame per RTP packet for now */
|
||||||
@ -282,7 +282,7 @@ gst_rtp_speex_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
g_assert (payload_len <= GST_RTP_BASE_PAYLOAD_MTU (rtpspeexpay));
|
g_assert (payload_len <= GST_RTP_BASE_PAYLOAD_MTU (rtpspeexpay));
|
||||||
|
|
||||||
/* copy timestamp and duration */
|
/* copy timestamp and duration */
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
GST_BUFFER_PTS (outbuf) = timestamp;
|
||||||
GST_BUFFER_DURATION (outbuf) = duration;
|
GST_BUFFER_DURATION (outbuf) = duration;
|
||||||
|
|
||||||
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
|
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
|
||||||
|
@ -157,7 +157,7 @@ gst_rtp_sv3v_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
seq = gst_rtp_buffer_get_seq (&rtp);
|
seq = gst_rtp_buffer_get_seq (&rtp);
|
||||||
|
|
||||||
GST_DEBUG ("timestamp %" GST_TIME_FORMAT ", sequence number:%d",
|
GST_DEBUG ("timestamp %" GST_TIME_FORMAT ", sequence number:%d",
|
||||||
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), seq);
|
GST_TIME_ARGS (GST_BUFFER_PTS (buf)), seq);
|
||||||
|
|
||||||
if (seq != rtpsv3vdepay->nextseq) {
|
if (seq != rtpsv3vdepay->nextseq) {
|
||||||
GST_DEBUG ("Sequence discontinuity, clearing adapter");
|
GST_DEBUG ("Sequence discontinuity, clearing adapter");
|
||||||
|
@ -285,7 +285,7 @@ gst_rtp_theora_pay_init_packet (GstRtpTheoraPay * rtptheorapay, guint8 TDT,
|
|||||||
(rtptheorapay), 0, 0);
|
(rtptheorapay), 0, 0);
|
||||||
gst_rtp_theora_pay_reset_packet (rtptheorapay, TDT);
|
gst_rtp_theora_pay_reset_packet (rtptheorapay, TDT);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (rtptheorapay->packet) = timestamp;
|
GST_BUFFER_PTS (rtptheorapay->packet) = timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
@ -731,7 +731,7 @@ gst_rtp_theora_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
data = map.data;
|
data = map.data;
|
||||||
size = map.size;
|
size = map.size;
|
||||||
duration = GST_BUFFER_DURATION (buffer);
|
duration = GST_BUFFER_DURATION (buffer);
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (rtptheorapay, "size %" G_GSIZE_FORMAT
|
GST_DEBUG_OBJECT (rtptheorapay, "size %" G_GSIZE_FORMAT
|
||||||
", duration %" GST_TIME_FORMAT, size, GST_TIME_ARGS (duration));
|
", duration %" GST_TIME_FORMAT, size, GST_TIME_ARGS (duration));
|
||||||
|
@ -280,7 +280,7 @@ gst_rtp_vorbis_pay_init_packet (GstRtpVorbisPay * rtpvorbispay, guint8 VDT,
|
|||||||
(rtpvorbispay), 0, 0);
|
(rtpvorbispay), 0, 0);
|
||||||
gst_rtp_vorbis_pay_reset_packet (rtpvorbispay, VDT);
|
gst_rtp_vorbis_pay_reset_packet (rtpvorbispay, VDT);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (rtpvorbispay->packet) = timestamp;
|
GST_BUFFER_PTS (rtpvorbispay->packet) = timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
@ -724,7 +724,7 @@ gst_rtp_vorbis_pay_handle_buffer (GstRTPBasePayload * basepayload,
|
|||||||
data = map.data;
|
data = map.data;
|
||||||
size = map.size;
|
size = map.size;
|
||||||
duration = GST_BUFFER_DURATION (buffer);
|
duration = GST_BUFFER_DURATION (buffer);
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
|
|
||||||
GST_LOG_OBJECT (rtpvorbispay, "size %" G_GSIZE_FORMAT
|
GST_LOG_OBJECT (rtpvorbispay, "size %" G_GSIZE_FORMAT
|
||||||
", duration %" GST_TIME_FORMAT, size, GST_TIME_ARGS (duration));
|
", duration %" GST_TIME_FORMAT, size, GST_TIME_ARGS (duration));
|
||||||
|
@ -364,7 +364,7 @@ gst_rtp_vraw_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||||||
goto alloc_failed;
|
goto alloc_failed;
|
||||||
|
|
||||||
/* clear timestamp from alloc... */
|
/* clear timestamp from alloc... */
|
||||||
GST_BUFFER_TIMESTAMP (new_buffer) = -1;
|
GST_BUFFER_PTS (new_buffer) = -1;
|
||||||
|
|
||||||
if (!gst_video_frame_map (&rtpvrawdepay->frame, &rtpvrawdepay->vinfo,
|
if (!gst_video_frame_map (&rtpvrawdepay->frame, &rtpvrawdepay->vinfo,
|
||||||
new_buffer, GST_MAP_WRITE | GST_VIDEO_FRAME_MAP_FLAG_NO_REF)) {
|
new_buffer, GST_MAP_WRITE | GST_VIDEO_FRAME_MAP_FLAG_NO_REF)) {
|
||||||
|
@ -346,9 +346,9 @@ gst_rtp_vraw_pay_handle_buffer (GstRTPBasePayload * payload, GstBuffer * buffer)
|
|||||||
out = gst_rtp_buffer_new_allocate (left, 0, 0);
|
out = gst_rtp_buffer_new_allocate (left, 0, 0);
|
||||||
|
|
||||||
if (field == 0) {
|
if (field == 0) {
|
||||||
GST_BUFFER_TIMESTAMP (out) = GST_BUFFER_TIMESTAMP (buffer);
|
GST_BUFFER_PTS (out) = GST_BUFFER_PTS (buffer);
|
||||||
} else {
|
} else {
|
||||||
GST_BUFFER_TIMESTAMP (out) = GST_BUFFER_TIMESTAMP (buffer) +
|
GST_BUFFER_PTS (out) = GST_BUFFER_PTS (buffer) +
|
||||||
GST_BUFFER_DURATION (buffer) / 2;
|
GST_BUFFER_DURATION (buffer) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,8 +394,8 @@ process_list_item (GstBuffer ** buffer, guint idx, gpointer user_data)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (GST_BUFFER_DURATION_IS_VALID (*buffer) &&
|
if (GST_BUFFER_DURATION_IS_VALID (*buffer) &&
|
||||||
GST_BUFFER_TIMESTAMP_IS_VALID (*buffer))
|
GST_BUFFER_PTS_IS_VALID (*buffer))
|
||||||
bd->rtp_mux->last_stop = GST_BUFFER_TIMESTAMP (*buffer) +
|
bd->rtp_mux->last_stop = GST_BUFFER_PTS (*buffer) +
|
||||||
GST_BUFFER_DURATION (*buffer);
|
GST_BUFFER_DURATION (*buffer);
|
||||||
else
|
else
|
||||||
bd->rtp_mux->last_stop = GST_CLOCK_TIME_NONE;
|
bd->rtp_mux->last_stop = GST_CLOCK_TIME_NONE;
|
||||||
@ -504,8 +504,8 @@ gst_rtp_mux_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (GST_BUFFER_DURATION_IS_VALID (buffer) &&
|
if (GST_BUFFER_DURATION_IS_VALID (buffer) &&
|
||||||
GST_BUFFER_TIMESTAMP_IS_VALID (buffer))
|
GST_BUFFER_PTS_IS_VALID (buffer))
|
||||||
rtp_mux->last_stop = GST_BUFFER_TIMESTAMP (buffer) +
|
rtp_mux->last_stop = GST_BUFFER_PTS (buffer) +
|
||||||
GST_BUFFER_DURATION (buffer);
|
GST_BUFFER_DURATION (buffer);
|
||||||
else
|
else
|
||||||
rtp_mux->last_stop = GST_CLOCK_TIME_NONE;
|
rtp_mux->last_stop = GST_CLOCK_TIME_NONE;
|
||||||
|
@ -1742,7 +1742,7 @@ gst_rtp_session_chain_recv_rtp (GstPad * pad, GstObject * parent,
|
|||||||
GST_RTP_SESSION_UNLOCK (rtpsession);
|
GST_RTP_SESSION_UNLOCK (rtpsession);
|
||||||
|
|
||||||
/* get NTP time when this packet was captured, this depends on the timestamp. */
|
/* get NTP time when this packet was captured, this depends on the timestamp. */
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
||||||
/* convert to running time using the segment values */
|
/* convert to running time using the segment values */
|
||||||
running_time =
|
running_time =
|
||||||
@ -2106,11 +2106,11 @@ gst_rtp_session_chain_send_rtp_common (GstRtpSession * rtpsession,
|
|||||||
* So, just take it from the first group. */
|
* So, just take it from the first group. */
|
||||||
buffer = gst_buffer_list_get (GST_BUFFER_LIST_CAST (data), 0);
|
buffer = gst_buffer_list_get (GST_BUFFER_LIST_CAST (data), 0);
|
||||||
if (buffer)
|
if (buffer)
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
else
|
else
|
||||||
timestamp = -1;
|
timestamp = -1;
|
||||||
} else {
|
} else {
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (GST_BUFFER_CAST (data));
|
timestamp = GST_BUFFER_PTS (GST_BUFFER_CAST (data));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
||||||
|
@ -2557,7 +2557,7 @@ rtp_session_process_feedback (RTPSession * sess, GstRTCPPacket * packet,
|
|||||||
fci_buffer = gst_buffer_copy_region (packet->rtcp->buffer,
|
fci_buffer = gst_buffer_copy_region (packet->rtcp->buffer,
|
||||||
GST_BUFFER_COPY_MEMORY, fci_data - packet->rtcp->map.data,
|
GST_BUFFER_COPY_MEMORY, fci_data - packet->rtcp->map.data,
|
||||||
fci_length);
|
fci_length);
|
||||||
GST_BUFFER_TIMESTAMP (fci_buffer) = pinfo->running_time;
|
GST_BUFFER_PTS (fci_buffer) = pinfo->running_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
RTP_SESSION_UNLOCK (sess);
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
@ -1764,7 +1764,7 @@ rtp_source_timeout (RTPSource * src, GstClockTime current_time,
|
|||||||
|
|
||||||
/* Time out AVPF packets that are older than the desired length */
|
/* Time out AVPF packets that are older than the desired length */
|
||||||
while ((pkt = g_queue_peek_tail (src->retained_feedback)) &&
|
while ((pkt = g_queue_peek_tail (src->retained_feedback)) &&
|
||||||
GST_BUFFER_TIMESTAMP (pkt) < feedback_retention_window)
|
GST_BUFFER_PTS (pkt) < feedback_retention_window)
|
||||||
gst_buffer_unref (g_queue_pop_tail (src->retained_feedback));
|
gst_buffer_unref (g_queue_pop_tail (src->retained_feedback));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1774,7 +1774,7 @@ compare_buffers (gconstpointer a, gconstpointer b, gpointer user_data)
|
|||||||
const GstBuffer *bufa = a;
|
const GstBuffer *bufa = a;
|
||||||
const GstBuffer *bufb = b;
|
const GstBuffer *bufb = b;
|
||||||
|
|
||||||
return GST_BUFFER_TIMESTAMP (bufa) - GST_BUFFER_TIMESTAMP (bufb);
|
return GST_BUFFER_PTS (bufa) - GST_BUFFER_PTS (bufb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1786,7 +1786,7 @@ rtp_source_retain_rtcp_packet (RTPSource * src, GstRTCPPacket * packet,
|
|||||||
buffer = gst_buffer_copy_region (packet->rtcp->buffer, GST_BUFFER_COPY_MEMORY,
|
buffer = gst_buffer_copy_region (packet->rtcp->buffer, GST_BUFFER_COPY_MEMORY,
|
||||||
packet->offset, (gst_rtcp_packet_get_length (packet) + 1) * 4);
|
packet->offset, (gst_rtcp_packet_get_length (packet) + 1) * 4);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (buffer) = running_time;
|
GST_BUFFER_PTS (buffer) = running_time;
|
||||||
|
|
||||||
g_queue_insert_sorted (src->retained_feedback, buffer, compare_buffers, NULL);
|
g_queue_insert_sorted (src->retained_feedback, buffer, compare_buffers, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user