diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-14 10:08:44 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-14 10:08:44 -0300 |
commit | 1f46467cd4eae4c11e8f91554679f10ac8b2da53 (patch) | |
tree | b3777305691d9cdebd7328c997690da89a7da764 /v4l2-apps/libv4l2util/v4l2_driver.c | |
parent | 91ca953d196882ae26470d29decfd7356151226c (diff) | |
download | mediapointer-dvb-s2-1f46467cd4eae4c11e8f91554679f10ac8b2da53.tar.gz mediapointer-dvb-s2-1f46467cd4eae4c11e8f91554679f10ac8b2da53.tar.bz2 |
Improve decode_tm6000 for better usage of mmap method
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Now, mmap method is the default, when reading from tm6000 V4L2 device.
Also, now, it is possible to specify the channel frequency via command
line, and the number of video buffers to be used.
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'v4l2-apps/libv4l2util/v4l2_driver.c')
-rw-r--r-- | v4l2-apps/libv4l2util/v4l2_driver.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/v4l2-apps/libv4l2util/v4l2_driver.c b/v4l2-apps/libv4l2util/v4l2_driver.c index 94f826968..919119b6a 100644 --- a/v4l2-apps/libv4l2util/v4l2_driver.c +++ b/v4l2-apps/libv4l2util/v4l2_driver.c @@ -646,6 +646,9 @@ int v4l2_mmap_bufs(struct v4l2_driver *drv, unsigned int num_buffers) return 0; } +/* Returns <0, if error, 0 if nothing to read and <size>, if something + read + */ int v4l2_rcvbuf(struct v4l2_driver *drv, v4l2_recebe_buffer *rec_buf) { int ret; @@ -668,7 +671,7 @@ int v4l2_rcvbuf(struct v4l2_driver *drv, v4l2_recebe_buffer *rec_buf) default: perror ("dqbuf"); - return errno; + return -errno; } } prt_buf_info("DQBUF",&buf); @@ -677,19 +680,18 @@ int v4l2_rcvbuf(struct v4l2_driver *drv, v4l2_recebe_buffer *rec_buf) ret = rec_buf (&buf,&drv->bufs[buf.index]); - if (ret) { + if (ret<0) { v4l2_free_bufs(drv); return ret; } if (-1 == xioctl (drv->fd, VIDIOC_QBUF, &buf)) { perror ("qbuf"); - return errno; + return -errno; } - return 0; + return ret; } - int v4l2_start_streaming(struct v4l2_driver *drv) { uint32_t i; |