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