deinterlace: get frame flags correctly

Also move the deinterlace plugin to ported status
This commit is contained in:
Wim Taymans 2012-07-23 15:49:04 +02:00
parent a5dfa3d689
commit 7fdd607561
2 changed files with 17 additions and 18 deletions

View file

@ -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

View file

@ -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,