Andreas Huber | e46b7be | 2009-07-14 16:56:47 -0700 | [diff] [blame] | 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 | |
| 23 | namespace android { |
| 24 | |
Andreas Huber | 27366fc | 2009-11-20 09:32:46 -0800 | [diff] [blame] | 25 | struct AwesomePlayer; |
Andreas Huber | e46b7be | 2009-07-14 16:56:47 -0700 | [diff] [blame] | 26 | |
| 27 | class StagefrightPlayer : public MediaPlayerInterface { |
| 28 | public: |
| 29 | StagefrightPlayer(); |
| 30 | virtual ~StagefrightPlayer(); |
| 31 | |
| 32 | virtual status_t initCheck(); |
Andreas Huber | 2564300 | 2010-01-28 11:19:57 -0800 | [diff] [blame] | 33 | |
| 34 | virtual status_t setDataSource( |
| 35 | const char *url, const KeyedVector<String8, String8> *headers); |
| 36 | |
Andreas Huber | e46b7be | 2009-07-14 16:56:47 -0700 | [diff] [blame] | 37 | virtual status_t setDataSource(int fd, int64_t offset, int64_t length); |
Andreas Huber | 52b52cd | 2010-11-23 11:41:34 -0800 | [diff] [blame] | 38 | |
| 39 | virtual status_t setDataSource(const sp<IStreamSource> &source); |
| 40 | |
Andreas Huber | e3c0183 | 2010-08-16 08:49:37 -0700 | [diff] [blame] | 41 | virtual status_t setVideoSurface(const sp<Surface> &surface); |
Glenn Kasten | cc562a3 | 2011-02-08 17:26:17 -0800 | [diff] [blame] | 42 | virtual status_t setVideoSurfaceTexture( |
| 43 | const sp<ISurfaceTexture> &surfaceTexture); |
Andreas Huber | e46b7be | 2009-07-14 16:56:47 -0700 | [diff] [blame] | 44 | virtual status_t prepare(); |
| 45 | virtual status_t prepareAsync(); |
| 46 | virtual status_t start(); |
| 47 | virtual status_t stop(); |
| 48 | virtual status_t pause(); |
| 49 | virtual bool isPlaying(); |
| 50 | virtual status_t seekTo(int msec); |
| 51 | virtual status_t getCurrentPosition(int *msec); |
| 52 | virtual status_t getDuration(int *msec); |
| 53 | virtual status_t reset(); |
| 54 | virtual status_t setLooping(int loop); |
| 55 | virtual player_type playerType(); |
| 56 | virtual status_t invoke(const Parcel &request, Parcel *reply); |
| 57 | virtual void setAudioSink(const sp<AudioSink> &audioSink); |
Gloria Wang | d01ec6e | 2011-04-25 17:28:22 -0700 | [diff] [blame] | 58 | virtual status_t setParameter(int key, const Parcel &request); |
| 59 | virtual status_t getParameter(int key, Parcel *reply); |
Andreas Huber | e46b7be | 2009-07-14 16:56:47 -0700 | [diff] [blame] | 60 | |
Andreas Huber | 62f7ffe | 2010-05-06 10:18:05 -0700 | [diff] [blame] | 61 | virtual status_t getMetadata( |
| 62 | const media::Metadata::Filter& ids, Parcel *records); |
| 63 | |
Andreas Huber | e46b7be | 2009-07-14 16:56:47 -0700 | [diff] [blame] | 64 | private: |
Andreas Huber | 27366fc | 2009-11-20 09:32:46 -0800 | [diff] [blame] | 65 | AwesomePlayer *mPlayer; |
Andreas Huber | e46b7be | 2009-07-14 16:56:47 -0700 | [diff] [blame] | 66 | |
| 67 | StagefrightPlayer(const StagefrightPlayer &); |
| 68 | StagefrightPlayer &operator=(const StagefrightPlayer &); |
| 69 | }; |
| 70 | |
| 71 | } // namespace android |
| 72 | |
| 73 | #endif // ANDROID_STAGEFRIGHTPLAYER_H |