1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 /** 19 @file omx_aac_component.h 20 OpenMax decoder_component component. 21 22 */ 23 24 #ifndef OMX_AAC_COMPONENT_H_INCLUDED 25 #define OMX_AAC_COMPONENT_H_INCLUDED 26 27 #ifndef PV_OMXCOMPONENT_H_INCLUDED 28 #include "pv_omxcomponent.h" 29 #endif 30 31 #ifndef AAC_DEC_H_INCLUDED 32 #include "aac_dec.h" 33 #endif 34 35 #ifndef AAC_TIMESTAMP_H_INCLUDED 36 #include "aac_timestamp.h" 37 #endif 38 39 40 #define INPUT_BUFFER_SIZE_AAC 1536 41 #define OUTPUT_BUFFER_SIZE_AAC 8192 42 43 #define NUMBER_INPUT_BUFFER_AAC 10 44 #define NUMBER_OUTPUT_BUFFER_AAC 9 45 46 47 class OpenmaxAacAO : public OmxComponentAudio 48 { 49 public: 50 51 OpenmaxAacAO(); 52 ~OpenmaxAacAO(); 53 54 OMX_ERRORTYPE ConstructComponent(OMX_PTR pAppData, OMX_PTR pProxy); 55 OMX_ERRORTYPE DestroyComponent(); 56 57 OMX_ERRORTYPE ComponentInit(); 58 OMX_ERRORTYPE ComponentDeInit(); 59 60 static void ComponentGetRolesOfComponent(OMX_STRING* aRoleString); 61 void ProcessData(); 62 void SyncWithInputTimestamp(); 63 void ProcessInBufferFlag(); 64 65 void UpdateAACPlusFlag(OMX_BOOL aAacPlusFlag); 66 void ResetComponent(); 67 OMX_ERRORTYPE GetConfig( 68 OMX_IN OMX_HANDLETYPE hComponent, 69 OMX_IN OMX_INDEXTYPE nIndex, 70 OMX_INOUT OMX_PTR pComponentConfigStructure); 71 72 73 private: 74 75 void CheckForSilenceInsertion(); 76 void DoSilenceInsertion(); 77 78 79 AacTimeStampCalc iCurrentFrameTS; 80 OmxAacDecoder* ipAacDec; 81 }; 82 83 84 85 #endif // OMX_AAC_COMPONENT_H_INCLUDED 86