context: reset VA context if VA surfaces set changed.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Sat, 3 May 2014 13:47:53 +0000 (15:47 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 21 May 2014 17:59:52 +0000 (19:59 +0200)
It is a requirement from VA-API specification that the VA context got
from vaCreateContext(), for decoding purposes, binds the supplied set
of VA surfaces. This means that if the set of VA surfaces is to be
changed for the current decode session, then the VA context needs to
be recreated with the new set of VA surfaces.

gst-libs/gst/vaapi/gstvaapicontext.c

index e79c30f..27efdd9 100644 (file)
@@ -399,6 +399,9 @@ gst_vaapi_context_reset (GstVaapiContext * context,
   } else if (new_cip->usage == GST_VAAPI_CONTEXT_USAGE_ENCODE) {
     if (context_update_config_encoder (context, &new_cip->config.encoder))
       reset_config = TRUE;
+  } else if (new_cip->usage == GST_VAAPI_CONTEXT_USAGE_DECODE) {
+    if (reset_surfaces)
+      reset_config = TRUE;
   }
 
   if (reset_surfaces)