1 /* 2 * 3 * Copyright 2013 Rockchip Electronics Co., LTD. 4 * 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 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 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. 16 */ 17 18 /* 19 * @file Rockchip_OSAL_ColorUtils.h 20 * @brief 21 * @author xhr(xhr@rock-chips.com) 22 * @version 1.0.0 23 * @history 24 * 2018.8.15 : Create 25 */ 26 #ifndef ROCKCHIP_OSAL_COLORUTILS 27 #define ROCKCHIP_OSAL_COLORUTILS 28 29 #include <stdio.h> 30 #include <stdlib.h> 31 #include "OMX_Types.h" 32 #include "OMX_Video.h" 33 #include "VideoExt.h" 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 enum { 40 kNotSupported, 41 kPreferBitstream, 42 kPreferContainer, 43 }; 44 45 OMX_BOOL colorAspectsDiffer(const OMX_COLORASPECTS *a, const OMX_COLORASPECTS *b); 46 47 void convertIsoColorAspectsToCodecAspects(OMX_U32 primaries, 48 OMX_U32 transfer, 49 OMX_U32 coeffs, 50 OMX_U32 fullRange, 51 OMX_COLORASPECTS *aspects); 52 53 void convertCodecAspectsToIsoColorAspects(OMX_COLORASPECTS *codecAspect, ISO_COLORASPECTS *colorAspect); 54 55 OMX_U32 handleColorAspectsChange(const OMX_COLORASPECTS *a /* mDefaultColorAspects */, 56 const OMX_COLORASPECTS *b /* mBitstreamColorAspects */, 57 OMX_COLORASPECTS *c /* mFinalColorAspects */, 58 OMX_U32 perference); 59 60 void updateFinalColorAspects(const OMX_COLORASPECTS *otherAspects, 61 const OMX_COLORASPECTS *preferredAspects, 62 OMX_COLORASPECTS *mFinalColorAspects); 63 #ifdef __cplusplus 64 } 65 #endif 66 67 #endif