| 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_IMEDIAPLAYERSERVICE_H | 
|  | 18 | #define ANDROID_IMEDIAPLAYERSERVICE_H | 
|  | 19 |  | 
| Nicolas Catania | 1d187f1 | 2009-05-12 23:25:55 -0700 | [diff] [blame] | 20 | #include <utils/Errors.h>  // for status_t | 
| Andreas Huber | 2db8455 | 2010-01-28 11:19:57 -0800 | [diff] [blame^] | 21 | #include <utils/KeyedVector.h> | 
| The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | #include <utils/RefBase.h> | 
| Andreas Huber | 2db8455 | 2010-01-28 11:19:57 -0800 | [diff] [blame^] | 23 | #include <utils/String8.h> | 
| Mathias Agopian | 7562408 | 2009-05-19 19:08:10 -0700 | [diff] [blame] | 24 | #include <binder/IInterface.h> | 
|  | 25 | #include <binder/Parcel.h> | 
| The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 |  | 
|  | 27 | #include <media/IMediaPlayerClient.h> | 
|  | 28 | #include <media/IMediaPlayer.h> | 
|  | 29 | #include <media/IMediaMetadataRetriever.h> | 
|  | 30 |  | 
|  | 31 | namespace android { | 
|  | 32 |  | 
|  | 33 | class IMediaRecorder; | 
| Andreas Huber | 20111aa | 2009-07-14 16:56:47 -0700 | [diff] [blame] | 34 | class IOMX; | 
| The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 35 |  | 
|  | 36 | class IMediaPlayerService: public IInterface | 
|  | 37 | { | 
|  | 38 | public: | 
|  | 39 | DECLARE_META_INTERFACE(MediaPlayerService); | 
|  | 40 |  | 
| Nicolas Catania | 6609518 | 2009-06-11 16:33:49 -0700 | [diff] [blame] | 41 | virtual sp<IMediaRecorder>  createMediaRecorder(pid_t pid) = 0; | 
| The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | virtual sp<IMediaMetadataRetriever> createMetadataRetriever(pid_t pid) = 0; | 
| Andreas Huber | 2db8455 | 2010-01-28 11:19:57 -0800 | [diff] [blame^] | 43 | virtual sp<IMediaPlayer>    create(pid_t pid, const sp<IMediaPlayerClient>& client, const char* url, const KeyedVector<String8, String8> *headers = NULL) = 0; | 
| The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 44 | virtual sp<IMediaPlayer>    create(pid_t pid, const sp<IMediaPlayerClient>& client, int fd, int64_t offset, int64_t length) = 0; | 
|  | 45 | virtual sp<IMemory>         decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0; | 
|  | 46 | virtual sp<IMemory>         decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0; | 
| Andreas Huber | 318ad9c | 2009-10-15 13:46:54 -0700 | [diff] [blame] | 47 | virtual sp<IOMX>            getOMX() = 0; | 
| Marco Nelissen | 10dbb8e | 2009-09-20 10:42:13 -0700 | [diff] [blame] | 48 |  | 
|  | 49 | // Take a peek at currently playing audio, for visualization purposes. | 
|  | 50 | // This returns a buffer of 16 bit mono PCM data, or NULL if no visualization buffer is currently available. | 
|  | 51 | virtual sp<IMemory>         snoop() = 0; | 
| The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | }; | 
|  | 53 |  | 
|  | 54 | // ---------------------------------------------------------------------------- | 
|  | 55 |  | 
|  | 56 | class BnMediaPlayerService: public BnInterface<IMediaPlayerService> | 
|  | 57 | { | 
|  | 58 | public: | 
|  | 59 | virtual status_t    onTransact( uint32_t code, | 
|  | 60 | const Parcel& data, | 
|  | 61 | Parcel* reply, | 
|  | 62 | uint32_t flags = 0); | 
|  | 63 | }; | 
|  | 64 |  | 
|  | 65 | }; // namespace android | 
|  | 66 |  | 
|  | 67 | #endif // ANDROID_IMEDIAPLAYERSERVICE_H |