rtp: rename gst_rtp_sbc_pay_flush_buffers()

gst_rtp_sbc_pay_flush_buffers() is a misleading name. A better name would
be gst_rtp_sbc_pay_drain_buffers(), because that's what it does, it drains
any leftover queued data and pushes it downstream. "Flushing" in GStreamer
typically means to throw away any queued data and not process/push it
downstream.

Signed-off-by: Michal Dzik <michal.dzik@streamunlimited.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/700>
This commit is contained in:
Michal Dzik 2020-03-30 09:29:07 +02:00 committed by GStreamer Marge Bot
parent 680722bbfa
commit 8e8b22174d

View file

@ -173,7 +173,7 @@ gst_rtp_sbc_pay_set_caps (GstRTPBasePayload * payload, GstCaps * caps)
}
static GstFlowReturn
gst_rtp_sbc_pay_flush_buffers (GstRtpSBCPay * sbcpay)
gst_rtp_sbc_pay_drain_buffers (GstRtpSBCPay * sbcpay)
{
GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
guint available;
@ -251,7 +251,7 @@ gst_rtp_sbc_pay_handle_buffer (GstRTPBasePayload * payload, GstBuffer * buffer)
if (GST_BUFFER_IS_DISCONT (buffer)) {
/* Try to flush whatever's left */
gst_rtp_sbc_pay_flush_buffers (sbcpay);
gst_rtp_sbc_pay_drain_buffers (sbcpay);
/* Drop the rest */
gst_adapter_flush (sbcpay->adapter,
gst_adapter_available (sbcpay->adapter));
@ -268,7 +268,7 @@ gst_rtp_sbc_pay_handle_buffer (GstRTPBasePayload * payload, GstBuffer * buffer)
if (available + RTP_SBC_HEADER_TOTAL >=
GST_RTP_BASE_PAYLOAD_MTU (sbcpay) ||
(available > (sbcpay->min_frames * sbcpay->frame_length)))
return gst_rtp_sbc_pay_flush_buffers (sbcpay);
return gst_rtp_sbc_pay_drain_buffers (sbcpay);
return GST_FLOW_OK;
}
@ -280,13 +280,13 @@ gst_rtp_sbc_pay_sink_event (GstRTPBasePayload * payload, GstEvent * event)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
gst_rtp_sbc_pay_flush_buffers (sbcpay);
gst_rtp_sbc_pay_drain_buffers (sbcpay);
break;
case GST_EVENT_FLUSH_STOP:
gst_adapter_clear (sbcpay->adapter);
break;
case GST_EVENT_SEGMENT:
gst_rtp_sbc_pay_flush_buffers (sbcpay);
gst_rtp_sbc_pay_drain_buffers (sbcpay);
break;
default:
break;