plugins: fix initialization with foreign context.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 7 Mar 2014 16:38:14 +0000 (17:38 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 13 Jun 2014 15:42:29 +0000 (17:42 +0200)
When a new display is settled through GstElement::set_context() (>= 1.2),
or GstVideoContext::set_context() (<= 1.0), then we shall also update the
associated display type.

gst/vaapi/gstvaapipluginbase.c

index a637b36..5cb2796 100644 (file)
@@ -65,6 +65,7 @@ plugin_set_context (GstElement * element, GstContext * context)
     GST_INFO_OBJECT (element, "set display %p", display);
     gst_vaapi_display_replace (&plugin->display, display);
     gst_vaapi_display_unref (display);
+    plugin->display_type = gst_vaapi_display_get_display_type (display);
   }
 }
 #else
@@ -75,6 +76,7 @@ plugin_set_context (GstVideoContext * context, const gchar * type,
   GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (context);
 
   gst_vaapi_set_display (type, value, &plugin->display);
+  plugin->display_type = gst_vaapi_display_get_display_type (plugin->display);
 }
 
 static void