🌐 English

    Camera Device API#

    Header File#

    OasisMedia.h

    Functions#

    int32_t configCameras ( key_value_map_t & parameters )
    OasisMedia.h
    Registers camera devices.
    Parameters
    parameters  The key-value map required for registering camera devices.
    Return Value
    • 0: Success
    • -1: Failure

    The key-value map that can be passed as a parameter to the oasis::configCameras function is as follows:

    Key
    Default
    M
    Description
    source-count
    Specifies the number of camera devices to register.

    The key values to be configured for each camera device are specified in the format source<N>-<key_name>. <N> starts from 1 and increases by 1.

    The key-value map for each camera device is as follows:

    Key
    Default
    M
    Description
    source<N>-camera-id
    Specifies the ID of the camera device. It can be assigned starting from 0, and is used as a parameter in APIs that require a camera ID. For devices that support /dev/videoN, the value of N can be used as the ID.
    source<N>-capture-format
    YUV420
    Specifies the capture format supported by the camera image sensor.
    source<N>-capture-buffers
    3
    Specifies the number of capture buffers for the camera image sensor.
    source<N>-fps
    30
    Specifies the FPS of the camera image sensor. This may not be supported depending on the device.
    source<N>-loc
    front
     
    Specifies the location where the camera device is attached. It can be set to one of the following values: front, rear, left, right, center, or any.
    source<N>-capture-resolution
    1080p
    Specifies the capture size of the camera device image sensor. It can be set to one of the following values: 2160p, 1440p, 1080p, 720p, 720i, 480p, or 480i.
    source<N>-capture-width
     
    Specifies the capture width of the camera device image sensor. This can be used instead of capture-resolution.
    source<N>-capture-height
     
    Specifies the capture height of the camera device image sensor. This can be used instead of capture-resolution.
    source<N>-subchannel-width
     
    Specifies the sub-image width if the camera device supports generating sub-images.
    source<N>-subchannel-height
     
    Specifies the sub-image height if the camera device supports generating sub-images.
    source<N>-subchannel-rotation
    0
     
    Specifies the rotation angle if the camera device supports generating sub-images. This may not be supported depending on the device. It can be set to one of the following values: 0, 90, 180, or 270.

    Note

    At least one of capture-resolution, capture-width, or capture-height must be specified. If they are specified together, the capture-resolution value takes precedence.

    The capture format values corresponding to V4L2_PIX_FMT are as follows:

    V4L2_PIX_FMT Value source-capture-format
    V4L2_PIX_FMT_YUYV YUYV
    V4L2_PIX_FMT_YVYU YVYU
    V4L2_PIX_FMT_UYVY UYVY
    V4L2_PIX_FMT_VYUY VYUY
    V4L2_PIX_FMT_NV16 NV16
    V4L2_PIX_FMT_NV12 NV12
    V4L2_PIX_FMT_NV12M NV12M
    V4L2_PIX_FMT_NV21 NV21
    V4L2_PIX_FMT_P010 P010
    V4L2_PIX_FMT_P010M P010M
    V4L2_PIX_FMT_YVU420 YVU420
    V4L2_PIX_FMT_YUV420 YUV420
    V4L2_PIX_FMT_YVU420M YVU420M
    V4L2_PIX_FMT_YUV420M YUV420M
    V4L2_PIX_FMT_YUV422M YUV422M
    V4L2_PIX_FMT_YUV444M YUV444M
    V4L2_PIX_FMT_ABGR32 ABGR32
    V4L2_PIX_FMT_BGR32 BGR4
    V4L2_PIX_FMT_RGB32 RGB4
    V4L2_PIX_FMT_XBGR32 XBGR32
    V4L2_PIX_FMT_ARGB32 ARGB32
    V4L2_PIX_FMT_XRGB32 XRGB32
    V4L2_PIX_FMT_GREY GREY
    V4L2_PIX_FMT_MJPEG MJPEG
    V4L2_PIX_FMT_H264 H264
    V4L2_PIX_FMT_H265 H265
    V4L2_PIX_FMT_VP8 VP8
    V4L2_PIX_FMT_VP9 VP9
    V4L2_PIX_FMT_SBGGR8 SBGGR8
    V4L2_PIX_FMT_SGBRG8 SGBRG8
    V4L2_PIX_FMT_SGRBG8 SGRBG8
    V4L2_PIX_FMT_SRGGB8 SRGGB8
    V4L2_PIX_FMT_SBGGR10 SBGGR10
    V4L2_PIX_FMT_SGBRG10 SGBRG10
    V4L2_PIX_FMT_SGRBG10 SGRBG10
    V4L2_PIX_FMT_SRGGB10 SRGGB10
    V4L2_PIX_FMT_SBGGR10P SBGGR10P
    V4L2_PIX_FMT_SGBRG10P SGBRG10P
    V4L2_PIX_FMT_SGRBG10P SGRBG10P
    V4L2_PIX_FMT_SRGGB10P SRGGB10P
    V4L2_PIX_FMT_SBGGR12 SBGGR12
    V4L2_PIX_FMT_SGBRG12 SGBRG12
    V4L2_PIX_FMT_SGRBG12 SGRBG12
    V4L2_PIX_FMT_SRGGB12 SRGGB12
    V4L2_PIX_FMT_SBGGR12P SBGGR12P
    V4L2_PIX_FMT_SGBRG12P SGBRG12P
    V4L2_PIX_FMT_SGRBG12P SGRBG12P
    V4L2_PIX_FMT_SRGGB12P SRGGB12P
    V4L2_PIX_FMT_SBGGR16 SBGGR16
    V4L2_PIX_FMT_SGBRG16 SGBRG16
    V4L2_PIX_FMT_SGRBG16 SGRBG16
    V4L2_PIX_FMT_SRGGB16 SRGGB16

    The additional key-value map applied to the AllWinner chipset is as follows:

    Key
    Default
    M
    Description
    source<N>-isp-id
    -1
     
    Specifies the ISP device ID to bind to the camera device.
    source<N>-isp-wdr-mode
    0
     
    Specifies the ISP Wide Dynamic Range (WDR) mode. It can be set to one of the following values: "0" for Normal, "1" for DOL, or "2" for Companding.

    The additional key-value map applied to the KL730 chipset is as follows:

    Key
    Default
    M
    Description
    source<N>-sensor-config
    The folder path for the camera device's sensor config.
    source<N>-autoscene-config
    The folder path for the camera device's autoscene config.
    source<N>-resource-dir
    The folder path for the camera device's resource directory.

    The additional key-value map applied to the RaspberryPi chipset is as follows:

    Key
    Default
    M
    Description
    source<N>-hflip
    0
     
    Applies a horizontal flip to the camera device video stream.
    source<N>-vflip
    0
     
    Applies a vertical flip to the camera device video stream.

    Examples#

    Below is an example of registering a camera device on a KL730 chipset after calling oasis::initialize.

    oasis::key_value_map_t parameters;
    
    parameters["source-count"] = "1";
    
    parameters["source1-camera-id"] = "0";
    parameters["source1-isp-id"] = "0";
    parameters["source1-isp-wdr-mode"] = "0";
    parameters["source1-capture-format"] = "YUV420";
    parameters["source1-capture-buffers"] = "5";
    parameters["source1-fps"] = "30";
    parameters["source1-subchannel-rotation"] = "0";
    parameters["source1-loc"] = "front";
    parameters["source1-capture-resolution"] = "1080p";
    parameters["source1-sensor-config"] = "./Resource_tp2863/VIC/0/tp2863_1920x1080_ch0.cfg";
    parameters["source1-autoscene-config"] = "./Resource_tp2863/AutoScene/autoscene_conf.cfg";
    parameters["source1-resource-dir"] = "./Resource_tp2863/";
    
    oasis::configCameras(parameters);
    

    Below is an example of registering a camera device on an AllWinner chipset after calling oasis::initialize.

    oasis::key_value_map_t parameters;
    
    parameters["source-count"] = "1";
    
    parameters["source1-camera-id"] = "0";
    parameters["source1-isp-id"] = "0";
    parameters["source1-isp-wdr-mode"] = "1";
    parameters["source1-capture-buffers"] = "5";
    parameters["source1-fps"] = "30";
    parameters["source1-subchannel-rotation"] = "0";
    parameters["source1-loc"] = "front";
    parameters["source1-capture-resolution"] = "2160p";
    
    oasis::configCameras(parameters);