diff --git a/gst/rtp/gstrtpac3pay.c b/gst/rtp/gstrtpac3pay.c index 8c5c2350db..1feccedf4a 100644 --- a/gst/rtp/gstrtpac3pay.c +++ b/gst/rtp/gstrtpac3pay.c @@ -274,7 +274,9 @@ gst_rtp_ac3_pay_flush (GstRtpAC3Pay * rtpac3pay) payload_len = gst_rtp_buffer_calc_payload_len (towrite, 0, 0); /* create buffer to hold the payload */ - outbuf = gst_rtp_buffer_new_allocate (2, 0, 0); + outbuf = + gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD + (rtpac3pay), 2, 0, 0); if (FT == 0) { /* check if it all fits */ diff --git a/gst/rtp/gstrtpamrpay.c b/gst/rtp/gstrtpamrpay.c index 7921d97132..828a7189f9 100644 --- a/gst/rtp/gstrtpamrpay.c +++ b/gst/rtp/gstrtpamrpay.c @@ -312,7 +312,9 @@ gst_rtp_amr_pay_handle_buffer (GstRTPBasePayload * basepayload, goto too_big; /* now alloc output buffer */ - outbuf = gst_rtp_buffer_new_allocate (payload_len, 0, 0); + outbuf = + gst_rtp_base_payload_allocate_output_buffer (basepayload, payload_len, 0, + 0); gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp); diff --git a/gst/rtp/gstrtpceltpay.c b/gst/rtp/gstrtpceltpay.c index c4988977ed..a29d23b170 100644 --- a/gst/rtp/gstrtpceltpay.c +++ b/gst/rtp/gstrtpceltpay.c @@ -332,7 +332,9 @@ gst_rtp_celt_pay_flush_queued (GstRtpCELTPay * rtpceltpay) payload_len, GST_TIME_ARGS (rtpceltpay->qduration)); /* get a big enough packet for the sizes + payloads */ - outbuf = gst_rtp_buffer_new_allocate (payload_len, 0, 0); + outbuf = + gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD + (rtpceltpay), payload_len, 0, 0); GST_BUFFER_DURATION (outbuf) = duration; diff --git a/gst/rtp/gstrtpg723pay.c b/gst/rtp/gstrtpg723pay.c index cb6dff52a1..18e294a3f7 100644 --- a/gst/rtp/gstrtpg723pay.c +++ b/gst/rtp/gstrtpg723pay.c @@ -144,8 +144,9 @@ gst_rtp_g723_pay_flush (GstRTPG723Pay * pay) avail = gst_adapter_available (pay->adapter); - outbuf = gst_rtp_buffer_new_allocate (0, 0, 0); - + outbuf = + gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD (pay), + 0, 0, 0); gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp); GST_BUFFER_PTS (outbuf) = pay->timestamp; diff --git a/gst/rtp/gstrtpg729pay.c b/gst/rtp/gstrtpg729pay.c index 378fa64e09..78097805e3 100644 --- a/gst/rtp/gstrtpg729pay.c +++ b/gst/rtp/gstrtpg729pay.c @@ -167,7 +167,9 @@ gst_rtp_g729_pay_push (GstRTPG729Pay * rtpg729pay, GstBuffer * buf) payload_len, GST_TIME_ARGS (rtpg729pay->next_ts)); /* create buffer to hold the payload */ - outbuf = gst_rtp_buffer_new_allocate (0, 0, 0); + outbuf = + gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD + (rtpg729pay), 0, 0, 0); gst_rtp_buffer_map (outbuf, GST_MAP_READWRITE, &rtp); diff --git a/gst/rtp/gstrtpgsmpay.c b/gst/rtp/gstrtpgsmpay.c index aa239a8b06..25fa0fa0a2 100644 --- a/gst/rtp/gstrtpgsmpay.c +++ b/gst/rtp/gstrtpgsmpay.c @@ -145,7 +145,7 @@ gst_rtp_gsm_pay_handle_buffer (GstRTPBasePayload * basepayload, if (payload_len > GST_RTP_BASE_PAYLOAD_MTU (rtpgsmpay)) goto too_big; - outbuf = gst_rtp_buffer_new_allocate (0, 0, 0); + outbuf = gst_rtp_base_payload_allocate_output_buffer (basepayload, 0, 0, 0); /* copy timestamp and duration */ GST_BUFFER_PTS (outbuf) = timestamp; diff --git a/gst/rtp/gstrtpgstpay.c b/gst/rtp/gstrtpgstpay.c index a0f42e32e1..15b281bd73 100644 --- a/gst/rtp/gstrtpgstpay.c +++ b/gst/rtp/gstrtpgstpay.c @@ -299,7 +299,9 @@ gst_rtp_gst_pay_create_from_adapter (GstRtpGSTPay * rtpgstpay, payload_len = gst_rtp_buffer_calc_payload_len (towrite, 0, 0); /* create buffer to hold the header */ - outbuf = gst_rtp_buffer_new_allocate (8, 0, 0); + outbuf = + gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD + (rtpgstpay), 8, 0, 0); gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp); payload = gst_rtp_buffer_get_payload (&rtp); diff --git a/gst/rtp/gstrtpmp2tpay.c b/gst/rtp/gstrtpmp2tpay.c index 12f948ed8b..8dac50b9a9 100644 --- a/gst/rtp/gstrtpmp2tpay.c +++ b/gst/rtp/gstrtpmp2tpay.c @@ -152,7 +152,9 @@ gst_rtp_mp2t_pay_flush (GstRTPMP2TPay * rtpmp2tpay) break; /* create buffer to hold the payload */ - outbuf = gst_rtp_buffer_new_allocate (0, 0, 0); + outbuf = + gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD + (rtpmp2tpay), 0, 0, 0); /* get payload */ paybuf = gst_adapter_take_buffer_fast (rtpmp2tpay->adapter, payload_len); diff --git a/gst/rtp/gstrtpmp4apay.c b/gst/rtp/gstrtpmp4apay.c index 2f01b21b59..ab1eeb55a3 100644 --- a/gst/rtp/gstrtpmp4apay.c +++ b/gst/rtp/gstrtpmp4apay.c @@ -408,7 +408,8 @@ gst_rtp_mp4a_pay_handle_buffer (GstRTPBasePayload * basepayload, packet_len, payload_len); /* create buffer to hold the payload. */ - outbuf = gst_rtp_buffer_new_allocate (header_len, 0, 0); + outbuf = gst_rtp_base_payload_allocate_output_buffer (basepayload, + header_len, 0, 0); /* copy payload */ gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp); diff --git a/gst/rtp/gstrtpmp4gpay.c b/gst/rtp/gstrtpmp4gpay.c index 1f64b24c35..532e2de25c 100644 --- a/gst/rtp/gstrtpmp4gpay.c +++ b/gst/rtp/gstrtpmp4gpay.c @@ -487,8 +487,9 @@ gst_rtp_mp4g_pay_flush (GstRtpMP4GPay * rtpmp4gpay) packet_len, payload_len); /* create buffer to hold the payload, also make room for the 4 header bytes. */ - outbuf = gst_rtp_buffer_new_allocate (4, 0, 0); - + outbuf = + gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD + (rtpmp4gpay), 4, 0, 0); gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp); /* copy payload */ diff --git a/gst/rtp/gstrtpmpapay.c b/gst/rtp/gstrtpmpapay.c index 09fa8a8433..62639f7127 100644 --- a/gst/rtp/gstrtpmpapay.c +++ b/gst/rtp/gstrtpmpapay.c @@ -213,7 +213,9 @@ gst_rtp_mpa_pay_flush (GstRtpMPAPay * rtpmpapay) payload_len = gst_rtp_buffer_calc_payload_len (towrite, 0, 0); /* create buffer to hold the payload */ - outbuf = gst_rtp_buffer_new_allocate (4, 0, 0); + outbuf = + gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD + (rtpmpapay), 4, 0, 0); gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp); diff --git a/gst/rtp/gstrtpsbcpay.c b/gst/rtp/gstrtpsbcpay.c index 1d2cbd4095..f2cf849ec8 100644 --- a/gst/rtp/gstrtpsbcpay.c +++ b/gst/rtp/gstrtpsbcpay.c @@ -198,7 +198,9 @@ gst_rtp_sbc_pay_flush_buffers (GstRtpSBCPay * sbcpay) if (payload_length == 0) /* Nothing to send */ return GST_FLOW_OK; - outbuf = gst_rtp_buffer_new_allocate (RTP_SBC_PAYLOAD_HEADER_SIZE, 0, 0); + outbuf = + gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD + (sbcpay), RTP_SBC_PAYLOAD_HEADER_SIZE, 0, 0); /* get payload */ gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp); diff --git a/gst/rtp/gstrtpspeexpay.c b/gst/rtp/gstrtpspeexpay.c index 7816bd63cd..6f086b0103 100644 --- a/gst/rtp/gstrtpspeexpay.c +++ b/gst/rtp/gstrtpspeexpay.c @@ -279,8 +279,8 @@ gst_rtp_speex_pay_handle_buffer (GstRTPBasePayload * basepayload, duration = GST_BUFFER_DURATION (buffer); /* FIXME, only one SPEEX frame per RTP packet for now */ + outbuf = gst_rtp_base_payload_allocate_output_buffer (basepayload, 0, 0, 0); - outbuf = gst_rtp_buffer_new_allocate (0, 0, 0); /* FIXME, assert for now */ g_assert (gst_buffer_get_size (buffer) <= GST_RTP_BASE_PAYLOAD_MTU (rtpspeexpay)); diff --git a/gst/rtp/gstrtpvorbispay.c b/gst/rtp/gstrtpvorbispay.c index 9220f372c2..8a3c249c0f 100644 --- a/gst/rtp/gstrtpvorbispay.c +++ b/gst/rtp/gstrtpvorbispay.c @@ -270,14 +270,18 @@ static void gst_rtp_vorbis_pay_init_packet (GstRtpVorbisPay * rtpvorbispay, guint8 VDT, GstClockTime timestamp) { + guint len; + GST_LOG_OBJECT (rtpvorbispay, "starting new packet, VDT: %d", VDT); gst_rtp_vorbis_pay_clear_packet (rtpvorbispay); /* new packet allocate max packet size */ - rtpvorbispay->packet = - gst_rtp_buffer_new_allocate_len (GST_RTP_BASE_PAYLOAD_MTU + len = gst_rtp_buffer_calc_payload_len (GST_RTP_BASE_PAYLOAD_MTU (rtpvorbispay), 0, 0); + rtpvorbispay->packet = + gst_rtp_base_payload_allocate_output_buffer (GST_RTP_BASE_PAYLOAD + (rtpvorbispay), len, 0, 0); gst_rtp_vorbis_pay_reset_packet (rtpvorbispay, VDT); GST_BUFFER_PTS (rtpvorbispay->packet) = timestamp;