The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | ** |
Jean-Baptiste Queru | 4506c62 | 2010-07-29 17:35:37 -0700 | [diff] [blame] | 3 | ** Copyright 2008, The Android Open Source Project |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 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 | |
| 23 | namespace android { |
| 24 | |
Andreas Huber | ea6a38c | 2009-11-16 15:43:38 -0800 | [diff] [blame] | 25 | class MediaRecorderBase; |
Gloria Wang | 608a263 | 2009-10-29 15:46:37 -0700 | [diff] [blame] | 26 | class MediaPlayerService; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 27 | |
| 28 | class MediaRecorderClient : public BnMediaRecorder |
| 29 | { |
| 30 | public: |
James Dong | 929642e | 2010-07-08 11:16:11 -0700 | [diff] [blame] | 31 | virtual status_t setCamera(const sp<ICamera>& camera); |
Jamie Gennis | 85cfdd0 | 2010-08-10 16:37:53 -0700 | [diff] [blame] | 32 | virtual status_t setPreviewSurface(const sp<Surface>& surface); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 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); |
Nipun Kwatra | b33a5ae | 2010-08-26 17:20:53 -0700 | [diff] [blame] | 40 | virtual status_t setOutputFileAuxiliary(int fd); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 41 | virtual status_t setVideoSize(int width, int height); |
| 42 | virtual status_t setVideoFrameRate(int frames_per_second); |
The Android Open Source Project | ba87e3e | 2009-03-13 13:04:22 -0700 | [diff] [blame] | 43 | virtual status_t setParameters(const String8& params); |
James Dong | fe1bafe | 2010-06-25 17:06:47 -0700 | [diff] [blame] | 44 | virtual status_t setListener(const sp<IMediaRecorderClient>& listener); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | virtual status_t prepare(); |
| 46 | virtual status_t getMaxAmplitude(int* max); |
| 47 | virtual status_t start(); |
| 48 | virtual status_t stop(); |
James Dong | 929642e | 2010-07-08 11:16:11 -0700 | [diff] [blame] | 49 | virtual status_t reset(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 50 | virtual status_t init(); |
| 51 | virtual status_t close(); |
| 52 | virtual status_t release(); |
| 53 | |
James Dong | 929642e | 2010-07-08 11:16:11 -0700 | [diff] [blame] | 54 | virtual status_t dump(int fd, const Vector<String16>& args) const; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 55 | private: |
James Dong | 929642e | 2010-07-08 11:16:11 -0700 | [diff] [blame] | 56 | friend class MediaPlayerService; // for accessing private constructor |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | |
James Dong | 929642e | 2010-07-08 11:16:11 -0700 | [diff] [blame] | 58 | MediaRecorderClient(const sp<MediaPlayerService>& service, pid_t pid); |
| 59 | virtual ~MediaRecorderClient(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 60 | |
James Dong | 929642e | 2010-07-08 11:16:11 -0700 | [diff] [blame] | 61 | pid_t mPid; |
| 62 | Mutex mLock; |
| 63 | MediaRecorderBase *mRecorder; |
| 64 | sp<MediaPlayerService> mMediaPlayerService; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 65 | }; |
| 66 | |
| 67 | }; // namespace android |
| 68 | |
| 69 | #endif // ANDROID_MEDIARECORDERCLIENT_H |