Andreas Huber | 4b3913a | 2011-05-11 14:13:42 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 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 express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef SOFT_AAC_H_ |
| 18 | |
| 19 | #define SOFT_AAC_H_ |
| 20 | |
| 21 | #include "SimpleSoftOMXComponent.h" |
| 22 | |
| 23 | struct tPVMP4AudioDecoderExternal; |
| 24 | |
| 25 | namespace android { |
| 26 | |
| 27 | struct SoftAAC : public SimpleSoftOMXComponent { |
| 28 | SoftAAC(const char *name, |
| 29 | const OMX_CALLBACKTYPE *callbacks, |
| 30 | OMX_PTR appData, |
| 31 | OMX_COMPONENTTYPE **component); |
| 32 | |
| 33 | protected: |
| 34 | virtual ~SoftAAC(); |
| 35 | |
| 36 | virtual OMX_ERRORTYPE internalGetParameter( |
| 37 | OMX_INDEXTYPE index, OMX_PTR params); |
| 38 | |
| 39 | virtual OMX_ERRORTYPE internalSetParameter( |
| 40 | OMX_INDEXTYPE index, const OMX_PTR params); |
| 41 | |
| 42 | virtual void onQueueFilled(OMX_U32 portIndex); |
| 43 | virtual void onPortFlushCompleted(OMX_U32 portIndex); |
| 44 | virtual void onPortEnableCompleted(OMX_U32 portIndex, bool enabled); |
| 45 | |
| 46 | private: |
| 47 | enum { |
| 48 | kNumBuffers = 4 |
| 49 | }; |
| 50 | |
| 51 | tPVMP4AudioDecoderExternal *mConfig; |
Andreas Huber | 9b8e496 | 2012-03-26 11:13:27 -0700 | [diff] [blame] | 52 | bool mIsADTS; |
Andreas Huber | 4b3913a | 2011-05-11 14:13:42 -0700 | [diff] [blame] | 53 | void *mDecoderBuf; |
| 54 | |
| 55 | size_t mInputBufferCount; |
| 56 | size_t mUpsamplingFactor; |
| 57 | int64_t mAnchorTimeUs; |
| 58 | int64_t mNumSamplesOutput; |
| 59 | |
| 60 | bool mSignalledError; |
| 61 | |
| 62 | enum { |
| 63 | NONE, |
| 64 | AWAITING_DISABLED, |
| 65 | AWAITING_ENABLED |
| 66 | } mOutputPortSettingsChange; |
| 67 | |
| 68 | void initPorts(); |
| 69 | status_t initDecoder(); |
| 70 | bool isConfigured() const; |
| 71 | |
| 72 | DISALLOW_EVIL_CONSTRUCTORS(SoftAAC); |
| 73 | }; |
| 74 | |
| 75 | } // namespace android |
| 76 | |
| 77 | #endif // SOFT_AAC_H_ |