blob: 1d1913dfe2f0191c6a536488ecaa1a26562e262e [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 **
Jean-Baptiste Queru4506c622010-07-29 17:35:37 -07003 ** Copyright 2008, The Android Open Source Project
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004 **
5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at
8 **
9 ** http://www.apache.org/licenses/LICENSE-2.0
10 **
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
16 */
17
18#ifndef ANDROID_MEDIARECORDERCLIENT_H
19#define ANDROID_MEDIARECORDERCLIENT_H
20
21#include <media/IMediaRecorder.h>
22
23namespace android {
24
Andreas Huberea6a38c2009-11-16 15:43:38 -080025class MediaRecorderBase;
Gloria Wang608a2632009-10-29 15:46:37 -070026class MediaPlayerService;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080027
28class MediaRecorderClient : public BnMediaRecorder
29{
30public:
James Dong929642e2010-07-08 11:16:11 -070031 virtual status_t setCamera(const sp<ICamera>& camera);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032 virtual status_t setPreviewSurface(const sp<ISurface>& surface);
33 virtual status_t setVideoSource(int vs);
34 virtual status_t setAudioSource(int as);
35 virtual status_t setOutputFormat(int of);
36 virtual status_t setVideoEncoder(int ve);
37 virtual status_t setAudioEncoder(int ae);
38 virtual status_t setOutputFile(const char* path);
39 virtual status_t setOutputFile(int fd, int64_t offset, int64_t length);
40 virtual status_t setVideoSize(int width, int height);
41 virtual status_t setVideoFrameRate(int frames_per_second);
The Android Open Source Projectba87e3e2009-03-13 13:04:22 -070042 virtual status_t setParameters(const String8& params);
James Dongfe1bafe2010-06-25 17:06:47 -070043 virtual status_t setListener(const sp<IMediaRecorderClient>& listener);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044 virtual status_t prepare();
45 virtual status_t getMaxAmplitude(int* max);
46 virtual status_t start();
47 virtual status_t stop();
James Dong929642e2010-07-08 11:16:11 -070048 virtual status_t reset();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049 virtual status_t init();
50 virtual status_t close();
51 virtual status_t release();
52
James Dong929642e2010-07-08 11:16:11 -070053 virtual status_t dump(int fd, const Vector<String16>& args) const;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054private:
James Dong929642e2010-07-08 11:16:11 -070055 friend class MediaPlayerService; // for accessing private constructor
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056
James Dong929642e2010-07-08 11:16:11 -070057 MediaRecorderClient(const sp<MediaPlayerService>& service, pid_t pid);
58 virtual ~MediaRecorderClient();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080059
James Dong929642e2010-07-08 11:16:11 -070060 pid_t mPid;
61 Mutex mLock;
62 MediaRecorderBase *mRecorder;
63 sp<MediaPlayerService> mMediaPlayerService;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080064};
65
66}; // namespace android
67
68#endif // ANDROID_MEDIARECORDERCLIENT_H
69