refine csc module.

make _output_format can only change follow with _csc_type.

Signed-off-by: Wind Yuan <feng.yuan@intel.com>
diff --git a/xcore/cl_csc_handler.cpp b/xcore/cl_csc_handler.cpp
index 107f6c8..942b484 100644
--- a/xcore/cl_csc_handler.cpp
+++ b/xcore/cl_csc_handler.cpp
@@ -75,40 +75,23 @@
     return XCAM_RETURN_NO_ERROR;
 }
 
-CLCscImageHandler::CLCscImageHandler (const char *name)
+CLCscImageHandler::CLCscImageHandler (const char *name, CLCscType type)
     : CLImageHandler (name)
+    , _output_format (V4L2_PIX_FMT_NV12)
+    , _csc_type (type)
 {
+    switch (type) {
+    case CL_CSC_TYPE_RGBATONV12:
+        _output_format = V4L2_PIX_FMT_NV12;
+        break;
+    case CL_CSC_TYPE_RGBATOLAB:
+        _output_format = XCAM_PIX_FMT_LAB;
+        break;
+    default:
+        break;
+    }
 }
 
-bool
-CLCscImageHandler::set_output_format (uint32_t fourcc)
-{
-    XCAM_FAIL_RETURN (
-        WARNING,
-        fourcc == V4L2_PIX_FMT_NV12 || fourcc == XCAM_PIX_FMT_LAB,
-        false,
-        "CL image handler(%s) doesn't support format(%s) settings",
-        get_name (), xcam_fourcc_to_string (fourcc));
-
-    _output_format = fourcc;
-    return true;
-}
-
-bool
-CLCscImageHandler::set_csc_type (CLCscType type)
-{
-    XCAM_FAIL_RETURN (
-        WARNING,
-        type == CL_CSC_TYPE_RGBATONV12 || type == CL_CSC_TYPE_RGBATOLAB,
-        false,
-        "CL image handler(%s) doesn't support type(%d) settings",
-        get_name (), (int)type);
-
-    _csc_type = type;
-    return true;
-}
-
-
 XCamReturn
 CLCscImageHandler::prepare_buffer_pool_video_info (
     const VideoBufferInfo &input,
@@ -158,7 +141,8 @@
         "CL image handler(%s) load source failed", csc_kernel->get_kernel_name());
 
     XCAM_ASSERT (csc_kernel->is_valid ());
-    csc_handler = new CLCscImageHandler ("cl_handler_csc");
+
+    csc_handler = new CLCscImageHandler ("cl_handler_csc", type);
     csc_handler->add_kernel (csc_kernel);
 
     return csc_handler;
diff --git a/xcore/cl_csc_handler.h b/xcore/cl_csc_handler.h
index 8c6e86a..35d730d 100644
--- a/xcore/cl_csc_handler.h
+++ b/xcore/cl_csc_handler.h
@@ -54,9 +54,7 @@
     : public CLImageHandler
 {
 public:
-    explicit CLCscImageHandler (const char *name);
-    bool set_output_format (uint32_t fourcc);
-    bool set_csc_type(CLCscType type);
+    explicit CLCscImageHandler (const char *name, CLCscType type);
 
 protected:
     virtual XCamReturn prepare_buffer_pool_video_info (