1 /* 2 * 3 * Copyright 2018 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 #ifndef __OMX_VDEC_GLOBAL_H__ 19 #define __OMX_VDEC_GLOBAL_H__ 20 21 #include "OMX_Video.h" 22 #include "VideoExt.h" 23 #include "OMX_Types.h" 24 25 /* 26 * this definition for debug 27 */ 28 #define VDEC_DBG_RECORD_MASK 0xff000000 29 #define VDEC_DBG_RECORD_IN 0x01000000 30 #define VDEC_DBG_RECORD_OUT 0x02000000 31 32 #define VIDEO_DBG_LOG_MASK 0x0000ffff 33 #define VIDEO_DBG_LOG_PTS 0x00000001 34 #define VIDEO_DBG_LOG_FPS 0x00000002 35 #define VIDEO_DBG_LOG_BUFFER 0x00000004 36 #define VIDEO_DBG_LOG_DBG 0x00000008 37 #define VIDEO_DBG_LOG_PORT 0x00000010 38 #define VIDEO_DBG_LOG_BUFFER_POSITION 0x00000020 39 40 #define VDEC_DBG_VPU_MPP_FIRST 0x00000001 41 #define VDEC_DBG_VPU_VPUAPI_FIRST 0x00000002 42 43 extern OMX_U32 omx_vdec_debug; 44 extern OMX_U32 omx_venc_debug; 45 46 #define VDEC_DBG_LOG(fmt, ...) \ 47 do { \ 48 if (omx_vdec_debug & VIDEO_DBG_LOG_DBG) \ 49 { omx_info(fmt, ## __VA_ARGS__); } \ 50 } while (0) 51 52 #define VDEC_DBG_LOG_F(fmt, ...) \ 53 do { \ 54 if (omx_vdec_debug & VIDEO_DBG_LOG_DBG) \ 55 { omx_info_f(fmt, ## __VA_ARGS__); } \ 56 } while (0) 57 58 #define VDEC_DBG(level, fmt, ...) \ 59 do { \ 60 if (omx_vdec_debug & level) \ 61 { omx_info(fmt, ## __VA_ARGS__); } \ 62 } while (0) 63 64 #define VDEC_DBG_F(level, fmt, ...) \ 65 do { \ 66 if (omx_vdec_debug & level) \ 67 { omx_info_f(fmt, ## __VA_ARGS__); } \ 68 } while (0) 69 70 #define VENC_DBG_LOG(fmt, ...) \ 71 do { \ 72 if (omx_venc_debug & VIDEO_DBG_LOG_DBG) \ 73 { omx_info(fmt, ## __VA_ARGS__); } \ 74 } while (0) 75 76 #define VENC_DBG_LOG_F(fmt, ...) \ 77 do { \ 78 if (omx_venc_debug & VIDEO_DBG_LOG_DBG) \ 79 { omx_info_f(fmt, ## __VA_ARGS__); } \ 80 } while (0) 81 82 #define VENC_DBG(level, fmt, ...) \ 83 do { \ 84 if (omx_venc_debug & level) \ 85 { omx_info(fmt, ## __VA_ARGS__); } \ 86 } while (0) 87 88 #define VENC_DBG_F(level, fmt, ...) \ 89 do { \ 90 if (omx_venc_debug & level) \ 91 { omx_info_f(fmt, ## __VA_ARGS__); } \ 92 } while (0) 93 94 #define VIDEO_DBG(level, fmt, ...) \ 95 do { \ 96 if (omx_venc_debug & level || omx_vdec_debug & level) \ 97 { omx_info(fmt, ## __VA_ARGS__); } \ 98 } while (0) 99 100 #define VIDEO_DBG_F(level, fmt, ...) \ 101 do { \ 102 if (omx_venc_debug & level || omx_vdec_debug & level) \ 103 { omx_info_f(fmt, ## __VA_ARGS__); } \ 104 } while (0) 105 106 #define MAX_VIDEO_INPUTBUFFER_NUM 4 107 #define MAX_VIDEO_OUTPUTBUFFER_NUM 2 108 109 #define DEFAULT_FRAME_WIDTH 1920 110 #define DEFAULT_FRAME_HEIGHT 1088 111 112 #define DEFAULT_VIDEO_INPUT_BUFFER_SIZE ((DEFAULT_FRAME_WIDTH * DEFAULT_FRAME_HEIGHT) * 2) 113 #define DEFAULT_VIDEO_OUTPUT_BUFFER_SIZE ((DEFAULT_FRAME_WIDTH * DEFAULT_FRAME_HEIGHT * 3) / 2) 114 115 #define INPUT_PORT_SUPPORTFORMAT_NUM_MAX 1 116 117 #define DEFAULT_IEP_OUTPUT_BUFFER_COUNT 2 118 119 typedef struct _DECODE_CODEC_EXTRA_BUFFERINFO { 120 /* For Decode Output */ 121 OMX_U32 imageWidth; 122 OMX_U32 imageHeight; 123 OMX_COLOR_FORMATTYPE ColorFormat; 124 } DECODE_CODEC_EXTRA_BUFFERINFO; 125 126 typedef enum _RKVPU_OMX_VDEC_FLAG_MAP { 127 RKVPU_OMX_VDEC_NONE = 0, 128 RKVPU_OMX_VDEC_IS_DIV3 = 0x01, 129 RKVPU_OMX_VDEC_USE_DTS = 0x02, 130 RKVPU_OMX_VDEC_THUMBNAIL = 0x04, 131 RKVPU_OMX_VDEC_BUTT, 132 } RKVPU_OMX_VDEC_FLAG_MAP; 133 #endif