vaapidecode: report unsupported codec profiles.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 2 Apr 2012 12:51:06 +0000 (14:51 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 2 Apr 2012 14:11:22 +0000 (16:11 +0200)
Try to gracefully abort when the HW does not support the requested
profile. There is no fallback unless profiles are correctly parsed
and matched through caps beforehand.

NEWS
gst/vaapi/gstvaapidecode.c

diff --git a/NEWS b/NEWS
index a3f4ee6..f3ac4eb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Copyright (C) 2011-2012 Intel Corporation
 Copyright (C) 2011 Collabora
 
 Version 0.3.7 - DD.Apr.2012
+* Fix vaapidecode to report unsupported codec profiles
 * Don't forcibly resize user provided X windows (Holger Kaelberer)
 * Recalculate render rect only if caps are negotiated (Holger Kaelberer)
 
index 5035fcd..6e73d3a 100644 (file)
@@ -269,7 +269,17 @@ error_decode_timeout:
 error_decode:
     {
         GST_DEBUG("decode error %d", status);
-        return GST_FLOW_UNEXPECTED;
+        switch (status) {
+        case GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC:
+        case GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE:
+        case GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT:
+            ret = GST_FLOW_NOT_SUPPORTED;
+            break;
+        default:
+            ret = GST_FLOW_UNEXPECTED;
+            break;
+        }
+        return ret;
     }
 error_create_buffer:
     {