Andreas Huber | 8406678 | 2011-08-16 09:34:26 -0700 | [diff] [blame] | 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 | |
| 22 | namespace android { |
| 23 | |
Marco Nelissen | cb1f88c | 2012-08-31 11:07:37 -0700 | [diff] [blame] | 24 | struct FragmentedMP4Parser; |
Andreas Huber | 8406678 | 2011-08-16 09:34:26 -0700 | [diff] [blame] | 25 | |
| 26 | struct MP4Source : public NuPlayer::Source { |
Andreas Huber | b5f25f0 | 2013-02-05 10:14:26 -0800 | [diff] [blame] | 27 | MP4Source(const sp<AMessage> ¬ify, const sp<IStreamSource> &source); |
Andreas Huber | 8406678 | 2011-08-16 09:34:26 -0700 | [diff] [blame] | 28 | |
Andreas Huber | 9575c96 | 2013-02-05 13:59:56 -0800 | [diff] [blame] | 29 | virtual void prepareAsync(); |
Andreas Huber | 8406678 | 2011-08-16 09:34:26 -0700 | [diff] [blame] | 30 | 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 | |
| 39 | protected: |
| 40 | virtual ~MP4Source(); |
| 41 | |
| 42 | private: |
| 43 | sp<IStreamSource> mSource; |
| 44 | sp<ALooper> mLooper; |
Marco Nelissen | cb1f88c | 2012-08-31 11:07:37 -0700 | [diff] [blame] | 45 | sp<FragmentedMP4Parser> mParser; |
Andreas Huber | 8406678 | 2011-08-16 09:34:26 -0700 | [diff] [blame] | 46 | bool mEOS; |
| 47 | |
| 48 | DISALLOW_EVIL_CONSTRUCTORS(MP4Source); |
| 49 | }; |
| 50 | |
| 51 | } // namespace android |
| 52 | |
| 53 | #endif // MP4_SOURCE_H |