Skip to content

Commit

Permalink
v4l2: Implement exynos_v4l2_prepare
Browse files Browse the repository at this point in the history
This is needed for recent Samsung camera HALs.

Change-Id: I800b1aca043bf80d0c60edeba33de19df84ea8cb
  • Loading branch information
raymanfx committed Aug 14, 2017
1 parent 7b67ee6 commit 0bc62e7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/exynos_v4l2.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ int exynos_v4l2_s_parm(int fd, struct v4l2_streamparm *streamparm);
int exynos_v4l2_g_ext_ctrl(int fd, struct v4l2_ext_controls *ctrl);
/*! \ingroup exynos_v4l2 */
int exynos_v4l2_s_ext_ctrl(int fd, struct v4l2_ext_controls *ctrl);
/*! \ingroup exynos_v4l2 */
int exynos_v4l2_prepare(int fd, struct v4l2_buffer *buf);

/* V4L2_SUBDEV */
#include <linux/v4l2-subdev.h>
Expand Down
25 changes: 25 additions & 0 deletions libv4l2/exynos_v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,3 +866,28 @@ int exynos_v4l2_s_ext_ctrl(int fd, struct v4l2_ext_controls *ctrl)

return ret;
}

int exynos_v4l2_prepare(int fd, struct v4l2_buffer *buf)
{
int ret = -1;

Exynos_v4l2_In();

if (fd < 0) {
ALOGE("%s: invalid fd: %d", __func__, fd);
return ret;
}

if (!buf) {
ALOGE("%s: buf is NULL", __func__);
return ret;
}

ret = ioctl(fd, VIDIOC_PREPARE_BUF, buf);
if (ret)
ALOGE("failed to ioctl: VIDIOC_PREPARE_BUF (%d - %s)", errno, strerror(errno));

Exynos_v4l2_Out();

return ret;
}

0 comments on commit 0bc62e7

Please sign in to comment.