From 7fdd6075618a6696a44e1183cab2177598d7f646 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 23 Jul 2012 15:49:04 +0200 Subject: [PATCH] deinterlace: get frame flags correctly Also move the deinterlace plugin to ported status --- configure.ac | 4 +--- gst/deinterlace/gstdeinterlace.c | 31 ++++++++++++++++--------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index be132e9..a30a785 100644 --- a/configure.ac +++ b/configure.ac @@ -297,9 +297,7 @@ dnl *** plug-ins to include *** dnl Non ported plugins (non-dependant, then dependant) dnl Make sure you have a space before and after all plugins -GST_PLUGINS_NONPORTED="deinterlace \ - cairo cairo_gobject gdk_pixbuf \ - osx_audio " +GST_PLUGINS_NONPORTED="cairo cairo_gobject gdk_pixbuf osx_audio " AC_SUBST(GST_PLUGINS_NONPORTED) dnl these are all the gst plug-ins, compilable without additional libs diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c index 40f90ef..6fe8dd0 100644 --- a/gst/deinterlace/gstdeinterlace.c +++ b/gst/deinterlace/gstdeinterlace.c @@ -1029,18 +1029,16 @@ gst_deinterlace_get_buffer_state (GstDeinterlace * self, GstVideoFrame * frame, if (state) { if (interlacing_mode == GST_VIDEO_INTERLACE_MODE_MIXED) { - if (GST_VIDEO_INFO_FLAG_IS_SET (frame, GST_VIDEO_BUFFER_FLAG_RFF)) { + if (GST_VIDEO_FRAME_IS_RFF (frame)) { *state = GST_DEINTERLACE_BUFFER_STATE_DROP; - } else if (GST_VIDEO_INFO_FLAG_IS_SET (frame, - GST_VIDEO_BUFFER_FLAG_ONEFIELD)) { + } else if (GST_VIDEO_FRAME_IS_ONEFIELD (frame)) { /* tc top if tff, tc bottom otherwise */ - if (GST_VIDEO_INFO_FLAG_IS_SET (frame, GST_VIDEO_BUFFER_FLAG_TFF)) { + if (GST_VIDEO_FRAME_IS_TFF (frame)) { *state = GST_DEINTERLACE_BUFFER_STATE_TC_T; } else { *state = GST_DEINTERLACE_BUFFER_STATE_TC_B; } - } else if (GST_VIDEO_INFO_FLAG_IS_SET (frame, - GST_VIDEO_BUFFER_FLAG_INTERLACED)) { + } else if (GST_VIDEO_FRAME_IS_INTERLACED (frame)) { *state = GST_DEINTERLACE_BUFFER_STATE_TC_M; } else { *state = GST_DEINTERLACE_BUFFER_STATE_TC_P; @@ -1064,21 +1062,16 @@ gst_deinterlace_push_history (GstDeinterlace * self, GstBuffer * buffer) int i = 1; GstClockTime timestamp; GstDeinterlaceFieldLayout field_layout = self->field_layout; - gboolean repeated = - GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_RFF); - gboolean tff = GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_TFF); - gboolean onefield = - GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_ONEFIELD); + gboolean repeated; + gboolean tff; + gboolean onefield; GstVideoFrame *frame = NULL; GstVideoFrame *field1, *field2 = NULL; - guint fields_to_push = (onefield) ? 1 : (!repeated) ? 2 : 3; + guint fields_to_push; gint field1_flags, field2_flags; GstVideoInterlaceMode interlacing_mode; guint8 buf_state; - g_return_if_fail (self->history_count < - GST_DEINTERLACE_MAX_FIELD_HISTORY - fields_to_push); - /* we will only read from this buffer and write into fresh output buffers * if this is not the case, change the map flags as appropriate */ @@ -1086,6 +1079,14 @@ gst_deinterlace_push_history (GstDeinterlace * self, GstBuffer * buffer) /* we can manage the buffer ref count using the maps from here on */ gst_buffer_unref (buffer); + repeated = GST_VIDEO_FRAME_IS_RFF (frame); + tff = GST_VIDEO_FRAME_IS_TFF (frame); + onefield = GST_VIDEO_FRAME_IS_ONEFIELD (frame); + fields_to_push = (onefield) ? 1 : (!repeated) ? 2 : 3; + + g_return_if_fail (self->history_count < + GST_DEINTERLACE_MAX_FIELD_HISTORY - fields_to_push); + gst_deinterlace_get_buffer_state (self, frame, &buf_state, &interlacing_mode); GST_DEBUG_OBJECT (self, -- 2.7.4