Home | History | Annotate | Download | only in camera
      1 /*
      2  * Copyright (C) 2011 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 HW_EMULATOR_CAMERA_EMULATED_FAKE_CAMERA_H
     18 #define HW_EMULATOR_CAMERA_EMULATED_FAKE_CAMERA_H
     19 
     20 /*
     21  * Contains declaration of a class EmulatedFakeCamera that encapsulates
     22  * functionality of a fake camera. This class is nothing more than a placeholder
     23  * for EmulatedFakeCameraDevice instance.
     24  */
     25 
     26 #include "EmulatedCamera.h"
     27 #include "EmulatedFakeCameraDevice.h"
     28 
     29 namespace android {
     30 
     31 /* Encapsulates functionality of a fake camera.
     32  * This class is nothing more than a placeholder for EmulatedFakeCameraDevice
     33  * instance that emulates a fake camera device.
     34  */
     35 class EmulatedFakeCamera : public EmulatedCamera {
     36 public:
     37     /* Constructs EmulatedFakeCamera instance. */
     38     EmulatedFakeCamera(int cameraId, bool facingBack, struct hw_module_t* module);
     39 
     40     /* Destructs EmulatedFakeCamera instance. */
     41     ~EmulatedFakeCamera();
     42 
     43     /****************************************************************************
     44      * EmulatedCamera virtual overrides.
     45      ***************************************************************************/
     46 
     47 public:
     48     /* Initializes EmulatedFakeCamera instance. */
     49      status_t Initialize();
     50 
     51     /****************************************************************************
     52      * EmulatedCamera abstract API implementation.
     53      ***************************************************************************/
     54 
     55 protected:
     56     /* Gets emulated camera device ised by this instance of the emulated camera.
     57      */
     58     EmulatedCameraDevice* getCameraDevice();
     59 
     60     /****************************************************************************
     61      * Data memebers.
     62      ***************************************************************************/
     63 
     64 protected:
     65     /* Facing back (true) or front (false) switch. */
     66     bool                        mFacingBack;
     67 
     68     /* Contained fake camera device object. */
     69     EmulatedFakeCameraDevice    mFakeCameraDevice;
     70 };
     71 
     72 }; /* namespace android */
     73 
     74 #endif  /* HW_EMULATOR_CAMERA_EMULATED_FAKE_CAMERA_H */
     75