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 Rkvpu_OMX_VdecControl.h 20 * @brief 21 * @author Csy (csy@rock-chips.com) 22 * @version 1.0.0 23 * @history 24 * 2013.11.28 : Create 25 */ 26 27 #ifndef RKVPU_OMX_VIDEO_DECODECONTROL 28 #define RKVPU_OMX_VIDEO_DECODECONTROL 29 30 #include "OMX_Component.h" 31 #include "Rockchip_OMX_Def.h" 32 #include "Rockchip_OSAL_Queue.h" 33 #include "Rockchip_OMX_Baseport.h" 34 #include "Rockchip_OMX_Basecomponent.h" 35 #include "library_register.h" 36 #include "vpu_global.h" 37 #include "OMX_VideoExt.h" 38 #include "VideoExt.h" 39 40 #ifdef __cplusplus 41 extern "C" { 42 #endif 43 44 OMX_ERRORTYPE Rkvpu_OMX_UseBuffer( 45 OMX_IN OMX_HANDLETYPE hComponent, 46 OMX_INOUT OMX_BUFFERHEADERTYPE **ppBufferHdr, 47 OMX_IN OMX_U32 nPortIndex, 48 OMX_IN OMX_PTR pAppPrivate, 49 OMX_IN OMX_U32 nSizeBytes, 50 OMX_IN OMX_U8 *pBuffer); 51 52 OMX_ERRORTYPE Rkvpu_OMX_AllocateBuffer( 53 OMX_IN OMX_HANDLETYPE hComponent, 54 OMX_INOUT OMX_BUFFERHEADERTYPE **ppBuffer, 55 OMX_IN OMX_U32 nPortIndex, 56 OMX_IN OMX_PTR pAppPrivate, 57 OMX_IN OMX_U32 nSizeBytes); 58 59 OMX_ERRORTYPE Rkvpu_OMX_FreeBuffer( 60 OMX_IN OMX_HANDLETYPE hComponent, 61 OMX_IN OMX_U32 nPortIndex, 62 OMX_IN OMX_BUFFERHEADERTYPE *pBufferHdr); 63 64 OMX_ERRORTYPE Rkvpu_OMX_AllocateTunnelBuffer( 65 ROCKCHIP_OMX_BASEPORT *pOMXBasePort, 66 OMX_U32 nPortIndex); 67 68 OMX_ERRORTYPE Rkvpu_OMX_FreeTunnelBuffer( 69 ROCKCHIP_OMX_BASEPORT *pOMXBasePort, 70 OMX_U32 nPortIndex); 71 72 OMX_ERRORTYPE Rkvpu_OMX_ComponentTunnelRequest( 73 OMX_IN OMX_HANDLETYPE hComp, 74 OMX_IN OMX_U32 nPort, 75 OMX_IN OMX_HANDLETYPE hTunneledComp, 76 OMX_IN OMX_U32 nTunneledPort, 77 OMX_INOUT OMX_TUNNELSETUPTYPE *pTunnelSetup); 78 79 OMX_ERRORTYPE Rkvpu_OMX_GetParameter( 80 OMX_IN OMX_HANDLETYPE hComponent, 81 OMX_IN OMX_INDEXTYPE nParamIndex, 82 OMX_INOUT OMX_PTR ComponentParameterStructure); 83 84 OMX_ERRORTYPE Rkvpu_OMX_SetParameter( 85 OMX_IN OMX_HANDLETYPE hComponent, 86 OMX_IN OMX_INDEXTYPE nIndex, 87 OMX_IN OMX_PTR ComponentParameterStructure); 88 89 OMX_ERRORTYPE Rkvpu_OMX_GetConfig( 90 OMX_HANDLETYPE hComponent, 91 OMX_INDEXTYPE nIndex, 92 OMX_PTR pComponentConfigStructure); 93 94 OMX_ERRORTYPE Rkvpu_OMX_SetConfig( 95 OMX_HANDLETYPE hComponent, 96 OMX_INDEXTYPE nIndex, 97 OMX_PTR pComponentConfigStructure); 98 99 OMX_ERRORTYPE Rkvpu_OMX_ComponentRoleEnum( 100 OMX_HANDLETYPE hComponent, 101 OMX_U8 *cRole, 102 OMX_U32 nIndex); 103 104 OMX_ERRORTYPE Rkvpu_OMX_GetExtensionIndex( 105 OMX_IN OMX_HANDLETYPE hComponent, 106 OMX_IN OMX_STRING cParameterName, 107 OMX_OUT OMX_INDEXTYPE *pIndexType); 108 109 OMX_ERRORTYPE Rkvpu_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, ROCKCHIP_OMX_DATABUFFER *dataBuffer); 110 OMX_ERRORTYPE Rkvpu_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, ROCKCHIP_OMX_DATABUFFER *dataBuffer); 111 OMX_ERRORTYPE Rkvpu_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent); 112 OMX_ERRORTYPE Rkvpu_Frame2Outbuf(OMX_COMPONENTTYPE *pOMXComponent, 113 OMX_BUFFERHEADERTYPE* pOutputBuffer, VPU_FRAME *pframe); 114 OMX_ERRORTYPE Rkvpu_OutputBufferGetQueue(ROCKCHIP_OMX_BASECOMPONENT *pRockchipComponent); 115 OMX_ERRORTYPE Rkvpu_InputBufferGetQueue(ROCKCHIP_OMX_BASECOMPONENT *pRockchipComponent); 116 OMX_ERRORTYPE Rkvpu_ResolutionUpdate(OMX_COMPONENTTYPE *pOMXComponent); 117 118 #ifdef USE_ANB 119 OMX_ERRORTYPE Rkvpu_Shared_ANBBufferToData(ROCKCHIP_OMX_DATABUFFER *pUseBuffer, 120 ROCKCHIP_OMX_DATA *pData, ROCKCHIP_OMX_BASEPORT *pRockchipPort, ROCKCHIP_OMX_PLANE nPlane); 121 OMX_ERRORTYPE Rkvpu_Shared_DataToANBBuffer(ROCKCHIP_OMX_DATA *pData, 122 ROCKCHIP_OMX_DATABUFFER *pUseBuffer, ROCKCHIP_OMX_BASEPORT *pRockchipPort); 123 #endif 124 125 /* 126 * for port infintion 127 */ 128 OMX_ERRORTYPE Rkvpu_UpdatePortDefinition( 129 OMX_HANDLETYPE hComponent, 130 const OMX_PARAM_PORTDEFINITIONTYPE *pPortDefinition, 131 const OMX_U32 nPortIndex); 132 133 OMX_ERRORTYPE Rkvpu_CheckPortDefinition( 134 const OMX_PARAM_PORTDEFINITIONTYPE *pNewPortDefinition, 135 const OMX_PARAM_PORTDEFINITIONTYPE *pPortDefinition, 136 const OMX_U32 nPortIndex); 137 138 OMX_U32 Rkvpu_GetCompressRatioByCodingtype( 139 OMX_VIDEO_CODINGTYPE codingType); 140 141 #ifdef __cplusplus 142 } 143 #endif 144 #endif