IMediaPlayerService.h revision 7b5eb023f8d87cca6d830ae6c11c6aadbe02aca8
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 20#include <utils/RefBase.h> 21#include <utils/IInterface.h> 22#include <utils/Parcel.h> 23 24#include <media/IMediaPlayerClient.h> 25#include <media/IMediaPlayer.h> 26#include <media/IMediaMetadataRetriever.h> 27 28namespace android { 29 30class IMediaRecorder; 31 32class IMediaPlayerService: public IInterface 33{ 34public: 35 DECLARE_META_INTERFACE(MediaPlayerService); 36 37 virtual sp<IMediaRecorder> createMediaRecorder(pid_t pid) = 0; 38 virtual sp<IMediaMetadataRetriever> createMetadataRetriever(pid_t pid) = 0; 39 40 virtual sp<IMediaPlayer> create(pid_t pid, const sp<IMediaPlayerClient>& client, const char* url) = 0; 41 virtual sp<IMediaPlayer> create(pid_t pid, const sp<IMediaPlayerClient>& client, int fd, int64_t offset, int64_t length) = 0; 42 virtual sp<IMemory> decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0; 43 virtual sp<IMemory> decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0; 44}; 45 46// ---------------------------------------------------------------------------- 47 48class BnMediaPlayerService: public BnInterface<IMediaPlayerService> 49{ 50public: 51 virtual status_t onTransact( uint32_t code, 52 const Parcel& data, 53 Parcel* reply, 54 uint32_t flags = 0); 55}; 56 57}; // namespace android 58 59#endif // ANDROID_IMEDIAPLAYERSERVICE_H 60 61