class CvAbstractCamera

#include <cap_ios.h>

class CvAbstractCamera: public NSObject
{
public:
    // properties

    AVCaptureSession*
    captureSession;

    BOOL
    captureSessionLoaded;

    AVCaptureVideoPreviewLayer*
    captureVideoPreviewLayer;

    AVCaptureDevicePosition
    defaultAVCaptureDevicePosition;

    NSString*const
    defaultAVCaptureSessionPreset;

    AVCaptureVideoOrientation
    defaultAVCaptureVideoOrientation;

    int
    defaultFPS;

    int
    imageHeight;

    int
    imageWidth;

    UIView*
    parentView;

    BOOL
    running;

    BOOL
    useAVCaptureVideoPreviewLayer;

    AVCaptureConnection*
    videoCaptureConnection;

    // methods

    virtual
    void
    createCaptureOutput();

    virtual
    void
    createVideoPreviewLayer();

    virtual
    id
    initWithParentView:(UIView* parent);

    virtual
    void
    lockBalance();

    virtual
    void
    lockExposure();

    virtual
    void
    lockFocus();

    virtual
    void
    start();

    virtual
    void
    stop();

    virtual
    void
    switchCameras();

    virtual
    void
    unlockBalance();

    virtual
    void
    unlockExposure();

    virtual
    void
    unlockFocus();

    virtual
    void
    updateOrientation();

protected:
    // fields

    BOOL cameraAvailable;
    UIDeviceOrientation currentDeviceOrientation;
};

// direct descendants

class CvPhotoCamera;
class CvVideoCamera;