vaapidecodebin: check for postproc instance
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Mon, 6 Jul 2015 18:22:57 +0000 (20:22 +0200)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Thu, 13 Aug 2015 15:34:42 +0000 (17:34 +0200)
If the VPP's deinterlace-method is set, first we should check if the postproc
is already instanced to set it. Otherwise we just store it until the VPP is
added into the bin.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=749554

gst/vaapi/gstvaapidecodebin.c

index 121bda7..e602d62 100644 (file)
@@ -224,8 +224,9 @@ gst_vaapi_decode_bin_set_property (GObject * object,
       break;
     case PROP_DEINTERLACE_METHOD:
       vaapidecbin->deinterlace_method = g_value_get_enum (value);
-      g_object_set (G_OBJECT (vaapidecbin->postproc), "deinterlace-method",
-          vaapidecbin->deinterlace_method, NULL);
+      if (vaapidecbin->postproc)
+        g_object_set (G_OBJECT (vaapidecbin->postproc), "deinterlace-method",
+            vaapidecbin->deinterlace_method, NULL);
       break;
     case PROP_DISABLE_VPP:
     {
@@ -457,6 +458,7 @@ gst_vaapi_decode_bin_init (GstVaapiDecodeBin * vaapidecbin)
   GstPad *element_pad, *ghost_pad;
 
   vaapidecbin->has_vpp = HAS_VPP_UNKNOWN;
+  vaapidecbin->deinterlace_method = DEFAULT_DEINTERLACE_METHOD;
 
   if (!gst_vaapi_decode_bin_configure (vaapidecbin))
     return;