fixed svace issue
[platform/adaptation/ap_samsung/libomxil-e3250-v4l2.git] / exynos / libcsc / csc.c
index df7a09d..39c0e0e 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #ifndef TIZEN_FEATURE_E3250 /* build env */
 #include <utils/Log.h>
 #include <system/graphics.h>
@@ -235,6 +236,12 @@ static CSC_ERRORCODE conv_sw_src_nv12t(
     return ret;
 }
 
+void csc_interleave_memcpy_neon(
+    unsigned char *dest,
+    unsigned char *src1,
+    unsigned char *src2,
+    unsigned int src_size);
+
 /* source is YUV420P */
 static CSC_ERRORCODE conv_sw_src_yuv420p(
     CSC_HANDLE *handle)
@@ -422,7 +429,7 @@ static CSC_ERRORCODE csc_init_hw(
 #endif
         default:
             ALOGE("%s:: unsupported csc_hw_type, csc use sw", __func__);
-            csc_handle->csc_hw_handle == NULL;
+            csc_handle->csc_hw_handle = NULL;
             break;
         }
     }
@@ -432,6 +439,7 @@ static CSC_ERRORCODE csc_init_hw(
             ALOGE("%s:: CSC_METHOD_HW can't open HW", __func__);
             free(csc_handle);
             csc_handle = NULL;
+            return CSC_ErrorNotInit;
         }
     }
 
@@ -495,20 +503,24 @@ static CSC_ERRORCODE csc_set_buffer(
 {
     CSC_HANDLE *csc_handle;
     CSC_ERRORCODE ret = CSC_ErrorNone;
+#ifdef ENABLE_GSCALER
     void *src_addr[3] = {NULL, };
     void *dst_addr[3] = {NULL, };
+#endif
 
     if (handle == NULL)
         return CSC_ErrorNotInit;
 
     csc_handle = (CSC_HANDLE *)handle;
     if (csc_handle->csc_method == CSC_METHOD_HW) {
+#ifdef ENABLE_GSCALER
         src_addr[0] = csc_handle->src_buffer.planes[CSC_Y_PLANE];
         src_addr[1] = csc_handle->src_buffer.planes[CSC_U_PLANE];
         src_addr[2] = csc_handle->src_buffer.planes[CSC_V_PLANE];
         dst_addr[0] = csc_handle->dst_buffer.planes[CSC_Y_PLANE];
         dst_addr[1] = csc_handle->dst_buffer.planes[CSC_U_PLANE];
         dst_addr[2] = csc_handle->dst_buffer.planes[CSC_V_PLANE];
+#endif
 
         switch (csc_handle->csc_hw_type) {
         case CSC_HW_TYPE_FIMC:
@@ -749,7 +761,6 @@ CSC_ERRORCODE csc_set_src_buffer(
 {
     CSC_HANDLE *csc_handle;
     CSC_ERRORCODE ret = CSC_ErrorNone;
-    void *addr[3] = {NULL, };
 
     if (handle == NULL)
         return CSC_ErrorNotInit;
@@ -771,7 +782,6 @@ CSC_ERRORCODE csc_set_dst_buffer(
 {
     CSC_HANDLE *csc_handle;
     CSC_ERRORCODE ret = CSC_ErrorNone;
-    void *addr[3] = {NULL, };
 
     if (handle == NULL)
         return CSC_ErrorNotInit;
@@ -795,7 +805,10 @@ CSC_ERRORCODE csc_convert(
 
     if ((csc_handle->csc_method == CSC_METHOD_HW) &&
         (csc_handle->csc_hw_handle == NULL))
-        csc_init_hw(handle);
+        ret = csc_init_hw(handle);
+
+    if (ret != CSC_ErrorNone)
+        return ret;
 
     csc_set_format(csc_handle);
     csc_set_buffer(csc_handle);