blob: a6ef622c6b582538d7b0cffc747f8d0d7da2f7bb [file] [log] [blame]
Andreas Huber84066782011-08-16 09:34:26 -07001/*
2 * Copyright (C) 2012 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 MP4_SOURCE_H
18#define MP4_SOURCE_H
19
20#include "NuPlayerSource.h"
21
22namespace android {
23
Marco Nelissencb1f88c2012-08-31 11:07:37 -070024struct FragmentedMP4Parser;
Andreas Huber84066782011-08-16 09:34:26 -070025
26struct MP4Source : public NuPlayer::Source {
Andreas Huberb5f25f02013-02-05 10:14:26 -080027 MP4Source(const sp<AMessage> &notify, const sp<IStreamSource> &source);
Andreas Huber84066782011-08-16 09:34:26 -070028
Andreas Huber9575c962013-02-05 13:59:56 -080029 virtual void prepareAsync();
Andreas Huber84066782011-08-16 09:34:26 -070030 virtual void start();
31
32 virtual status_t feedMoreTSData();
33
34 virtual sp<AMessage> getFormat(bool audio);
35
36 virtual status_t dequeueAccessUnit(
37 bool audio, sp<ABuffer> *accessUnit);
38
39protected:
40 virtual ~MP4Source();
41
42private:
43 sp<IStreamSource> mSource;
44 sp<ALooper> mLooper;
Marco Nelissencb1f88c2012-08-31 11:07:37 -070045 sp<FragmentedMP4Parser> mParser;
Andreas Huber84066782011-08-16 09:34:26 -070046 bool mEOS;
47
48 DISALLOW_EVIL_CONSTRUCTORS(MP4Source);
49};
50
51} // namespace android
52
53#endif // MP4_SOURCE_H