blob: 794bbcc6c4e69151f337bfdf63f3a07883c25a72 [file] [log] [blame]
Andreas Hubera979ad62010-08-19 10:56:15 -07001/*
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 Hubere536f802010-08-31 14:25:36 -070023#include <media/stagefright/foundation/AString.h>
24
Andreas Hubera979ad62010-08-19 10:56:15 -070025#include <utils/List.h>
26#include <utils/RefBase.h>
27
28namespace android {
29
30struct ABuffer;
31struct AMessage;
32
33struct AMPEG4ElementaryAssembler : public ARTPAssembler {
Andreas Hubere536f802010-08-31 14:25:36 -070034 AMPEG4ElementaryAssembler(
35 const sp<AMessage> &notify, const AString &desc,
36 const AString &params);
Andreas Hubera979ad62010-08-19 10:56:15 -070037
38protected:
39 virtual ~AMPEG4ElementaryAssembler();
40
41 virtual AssemblyStatus assembleMore(const sp<ARTPSource> &source);
42 virtual void onByeReceived();
43 virtual void packetLost();
44
45private:
46 sp<AMessage> mNotifyMsg;
Andreas Hubere536f802010-08-31 14:25:36 -070047 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 Hubera979ad62010-08-19 10:56:15 -070059
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_