AnsweredAssumed Answered

How to port a raw RGB camera sensor to i.MX6 BSP

Question asked by Bruce Cheng on Feb 19, 2014
Latest reply on Nov 30, 2017 by aravinthkumar jayaprakasam
Branched to a new discussion

High quality camera sensors usually output only raw RGB(Bayer pattern) data.

But FSL camera HAL can only preview HAL_PIXEL_FORMAT_YCbCr_420_SP format, which is supported by IPU and VPU both(see below codes in BSP).


void DeviceAdapter::setPreviewPixelFormat()


    int vpuFormats[MAX_VPU_SUPPORT_FORMAT];

    memset(vpuFormats, 0, sizeof(vpuFormats));

    int ret = mMetadaManager->getSupportedRecordingFormat(&vpuFormats[0],


    if (ret != NO_ERROR) {

        FLOGE("getSupportedRecordingFormat failed");

        mPreviewPixelFormat = HAL_PIXEL_FORMAT_YCbCr_420_SP;



    mPreviewPixelFormat = getMatchFormat(vpuFormats, MAX_VPU_SUPPORT_FORMAT,

                          mAvailableFormats, MAX_SENSOR_FORMAT);



How to modify the camera HALL to preview this type of sensor data?