MP4Source.h revision cb1f88c684140ce0eb407049a78f889bc7d51be1
1/*
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
24struct FragmentedMP4Parser;
25
26struct MP4Source : public NuPlayer::Source {
27    MP4Source(const sp<IStreamSource> &source);
28
29    virtual void start();
30
31    virtual status_t feedMoreTSData();
32
33    virtual sp<AMessage> getFormat(bool audio);
34
35    virtual status_t dequeueAccessUnit(
36            bool audio, sp<ABuffer> *accessUnit);
37
38protected:
39    virtual ~MP4Source();
40
41private:
42    sp<IStreamSource> mSource;
43    sp<ALooper> mLooper;
44    sp<FragmentedMP4Parser> mParser;
45    bool mEOS;
46
47    DISALLOW_EVIL_CONSTRUCTORS(MP4Source);
48};
49
50}  // namespace android
51
52#endif // MP4_SOURCE_H
53