Home | History | Annotate | Download | only in media
      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_IMEDIARECORDER_H
     19 #define ANDROID_IMEDIARECORDER_H
     20 
     21 #include <binder/IInterface.h>
     22 
     23 namespace android {
     24 
     25 class Surface;
     26 class ICamera;
     27 class ICameraRecordingProxy;
     28 class IMediaRecorderClient;
     29 class ISurfaceTexture;
     30 
     31 class IMediaRecorder: public IInterface
     32 {
     33 public:
     34     DECLARE_META_INTERFACE(MediaRecorder);
     35 
     36     virtual status_t setCamera(const sp<ICamera>& camera,
     37                                const sp<ICameraRecordingProxy>& proxy) = 0;
     38     virtual status_t setPreviewSurface(const sp<Surface>& surface) = 0;
     39     virtual status_t setVideoSource(int vs) = 0;
     40     virtual status_t setAudioSource(int as) = 0;
     41     virtual status_t setOutputFormat(int of) = 0;
     42     virtual status_t setVideoEncoder(int ve) = 0;
     43     virtual status_t setAudioEncoder(int ae) = 0;
     44     virtual status_t setOutputFile(const char* path) = 0;
     45     virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0;
     46     virtual status_t setVideoSize(int width, int height) = 0;
     47     virtual status_t setVideoFrameRate(int frames_per_second) = 0;
     48     virtual status_t setParameters(const String8& params) = 0;
     49     virtual status_t setListener(const sp<IMediaRecorderClient>& listener) = 0;
     50     virtual status_t prepare() = 0;
     51     virtual status_t getMaxAmplitude(int* max) = 0;
     52     virtual status_t start() = 0;
     53     virtual status_t stop() = 0;
     54     virtual status_t reset() = 0;
     55     virtual status_t init() = 0;
     56     virtual status_t close() = 0;
     57     virtual status_t release() = 0;
     58     virtual sp<ISurfaceTexture> querySurfaceMediaSource() = 0;
     59 };
     60 
     61 // ----------------------------------------------------------------------------
     62 
     63 class BnMediaRecorder: public BnInterface<IMediaRecorder>
     64 {
     65 public:
     66     virtual status_t    onTransact( uint32_t code,
     67                                     const Parcel& data,
     68                                     Parcel* reply,
     69                                     uint32_t flags = 0);
     70 };
     71 
     72 }; // namespace android
     73 
     74 #endif // ANDROID_IMEDIARECORDER_H
     75