VPP: check the filter when query the video filter capabilities
authorXiang, Haihao <haihao.xiang@intel.com>
Tue, 23 Jul 2013 05:08:05 +0000 (13:08 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 6 Sep 2013 07:27:12 +0000 (15:27 +0800)
Return VA_STATUS_ERROR_UNSUPPORTED_FILTER if an unsupported filter
was supplied

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit 428723853f88b4d5cac436f5fd62e6cc64a9e8e9)

src/i965_drv_video.c

index 4097750..bd6aa9a 100755 (executable)
@@ -4587,6 +4587,17 @@ VAStatus i965_QueryVideoProcFilterCaps(
     if (!filter_caps || !num_filter_caps)
         return VA_STATUS_ERROR_INVALID_PARAMETER;
 
+    for (i = 0; i < i965->codec_info->num_filters; i++) {
+        if (type == i965->codec_info->filters[i].type &&
+            i965_os_has_ring_support(ctx, i965->codec_info->filters[i].ring))
+            break;
+    }
+
+    if (i == i965->codec_info->num_filters)
+        return VA_STATUS_ERROR_UNSUPPORTED_FILTER;
+
+    i = 0;
+
     switch (type) {
     case VAProcFilterNoiseReduction:
     case VAProcFilterSharpening: