3 * Copyright 2012 Samsung Electronics S.LSI Co. LTD
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #define LOG_TAG "libcsc_helper"
19 #ifndef TIZEN_FEATURE_E3250 /* build env */
20 #include <cutils/log.h>
21 #include <system/graphics.h>
24 #include "Exynos_OMX_Def.h"
27 #include "exynos_format.h"
29 OMX_COLOR_FORMATTYPE hal_2_omx_pixel_format(
30 unsigned int hal_format)
32 OMX_COLOR_FORMATTYPE omx_format;
34 #ifndef TIZEN_FEATURE_E3250 /* build env */ /* useless */
35 case HAL_PIXEL_FORMAT_YCbCr_422_I:
36 omx_format = OMX_COLOR_FormatYCbYCr;
39 case HAL_PIXEL_FORMAT_YCbCr_420_P:
40 omx_format = OMX_COLOR_FormatYUV420Planar;
42 case HAL_PIXEL_FORMAT_YCbCr_420_SP:
43 omx_format = OMX_COLOR_FormatYUV420SemiPlanar;
46 case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP_TILED:
47 omx_format = OMX_SEC_COLOR_FormatNV12TPhysicalAddress;
50 case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED:
51 omx_format = OMX_SEC_COLOR_FormatNV12Tiled;
53 case HAL_PIXEL_FORMAT_ARGB888:
54 omx_format = OMX_COLOR_Format32bitARGB8888;
57 omx_format = OMX_COLOR_FormatYUV420Planar;
63 unsigned int omx_2_hal_pixel_format(
64 OMX_COLOR_FORMATTYPE omx_format)
66 unsigned int hal_format;
68 #ifndef TIZEN_FEATURE_E3250 /* build env */ /* useless */
69 case OMX_COLOR_FormatYCbYCr:
70 hal_format = HAL_PIXEL_FORMAT_YCbCr_422_I;
73 case OMX_COLOR_FormatYUV420Planar:
74 hal_format = HAL_PIXEL_FORMAT_YCbCr_420_P;
76 case OMX_COLOR_FormatYUV420SemiPlanar:
77 hal_format = HAL_PIXEL_FORMAT_YCbCr_420_SP;
80 case OMX_SEC_COLOR_FormatNV12TPhysicalAddress:
81 hal_format = HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP_TILED;
84 case OMX_SEC_COLOR_FormatNV12Tiled:
85 hal_format = HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED;
87 case OMX_COLOR_Format32bitARGB8888:
88 hal_format = HAL_PIXEL_FORMAT_ARGB888;
91 hal_format = HAL_PIXEL_FORMAT_YCbCr_420_P;