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_mp3_component.h 20 OpenMax decoder_component component. 21 22 */ 23 24 #ifndef OMX_MP3_COMPONENT_H_INCLUDED 25 #define OMX_MP3_COMPONENT_H_INCLUDED 26 27 #ifndef PV_OMXCOMPONENT_H_INCLUDED 28 #include "pv_omxcomponent.h" 29 #endif 30 31 #ifndef MP3_DEC_H_INCLUDED 32 #include "mp3_dec.h" 33 #endif 34 35 36 #ifndef MP3_TIMESTAMP_H_INCLUDED 37 #include "mp3_timestamp.h" 38 #endif 39 40 41 42 #define INPUT_BUFFER_SIZE_MP3 8192 43 #define OUTPUT_BUFFER_SIZE_MP3 4608 44 45 #define NUMBER_INPUT_BUFFER_MP3 10 46 #define NUMBER_OUTPUT_BUFFER_MP3 9 47 48 49 class OpenmaxMp3AO : public OmxComponentAudio 50 { 51 public: 52 53 OpenmaxMp3AO(); 54 ~OpenmaxMp3AO(); 55 56 OMX_ERRORTYPE ConstructComponent(OMX_PTR pAppData, OMX_PTR pProxy); 57 OMX_ERRORTYPE DestroyComponent(); 58 59 OMX_ERRORTYPE ComponentInit(); 60 OMX_ERRORTYPE ComponentDeInit(); 61 62 static void ComponentGetRolesOfComponent(OMX_STRING* aRoleString); 63 void ProcessData(); 64 void SyncWithInputTimestamp(); 65 void ProcessInBufferFlag(); 66 67 void ResetComponent(); 68 OMX_ERRORTYPE GetConfig( 69 OMX_IN OMX_HANDLETYPE hComponent, 70 OMX_IN OMX_INDEXTYPE nIndex, 71 OMX_INOUT OMX_PTR pComponentConfigStructure); 72 73 private: 74 75 void CheckForSilenceInsertion(); 76 void DoSilenceInsertion(); 77 78 Mp3Decoder* ipMp3Dec; 79 Mp3TimeStampCalc iCurrentFrameTS; 80 81 82 }; 83 84 #endif // OMX_MP3_COMPONENT_H_INCLUDED 85