static CSC_ERRORCODE conv_hw(
    CSC_HANDLE *handle)
{
    CSC_ERRORCODE ret = CSC_ErrorNone;
    switch (handle->csc_hw_type) {
#ifdef ENABLE_FIMC
    case CSC_HW_TYPE_FIMC:
        if (exynos_fimc_convert(handle->csc_hw_handle) != 0) {
            ALOGE("%s:: exynos_fimc_convert() fail", __func__);
            ret = CSC_Error;
        }
        break;
#endif
#ifdef ENABLE_GSCALER
    case CSC_HW_TYPE_GSCALER:
        if (exynos_gsc_convert(handle->csc_hw_handle) != 0) {
            ALOGE("%s:: exynos_gsc_convert() fail", __func__);
            ret = CSC_Error;
        }
        break;
#endif
    default:
        ALOGE("%s:: unsupported csc_hw_type(%d)", __func__, handle->csc_hw_type);
        ret = CSC_ErrorNotImplemented;
        break;
    }

    return ret;
}
Esempio n. 2
0
static CSC_ERRORCODE conv_hw(
    CSC_HANDLE *handle)
{
    CSC_ERRORCODE ret = CSC_ErrorNone;
    switch (handle->csc_hw_type) {
#ifdef ENABLE_FIMC
    case CSC_HW_TYPE_FIMC:
    {
        void *src_addr[3];
        void *dst_addr[3];
        OMX_COLOR_FORMATTYPE src_omx_format;
        OMX_COLOR_FORMATTYPE dst_omx_format;
        src_addr[0] = handle->src_buffer.planes[CSC_Y_PLANE];
        src_addr[1] = handle->src_buffer.planes[CSC_UV_PLANE];
        dst_addr[0] = handle->dst_buffer.planes[CSC_Y_PLANE];
        dst_addr[1] = handle->dst_buffer.planes[CSC_U_PLANE];
        dst_addr[2] = handle->dst_buffer.planes[CSC_V_PLANE];
        src_omx_format = hal_2_omx_pixel_format(handle->src_format.color_format);
        dst_omx_format = hal_2_omx_pixel_format(handle->dst_format.color_format);
        csc_hwconverter_convert_nv12t(
            handle->csc_hw_handle,
            dst_addr,
            src_addr,
            handle->dst_format.width,
            handle->dst_format.height,
            dst_omx_format,
            src_omx_format);
        break;
    }
#endif
#ifdef ENABLE_GSCALER
    case CSC_HW_TYPE_GSCALER:
        if (exynos_gsc_convert(handle->csc_hw_handle) != 0) {
            ALOGE("%s:: exynos_gsc_convert() fail", __func__);
            ret = CSC_Error;
        }
        break;
#endif
    default:
        ALOGE("%s:: unsupported csc_hw_type(%d)", __func__, handle->csc_hw_type);
        ret = CSC_ErrorNotImplemented;
        break;
    }

    return ret;
}
static CSC_ERRORCODE conv_hw(
    CSC_HANDLE *handle)
{
    CSC_ERRORCODE ret = CSC_ErrorNone;
    switch (handle->csc_hw_type) {
#ifdef ENABLE_FIMC
    case CSC_HW_TYPE_FIMC:
    {
        void *src_addr[3];
        void *dst_addr[3];
        OMX_COLOR_FORMATTYPE src_omx_format;
        OMX_COLOR_FORMATTYPE dst_omx_format;
        src_addr[0] = handle->src_buffer.planes[CSC_Y_PLANE];
        src_addr[1] = handle->src_buffer.planes[CSC_UV_PLANE];
        dst_addr[0] = handle->dst_buffer.planes[CSC_Y_PLANE];
        dst_addr[1] = handle->dst_buffer.planes[CSC_U_PLANE];
        dst_addr[2] = handle->dst_buffer.planes[CSC_V_PLANE];
        src_omx_format = hal_2_omx_pixel_format(handle->src_format.color_format);
        dst_omx_format = hal_2_omx_pixel_format(handle->dst_format.color_format);
        csc_hwconverter_convert_nv12t(
            handle->csc_hw_handle,
            dst_addr,
            src_addr,
            handle->dst_format.width,
            handle->dst_format.height,
            dst_omx_format,
            src_omx_format);
        break;
    }
#endif
#ifdef ENABLE_GSCALER
    case CSC_HW_TYPE_GSCALER:
        if (exynos_gsc_convert(handle->csc_hw_handle) != 0) {
            ALOGE("%s:: exynos_gsc_convert() fail", __func__);
            ret = CSC_Error;
        }
        break;
#endif
#ifdef ENABLE_G2D
    case CSC_HW_TYPE_G2D:
    {
        g2d_data *g2d = (g2d_data *)handle->csc_hw_handle;
        struct fimg2d_blit blit;
        int err;

        memset(&blit, 0, sizeof(blit));
        blit.op = BLIT_OP_SRC_COPY;
        blit.param.g_alpha = 0xFF;
        blit.src = &g2d->src;
        blit.dst = &g2d->dst;
        blit.sync = BLIT_SYNC;

        err = ioctl(g2d->fd, FIMG2D_BITBLT_BLIT, &blit);
        if (err < 0) {
            ALOGE("FIMG2D_BITBLT_BLIT ioctl failed: %s", strerror(errno));
            ret = CSC_Error;
        }

        break;
    }
#endif
    default:
        ALOGE("%s:: unsupported csc_hw_type(%d)", __func__, handle->csc_hw_type);
        ret = CSC_ErrorNotImplemented;
        break;
    }

    return ret;
}