StagefrightPlayer.h revision 20111aa043c5f404472bc63b90bc5aad906b1101
19066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/*
29066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project**
39066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** Copyright 2009, The Android Open Source Project
49066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project**
59066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** Licensed under the Apache License, Version 2.0 (the "License");
69066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** you may not use this file except in compliance with the License.
79066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** You may obtain a copy of the License at
89066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project**
99066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project**     http://www.apache.org/licenses/LICENSE-2.0
109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project**
119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** Unless required by applicable law or agreed to in writing, software
129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** distributed under the License is distributed on an "AS IS" BASIS,
139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** See the License for the specific language governing permissions and
159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** limitations under the License.
169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project*/
179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#ifndef ANDROID_STAGEFRIGHTPLAYER_H
1969ddab4575ff684c533c995e07ca15fe18543fc0Jeff Sharkey#define ANDROID_STAGEFRIGHTPLAYER_H
201a303953589fdddf21d88b8fa660136f5b060d0dJeff Sharkey
21db3c8678e5cbdfec011afaf25bde2091152c30adHaoyu Bai#include <media/MediaPlayerInterface.h>
22961e30458319cfd50e1892ba7dd14a1d0ebe4cc7Jeff Sharkey
23961e30458319cfd50e1892ba7dd14a1d0ebe4cc7Jeff Sharkeynamespace android {
24fb878b66b9456f8fee2bcb1076263852d207949dJeff Sharkey
25fb878b66b9456f8fee2bcb1076263852d207949dJeff Sharkeyclass MediaPlayerImpl;
26fb878b66b9456f8fee2bcb1076263852d207949dJeff Sharkey
27fb878b66b9456f8fee2bcb1076263852d207949dJeff Sharkeyclass StagefrightPlayer : public MediaPlayerInterface {
28fb878b66b9456f8fee2bcb1076263852d207949dJeff Sharkeypublic:
29fb878b66b9456f8fee2bcb1076263852d207949dJeff Sharkey    StagefrightPlayer();
30fb878b66b9456f8fee2bcb1076263852d207949dJeff Sharkey    virtual ~StagefrightPlayer();
31c006f1aec15454782c35e028ad64d79a5c161cc1Jeff Sharkey
32c006f1aec15454782c35e028ad64d79a5c161cc1Jeff Sharkey    virtual status_t initCheck();
33fdfef57f498e3021a34342538aef9f1c7ccbae78Jeff Sharkey    virtual status_t setDataSource(const char *url);
34c006f1aec15454782c35e028ad64d79a5c161cc1Jeff Sharkey    virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
359538bdd3c77968c7673719c580ae653ede4654d6Irfan Sheriff    virtual status_t setVideoSurface(const sp<ISurface> &surface);
3615c7439acb22ab079dd2ebe42bdf0d2ffd525c5dJaikumar Ganesh    virtual status_t prepare();
3769ddab4575ff684c533c995e07ca15fe18543fc0Jeff Sharkey    virtual status_t prepareAsync();
389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    virtual status_t start();
399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    virtual status_t stop();
40148c7d0de720a92632aa6ed10a39bfc38b427239tk.mun    virtual status_t pause();
419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    virtual bool isPlaying();
4269ddab4575ff684c533c995e07ca15fe18543fc0Jeff Sharkey    virtual status_t seekTo(int msec);
439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    virtual status_t getCurrentPosition(int *msec);
44148c7d0de720a92632aa6ed10a39bfc38b427239tk.mun    virtual status_t getDuration(int *msec);
45434203a277cd2f237a71508a3d5a7d1602126cd5Robert Greenwalt    virtual status_t reset();
46da6da0907b28d4704aabbdb1bbeb4300954670d1Irfan Sheriff    virtual status_t setLooping(int loop);
479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    virtual player_type playerType();
48da3d5e6587c1476d489495ac93e84ebf223024c9Robert Greenwalt    virtual status_t invoke(const Parcel &request, Parcel *reply);
491997069436f0d47583a0b700c12ed63132cf3312Benoit Goby    virtual void setAudioSink(const sp<AudioSink> &audioSink);
509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
51db3c8678e5cbdfec011afaf25bde2091152c30adHaoyu Baiprivate:
52c006f1aec15454782c35e028ad64d79a5c161cc1Jeff Sharkey    MediaPlayerImpl *mPlayer;
53c006f1aec15454782c35e028ad64d79a5c161cc1Jeff Sharkey
54367d15ab1a33b6159447fa8542d4fa8ff148371cJeff Sharkey    StagefrightPlayer(const StagefrightPlayer &);
55c9822c5aeae833bb4a586c7af8a7b2641e8c17aeWink Saville    StagefrightPlayer &operator=(const StagefrightPlayer &);
5615c7439acb22ab079dd2ebe42bdf0d2ffd525c5dJaikumar Ganesh};
570a46db5d88461d9a6c85bb2e95982ac4c511d57eRobert Greenwalt
589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project}  // namespace android
59d55a6b498d66d8fc415908ecf63e50f46cce67e8Robert Greenwalt
609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#endif  // ANDROID_STAGEFRIGHTPLAYER_H
61c006f1aec15454782c35e028ad64d79a5c161cc1Jeff Sharkey