blob: d5c1594fd2a7fc9edadf77f191f54f4172e7d732 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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 Catania20cb94e2009-05-12 23:25:55 -070020#include <utils/Errors.h> // for status_t
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080021#include <utils/RefBase.h>
Mathias Agopian07952722009-05-19 19:08:10 -070022#include <binder/IInterface.h>
23#include <binder/Parcel.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080024
25#include <media/IMediaPlayerClient.h>
26#include <media/IMediaPlayer.h>
27#include <media/IMediaMetadataRetriever.h>
28
29namespace android {
30
31class IMediaRecorder;
Andreas Hubere46b7be2009-07-14 16:56:47 -070032class IOMX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033
34class IMediaPlayerService: public IInterface
35{
36public:
37 DECLARE_META_INTERFACE(MediaPlayerService);
38
Nicolas Catania32f82772009-06-11 16:33:49 -070039 virtual sp<IMediaRecorder> createMediaRecorder(pid_t pid) = 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080040 virtual sp<IMediaMetadataRetriever> createMetadataRetriever(pid_t pid) = 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041 virtual sp<IMediaPlayer> create(pid_t pid, const sp<IMediaPlayerClient>& client, const char* url) = 0;
42 virtual sp<IMediaPlayer> create(pid_t pid, const sp<IMediaPlayerClient>& client, int fd, int64_t offset, int64_t length) = 0;
43 virtual sp<IMemory> decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0;
44 virtual sp<IMemory> decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0;
Andreas Huber784202e2009-10-15 13:46:54 -070045 virtual sp<IOMX> getOMX() = 0;
Marco Nelissenc39d2e32009-09-20 10:42:13 -070046
47 // Take a peek at currently playing audio, for visualization purposes.
48 // This returns a buffer of 16 bit mono PCM data, or NULL if no visualization buffer is currently available.
49 virtual sp<IMemory> snoop() = 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050};
51
52// ----------------------------------------------------------------------------
53
54class BnMediaPlayerService: public BnInterface<IMediaPlayerService>
55{
56public:
57 virtual status_t onTransact( uint32_t code,
58 const Parcel& data,
59 Parcel* reply,
60 uint32_t flags = 0);
61};
62
63}; // namespace android
64
65#endif // ANDROID_IMEDIAPLAYERSERVICE_H