StagefrightPlayer.h revision a64c8c79af1a15911c55306d83a797fa50969f77
1/*
2**
3** Copyright 2009, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9**     http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18#ifndef ANDROID_STAGEFRIGHTPLAYER_H
19#define ANDROID_STAGEFRIGHTPLAYER_H
20
21#include <media/MediaPlayerInterface.h>
22
23namespace android {
24
25class MediaPlayerImpl;
26
27class StagefrightPlayer : public MediaPlayerInterface {
28public:
29    StagefrightPlayer();
30    virtual ~StagefrightPlayer();
31
32    virtual status_t initCheck();
33    virtual status_t setDataSource(const char *url);
34    virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
35    virtual status_t setVideoSurface(const sp<ISurface> &surface);
36    virtual status_t prepare();
37    virtual status_t prepareAsync();
38    virtual status_t start();
39    virtual status_t stop();
40    virtual status_t pause();
41    virtual bool isPlaying();
42    virtual status_t seekTo(int msec);
43    virtual status_t getCurrentPosition(int *msec);
44    virtual status_t getDuration(int *msec);
45    virtual status_t reset();
46    virtual status_t setLooping(int loop);
47    virtual player_type playerType();
48    virtual status_t invoke(const Parcel &request, Parcel *reply);
49    virtual void setAudioSink(const sp<AudioSink> &audioSink);
50
51private:
52    MediaPlayerImpl *mPlayer;
53
54    StagefrightPlayer(const StagefrightPlayer &);
55    StagefrightPlayer &operator=(const StagefrightPlayer &);
56};
57
58}  // namespace android
59
60#endif  // ANDROID_STAGEFRIGHTPLAYER_H
61