1 /* 2 * 3 * Copyright 2010 Samsung Electronics S.LSI 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 SEC_OMX_Venc.h 20 * @brief 21 * @author SeungBeom Kim (sbcrux.kim (at) samsung.com) 22 * Yunji Kim (yunji.kim (at) samsung.com) 23 * @version 1.0 24 * @history 25 * 2010.7.15 : Create 26 */ 27 28 #ifndef SEC_OMX_VIDEO_ENCODE 29 #define SEC_OMX_VIDEO_ENCODE 30 31 #include "OMX_Component.h" 32 #include "SEC_OMX_Def.h" 33 #include "SEC_OSAL_Queue.h" 34 #include "SEC_OMX_Baseport.h" 35 36 #define MAX_VIDEO_INPUTBUFFER_NUM 5 37 #define MAX_VIDEO_OUTPUTBUFFER_NUM 4 38 39 #define DEFAULT_FRAME_WIDTH 176 40 #define DEFAULT_FRAME_HEIGHT 144 41 42 #define DEFAULT_VIDEO_INPUT_BUFFER_SIZE ALIGN_TO_8KB(ALIGN_TO_128B(DEFAULT_FRAME_WIDTH) * ALIGN_TO_32B(DEFAULT_FRAME_HEIGHT)) \ 43 + ALIGN_TO_8KB(ALIGN_TO_128B(DEFAULT_FRAME_WIDTH) * ALIGN_TO_32B(DEFAULT_FRAME_HEIGHT / 2)) 44 /* (DEFAULT_FRAME_WIDTH * DEFAULT_FRAME_HEIGHT * 3) / 2 */ 45 #define DEFAULT_VIDEO_OUTPUT_BUFFER_SIZE DEFAULT_VIDEO_INPUT_BUFFER_SIZE 46 47 #define INPUT_PORT_SUPPORTFORMAT_NUM_MAX 3 48 #define OUTPUT_PORT_SUPPORTFORMAT_NUM_MAX 1 49 50 51 typedef struct 52 { 53 void *pAddrY; 54 void *pAddrC; 55 } MFC_ENC_ADDR_INFO; 56 57 58 #ifdef __cplusplus 59 extern "C" { 60 #endif 61 62 OMX_ERRORTYPE SEC_OMX_UseBuffer( 63 OMX_IN OMX_HANDLETYPE hComponent, 64 OMX_INOUT OMX_BUFFERHEADERTYPE **ppBufferHdr, 65 OMX_IN OMX_U32 nPortIndex, 66 OMX_IN OMX_PTR pAppPrivate, 67 OMX_IN OMX_U32 nSizeBytes, 68 OMX_IN OMX_U8 *pBuffer); 69 OMX_ERRORTYPE SEC_OMX_AllocateBuffer( 70 OMX_IN OMX_HANDLETYPE hComponent, 71 OMX_INOUT OMX_BUFFERHEADERTYPE **ppBuffer, 72 OMX_IN OMX_U32 nPortIndex, 73 OMX_IN OMX_PTR pAppPrivate, 74 OMX_IN OMX_U32 nSizeBytes); 75 OMX_ERRORTYPE SEC_OMX_FreeBuffer( 76 OMX_IN OMX_HANDLETYPE hComponent, 77 OMX_IN OMX_U32 nPortIndex, 78 OMX_IN OMX_BUFFERHEADERTYPE *pBufferHdr); 79 OMX_ERRORTYPE SEC_OMX_AllocateTunnelBuffer( 80 SEC_OMX_BASEPORT *pOMXBasePort, 81 OMX_U32 nPortIndex); 82 OMX_ERRORTYPE SEC_OMX_FreeTunnelBuffer( 83 SEC_OMX_BASEPORT *pOMXBasePort, 84 OMX_U32 nPortIndex); 85 OMX_ERRORTYPE SEC_OMX_ComponentTunnelRequest( 86 OMX_IN OMX_HANDLETYPE hComp, 87 OMX_IN OMX_U32 nPort, 88 OMX_IN OMX_HANDLETYPE hTunneledComp, 89 OMX_IN OMX_U32 nTunneledPort, 90 OMX_INOUT OMX_TUNNELSETUPTYPE *pTunnelSetup); 91 OMX_ERRORTYPE SEC_OMX_BufferProcess(OMX_HANDLETYPE hComponent); 92 OMX_ERRORTYPE SEC_OMX_VideoEncodeGetParameter( 93 OMX_IN OMX_HANDLETYPE hComponent, 94 OMX_IN OMX_INDEXTYPE nParamIndex, 95 OMX_INOUT OMX_PTR ComponentParameterStructure); 96 OMX_ERRORTYPE SEC_OMX_VideoEncodeSetParameter( 97 OMX_IN OMX_HANDLETYPE hComponent, 98 OMX_IN OMX_INDEXTYPE nIndex, 99 OMX_IN OMX_PTR ComponentParameterStructure); 100 OMX_ERRORTYPE SEC_OMX_VideoEncodeComponentDeinit(OMX_IN OMX_HANDLETYPE hComponent); 101 102 #ifdef __cplusplus 103 } 104 #endif 105 106 #endif 107