summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--v3/EmulatedFakeCamera3.cpp51
-rw-r--r--v3/EmulatedFakeCamera3.h5
-rw-r--r--v3/fake-pipeline2/Sensor.cpp80
-rw-r--r--v3/fake-pipeline2/Sensor.h8
-rw-r--r--v3/fake-pipeline2/camera_hw.cpp14
-rw-r--r--[-rwxr-xr-x]v3/fake-pipeline2/camera_hw.h2
6 files changed, 122 insertions, 38 deletions
diff --git a/v3/fake-pipeline2/camera_hw.cpp b/v3/fake-pipeline2/camera_hw.cpp
index ec74667..6ea014c 100644
--- a/v3/fake-pipeline2/camera_hw.cpp
+++ b/v3/fake-pipeline2/camera_hw.cpp
@@ -205,7 +205,7 @@ int releasebuf_and_stop_capturing(struct VideoInfo *vinfo)
DBG_LOGB("VIDIOC_STREAMOFF, errno=%d", errno);
res = -1;
}
- if (vinfo->dev_status == -1) {
+ if (!vinfo->preview.buf.length) {
vinfo->preview.buf.length = vinfo->tempbuflen;
}
for (i = 0; i < (int)vinfo->preview.rb.count; ++i) {
@@ -291,8 +291,16 @@ int putback_frame(struct VideoInfo *vinfo)
if (vinfo->dev_status == -1)
return 0;
- if (ioctl(vinfo->fd, VIDIOC_QBUF, &vinfo->preview.buf) < 0)
- DBG_LOGB("QBUF failed error=%d\n", errno);
+ if (!vinfo->preview.buf.length) {
+ vinfo->preview.buf.length = vinfo->tempbuflen;
+ }
+
+ if (ioctl(vinfo->fd, VIDIOC_QBUF, &vinfo->preview.buf) < 0) {
+ DBG_LOGB("QBUF failed error=%d\n", errno);
+ if (errno == ENODEV) {
+ set_device_status(vinfo);
+ }
+ }
return 0;
}