mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
rtpmpvpay: Create buffer lists instead of pushing each buffer individually
This commit is contained in:
parent
f67bafb90d
commit
7e1d28d27f
1 changed files with 11 additions and 3 deletions
|
@ -160,12 +160,15 @@ gst_rtp_mpv_pay_sink_event (GstRTPBasePayload * payload, GstEvent * event)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#define RTP_HEADER_LEN 12
|
||||
|
||||
static GstFlowReturn
|
||||
gst_rtp_mpv_pay_flush (GstRTPMPVPay * rtpmpvpay)
|
||||
{
|
||||
GstBuffer *outbuf;
|
||||
GstFlowReturn ret;
|
||||
guint avail;
|
||||
GstBufferList *list;
|
||||
GstBuffer *outbuf;
|
||||
|
||||
guint8 *payload;
|
||||
|
||||
|
@ -173,6 +176,10 @@ gst_rtp_mpv_pay_flush (GstRTPMPVPay * rtpmpvpay)
|
|||
|
||||
ret = GST_FLOW_OK;
|
||||
|
||||
list =
|
||||
gst_buffer_list_new_sized (avail / (GST_RTP_BASE_PAYLOAD_MTU (rtpmpvpay) -
|
||||
RTP_HEADER_LEN) + 1);
|
||||
|
||||
while (avail > 0) {
|
||||
guint towrite;
|
||||
guint packet_len;
|
||||
|
@ -217,10 +224,11 @@ gst_rtp_mpv_pay_flush (GstRTPMPVPay * rtpmpvpay)
|
|||
outbuf = gst_buffer_append (outbuf, paybuf);
|
||||
|
||||
GST_BUFFER_PTS (outbuf) = rtpmpvpay->first_ts;
|
||||
|
||||
ret = gst_rtp_base_payload_push (GST_RTP_BASE_PAYLOAD (rtpmpvpay), outbuf);
|
||||
gst_buffer_list_add (list, outbuf);
|
||||
}
|
||||
|
||||
ret = gst_rtp_base_payload_push_list (GST_RTP_BASE_PAYLOAD (rtpmpvpay), list);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue