mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
deinterlace: Ensure DISCONT flag is properly propagated
The output of deinterlace at startup, or when receiving a new DISCONT buffer, should have the DISCONT flag set on the first buffer.
This commit is contained in:
parent
b7866315a6
commit
1d2db2ba4f
2 changed files with 12 additions and 0 deletions
|
@ -832,6 +832,8 @@ gst_deinterlace_reset (GstDeinterlace * self)
|
|||
self->need_more = FALSE;
|
||||
self->have_eos = FALSE;
|
||||
|
||||
self->discont = TRUE;
|
||||
|
||||
gst_deinterlace_set_allocation (self, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
@ -1638,6 +1640,10 @@ restart:
|
|||
GST_TIME_ARGS (GST_BUFFER_DURATION (field1_buffer)),
|
||||
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (field1_buffer) +
|
||||
GST_BUFFER_DURATION (field1_buffer)));
|
||||
if (self->discont) {
|
||||
GST_BUFFER_FLAG_SET (field1_buffer, GST_BUFFER_FLAG_DISCONT);
|
||||
self->discont = FALSE;
|
||||
}
|
||||
return gst_pad_push (self->srcpad, field1_buffer);
|
||||
} else if (IS_TELECINE (interlacing_mode)
|
||||
&& GST_VIDEO_FRAME_IS_INTERLACED (field1->frame) && !same_buffer) {
|
||||
|
@ -1805,6 +1811,10 @@ restart:
|
|||
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)),
|
||||
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf) +
|
||||
GST_BUFFER_DURATION (outbuf)));
|
||||
if (self->discont) {
|
||||
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
|
||||
self->discont = FALSE;
|
||||
}
|
||||
ret = gst_pad_push (self->srcpad, outbuf);
|
||||
} else {
|
||||
ret = GST_FLOW_OK;
|
||||
|
@ -2067,6 +2077,7 @@ gst_deinterlace_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||
if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DISCONT)) {
|
||||
GST_DEBUG_OBJECT (self, "DISCONT buffer, resetting history");
|
||||
gst_deinterlace_reset_history (self, FALSE);
|
||||
self->discont = TRUE;
|
||||
}
|
||||
|
||||
gst_deinterlace_push_history (self, buf);
|
||||
|
|
|
@ -141,6 +141,7 @@ struct _GstDeinterlace
|
|||
GstAllocationParams params;
|
||||
|
||||
gboolean passthrough;
|
||||
gboolean discont;
|
||||
|
||||
GstClockTime field_duration; /* Duration of one field */
|
||||
|
||||
|
|
Loading…
Reference in a new issue