int v4l2_overlay_set_position(int fd, int32_t x, int32_t y, int32_t w, int32_t h)
{
    LOG_FUNCTION_NAME

    struct v4l2_format format;
    int ret;

     /* configure the src format pix */
    /* configure the dst v4l2_overlay window */
    format.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
    ret = v4l2_overlay_ioctl(fd, VIDIOC_G_FMT, &format,
                             "get v4l2_overlay format");
    if (ret)
       return ret;
    LOGV("v4l2_overlay_set_position:: w=%d h=%d", format.fmt.win.w.width, format.fmt.win.w.height);

    if (mRotateOverlay) {
        w = 480;
        h = 800;
        x = 0;
        y = 0;
    }
    configure_window(&format.fmt.win, w, h, x, y);

    format.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
    ret = v4l2_overlay_ioctl(fd, VIDIOC_S_FMT, &format,
                             "set v4l2_overlay format");
    LOGV("v4l2_overlay_set_position:: w=%d h=%d", format.fmt.win.w.width, format.fmt.win.w.height);

    if (ret)
       return ret;
    v4l2_overlay_dump_state(fd);

    return 0;
}
Example #2
0
static void error(int fd, const char *msg)
{
    LOGE("Error = %s from %s", strerror(errno), msg);

#ifdef DEBUG_LIB_FIMC
    v4l2_overlay_dump_state(fd);
#endif
}
static void error(int fd, const char *msg)
{
  LOGE("Error = %s from %s. errno = %d", strerror(errno), msg, errno);
  v4l2_overlay_dump_state(fd);
}