Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gst-plugins-good.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2020-09-28 18:25:21 +0300
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-09-28 18:27:17 +0300
commitf95dde512c32dc31665de6c392daa88cf3b4fd53 (patch)
treed0eac60f05cb6031718dec0eb4678414409cdc5b /gst
parentd494be99167d81250bb9715015b067123d117a03 (diff)
rtp: Fix allocations to support source-info property
Use gst_rtp_base_payload_allocate_output_buffer() instead of gst_rtp_buffer_new_allocate() in order to allocate RTP buffer with correct number of CSRCs according to the meta. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/612>
Diffstat (limited to 'gst')
-rw-r--r--gst/rtp/gstrtpdvpay.c4
-rw-r--r--gst/rtp/gstrtph261pay.c5
-rw-r--r--gst/rtp/gstrtph263pay.c11
-rw-r--r--gst/rtp/gstrtph263ppay.c4
-rw-r--r--gst/rtp/gstrtph264pay.c4
-rw-r--r--gst/rtp/gstrtph265pay.c4
-rw-r--r--gst/rtp/gstrtpj2kpay.c4
-rw-r--r--gst/rtp/gstrtpjpegpay.c4
-rw-r--r--gst/rtp/gstrtpklvpay.c2
-rw-r--r--gst/rtp/gstrtpmp4vpay.c4
-rw-r--r--gst/rtp/gstrtpmpvpay.c4
-rw-r--r--gst/rtp/gstrtptheorapay.c4
-rw-r--r--gst/rtp/gstrtpvp8pay.c6
-rw-r--r--gst/rtp/gstrtpvp9pay.c4
14 files changed, 42 insertions, 22 deletions
diff --git a/gst/rtp/gstrtpdvpay.c b/gst/rtp/gstrtpdvpay.c
index 540d68566..3600251ce 100644
--- a/gst/rtp/gstrtpdvpay.c
+++ b/gst/rtp/gstrtpdvpay.c
@@ -332,7 +332,9 @@ gst_rtp_dv_pay_handle_buffer (GstRTPBasePayload * basepayload,
while (size >= 80) {
/* Allocate a new buffer, set the timestamp */
if (outbuf == NULL) {
- outbuf = gst_rtp_buffer_new_allocate (max_payload_size, 0, 0);
+ outbuf =
+ gst_rtp_base_payload_allocate_output_buffer (basepayload,
+ max_payload_size, 0, 0);
GST_BUFFER_PTS (outbuf) = GST_BUFFER_PTS (buffer);
if (!gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp)) {
diff --git a/gst/rtp/gstrtph261pay.c b/gst/rtp/gstrtph261pay.c
index 9b8c0d922..fadc2c99e 100644
--- a/gst/rtp/gstrtph261pay.c
+++ b/gst/rtp/gstrtph261pay.c
@@ -813,8 +813,9 @@ gst_rtp_h261_pay_fragment_push (GstRtpH261Pay * pay, GstBuffer * buffer,
nbytes = bitrange_to_bytes (start, end);
- outbuf = gst_rtp_buffer_new_allocate (nbytes +
- GST_RTP_H261_PAYLOAD_HEADER_LEN, 0, 0);
+ outbuf =
+ gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD (pay),
+ nbytes + GST_RTP_H261_PAYLOAD_HEADER_LEN, 0, 0);
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
payload = gst_rtp_buffer_get_payload (&rtp);
header = (GstRtpH261PayHeader *) payload;
diff --git a/gst/rtp/gstrtph263pay.c b/gst/rtp/gstrtph263pay.c
index a8def87aa..9c296a917 100644
--- a/gst/rtp/gstrtph263pay.c
+++ b/gst/rtp/gstrtph263pay.c
@@ -1355,7 +1355,9 @@ gst_rtp_h263_pay_A_fragment_push (GstRtpH263Pay * rtph263pay,
pack->gobn = context->gobs[first]->gobn;
pack->mode = GST_RTP_H263_PAYLOAD_HEADER_MODE_A;
- pack->outbuf = gst_rtp_buffer_new_allocate (pack->mode, 0, 0);
+ pack->outbuf =
+ gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD
+ (rtph263pay), pack->mode, 0, 0);
GST_DEBUG_OBJECT (rtph263pay, "Sending len:%d data to push function",
pack->payload_len);
@@ -1412,7 +1414,9 @@ gst_rtp_h263_pay_B_fragment_push (GstRtpH263Pay * rtph263pay,
}
pack->payload_len = pack->payload_end - pack->payload_start + 1;
- pack->outbuf = gst_rtp_buffer_new_allocate (pack->mode, 0, 0);
+ pack->outbuf =
+ gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD
+ (rtph263pay), pack->mode, 0, 0);
return gst_rtp_h263_pay_push (rtph263pay, context, pack);
}
@@ -1637,7 +1641,8 @@ gst_rtp_h263_send_entire_frame (GstRtpH263Pay * rtph263pay,
rtph263pay->available_data);
pack->outbuf =
- gst_rtp_buffer_new_allocate (GST_RTP_H263_PAYLOAD_HEADER_MODE_A, 0, 0);
+ gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD
+ (rtph263pay), GST_RTP_H263_PAYLOAD_HEADER_MODE_A, 0, 0);
return gst_rtp_h263_pay_push (rtph263pay, context, pack);
}
diff --git a/gst/rtp/gstrtph263ppay.c b/gst/rtp/gstrtph263ppay.c
index 3b1ee0512..bb454558b 100644
--- a/gst/rtp/gstrtph263ppay.c
+++ b/gst/rtp/gstrtph263ppay.c
@@ -732,7 +732,9 @@ gst_rtp_h263p_pay_flush (GstRtpH263PPay * rtph263ppay)
if (next_gop > 0)
towrite = MIN (next_gop, towrite);
- outbuf = gst_rtp_buffer_new_allocate (header_len, 0, 0);
+ outbuf =
+ gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD
+ (rtph263ppay), header_len, 0, 0);
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
/* last fragment gets the marker bit set */
diff --git a/gst/rtp/gstrtph264pay.c b/gst/rtp/gstrtph264pay.c
index 67353283e..52e92a5fc 100644
--- a/gst/rtp/gstrtph264pay.c
+++ b/gst/rtp/gstrtph264pay.c
@@ -1060,7 +1060,7 @@ gst_rtp_h264_pay_payload_nal_fragment (GstRTPBasePayload * basepayload,
/* use buffer lists
* create buffer without payload containing only the RTP header
* (memory block at index 0) */
- outbuf = gst_rtp_buffer_new_allocate (2, 0, 0);
+ outbuf = gst_rtp_base_payload_allocate_output_buffer (basepayload, 2, 0, 0);
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
@@ -1122,7 +1122,7 @@ gst_rtp_h264_pay_payload_nal_single (GstRTPBasePayload * basepayload,
/* create buffer without payload containing only the RTP header
* (memory block at index 0) */
- outbuf = gst_rtp_buffer_new_allocate (0, 0, 0);
+ outbuf = gst_rtp_base_payload_allocate_output_buffer (basepayload, 0, 0, 0);
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
diff --git a/gst/rtp/gstrtph265pay.c b/gst/rtp/gstrtph265pay.c
index 3793ad613..81e2bce0b 100644
--- a/gst/rtp/gstrtph265pay.c
+++ b/gst/rtp/gstrtph265pay.c
@@ -1131,7 +1131,7 @@ gst_rtp_h265_pay_payload_nal_single (GstRTPBasePayload * basepayload,
/* use buffer lists
* create buffer without payload containing only the RTP header
* (memory block at index 0) */
- outbuf = gst_rtp_buffer_new_allocate (0, 0, 0);
+ outbuf = gst_rtp_base_payload_allocate_output_buffer (basepayload, 0, 0, 0);
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
@@ -1206,7 +1206,7 @@ gst_rtp_h265_pay_payload_nal_fragment (GstRTPBasePayload * basepayload,
/* use buffer lists
* create buffer without payload containing only the RTP header
* (memory block at index 0), and with space for PayloadHdr and FU header */
- outbuf = gst_rtp_buffer_new_allocate (3, 0, 0);
+ outbuf = gst_rtp_base_payload_allocate_output_buffer (basepayload, 3, 0, 0);
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
diff --git a/gst/rtp/gstrtpj2kpay.c b/gst/rtp/gstrtpj2kpay.c
index 9ead8a21a..41d1fadca 100644
--- a/gst/rtp/gstrtpj2kpay.c
+++ b/gst/rtp/gstrtpj2kpay.c
@@ -440,7 +440,9 @@ gst_rtp_j2k_pay_handle_buffer (GstRTPBasePayload * basepayload,
data_size = payload_size - GST_RTP_J2K_HEADER_SIZE;
/* make buffer for header */
- outbuf = gst_rtp_buffer_new_allocate (GST_RTP_J2K_HEADER_SIZE, 0, 0);
+ outbuf =
+ gst_rtp_base_payload_allocate_output_buffer (basepayload,
+ GST_RTP_J2K_HEADER_SIZE, 0, 0);
GST_BUFFER_PTS (outbuf) = timestamp;
diff --git a/gst/rtp/gstrtpjpegpay.c b/gst/rtp/gstrtpjpegpay.c
index 31f8efa38..b79ecc606 100644
--- a/gst/rtp/gstrtpjpegpay.c
+++ b/gst/rtp/gstrtpjpegpay.c
@@ -885,7 +885,9 @@ gst_rtp_jpeg_pay_handle_buffer (GstRTPBasePayload * basepayload,
if (dri_found)
header_size += sizeof (restart_marker_header);
- outbuf = gst_rtp_buffer_new_allocate (header_size, 0, 0);
+ outbuf =
+ gst_rtp_base_payload_allocate_output_buffer (basepayload, header_size,
+ 0, 0);
gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp);
diff --git a/gst/rtp/gstrtpklvpay.c b/gst/rtp/gstrtpklvpay.c
index f24d29f3c..779d6a70e 100644
--- a/gst/rtp/gstrtpklvpay.c
+++ b/gst/rtp/gstrtpklvpay.c
@@ -147,7 +147,7 @@ gst_rtp_klv_pay_handle_buffer (GstRTPBasePayload * basepayload, GstBuffer * buf)
bytes_left = map.size - offset;
payload_size = MIN (bytes_left, max_payload_size);
- outbuf = gst_rtp_buffer_new_allocate (0, 0, 0);
+ outbuf = gst_rtp_base_payload_allocate_output_buffer (basepayload, 0, 0, 0);
if (payload_size == bytes_left) {
GST_LOG_OBJECT (pay, "last packet of KLV unit");
diff --git a/gst/rtp/gstrtpmp4vpay.c b/gst/rtp/gstrtpmp4vpay.c
index 29803392a..30c679d4a 100644
--- a/gst/rtp/gstrtpmp4vpay.c
+++ b/gst/rtp/gstrtpmp4vpay.c
@@ -278,7 +278,9 @@ gst_rtp_mp4v_pay_flush (GstRtpMP4VPay * rtpmp4vpay)
/* create buffer without payload. The payload will be put
* in next buffer instead. Both buffers will be merged */
- outbuf = gst_rtp_buffer_new_allocate (0, 0, 0);
+ outbuf =
+ gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD
+ (rtpmp4vpay), 0, 0, 0);
/* Take buffer with the payload from the adapter */
outbuf_data = gst_adapter_take_buffer_fast (rtpmp4vpay->adapter,
diff --git a/gst/rtp/gstrtpmpvpay.c b/gst/rtp/gstrtpmpvpay.c
index eb73af25e..24ad3c72c 100644
--- a/gst/rtp/gstrtpmpvpay.c
+++ b/gst/rtp/gstrtpmpvpay.c
@@ -204,7 +204,9 @@ gst_rtp_mpv_pay_flush (GstRTPMPVPay * rtpmpvpay)
payload_len = gst_rtp_buffer_calc_payload_len (towrite, 0, 0);
- outbuf = gst_rtp_buffer_new_allocate (4, 0, 0);
+ outbuf =
+ gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD
+ (rtpmpvpay), 4, 0, 0);
payload_len -= 4;
diff --git a/gst/rtp/gstrtptheorapay.c b/gst/rtp/gstrtptheorapay.c
index 61fb90bc6..136ce7d6d 100644
--- a/gst/rtp/gstrtptheorapay.c
+++ b/gst/rtp/gstrtptheorapay.c
@@ -281,8 +281,8 @@ gst_rtp_theora_pay_init_packet (GstRtpTheoraPay * rtptheorapay, guint8 TDT,
/* new packet allocate max packet size */
rtptheorapay->packet =
- gst_rtp_buffer_new_allocate_len (GST_RTP_BASE_PAYLOAD_MTU
- (rtptheorapay), 0, 0);
+ gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD
+ (rtptheorapay), GST_RTP_BASE_PAYLOAD_MTU (rtptheorapay), 0, 0);
gst_rtp_theora_pay_reset_packet (rtptheorapay, TDT);
GST_BUFFER_PTS (rtptheorapay->packet) = timestamp;
diff --git a/gst/rtp/gstrtpvp8pay.c b/gst/rtp/gstrtpvp8pay.c
index e3c8b3483..d286029b7 100644
--- a/gst/rtp/gstrtpvp8pay.c
+++ b/gst/rtp/gstrtpvp8pay.c
@@ -385,9 +385,9 @@ gst_rtp_vp8_create_header_buffer (GstRtpVP8Pay * self, guint8 partid,
guint8 *p;
GstRTPBuffer rtpbuffer = GST_RTP_BUFFER_INIT;
- out = gst_rtp_base_payload_allocate_output_buffer (
- GST_RTP_BASE_PAYLOAD_CAST (self), gst_rtp_vp8_calc_header_len (self),
- 0, 0);
+ out =
+ gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD_CAST
+ (self), gst_rtp_vp8_calc_header_len (self), 0, 0);
gst_rtp_buffer_map (out, GST_MAP_READWRITE, &rtpbuffer);
p = gst_rtp_buffer_get_payload (&rtpbuffer);
/* X=0,R=0,N=0,S=start,PartID=partid */
diff --git a/gst/rtp/gstrtpvp9pay.c b/gst/rtp/gstrtpvp9pay.c
index ce79c6463..6ec425150 100644
--- a/gst/rtp/gstrtpvp9pay.c
+++ b/gst/rtp/gstrtpvp9pay.c
@@ -386,7 +386,9 @@ gst_rtp_vp9_create_header_buffer (GstRtpVP9Pay * self,
guint off = 1;
guint hdrlen = gst_rtp_vp9_calc_header_len (self, start);
- out = gst_rtp_buffer_new_allocate (hdrlen, 0, 0);
+ out =
+ gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD (self),
+ hdrlen, 0, 0);
gst_rtp_buffer_map (out, GST_MAP_READWRITE, &rtpbuffer);
p = gst_rtp_buffer_get_payload (&rtpbuffer);
p[0] = 0x0;