Andreas Huber | a979ad6 | 2010-08-19 10:56:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 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 A_MPEG4_ELEM_ASSEMBLER_H_ |
| 18 | |
| 19 | #define A_MPEG4_ELEM_ASSEMBLER_H_ |
| 20 | |
| 21 | #include "ARTPAssembler.h" |
| 22 | |
Andreas Huber | e536f80 | 2010-08-31 14:25:36 -0700 | [diff] [blame] | 23 | #include <media/stagefright/foundation/AString.h> |
| 24 | |
Andreas Huber | a979ad6 | 2010-08-19 10:56:15 -0700 | [diff] [blame] | 25 | #include <utils/List.h> |
| 26 | #include <utils/RefBase.h> |
| 27 | |
| 28 | namespace android { |
| 29 | |
| 30 | struct ABuffer; |
| 31 | struct AMessage; |
| 32 | |
| 33 | struct AMPEG4ElementaryAssembler : public ARTPAssembler { |
Andreas Huber | e536f80 | 2010-08-31 14:25:36 -0700 | [diff] [blame] | 34 | AMPEG4ElementaryAssembler( |
| 35 | const sp<AMessage> ¬ify, const AString &desc, |
| 36 | const AString ¶ms); |
Andreas Huber | a979ad6 | 2010-08-19 10:56:15 -0700 | [diff] [blame] | 37 | |
| 38 | protected: |
| 39 | virtual ~AMPEG4ElementaryAssembler(); |
| 40 | |
| 41 | virtual AssemblyStatus assembleMore(const sp<ARTPSource> &source); |
| 42 | virtual void onByeReceived(); |
| 43 | virtual void packetLost(); |
| 44 | |
| 45 | private: |
| 46 | sp<AMessage> mNotifyMsg; |
Andreas Huber | e536f80 | 2010-08-31 14:25:36 -0700 | [diff] [blame] | 47 | bool mIsGeneric; |
| 48 | AString mParams; |
| 49 | |
| 50 | unsigned mSizeLength; |
| 51 | unsigned mIndexLength; |
| 52 | unsigned mIndexDeltaLength; |
| 53 | unsigned mCTSDeltaLength; |
| 54 | unsigned mDTSDeltaLength; |
| 55 | bool mRandomAccessIndication; |
| 56 | unsigned mStreamStateIndication; |
| 57 | unsigned mAuxiliaryDataSizeLength; |
| 58 | bool mHasAUHeader; |
Andreas Huber | a979ad6 | 2010-08-19 10:56:15 -0700 | [diff] [blame] | 59 | |
| 60 | uint32_t mAccessUnitRTPTime; |
| 61 | bool mNextExpectedSeqNoValid; |
| 62 | uint32_t mNextExpectedSeqNo; |
| 63 | bool mAccessUnitDamaged; |
| 64 | List<sp<ABuffer> > mPackets; |
| 65 | |
| 66 | AssemblyStatus addPacket(const sp<ARTPSource> &source); |
| 67 | void submitAccessUnit(); |
| 68 | |
| 69 | DISALLOW_EVIL_CONSTRUCTORS(AMPEG4ElementaryAssembler); |
| 70 | }; |
| 71 | |
| 72 | } // namespace android |
| 73 | |
| 74 | #endif // A_MPEG4_ELEM_ASSEMBLER_H_ |