120111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber/*
220111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * Copyright (C) 2009 The Android Open Source Project
320111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber *
420111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * Licensed under the Apache License, Version 2.0 (the "License");
520111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * you may not use this file except in compliance with the License.
620111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * You may obtain a copy of the License at
720111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber *
820111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber *      http://www.apache.org/licenses/LICENSE-2.0
920111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber *
1020111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * Unless required by applicable law or agreed to in writing, software
1120111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * distributed under the License is distributed on an "AS IS" BASIS,
1220111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1320111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * See the License for the specific language governing permissions and
1420111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber * limitations under the License.
1520111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber */
1620111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
1720111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber#ifndef CAMERA_SOURCE_H_
1820111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
1920111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber#define CAMERA_SOURCE_H_
2020111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
2120111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber#include <media/stagefright/MediaBuffer.h>
2220111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber#include <media/stagefright/MediaSource.h>
2354ff19ac69ace7c05ea90d225e26dab3b133f487James Dong#include <camera/ICamera.h>
244ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li#include <camera/ICameraRecordingProxyListener.h>
2554ff19ac69ace7c05ea90d225e26dab3b133f487James Dong#include <camera/CameraParameters.h>
2620111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber#include <utils/List.h>
2720111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber#include <utils/RefBase.h>
2820111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
2920111aa043c5f404472bc63b90bc5aad906b1101Andreas Hubernamespace android {
3020111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
3120111aa043c5f404472bc63b90bc5aad906b1101Andreas Huberclass IMemory;
32be5c74f5da6a93b0d23f96e11848acfcc3b4d1d9Andreas Huberclass Camera;
3354ff19ac69ace7c05ea90d225e26dab3b133f487James Dongclass Surface;
3420111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
357278cf32f1aa6a322f6dff1f8b7dacf7b6dddba6James Dongclass CameraSource : public MediaSource, public MediaBufferObserver {
3620111aa043c5f404472bc63b90bc5aad906b1101Andreas Huberpublic:
3754ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    /**
3854ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * Factory method to create a new CameraSource using the current
3954ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * settings (such as video size, frame rate, color format, etc)
4054ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * from the default camera.
4154ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     *
4254ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * @return NULL on error.
4354ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     */
4420111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber    static CameraSource *Create();
4554ff19ac69ace7c05ea90d225e26dab3b133f487James Dong
4654ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    /**
4754ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * Factory method to create a new CameraSource.
4854ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     *
4954ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * @param camera the video input frame data source. If it is NULL,
5054ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     *          we will try to connect to the camera with the given
5154ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     *          cameraId.
5254ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     *
5354ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * @param cameraId the id of the camera that the source will connect
5454ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     *          to if camera is NULL; otherwise ignored.
5554ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     *
5654ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * @param videoSize the dimension (in pixels) of the video frame
5754ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * @param frameRate the target frames per second
5854ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * @param surface the preview surface for display where preview
5954ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     *          frames are sent to
605c9523154d106b555db6c41f85ab205a4f189b02James Dong     * @param storeMetaDataInVideoBuffers true to request the camera
615c9523154d106b555db6c41f85ab205a4f189b02James Dong     *          source to store meta data in video buffers; false to
625c9523154d106b555db6c41f85ab205a4f189b02James Dong     *          request the camera source to store real YUV frame data
635c9523154d106b555db6c41f85ab205a4f189b02James Dong     *          in the video buffers. The camera source may not support
645c9523154d106b555db6c41f85ab205a4f189b02James Dong     *          storing meta data in video buffers, if so, a request
655c9523154d106b555db6c41f85ab205a4f189b02James Dong     *          to do that will NOT be honored. To find out whether
665c9523154d106b555db6c41f85ab205a4f189b02James Dong     *          meta data is actually being stored in video buffers
675c9523154d106b555db6c41f85ab205a4f189b02James Dong     *          during recording, call isMetaDataStoredInVideoBuffers().
6854ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     *
6954ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * @return NULL on error.
7054ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     */
7154ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    static CameraSource *CreateFromCamera(const sp<ICamera> &camera,
724ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li                                          const sp<ICameraRecordingProxy> &proxy,
7354ff19ac69ace7c05ea90d225e26dab3b133f487James Dong                                          int32_t cameraId,
7454ff19ac69ace7c05ea90d225e26dab3b133f487James Dong                                          Size videoSize,
7554ff19ac69ace7c05ea90d225e26dab3b133f487James Dong                                          int32_t frameRate,
765c9523154d106b555db6c41f85ab205a4f189b02James Dong                                          const sp<Surface>& surface,
775c9523154d106b555db6c41f85ab205a4f189b02James Dong                                          bool storeMetaDataInVideoBuffers = false);
7820111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
7920111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber    virtual ~CameraSource();
8020111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
8120111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber    virtual status_t start(MetaData *params = NULL);
82b44c9d2bdc0d5b9cb03254022a58e017b516e9e6James Dong    virtual status_t stop() { return reset(); }
835c9523154d106b555db6c41f85ab205a4f189b02James Dong    virtual status_t read(
845c9523154d106b555db6c41f85ab205a4f189b02James Dong            MediaBuffer **buffer, const ReadOptions *options = NULL);
8520111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
8654ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    /**
8754ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * Check whether a CameraSource object is properly initialized.
8854ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * Must call this method before stop().
8954ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * @return OK if initialization has successfully completed.
9054ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     */
9154ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    virtual status_t initCheck() const;
9254ff19ac69ace7c05ea90d225e26dab3b133f487James Dong
9354ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    /**
9454ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * Returns the MetaData associated with the CameraSource,
9554ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * including:
9654ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * kKeyColorFormat: YUV color format of the video frames
9754ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * kKeyWidth, kKeyHeight: dimension (in pixels) of the video frames
9854ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     * kKeySampleRate: frame rate in frames per second
992b37ced30f89437c804c3945b901019b86d210aeJames Dong     * kKeyMIMEType: always fixed to be MEDIA_MIMETYPE_VIDEO_RAW
10054ff19ac69ace7c05ea90d225e26dab3b133f487James Dong     */
10120111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber    virtual sp<MetaData> getFormat();
10220111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
1035c9523154d106b555db6c41f85ab205a4f189b02James Dong    /**
1045c9523154d106b555db6c41f85ab205a4f189b02James Dong     * Tell whether this camera source stores meta data or real YUV
1055c9523154d106b555db6c41f85ab205a4f189b02James Dong     * frame data in video buffers.
1065c9523154d106b555db6c41f85ab205a4f189b02James Dong     *
1075c9523154d106b555db6c41f85ab205a4f189b02James Dong     * @return true if meta data is stored in the video
1085c9523154d106b555db6c41f85ab205a4f189b02James Dong     *      buffers; false if real YUV data is stored in
1095c9523154d106b555db6c41f85ab205a4f189b02James Dong     *      the video buffers.
1105c9523154d106b555db6c41f85ab205a4f189b02James Dong     */
1115c9523154d106b555db6c41f85ab205a4f189b02James Dong    bool isMetaDataStoredInVideoBuffers() const;
11220111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
1137278cf32f1aa6a322f6dff1f8b7dacf7b6dddba6James Dong    virtual void signalBufferReturned(MediaBuffer* buffer);
1147278cf32f1aa6a322f6dff1f8b7dacf7b6dddba6James Dong
11565e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatraprotected:
1164ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    class ProxyListener: public BnCameraRecordingProxyListener {
1174ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    public:
1184ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li        ProxyListener(const sp<CameraSource>& source);
1194ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li        virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType,
1204ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li                const sp<IMemory> &data);
1214ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li
1224ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    private:
1234ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li        sp<CameraSource> mSource;
1244ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    };
1254ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li
1264ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    // isBinderAlive needs linkToDeath to work.
1274ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    class DeathNotifier: public IBinder::DeathRecipient {
1284ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    public:
1294ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li        DeathNotifier() {}
1304ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li        virtual void binderDied(const wp<IBinder>& who);
1314ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    };
1324ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li
13354ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    enum CameraFlags {
13454ff19ac69ace7c05ea90d225e26dab3b133f487James Dong        FLAGS_SET_CAMERA = 1L << 0,
13554ff19ac69ace7c05ea90d225e26dab3b133f487James Dong        FLAGS_HOT_CAMERA = 1L << 1,
13654ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    };
13754ff19ac69ace7c05ea90d225e26dab3b133f487James Dong
13854ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    int32_t  mCameraFlags;
13954ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    Size     mVideoSize;
140983cf231ab2d176a14595cdae46ff1b0c239af47James Dong    int32_t  mNumInputBuffers;
14154ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    int32_t  mVideoFrameRate;
14254ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    int32_t  mColorFormat;
14354ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    status_t mInitCheck;
14454ff19ac69ace7c05ea90d225e26dab3b133f487James Dong
14554ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    sp<Camera>   mCamera;
1464ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    sp<ICameraRecordingProxy>   mCameraRecordingProxy;
1474ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    sp<DeathNotifier> mDeathNotifier;
14854ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    sp<Surface>  mSurface;
149653252be963c07c99109d20f942d1f30c52a9360James Dong    sp<MetaData> mMeta;
15020111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
15165e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    int64_t mStartTimeUs;
15265e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    int32_t mNumFramesReceived;
15365e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    int64_t mLastFrameTimestampUs;
15465e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    bool mStarted;
1557757f5010a771fb8824b6fdf9788f588a1577e3fJames Dong    int32_t mNumFramesEncoded;
15665e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra
157e8e5f86e9e310b065596c8cbbca1543eb833dee1James Dong    // Time between capture of two frames.
158e8e5f86e9e310b065596c8cbbca1543eb833dee1James Dong    int64_t mTimeBetweenFrameCaptureUs;
159e8e5f86e9e310b065596c8cbbca1543eb833dee1James Dong
1604ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    CameraSource(const sp<ICamera>& camera, const sp<ICameraRecordingProxy>& proxy,
1614ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li                 int32_t cameraId,
16254ff19ac69ace7c05ea90d225e26dab3b133f487James Dong                 Size videoSize, int32_t frameRate,
1635c9523154d106b555db6c41f85ab205a4f189b02James Dong                 const sp<Surface>& surface,
1645c9523154d106b555db6c41f85ab205a4f189b02James Dong                 bool storeMetaDataInVideoBuffers);
16565e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra
16665e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    virtual void startCameraRecording();
16765e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    virtual void releaseRecordingFrame(const sp<IMemory>& frame);
16865e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra
16965e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    // Returns true if need to skip the current frame.
17065e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    // Called from dataCallbackTimestamp.
17165e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    virtual bool skipCurrentFrame(int64_t timestampUs) {return false;}
17265e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra
17365e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    // Callback called when still camera raw data is available.
17465e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    virtual void dataCallback(int32_t msgType, const sp<IMemory> &data) {}
17565e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra
17665e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType,
17765e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra            const sp<IMemory> &data);
17865e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra
17965e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatraprivate:
18065e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra    friend class CameraSourceListener;
18165e7e6facda89927cb26594b3b65ae81b3235ebcNipun Kwatra
18220111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber    Mutex mLock;
18320111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber    Condition mFrameAvailableCondition;
1847278cf32f1aa6a322f6dff1f8b7dacf7b6dddba6James Dong    Condition mFrameCompleteCondition;
1857278cf32f1aa6a322f6dff1f8b7dacf7b6dddba6James Dong    List<sp<IMemory> > mFramesReceived;
1867278cf32f1aa6a322f6dff1f8b7dacf7b6dddba6James Dong    List<sp<IMemory> > mFramesBeingEncoded;
187be5c74f5da6a93b0d23f96e11848acfcc3b4d1d9Andreas Huber    List<int64_t> mFrameTimes;
18820111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
189be5c74f5da6a93b0d23f96e11848acfcc3b4d1d9Andreas Huber    int64_t mFirstFrameTimeUs;
19013aec890216948b0c364f8f92792129d0335f506James Dong    int32_t mNumFramesDropped;
191f60cafe0e6aad8f9ce54660fa88b651ae4e749e6James Dong    int32_t mNumGlitches;
192f60cafe0e6aad8f9ce54660fa88b651ae4e749e6James Dong    int64_t mGlitchDurationThresholdUs;
193365a963142093a1cd8efdcea76b5f65096a5b115James Dong    bool mCollectStats;
1945c9523154d106b555db6c41f85ab205a4f189b02James Dong    bool mIsMetaDataStoredInVideoBuffers;
195c32cd79d9ad4aba7d959b5b3be7361b4715e6f18James Dong
196c32cd79d9ad4aba7d959b5b3be7361b4715e6f18James Dong    void releaseQueuedFrames();
197f60cafe0e6aad8f9ce54660fa88b651ae4e749e6James Dong    void releaseOneRecordingFrame(const sp<IMemory>& frame);
198be5c74f5da6a93b0d23f96e11848acfcc3b4d1d9Andreas Huber
19954ff19ac69ace7c05ea90d225e26dab3b133f487James Dong
2004ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    status_t init(const sp<ICamera>& camera, const sp<ICameraRecordingProxy>& proxy,
2014ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li                  int32_t cameraId, Size videoSize, int32_t frameRate,
2024ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li                  bool storeMetaDataInVideoBuffers);
203ae4c1ac6401185539c03ce0819e174fd1b04b136James Dong
204ae4c1ac6401185539c03ce0819e174fd1b04b136James Dong    status_t initWithCameraAccess(
205ae4c1ac6401185539c03ce0819e174fd1b04b136James Dong                  const sp<ICamera>& camera, const sp<ICameraRecordingProxy>& proxy,
206ae4c1ac6401185539c03ce0819e174fd1b04b136James Dong                  int32_t cameraId, Size videoSize, int32_t frameRate,
207ae4c1ac6401185539c03ce0819e174fd1b04b136James Dong                  bool storeMetaDataInVideoBuffers);
208ae4c1ac6401185539c03ce0819e174fd1b04b136James Dong
2094ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li    status_t isCameraAvailable(const sp<ICamera>& camera,
2104ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li                               const sp<ICameraRecordingProxy>& proxy,
2114ca2c7c913f8bd4ada13aca56d36045d42d1e00fWu-cheng Li                               int32_t cameraId);
21254ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    status_t isCameraColorFormatSupported(const CameraParameters& params);
21354ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    status_t configureCamera(CameraParameters* params,
21454ff19ac69ace7c05ea90d225e26dab3b133f487James Dong                    int32_t width, int32_t height,
21554ff19ac69ace7c05ea90d225e26dab3b133f487James Dong                    int32_t frameRate);
21654ff19ac69ace7c05ea90d225e26dab3b133f487James Dong
21754ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    status_t checkVideoSize(const CameraParameters& params,
21854ff19ac69ace7c05ea90d225e26dab3b133f487James Dong                    int32_t width, int32_t height);
21954ff19ac69ace7c05ea90d225e26dab3b133f487James Dong
22054ff19ac69ace7c05ea90d225e26dab3b133f487James Dong    status_t checkFrameRate(const CameraParameters& params,
22154ff19ac69ace7c05ea90d225e26dab3b133f487James Dong                    int32_t frameRate);
22254ff19ac69ace7c05ea90d225e26dab3b133f487James Dong
223b44c9d2bdc0d5b9cb03254022a58e017b516e9e6James Dong    void stopCameraRecording();
224ea7b485595f8cec6a66668b5c54c8f297d843f77James Dong    void releaseCamera();
225b44c9d2bdc0d5b9cb03254022a58e017b516e9e6James Dong    status_t reset();
226ea7b485595f8cec6a66668b5c54c8f297d843f77James Dong
22720111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber    CameraSource(const CameraSource &);
22820111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber    CameraSource &operator=(const CameraSource &);
22920111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber};
23020111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
23120111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber}  // namespace android
23220111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber
23320111aa043c5f404472bc63b90bc5aad906b1101Andreas Huber#endif  // CAMERA_SOURCE_H_
234