author | Guosong Zhou <guosong.zhou@amlogic.com> | 2017-04-01 12:29:41 (GMT) |
---|---|---|
committer | Guosong Zhou <guosong.zhou@amlogic.com> | 2017-04-01 12:29:41 (GMT) |
commit | a3e35871ec394897ece9c5c1520e70b9d968b20e (patch) | |
tree | 335f4d58f9fbed717943433e9fcb8def75e1ea79 | |
parent | 8db828db7f121bcee01fc52c651a0504a5f8b394 (diff) | |
download | camera-a3e35871ec394897ece9c5c1520e70b9d968b20e.zip camera-a3e35871ec394897ece9c5c1520e70b9d968b20e.tar.gz camera-a3e35871ec394897ece9c5c1520e70b9d968b20e.tar.bz2 |
PD#141268: camera: fix ATV camera cts
Change-Id: I46f898ed24dd2b87bad6b22426471d87bd20508b
Signed-off-by: Guosong Zhou <guosong.zhou@amlogic.com>
-rw-r--r-- | v3/fake-pipeline2/Sensor.cpp | 5 | ||||
-rw-r--r-- | v3/fake-pipeline2/camera_hw.cpp | 16 |
2 files changed, 16 insertions, 5 deletions
diff --git a/v3/fake-pipeline2/Sensor.cpp b/v3/fake-pipeline2/Sensor.cpp index f8660de..73c3c9a 100644 --- a/v3/fake-pipeline2/Sensor.cpp +++ b/v3/fake-pipeline2/Sensor.cpp @@ -554,6 +554,11 @@ int Sensor::getZoom(int *zoomMin, int *zoomMax, int *zoomStep) *zoomStep = 1; CAMHAL_LOGDB("%s: Can't get zoom level!\n", __FUNCTION__); } else { + if ((qc.step != 0) && (qc.minimum != 0) && + ((qc.minimum/qc.step) > (qc.maximum/qc.minimum))) { + DBG_LOGA("adjust zoom step. \n"); + qc.step = (qc.minimum * qc.step); + } *zoomMin = qc.minimum; *zoomMax = qc.maximum; *zoomStep = qc.step; diff --git a/v3/fake-pipeline2/camera_hw.cpp b/v3/fake-pipeline2/camera_hw.cpp index 6ea014c..13a6826 100644 --- a/v3/fake-pipeline2/camera_hw.cpp +++ b/v3/fake-pipeline2/camera_hw.cpp @@ -158,8 +158,11 @@ int start_capturing(struct VideoInfo *vinfo) } type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (ioctl(vinfo->fd, VIDIOC_STREAMON, &type) < 0) - DBG_LOGB("VIDIOC_STREAMON, errno=%d\n", errno); + if ((vinfo->preview.format.fmt.pix.width != 0) && + (vinfo->preview.format.fmt.pix.height != 0)) { + if (ioctl(vinfo->fd, VIDIOC_STREAMON, &type) < 0) + DBG_LOGB("VIDIOC_STREAMON, errno=%d\n", errno); + } vinfo->isStreaming = true; return 0; @@ -201,9 +204,12 @@ int releasebuf_and_stop_capturing(struct VideoInfo *vinfo) return -1; type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (ioctl(vinfo->fd, VIDIOC_STREAMOFF, &type) < 0) { - DBG_LOGB("VIDIOC_STREAMOFF, errno=%d", errno); - res = -1; + if ((vinfo->preview.format.fmt.pix.width != 0) && + (vinfo->preview.format.fmt.pix.height != 0)) { + if (ioctl(vinfo->fd, VIDIOC_STREAMOFF, &type) < 0) { + DBG_LOGB("VIDIOC_STREAMOFF, errno=%d", errno); + res = -1; + } } if (!vinfo->preview.buf.length) { vinfo->preview.buf.length = vinfo->tempbuflen; |