vaapipostproc: use GstBuffer flags for TFF.

Determine whether the buffer represents the top-field only by checking for
the GST_VIDEO_BUFFER_TFF flag instead of relying on the GstVaapiSurfaceProxy
flag. Also trust "interlaced" caps to determine whether the input frame
is interleaved or not.
This commit is contained in:
Gwenole Beauchesne 2012-12-13 15:47:27 +01:00
parent 936d8b8fc6
commit c21d76cff2

View file

@ -261,7 +261,7 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
GstFlowReturn ret; GstFlowReturn ret;
GstBuffer *outbuf = NULL; GstBuffer *outbuf = NULL;
guint outbuf_flags, flags; guint outbuf_flags, flags;
gboolean interlaced, tff; gboolean tff;
if (GST_VAAPI_IS_VIDEO_BUFFER(buf)) if (GST_VAAPI_IS_VIDEO_BUFFER(buf))
vbuf = GST_VAAPI_VIDEO_BUFFER(buf); vbuf = GST_VAAPI_VIDEO_BUFFER(buf);
@ -283,8 +283,7 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
timestamp = GST_BUFFER_TIMESTAMP(buf); timestamp = GST_BUFFER_TIMESTAMP(buf);
proxy = gst_vaapi_video_buffer_get_surface_proxy(vbuf); proxy = gst_vaapi_video_buffer_get_surface_proxy(vbuf);
interlaced = gst_vaapi_surface_proxy_get_interlaced(proxy); tff = GST_BUFFER_FLAG_IS_SET(buf, GST_VIDEO_BUFFER_TFF);
tff = gst_vaapi_surface_proxy_get_tff(proxy);
flags &= ~(GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD| flags &= ~(GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD|
GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD); GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD);
@ -296,7 +295,7 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
vbuf = GST_VAAPI_VIDEO_BUFFER(outbuf); vbuf = GST_VAAPI_VIDEO_BUFFER(outbuf);
outbuf_flags = flags; outbuf_flags = flags;
outbuf_flags |= interlaced ? ( outbuf_flags |= postproc->deinterlace ? (
tff ? tff ?
GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD : GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD :
GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD) : GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD) :
@ -317,7 +316,7 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
vbuf = GST_VAAPI_VIDEO_BUFFER(outbuf); vbuf = GST_VAAPI_VIDEO_BUFFER(outbuf);
outbuf_flags = flags; outbuf_flags = flags;
outbuf_flags |= interlaced ? ( outbuf_flags |= postproc->deinterlace ? (
tff ? tff ?
GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD : GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD :
GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD) : GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD) :