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_PVMEDIARECORDER_H 19 #define ANDROID_PVMEDIARECORDER_H 20 21 #include <media/mediarecorder.h> 22 #include <media/IMediaPlayerClient.h> 23 24 namespace android { 25 26 class ISurface; 27 class ICamera; 28 class AuthorDriverWrapper; 29 30 class PVMediaRecorder 31 { 32 public: 33 PVMediaRecorder(); 34 ~PVMediaRecorder(); 35 36 status_t init(); 37 status_t setAudioSource(audio_source as); 38 status_t setVideoSource(video_source vs); 39 status_t setOutputFormat(output_format of); 40 status_t setAudioEncoder(audio_encoder ae); 41 status_t setVideoEncoder(video_encoder ve); 42 status_t setVideoSize(int width, int height); 43 status_t setVideoFrameRate(int frames_per_second); 44 status_t setCamera(const sp<ICamera>& camera); 45 status_t setPreviewSurface(const sp<ISurface>& surface); 46 status_t setOutputFile(const char *path); 47 status_t setOutputFile(int fd, int64_t offset, int64_t length); 48 status_t setParameters(const String8& params); 49 status_t setListener(const sp<IMediaPlayerClient>& listener); 50 status_t prepare(); 51 status_t start(); 52 status_t stop(); 53 status_t close(); 54 status_t reset(); 55 status_t getMaxAmplitude(int *max); 56 57 private: 58 status_t doStop(); 59 60 AuthorDriverWrapper* mAuthorDriverWrapper; 61 }; 62 63 }; // namespace android 64 65 #endif // ANDROID_PVMEDIARECORDER_H 66 67