From 0815490bdb398a4eb17fb1ac65340216388a8147 Mon Sep 17 00:00:00 2001 From: Ethan Chen Date: Tue, 27 Aug 2013 17:33:58 -0700 Subject: [PATCH] libcsc: add extra convert_with_rotation function * i9500 liboemcamera requires the convert_with_rotation function. --- libcsc/csc.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/libcsc/csc.c b/libcsc/csc.c index 97b7925..e494fa0 100644 --- a/libcsc/csc.c +++ b/libcsc/csc.c @@ -754,3 +754,35 @@ CSC_ERRORCODE csc_convert( return ret; } + +#ifdef USE_CONVERT_WITH_ROTATE +CSC_ERRORCODE csc_convert_with_rotation( + void *handle, + int rot, + int flip_horiz, + int flip_vert) +{ + CSC_HANDLE *csc_handle = (CSC_HANDLE *)handle; + CSC_ERRORCODE ret = CSC_ErrorNone; + + if (csc_handle == NULL) + return CSC_ErrorNotInit; + + if ((csc_handle->csc_method == CSC_METHOD_HW) && + (csc_handle->csc_hw_handle == NULL)) + csc_init_hw(handle); + + csc_set_format(csc_handle); + csc_set_buffer(csc_handle); + + exynos_gsc_set_rotation(csc_handle->csc_hw_handle, + rot, flip_horiz, flip_vert); + + if (csc_handle->csc_method == CSC_METHOD_HW) + ret = conv_hw(csc_handle); + else + ret = conv_sw(csc_handle); + + return ret; +} +#endif -- 2.20.1