vaapipostproc: fix deinterlacing with VPP.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 21 Nov 2013 21:32:03 +0000 (22:32 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 21 Nov 2013 22:08:02 +0000 (23:08 +0100)
Fix basic deinterlacing flags provided to gst_vaapi_set_deinterlacing()
for the first field. Render flags were supplied instead of the actual
deinterlacing flags (deint_flags).

gst/vaapi/gstvaapipostproc.c

index acf32ad..6bcda3f 100755 (executable)
@@ -415,6 +415,7 @@ gst_vaapipostproc_process_vpp(GstBaseTransform *trans, GstBuffer *inbuf,
     GstClockTime timestamp;
     GstFlowReturn ret;
     GstBuffer *fieldbuf;
+    GstVaapiDeinterlaceMethod deint_method;
     guint flags, deint_flags;
     gboolean tff, deint;
 
@@ -437,6 +438,7 @@ gst_vaapipostproc_process_vpp(GstBaseTransform *trans, GstBuffer *inbuf,
           GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD);
 
     /* First field */
+    deint_method = postproc->deinterlace_method;
     if (postproc->flags & GST_VAAPI_POSTPROC_FLAG_DEINTERLACE) {
         fieldbuf = create_output_buffer(postproc);
         if (!fieldbuf)
@@ -448,9 +450,8 @@ gst_vaapipostproc_process_vpp(GstBaseTransform *trans, GstBuffer *inbuf,
         outbuf_surface = gst_vaapi_video_meta_get_surface(outbuf_meta);
 
         if (deint) {
-            GstVaapiDeinterlaceMethod deint_method;
             deint_flags = (tff ? GST_VAAPI_DEINTERLACE_FLAG_TOPFIELD : 0);
-            if (!set_best_deint_method(postproc, flags, &deint_method))
+            if (!set_best_deint_method(postproc, deint_flags, &deint_method))
                 goto error_op_deinterlace;
             if (deint_method != postproc->deinterlace_method) {
                 GST_DEBUG("unsupported deinterlace-method %u. Using %u instead",
@@ -484,7 +485,7 @@ gst_vaapipostproc_process_vpp(GstBaseTransform *trans, GstBuffer *inbuf,
     if (deint) {
         deint_flags = (tff ? 0 : GST_VAAPI_DEINTERLACE_FLAG_TOPFIELD);
         if (!gst_vaapi_filter_set_deinterlacing(postproc->filter,
-                postproc->deinterlace_method, deint_flags))
+                deint_method, deint_flags))
             goto error_op_deinterlace;
     }