14b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber/* 24b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * Copyright (C) 2011 The Android Open Source Project 34b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * 44b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * Licensed under the Apache License, Version 2.0 (the "License"); 54b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * you may not use this file except in compliance with the License. 64b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * You may obtain a copy of the License at 74b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * 84b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * http://www.apache.org/licenses/LICENSE-2.0 94b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * 104b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * Unless required by applicable law or agreed to in writing, software 114b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * distributed under the License is distributed on an "AS IS" BASIS, 124b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 134b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * See the License for the specific language governing permissions and 144b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber * limitations under the License. 154b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber */ 164b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 174b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber#ifndef SOFT_AAC_H_ 184b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 194b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber#define SOFT_AAC_H_ 204b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 214b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber#include "SimpleSoftOMXComponent.h" 224b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 234b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huberstruct tPVMP4AudioDecoderExternal; 244b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 254b3913a3e43d3180b21d77cc2f717b446350354fAndreas Hubernamespace android { 264b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 274b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huberstruct SoftAAC : public SimpleSoftOMXComponent { 284b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber SoftAAC(const char *name, 294b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber const OMX_CALLBACKTYPE *callbacks, 304b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber OMX_PTR appData, 314b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber OMX_COMPONENTTYPE **component); 324b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 334b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huberprotected: 344b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber virtual ~SoftAAC(); 354b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 364b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber virtual OMX_ERRORTYPE internalGetParameter( 374b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber OMX_INDEXTYPE index, OMX_PTR params); 384b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 394b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber virtual OMX_ERRORTYPE internalSetParameter( 404b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber OMX_INDEXTYPE index, const OMX_PTR params); 414b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 424b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber virtual void onQueueFilled(OMX_U32 portIndex); 434b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber virtual void onPortFlushCompleted(OMX_U32 portIndex); 444b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber virtual void onPortEnableCompleted(OMX_U32 portIndex, bool enabled); 454b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 464b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huberprivate: 474b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber enum { 484b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber kNumBuffers = 4 494b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber }; 504b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 514b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber tPVMP4AudioDecoderExternal *mConfig; 524b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber void *mDecoderBuf; 534b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 544b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber size_t mInputBufferCount; 554b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber size_t mUpsamplingFactor; 564b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber int64_t mAnchorTimeUs; 574b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber int64_t mNumSamplesOutput; 584b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 594b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber bool mSignalledError; 604b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 614b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber enum { 624b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber NONE, 634b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber AWAITING_DISABLED, 644b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber AWAITING_ENABLED 654b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber } mOutputPortSettingsChange; 664b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 674b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber void initPorts(); 684b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber status_t initDecoder(); 694b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber bool isConfigured() const; 704b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 714b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber DISALLOW_EVIL_CONSTRUCTORS(SoftAAC); 724b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber}; 734b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 744b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber} // namespace android 754b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber 764b3913a3e43d3180b21d77cc2f717b446350354fAndreas Huber#endif // SOFT_AAC_H_ 77