mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
ccconverter: Send gap event if generated output is empty
Sends a gap event if nothing to output for a given input buffer. For example, an input buffer might not contain any caption data for downstream requested field, then we need to inform downstream of the case. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6073>
This commit is contained in:
parent
550a21ccbe
commit
d2d2ac43e8
1 changed files with 19 additions and 0 deletions
|
@ -1703,6 +1703,25 @@ gst_cc_converter_generate_output (GstBaseTransform * base, GstBuffer ** outbuf)
|
|||
if (gst_buffer_get_size (*outbuf) <= 0) {
|
||||
gst_buffer_unref (*outbuf);
|
||||
*outbuf = NULL;
|
||||
|
||||
if (inbuf && GST_BUFFER_PTS_IS_VALID (inbuf)) {
|
||||
GstClockTime dur = 0;
|
||||
GstEvent *gap;
|
||||
|
||||
GST_TRACE_OBJECT (self, "Empty generated output for input %"
|
||||
GST_PTR_FORMAT, inbuf);
|
||||
|
||||
if (GST_BUFFER_DURATION_IS_VALID (inbuf)) {
|
||||
dur = GST_BUFFER_DURATION (inbuf);
|
||||
} else if (self->in_fps_n > 0 && self->in_fps_d > 0) {
|
||||
dur = gst_util_uint64_scale (GST_SECOND,
|
||||
self->in_fps_d, self->in_fps_n);
|
||||
}
|
||||
|
||||
gap = gst_event_new_gap (GST_BUFFER_PTS (inbuf), dur);
|
||||
gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (self), gap);
|
||||
}
|
||||
|
||||
ret = GST_FLOW_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue