diff options
Diffstat (limited to 'v4l2-apps')
-rw-r--r-- | v4l2-apps/test/capture_example.c | 15 | ||||
-rw-r--r-- | v4l2-apps/util/v4l2-ctl.cpp | 3 |
2 files changed, 10 insertions, 8 deletions
diff --git a/v4l2-apps/test/capture_example.c b/v4l2-apps/test/capture_example.c index b2260b05f..7e967e891 100644 --- a/v4l2-apps/test/capture_example.c +++ b/v4l2-apps/test/capture_example.c @@ -68,11 +68,11 @@ static int xioctl(int fh, int request, void *arg) static void process_image(const void *p, int size) { - if (!out_buf) - fputc('.', stdout); - else + if (out_buf) fwrite(p, size, 1, stdout); + fflush(stderr); + fprintf(stderr, "."); fflush(stdout); } @@ -125,7 +125,7 @@ static int read_frame(void) assert(buf.index < n_buffers); - process_image(buffers[buf.index].start, buffers[buf.index].length); + process_image(buffers[buf.index].start, buf.bytesused); if (-1 == xioctl(fd, VIDIOC_QBUF, &buf)) errno_exit("VIDIOC_QBUF"); @@ -160,7 +160,7 @@ static int read_frame(void) assert(i < n_buffers); - process_image((void *) buf.m.userptr, buf.length); + process_image((void *) buf.m.userptr, buf.bytesused); if (-1 == xioctl(fd, VIDIOC_QBUF, &buf)) errno_exit("VIDIOC_QBUF"); @@ -571,7 +571,7 @@ static void usage(FILE *fp, int argc, char **argv) fprintf(fp, "Usage: %s [options]\n\n" "Options:\n" - "-d | --device name Video device name [/dev/video]\n" + "-d | --device name Video device name [/dev/video0]\n" "-h | --help Print this message\n" "-m | --mmap Use memory mapped buffers\n" "-r | --read Use read() calls\n" @@ -596,7 +596,7 @@ long_options [] = { int main(int argc, char **argv) { - dev_name = "/dev/video"; + dev_name = "/dev/video0"; for (;;) { int idx; @@ -650,5 +650,6 @@ int main(int argc, char **argv) stop_capturing(); uninit_device(); close_device(); + fprintf(stderr, "\n"); return 0; } diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp index 41946978a..5d70ed9f3 100644 --- a/v4l2-apps/util/v4l2-ctl.cpp +++ b/v4l2-apps/util/v4l2-ctl.cpp @@ -1997,6 +1997,7 @@ int main(int argc, char **argv) memset(&vt, 0, sizeof(struct v4l2_tuner)); if (doioctl(fd, VIDIOC_G_TUNER, &vt, "VIDIOC_G_TUNER") == 0) { printf("Tuner:\n"); + printf("\tName : %s\n", vt.name); printf("\tCapabilities : %s\n", tcap2s(vt.capability).c_str()); if (vt.capability & V4L2_TUNER_CAP_LOW) printf("\tFrequency range : %.1f MHz - %.1f MHz\n", @@ -2004,7 +2005,7 @@ int main(int argc, char **argv) else printf("\tFrequency range : %.1f MHz - %.1f MHz\n", vt.rangelow / 16.0, vt.rangehigh / 16.0); - printf("\tSignal strength : %d%%\n", (int)(vt.signal / 655.35)); + printf("\tSignal strength/AFC : %d%%/%d\n", (int)(vt.signal / 655.35), vt.afc); printf("\tCurrent audio mode : %s\n", audmode2s(vt.audmode)); printf("\tAvailable subchannels: %s\n", rxsubchans2s(vt.rxsubchans).c_str()); |