csc: add csc_set_method()
Change-Id: I575bef5d62ae6414c43dac7d9fcdf58978850a93
Signed-off-by: Greg Hackmann <ghackmann@google.com>
diff --git a/libcsc/csc.c b/libcsc/csc.c
index ddb4541..385223c 100644
--- a/libcsc/csc.c
+++ b/libcsc/csc.c
@@ -475,7 +475,7 @@
CSC_HANDLE *csc_handle;
csc_handle = (CSC_HANDLE *)handle;
- if (csc_handle->csc_method == CSC_METHOD_HW) {
+ if (csc_handle->csc_hw_handle) {
switch (csc_handle->csc_hw_type) {
#ifdef ENABLE_FIMC
case CSC_HW_TYPE_FIMC:
@@ -517,6 +517,22 @@
return ret;
}
+CSC_ERRORCODE csc_set_method(
+ void *handle,
+ CSC_METHOD method)
+{
+ CSC_HANDLE *csc_handle;
+ CSC_ERRORCODE ret = CSC_ErrorNone;
+
+ if (handle == NULL)
+ return CSC_ErrorNotInit;
+
+ csc_handle = (CSC_HANDLE *)handle;
+ csc_handle->csc_method = method;
+
+ return ret;
+}
+
CSC_ERRORCODE csc_set_hw_property(
void *handle,
CSC_HW_PROPERTY_TYPE property,
diff --git a/libcsc/csc.h b/libcsc/csc.h
index 5fc50a2..f454f96 100644
--- a/libcsc/csc.h
+++ b/libcsc/csc.h
@@ -117,6 +117,22 @@
CSC_METHOD *method);
/*
+ * set color space converter method
+ *
+ * @param handle
+ * CSC handle[in]
+ *
+ * @param method
+ * CSC method[in]
+ *
+ * @return
+ * error code
+ */
+CSC_ERRORCODE csc_set_method(
+ void *handle,
+ CSC_METHOD method);
+
+/*
* Set hw property
*
* @param handle