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 Non ported plugins (non-dependant, then dependant)
dnl Make sure you have a space before and after all plugins dnl Make sure you have a space before and after all plugins
GST_PLUGINS_NONPORTED="deinterlace \ GST_PLUGINS_NONPORTED="cairo cairo_gobject gdk_pixbuf osx_audio "
cairo cairo_gobject gdk_pixbuf \
osx_audio "
AC_SUBST(GST_PLUGINS_NONPORTED) AC_SUBST(GST_PLUGINS_NONPORTED)
dnl these are all the gst plug-ins, compilable without additional libs 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 (state) {
if (interlacing_mode == GST_VIDEO_INTERLACE_MODE_MIXED) { 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; *state = GST_DEINTERLACE_BUFFER_STATE_DROP;
} else if (GST_VIDEO_INFO_FLAG_IS_SET (frame, } else if (GST_VIDEO_FRAME_IS_ONEFIELD (frame)) {
GST_VIDEO_BUFFER_FLAG_ONEFIELD)) {
/* tc top if tff, tc bottom otherwise */ /* 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; *state = GST_DEINTERLACE_BUFFER_STATE_TC_T;
} else { } else {
*state = GST_DEINTERLACE_BUFFER_STATE_TC_B; *state = GST_DEINTERLACE_BUFFER_STATE_TC_B;
} }
} else if (GST_VIDEO_INFO_FLAG_IS_SET (frame, } else if (GST_VIDEO_FRAME_IS_INTERLACED (frame)) {
GST_VIDEO_BUFFER_FLAG_INTERLACED)) {
*state = GST_DEINTERLACE_BUFFER_STATE_TC_M; *state = GST_DEINTERLACE_BUFFER_STATE_TC_M;
} else { } else {
*state = GST_DEINTERLACE_BUFFER_STATE_TC_P; *state = GST_DEINTERLACE_BUFFER_STATE_TC_P;
@ -1064,21 +1062,16 @@ gst_deinterlace_push_history (GstDeinterlace * self, GstBuffer * buffer)
int i = 1; int i = 1;
GstClockTime timestamp; GstClockTime timestamp;
GstDeinterlaceFieldLayout field_layout = self->field_layout; GstDeinterlaceFieldLayout field_layout = self->field_layout;
gboolean repeated = gboolean repeated;
GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_RFF); gboolean tff;
gboolean tff = GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_TFF); gboolean onefield;
gboolean onefield =
GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_ONEFIELD);
GstVideoFrame *frame = NULL; GstVideoFrame *frame = NULL;
GstVideoFrame *field1, *field2 = NULL; GstVideoFrame *field1, *field2 = NULL;
guint fields_to_push = (onefield) ? 1 : (!repeated) ? 2 : 3; guint fields_to_push;
gint field1_flags, field2_flags; gint field1_flags, field2_flags;
GstVideoInterlaceMode interlacing_mode; GstVideoInterlaceMode interlacing_mode;
guint8 buf_state; 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 /* 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 * 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 */ /* we can manage the buffer ref count using the maps from here on */
gst_buffer_unref (buffer); 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_deinterlace_get_buffer_state (self, frame, &buf_state, &interlacing_mode);
GST_DEBUG_OBJECT (self, GST_DEBUG_OBJECT (self,