blob: 9f968b242a106a588131db01fd8b56bd932a95bd [file] [log] [blame]
Ajit Khare73cfaf42013-01-07 23:28:47 -08001/*
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 DASHPLAYER_SOURCE_H_
18
19#define DASHPLAYER_SOURCE_H_
20
21#include "DashPlayer.h"
22//#include <media/stagefright/MediaDebug.h>
23
24namespace android {
25
26struct ABuffer;
27
28struct DashPlayer::Source : public RefBase {
29 Source() {}
30
31 virtual void start() = 0;
32 virtual void stop() {}
33
34 // Returns OK iff more data was available,
35 // an error or ERROR_END_OF_STREAM if not.
36 virtual status_t feedMoreTSData() = 0;
37
38 virtual sp<MetaData> getFormat(int audio) = 0;
39
40 virtual status_t dequeueAccessUnit(
41 int track, sp<ABuffer> *accessUnit) = 0;
42
43 virtual status_t getDuration(int64_t *durationUs) {
44 return INVALID_OPERATION;
45 }
46
47 virtual status_t seekTo(int64_t seekTimeUs) {
48 return INVALID_OPERATION;
49 }
50
51 virtual bool isSeekable() {
52 return false;
53 }
54
55 virtual status_t getNewSeekTime(int64_t* newSeek) {
56 return INVALID_OPERATION;
57 }
58
59 virtual status_t prepareAsync() {
60 return INVALID_OPERATION;
61 }
62
63 virtual bool isPrepareDone() {
64 return INVALID_OPERATION;
65 }
66
67 virtual status_t getParameter(int key, void **data, size_t *size) {
68 return INVALID_OPERATION;
69 }
70
71 virtual status_t setParameter(int key, void *data, size_t size) {
72 return INVALID_OPERATION;
73 }
74 virtual void notifyRenderingPosition(int64_t nRenderingTS){}
75
76 virtual status_t setupSourceData(const sp<AMessage> &msg, int iTrack){
77 return INVALID_OPERATION;
78 }
79 virtual status_t postNextTextSample(sp<ABuffer> accessUnit,const sp<AMessage> &msg,int iTrack) {
80 return INVALID_OPERATION;
81 }
82
83 virtual status_t getMediaPresence(bool &audio, bool &video, bool &text) {
84 return INVALID_OPERATION;
85 }
86
87 virtual void pause() {
88 ALOGE("Pause called on Wrong DataSource.. Please check !!!");
89 //CHECK(false);
90 }
91
92 virtual void resume() {
93 ALOGE("Resume called on Wrong DataSource.. Please check !!!");
94 //CHECK(false);
95 }
96
97protected:
98 virtual ~Source() {}
99
100private:
101 DISALLOW_EVIL_CONSTRUCTORS(Source);
102};
103
104} // namespace android
105
106#endif // DASHPLAYER_SOURCE_H_
107