Andreas Huber | ea6a38c | 2009-11-16 15:43:38 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 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 MEDIA_RECORDER_BASE_H_ |
| 18 | |
| 19 | #define MEDIA_RECORDER_BASE_H_ |
| 20 | |
| 21 | #include <media/mediarecorder.h> |
| 22 | |
| 23 | namespace android { |
| 24 | |
Jamie Gennis | 85cfdd0 | 2010-08-10 16:37:53 -0700 | [diff] [blame] | 25 | class Surface; |
Andreas Huber | ea6a38c | 2009-11-16 15:43:38 -0800 | [diff] [blame] | 26 | |
| 27 | struct MediaRecorderBase { |
| 28 | MediaRecorderBase() {} |
| 29 | virtual ~MediaRecorderBase() {} |
| 30 | |
| 31 | virtual status_t init() = 0; |
| 32 | virtual status_t setAudioSource(audio_source as) = 0; |
| 33 | virtual status_t setVideoSource(video_source vs) = 0; |
| 34 | virtual status_t setOutputFormat(output_format of) = 0; |
| 35 | virtual status_t setAudioEncoder(audio_encoder ae) = 0; |
| 36 | virtual status_t setVideoEncoder(video_encoder ve) = 0; |
| 37 | virtual status_t setVideoSize(int width, int height) = 0; |
| 38 | virtual status_t setVideoFrameRate(int frames_per_second) = 0; |
| 39 | virtual status_t setCamera(const sp<ICamera>& camera) = 0; |
Jamie Gennis | 85cfdd0 | 2010-08-10 16:37:53 -0700 | [diff] [blame] | 40 | virtual status_t setPreviewSurface(const sp<Surface>& surface) = 0; |
Andreas Huber | ea6a38c | 2009-11-16 15:43:38 -0800 | [diff] [blame] | 41 | virtual status_t setOutputFile(const char *path) = 0; |
| 42 | virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0; |
Nipun Kwatra | b33a5ae | 2010-08-26 17:20:53 -0700 | [diff] [blame] | 43 | virtual status_t setOutputFileAuxiliary(int fd) {return INVALID_OPERATION;} |
Andreas Huber | ea6a38c | 2009-11-16 15:43:38 -0800 | [diff] [blame] | 44 | virtual status_t setParameters(const String8& params) = 0; |
James Dong | fe1bafe | 2010-06-25 17:06:47 -0700 | [diff] [blame] | 45 | virtual status_t setListener(const sp<IMediaRecorderClient>& listener) = 0; |
Andreas Huber | ea6a38c | 2009-11-16 15:43:38 -0800 | [diff] [blame] | 46 | virtual status_t prepare() = 0; |
| 47 | virtual status_t start() = 0; |
| 48 | virtual status_t stop() = 0; |
| 49 | virtual status_t close() = 0; |
| 50 | virtual status_t reset() = 0; |
| 51 | virtual status_t getMaxAmplitude(int *max) = 0; |
James Dong | 929642e | 2010-07-08 11:16:11 -0700 | [diff] [blame] | 52 | virtual status_t dump(int fd, const Vector<String16>& args) const = 0; |
Andreas Huber | ea6a38c | 2009-11-16 15:43:38 -0800 | [diff] [blame] | 53 | |
| 54 | private: |
| 55 | MediaRecorderBase(const MediaRecorderBase &); |
| 56 | MediaRecorderBase &operator=(const MediaRecorderBase &); |
| 57 | }; |
| 58 | |
| 59 | } // namespace android |
| 60 | |
| 61 | #endif // MEDIA_RECORDER_BASE_H_ |