diff options
author | Rakesh Movva <r-movva@ti.com> | 2015-05-19 20:41:11 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@DLEZVX23.itg.ti.com> | 2015-05-22 10:39:39 -0500 |
commit | ce80588f9502200532a98a2e1298a810cee26d53 (patch) | |
tree | 9dc0a5e52dabdf314aa95f9604191ae6316afbcb | |
parent | 42d4731c437bcd2c933c161093ee53747e23e580 (diff) | |
download | dra7xx-ce80588f9502200532a98a2e1298a810cee26d53.tar.gz |
CameraHal: Set right parameters for VIDIOC_S_FMT
Buffer allocation needs to be done based on the sensor capabilities.
If the capture source is an interlaced format the height parameter
should be divided by 2.
Change-Id: Ia95be650247accf2bf64ca35d1dc0ffdcffde998
Signed-off-by: Rakesh Movva <r-movva@ti.com>
-rw-r--r-- | camera/V4LCameraAdapter/V4LCameraAdapter.cpp | 2 | ||||
-rw-r--r-- | camera/V4LCameraAdapter/V4LM2M.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/camera/V4LCameraAdapter/V4LCameraAdapter.cpp b/camera/V4LCameraAdapter/V4LCameraAdapter.cpp index bf8e5f1..3ece9ff 100644 --- a/camera/V4LCameraAdapter/V4LCameraAdapter.cpp +++ b/camera/V4LCameraAdapter/V4LCameraAdapter.cpp @@ -323,7 +323,7 @@ status_t V4LCameraAdapter::v4lSetFormat (int width, int height, uint32_t pix_for mVideoInfo->format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; mVideoInfo->format.fmt.pix.width = width; - mVideoInfo->format.fmt.pix.height = height; + mVideoInfo->format.fmt.pix.height = (mVideoInfo->format.fmt.pix.field == V4L2_FIELD_ALTERNATE) ? height/2 : height; mVideoInfo->format.fmt.pix.pixelformat = pix_format; mDeinterlaceEnabled = (mVideoInfo->format.fmt.pix.field == V4L2_FIELD_NONE) ? 0 : 1; diff --git a/camera/V4LCameraAdapter/V4LM2M.cpp b/camera/V4LCameraAdapter/V4LM2M.cpp index eaa2e36..493cf6d 100644 --- a/camera/V4LCameraAdapter/V4LM2M.cpp +++ b/camera/V4LCameraAdapter/V4LM2M.cpp @@ -518,8 +518,8 @@ int processFrame( interlace = dei; translen = translen; -// if (interlace) -// srcHeight /=2; + if (interlace) + srcHeight /=2; if (!streaming && init_queued_count==0) { describeFormat (srcFmt, srcWidth, srcHeight, &srcSize, &srcFourcc, &src_coplanar, &src_colorspace); |