mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
mpegtbase: vmethod to notify when we're done processing input
This can be used to notify subclasses no more data is expected this round. tsparse will use it to push whole buffers (without copy) on the main source pad. It could also be used later to decide whether to push pending data in order to reduce latency.
This commit is contained in:
parent
fe5cf525e1
commit
558beab1b4
2 changed files with 16 additions and 0 deletions
|
@ -1409,14 +1409,20 @@ mpegts_base_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||
MpegTSPacketizerPacketReturn pret;
|
||||
MpegTSPacketizer2 *packetizer;
|
||||
MpegTSPacketizerPacket packet;
|
||||
MpegTSBaseClass *klass;
|
||||
|
||||
base = GST_MPEGTS_BASE (parent);
|
||||
klass = GST_MPEGTS_BASE_GET_CLASS (base);
|
||||
|
||||
packetizer = base->packetizer;
|
||||
|
||||
if (G_UNLIKELY (base->queried_latency == FALSE)) {
|
||||
query_upstream_latency (base);
|
||||
}
|
||||
|
||||
if (klass->input_done)
|
||||
gst_buffer_ref (buf);
|
||||
|
||||
mpegts_packetizer_push (base->packetizer, buf);
|
||||
|
||||
while (res == GST_FLOW_OK) {
|
||||
|
@ -1465,6 +1471,13 @@ mpegts_base_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||
mpegts_packetizer_clear_packet (base->packetizer, &packet);
|
||||
}
|
||||
|
||||
if (klass->input_done) {
|
||||
if (res == GST_FLOW_OK)
|
||||
res = klass->input_done (base, buf);
|
||||
else
|
||||
gst_buffer_unref (buf);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,6 +168,9 @@ struct _MpegTSBaseClass {
|
|||
/* flush all streams */
|
||||
void (*flush) (MpegTSBase * base);
|
||||
|
||||
/* Notifies subclasses input buffer has been handled */
|
||||
GstFlowReturn (*input_done) (MpegTSBase *base, GstBuffer *buffer);
|
||||
|
||||
/* signals */
|
||||
void (*pat_info) (GstStructure *pat);
|
||||
void (*pmt_info) (GstStructure *pmt);
|
||||
|
|
Loading…
Reference in a new issue