MediaRecorderClient.h revision 89fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5
1/* 2 ** 3 ** Copyright 2008, HTC Inc. 4 ** 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 25class PVMediaRecorder; 26class ISurface; 27 28class MediaRecorderClient : public BnMediaRecorder 29{ 30public: 31 virtual status_t setCamera(const sp<ICamera>& camera); 32 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); 42 virtual status_t setListener(const sp<IMediaPlayerClient>& listener); 43 virtual status_t prepare(); 44 virtual status_t getMaxAmplitude(int* max); 45 virtual status_t start(); 46 virtual status_t stop(); 47 virtual status_t reset(); 48 virtual status_t init(); 49 virtual status_t close(); 50 virtual status_t release(); 51 52private: 53 friend class MediaPlayerService; // for accessing private constructor 54 55 MediaRecorderClient(pid_t pid); 56 virtual ~MediaRecorderClient(); 57 58 pid_t mPid; 59 Mutex mLock; 60 PVMediaRecorder *mRecorder; 61}; 62 63}; // namespace android 64 65#endif // ANDROID_MEDIARECORDERCLIENT_H 66 67