The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2008 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 ANDROID_IMEDIAPLAYER_H |
| 18 | #define ANDROID_IMEDIAPLAYER_H |
| 19 | |
| 20 | #include <utils/RefBase.h> |
| 21 | #include <utils/IInterface.h> |
| 22 | #include <utils/Parcel.h> |
| 23 | |
| 24 | namespace android { |
| 25 | |
| 26 | class ISurface; |
| 27 | |
| 28 | class IMediaPlayer: public IInterface |
| 29 | { |
| 30 | public: |
| 31 | DECLARE_META_INTERFACE(MediaPlayer); |
| 32 | |
| 33 | virtual void disconnect() = 0; |
| 34 | |
| 35 | virtual status_t setVideoSurface(const sp<ISurface>& surface) = 0; |
| 36 | virtual status_t prepareAsync() = 0; |
| 37 | virtual status_t start() = 0; |
| 38 | virtual status_t stop() = 0; |
| 39 | virtual status_t pause() = 0; |
| 40 | virtual status_t isPlaying(bool* state) = 0; |
| 41 | virtual status_t seekTo(int msec) = 0; |
| 42 | virtual status_t getCurrentPosition(int* msec) = 0; |
| 43 | virtual status_t getDuration(int* msec) = 0; |
| 44 | virtual status_t reset() = 0; |
| 45 | virtual status_t setAudioStreamType(int type) = 0; |
| 46 | virtual status_t setLooping(int loop) = 0; |
| 47 | virtual status_t setVolume(float leftVolume, float rightVolume) = 0; |
| 48 | }; |
| 49 | |
| 50 | // ---------------------------------------------------------------------------- |
| 51 | |
| 52 | class BnMediaPlayer: public BnInterface<IMediaPlayer> |
| 53 | { |
| 54 | public: |
| 55 | virtual status_t onTransact( uint32_t code, |
| 56 | const Parcel& data, |
| 57 | Parcel* reply, |
| 58 | uint32_t flags = 0); |
| 59 | }; |
| 60 | |
| 61 | }; // namespace android |
| 62 | |
| 63 | #endif // ANDROID_IMEDIAPLAYER_H |
| 64 | |