summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2020-07-16 16:52:10 +0100
committerAlastair Poole <netstar@gmail.com>2020-07-16 16:52:10 +0100
commitb6dae6649a14b2ec690e02fdffb9ccbd01cb1157 (patch)
treeca550db7d9131a87f18a0e8e1b04dfde90e1b5d5
parent110e3ddc843603ba3ac769c85b2647b15affdccf (diff)
fix: that wasn't right
-rw-r--r--README.md3
-rw-r--r--cam.c20
-rw-r--r--vid.c13
3 files changed, 6 insertions, 30 deletions
diff --git a/README.md b/README.md
index 045480e..730027f 100644
--- a/README.md
+++ b/README.md
@@ -9,4 +9,5 @@ EFL on OpenBSD. See https://enlightenment.org.
Yes, OpenBSD and EFL and Enlightenment is a viable choice on arm64 and
amd64 etc for all sorts of projects.
-Testing this on rpi4 (arm64).
+
+
diff --git a/cam.c b/cam.c
index 569859d..ce0eab1 100644
--- a/cam.c
+++ b/cam.c
@@ -167,12 +167,7 @@ mmap_camera(int fd, int w, int h)
borked("mmap");
}
}
-#if defined(__linux__)
- if (ioctl(fd, VIDIOC_QBUF, &buf)) {
- fprintf(stderr, "VIDIOC_QBUF\n");
- exit(1);
- }
-#else
+
for (i = 0; i < req.count; i++) {
memset(&buf, 0, sizeof(buf));
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
@@ -183,7 +178,7 @@ mmap_camera(int fd, int w, int h)
borked("VIDIOC_QBUF");
}
}
-#endif
+
if (ioctl(fd, VIDIOC_STREAMON, &type) == -1) {
borked("VIDIOC_STREAMON");
}
@@ -231,15 +226,8 @@ mmap_camera(int fd, int w, int h)
save_photo(out, w, h);
count++;
- for (i = 0; i < req.count; i++) {
- memset(&buf, 0, sizeof(buf));
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- buf.memory = V4L2_MEMORY_MMAP;
- buf.index = i;
-
- if (ioctl(fd, VIDIOC_QBUF, &buf) == -1) {
- borked("VIDIOC_QBUF");
- }
+ if (ioctl(fd, VIDIOC_QBUF, &buf) == -1) {
+ borked("VIDIOC_QBUF");
}
}
diff --git a/vid.c b/vid.c
index 2b8b41c..e645764 100644
--- a/vid.c
+++ b/vid.c
@@ -249,24 +249,11 @@ mmap_camera(Cam *cam)
ecore_thread_feedback(cam->thread, cam);
count++;
-#if defined(__linux__)
if (ioctl(fd, VIDIOC_QBUF, &buf)) {
fprintf(stderr, "VIDIOC_QBUF\n");
exit(1);
}
-#else
- for (i = 0; i < req.count; i++) {
- memset(&buf, 0, sizeof(buf));
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- buf.memory = V4L2_MEMORY_MMAP;
- buf.index = i;
- if (ioctl(fd, VIDIOC_QBUF, &buf) == -1) {
- fprintf(stderr, "VIDIOC_QBUF\n");
- exit(1);
- }
- }
-#endif
if (ecore_thread_check(cam->thread)) break;
}