if ((self->field_history[self->cur_field_idx].flags == PICTURE_INTERLACED_TOP
&& (self->fields == GST_DEINTERLACE_TF
|| IS_TELECINE (interlacing_mode)))
- || self->fields == GST_DEINTERLACE_ALL) {
+ || (self->fields == GST_DEINTERLACE_ALL
+ && !IS_TELECINE (interlacing_mode))) {
GST_DEBUG_OBJECT (self, "deinterlacing top field");
/* create new buffer */
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf) +
GST_BUFFER_DURATION (outbuf)));
} else {
- GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
- GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf);
+ GST_BUFFER_TIMESTAMP (outbuf) =
+ GST_BUFFER_TIMESTAMP (field1->frame->buffer);
+ GST_BUFFER_DURATION (outbuf) =
+ GST_BUFFER_DURATION (field1->frame->buffer);
}
/* Check if we need to drop the frame because of QoS */
gst_video_frame_unmap_and_free (outframe);
self->cur_field_idx--;
- if (self->cur_field_idx + 1 +
- gst_deinterlace_method_get_latency (self->method)
- < self->history_count || flushing) {
+ /* need to remove the field in the telecine weaving case */
+ if ((IS_TELECINE (interlacing_mode)
+ && self->method_id == GST_DEINTERLACE_WEAVE)
+ || self->cur_field_idx + 1 +
+ gst_deinterlace_method_get_latency (self->method) <
+ self->history_count || flushing) {
gst_video_frame_unmap_and_free (gst_deinterlace_pop_history (self));
}
outbuf = NULL;
if (ret != GST_FLOW_OK)
return ret;
- if (interlacing_mode == GST_VIDEO_INTERLACE_MODE_MIXED
+ if (IS_TELECINE (interlacing_mode)
&& self->method_id == GST_DEINTERLACE_WEAVE) {
/* pop off the second field */
GST_DEBUG_OBJECT (self, "Removing unused field (count: %d)",
if ((self->field_history[self->cur_field_idx].flags ==
PICTURE_INTERLACED_BOTTOM && (self->fields == GST_DEINTERLACE_BF
|| IS_TELECINE (interlacing_mode)))
- || self->fields == GST_DEINTERLACE_ALL) {
+ || (self->fields == GST_DEINTERLACE_ALL
+ && !IS_TELECINE (interlacing_mode))) {
GST_DEBUG_OBJECT (self, "deinterlacing bottom field");
/* create new buffer */
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf) +
GST_BUFFER_DURATION (outbuf)));
} else {
- GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
- GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf);
+ GST_BUFFER_TIMESTAMP (outbuf) =
+ GST_BUFFER_TIMESTAMP (field1->frame->buffer);
+ GST_BUFFER_DURATION (outbuf) =
+ GST_BUFFER_DURATION (field1->frame->buffer);
}
/* Check if we need to drop the frame because of QoS */
gst_video_frame_unmap_and_free (outframe);
self->cur_field_idx--;
- if (self->cur_field_idx + 1 +
- gst_deinterlace_method_get_latency (self->method)
- < self->history_count) {
+ /* need to remove the field in the telecine weaving case */
+ if ((IS_TELECINE (interlacing_mode)
+ && self->method_id == GST_DEINTERLACE_WEAVE)
+ || self->cur_field_idx + 1 +
+ gst_deinterlace_method_get_latency (self->method) <
+ self->history_count) {
gst_video_frame_unmap_and_free (gst_deinterlace_pop_history (self));
}
outbuf = NULL;
if (ret != GST_FLOW_OK)
return ret;
- if (interlacing_mode == GST_VIDEO_INTERLACE_MODE_MIXED
+ if (IS_TELECINE (interlacing_mode)
&& self->method_id == GST_DEINTERLACE_WEAVE) {
/* pop off the second field */
GST_DEBUG_OBJECT (self, "Removing unused field (count: %d)",