[Libva] [Libva-Intel-Driver][PATCH 2/2] VPP: Check the returned status of hsw_veb_pre_format_convert before VEBOX VPP

Zhao Yakui yakui.zhao at intel.com
Tue Aug 9 10:04:29 UTC 2016


Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
 src/gen75_vpp_vebox.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/gen75_vpp_vebox.c b/src/gen75_vpp_vebox.c
index 2bc5cf9..9895814 100644
--- a/src/gen75_vpp_vebox.c
+++ b/src/gen75_vpp_vebox.c
@@ -1367,7 +1367,7 @@ gen75_vebox_ensure_surfaces(VADriverContextP ctx,
     return VA_STATUS_SUCCESS;
 }
 
-int hsw_veb_pre_format_convert(VADriverContextP ctx,
+VAStatus hsw_veb_pre_format_convert(VADriverContextP ctx,
                            struct intel_vebox_context *proc_ctx)
 {
     VAStatus va_status;
@@ -1381,11 +1381,11 @@ int hsw_veb_pre_format_convert(VADriverContextP ctx,
 
     if ((obj_surf_input == NULL) &&
         (proc_ctx->pipeline_param->surface_region == NULL))
-        assert(0);
+        return VA_STATUS_ERROR_INVALID_PARAMETER;
 
     if ((obj_surf_output == NULL) &&
         (proc_ctx->pipeline_param->output_region == NULL))
-        assert(0);
+        return VA_STATUS_ERROR_INVALID_PARAMETER;
 
     if (proc_ctx->pipeline_param->surface_region) {
         proc_ctx->width_input   = proc_ctx->pipeline_param->surface_region->width;
@@ -1434,7 +1434,7 @@ int hsw_veb_pre_format_convert(VADriverContextP ctx,
                 // nothing to do here
      } else {
            /* not support other format as input */ 
-           assert(0);
+         return VA_STATUS_ERROR_UNIMPLEMENTED;
      }
     
      if (proc_ctx->format_convert_flags & PRE_FORMAT_CONVERT) {
@@ -1475,7 +1475,7 @@ int hsw_veb_pre_format_convert(VADriverContextP ctx,
               /* Nothing to do here */
      } else {
            /* not support other format as input */ 
-           assert(0);
+         return VA_STATUS_ERROR_UNIMPLEMENTED;
      }
   
      if(proc_ctx->format_convert_flags & POST_FORMAT_CONVERT ||
@@ -1517,7 +1517,7 @@ int hsw_veb_pre_format_convert(VADriverContextP ctx,
        }
      } 
     
-     return 0;
+     return VA_STATUS_SUCCESS;
 }
 
 VAStatus
@@ -1701,7 +1701,9 @@ gen75_vebox_process_picture(VADriverContextP ctx,
     if (status != VA_STATUS_SUCCESS)
         return status;
 
-    hsw_veb_pre_format_convert(ctx, proc_ctx);
+    status = hsw_veb_pre_format_convert(ctx, proc_ctx);
+    if (status != VA_STATUS_SUCCESS)
+        return status;
 
     status = gen75_vebox_ensure_surfaces(ctx, proc_ctx);
     if (status != VA_STATUS_SUCCESS)
@@ -1931,7 +1933,9 @@ gen8_vebox_process_picture(VADriverContextP ctx,
     if (status != VA_STATUS_SUCCESS)
         return status;
 
-    hsw_veb_pre_format_convert(ctx, proc_ctx);
+    status = hsw_veb_pre_format_convert(ctx, proc_ctx);
+    if (status != VA_STATUS_SUCCESS)
+        return status;
 
     status = gen75_vebox_ensure_surfaces(ctx, proc_ctx);
     if (status != VA_STATUS_SUCCESS)
@@ -2400,7 +2404,9 @@ gen9_vebox_process_picture(VADriverContextP ctx,
     if (status != VA_STATUS_SUCCESS)
         return status;
 
-    hsw_veb_pre_format_convert(ctx, proc_ctx);
+    status = hsw_veb_pre_format_convert(ctx, proc_ctx);
+    if (status != VA_STATUS_SUCCESS)
+        return status;
 
     status = gen75_vebox_ensure_surfaces(ctx, proc_ctx);
     if (status != VA_STATUS_SUCCESS)
-- 
1.9.1



More information about the Libva mailing list