Home | History | Annotate | Download | only in mp4
      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 
     24 struct FragmentedMP4Parser;
     25 
     26 struct MP4Source : public NuPlayer::Source {
     27     MP4Source(const sp<AMessage> &notify, const sp<IStreamSource> &source);
     28 
     29     virtual void prepareAsync();
     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;
     45     sp<FragmentedMP4Parser> mParser;
     46     bool mEOS;
     47 
     48     DISALLOW_EVIL_CONSTRUCTORS(MP4Source);
     49 };
     50 
     51 }  // namespace android
     52 
     53 #endif // MP4_SOURCE_H
     54