platform/upstream/v4l-utils.git
10 years agoparse_dib0700.pl: parse the remaining messages on dib0700
Mauro Carvalho Chehab [Tue, 24 Jun 2014 17:28:10 +0000 (14:28 -0300)]
parse_dib0700.pl: parse the remaining messages on dib0700

Parse the remaining messages on dib0700, except for the newer
I2C read/write formats.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agocontrib: add a parser for dib0700
Mauro Carvalho Chehab [Tue, 24 Jun 2014 16:29:20 +0000 (13:29 -0300)]
contrib: add a parser for dib0700

Add an initial parser for dib0700. While here, change the file
permisions of contrib scripts to be executable.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoqv4l2: fix opengl support for RGB32/BGR32.
Hans Verkuil [Mon, 23 Jun 2014 14:14:54 +0000 (16:14 +0200)]
qv4l2: fix opengl support for RGB32/BGR32.

For whatever reason the GL_RGBA4 internal format was used instead of
GL_RGB8, so each color component was just 4 bits instead of 8.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2-qt3: remove utility
Hans Verkuil [Mon, 23 Jun 2014 07:33:53 +0000 (09:33 +0200)]
qv4l2-qt3: remove utility

qv4l2-qt3 has been superseded by qv4l2. Nobody uses Qt3 anymore and this
qt3 version of qv4l2 hasn't been maintained for a long time. Time to
retire it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4lgrab/vbi-test: remove these utilities
Hans Verkuil [Mon, 23 Jun 2014 07:32:06 +0000 (09:32 +0200)]
v4lgrab/vbi-test: remove these utilities

v4lgrab doesn't work anymore since the v4l1 compat layer has been
removed a long time ago.

vbi-test has been replaced by v4l2-ctl --get-fmt-vbi and serves no good
purpose anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agomedia-ctl: Pass a positive error value to strerror()
Laurent Pinchart [Sat, 21 Jun 2014 08:26:47 +0000 (10:26 +0200)]
media-ctl: Pass a positive error value to strerror()

Negative error values are passed to the strerror() function which takes
positive error value arguments. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agowip
Laurent Pinchart [Wed, 31 Jul 2013 22:58:52 +0000 (00:58 +0200)]
wip

10 years agoUpdate sync-with-kernel to use installed kernel headers
Laurent Pinchart [Tue, 3 Jun 2014 10:10:52 +0000 (12:10 +0200)]
Update sync-with-kernel to use installed kernel headers

Kernel headers exported to userspace can contain kernel-specific
statements (such as __user annotations) that are removed when installing
the headers with 'make headers_install' in the kernel sources. Only
those headers must be used by userspace, raw headers are private to the
kernel.

Update the sync-with-kernel make target to use the installed headers.
The user must install the kernel headers by running

make headers_install

in KERNEL_DIR prior to run sync-with-kernel.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agomedia-ctl: Add DV timings support
Laurent Pinchart [Fri, 31 Jan 2014 13:21:57 +0000 (14:21 +0100)]
media-ctl: Add DV timings support

Support printing (with -p) and setting (with --set-dv) DV timings at the
pad level.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agomedia-ctl: Move flags printing code to a new print_flags function
Laurent Pinchart [Tue, 4 Feb 2014 10:22:15 +0000 (11:22 +0100)]
media-ctl: Move flags printing code to a new print_flags function

This will allow reusing the flag printing code for the DV timings flags.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agomedia-ctl: libv4l2subdev: Add DV timings support
Laurent Pinchart [Mon, 2 Jun 2014 14:49:15 +0000 (16:49 +0200)]
media-ctl: libv4l2subdev: Add DV timings support

Expose the pad-level get caps, query, get and set DV timings ioctls.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agolibv4lconvert: Fix a regression when converting from Y10B
Antonio Ospite [Mon, 16 Jun 2014 15:00:41 +0000 (17:00 +0200)]
libv4lconvert: Fix a regression when converting from Y10B

Fix a regression introduced in commit
efc29f1764a30808ebf7b3e1d9bfa27b909bf641 (libv4lconvert: Reject too
short source buffer before accessing it).

The old code:

case V4L2_PIX_FMT_Y10BPACK:
...
if (result == 0 && src_size < (width * height * 10 / 8)) {
V4LCONVERT_ERR("short y10b data frame\n");
errno = EPIPE;
result = -1;
}
...

meant to say "If the conversion was *successful* _but_ the frame size
was invalid, then take the error path", but in
efc29f1764a30808ebf7b3e1d9bfa27b909bf641 this (maybe weird) logic was
misunderstood and v4lconvert_convert_pixfmt() was made to return an
error even in the case of a successful conversion from Y10B.

Drop the no longer needed second check to fix this.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Cc: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agov4l2-ctl: add support to try/set raw VBI formats
Hans Verkuil [Tue, 17 Jun 2014 11:09:33 +0000 (13:09 +0200)]
v4l2-ctl: add support to try/set raw VBI formats

This was the last bit of missing functionality from v4l2-ctl, now that
this is in the full V4L2 API functionality is available through v4l2-ctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibv4l2: release the lock before doing a DQBUF
Thiago Santos [Mon, 9 Jun 2014 13:51:56 +0000 (10:51 -0300)]
libv4l2: release the lock before doing a DQBUF

In blocking mode, if there are no buffers available the DQBUF will block
waiting for a QBUF to be called but it will block holding the streaming
lock which will prevent any QBUF from happening, causing a deadlock.

Signed-off-by: Thiago Santos <ts.santos@sisa.samsung.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: don't warn about missing frameintervals
Hans Verkuil [Fri, 13 Jun 2014 14:07:35 +0000 (16:07 +0200)]
v4l2-compliance: don't warn about missing frameintervals

Only warn about missing ENUM_FRAMEINTERVALS support for discrete
framesizes, not for stepwise or continuous. Those framesize types
can be used as well for video receivers where ENUM_FRAMEINTERVALS
may not make sense.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: add support for the V4L2_EVENT_SOURCE_CHANGE event.
Hans Verkuil [Fri, 13 Jun 2014 13:14:51 +0000 (15:14 +0200)]
qv4l2: add support for the V4L2_EVENT_SOURCE_CHANGE event.

Subscribe to the V4L2_EVENT_SOURCE_CHANGE event. When such an event
arrives for the current input the application will call QUERYSTD or
QUERY_DV_TIMINGS to update the standard/timings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: fix broken querymenu check.
Hans Verkuil [Thu, 12 Jun 2014 13:58:23 +0000 (15:58 +0200)]
v4l2-compliance: fix broken querymenu check.

QUERYMENU can also return -ENOTTY if it isn't implemented at all.
Allow for that.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agorc_keymaps: Add keymap for the remote shipped with the Wobo i5 tv box
Hans de Goede [Thu, 8 May 2014 19:28:27 +0000 (21:28 +0200)]
rc_keymaps: Add keymap for the remote shipped with the Wobo i5 tv box

The Wobo i5 is an allwinner based android tv box, with its own custom remote,
this adds a keymap for this remote (like all allwinner devices, the wobo i5
can run plain Linux).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agorc_keymaps: Add a keymap for the remote shipped with allwinner i12-a20 tv boxes
Hans de Goede [Thu, 8 May 2014 19:22:46 +0000 (21:22 +0200)]
rc_keymaps: Add a keymap for the remote shipped with allwinner i12-a20 tv boxes

This is an unbranded remote found with unbranded allwinner a20 based android
tv boxes, which are referred to as i12 tv boxes since the pcb is marked i12
(the i12 name is also used in u-boot and for the devicetree files).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agorc_keymaps: Add a keymap for the remote shipped with allwinner ba10 tv boxes
Hans de Goede [Thu, 8 May 2014 19:20:35 +0000 (21:20 +0200)]
rc_keymaps: Add a keymap for the remote shipped with allwinner ba10 tv boxes

This is an unbranded remote found with unbranded allwinner a10 based android
tv boxes, which are referred to as ba10 tv boxes since the pcb is marked ba10
(the ba10 name is also used in u-boot and for the devicetree files).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agolibdvbv5: Find other TS in NIT pointer fix
Rob Barker [Thu, 29 May 2014 15:20:53 +0000 (12:20 -0300)]
libdvbv5: Find other TS in NIT pointer fix

dvb_scan_add_entry() is modified to return the pointer to the newly
created entry (the last in the list), so the add_update_nit_ functions
now modify the correct element, instead of the penultimate one.  This
fixes the finding of other TS in NIT scan feature.

Signed-off-by: Rob Barker <robert.barker@redembedded.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodvb-file: Fix bandwidth handling at online write function
Mauro Carvalho Chehab [Wed, 4 Jun 2014 17:14:55 +0000 (14:14 -0300)]
dvb-file: Fix bandwidth handling at online write function

The conversion from bandwidth in Hz to bandwidth with the legacy
oneline files is wrong. It was always returning bandwidth auto,
instead of writing the proper values on it. Fix it.

Reported-by: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agomedia-ctl: Add fall through comment to fix Coverity warning
Laurent Pinchart [Tue, 3 Jun 2014 09:55:42 +0000 (11:55 +0200)]
media-ctl: Add fall through comment to fix Coverity warning

The -f case falls through the -V case during option parsing. This is
desired but result in a missing break statement warning from Coverity.
Fix it by adding a fall through comment.

Reported-by: Coverity Scan
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agomedia-ctl: Fix media device version printing
Laurent Pinchart [Tue, 3 Jun 2014 09:54:58 +0000 (11:54 +0200)]
media-ctl: Fix media device version printing

Extract the version major, minor and patch level version components by
shifting right, not left.

Reported-by: Coverity Scan
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agomedia-ctl: Fix off-by-one buffer overflow with readlink
Laurent Pinchart [Tue, 3 Jun 2014 09:53:23 +0000 (11:53 +0200)]
media-ctl: Fix off-by-one buffer overflow with readlink

readlink() returns the number of bytes written to the buffer, which can
be up to the passed buffer size, without including the terminating '\0'.
This causes an off-by-one overflow as we pass the total buffer length to
the function and then try to append a terminating '\0'.

Fix it by passing the buffer size minus one to readlink().

Reported-by: Coverity Scan
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agoqv4l2: fix segmentation fault when compiled without ALSA support.
Hans Verkuil [Tue, 3 Jun 2014 09:04:16 +0000 (11:04 +0200)]
qv4l2: fix segmentation fault when compiled without ALSA support.

If opening the video device fails, then qv4l2 attempts to disable
two alsa widgets. If qv4l2 was compiled without alsa support, then
those widget pointers are NULL and you get a segfault.

Add the proper #ifdef so this is only done if alsa support was
compiled in.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoSynced with latest kernel
Hans Verkuil [Tue, 3 Jun 2014 08:19:56 +0000 (10:19 +0200)]
Synced with latest kernel

This adds the missing v4l2-mediabus.h header.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoAdd missing v4l2-mediabus.h
Hans Verkuil [Tue, 3 Jun 2014 08:15:44 +0000 (10:15 +0200)]
Add missing v4l2-mediabus.h

This header should also be copied when syncing with the kernel.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agomedia-ctl: Update copyright years
Laurent Pinchart [Mon, 2 Jun 2014 14:28:12 +0000 (16:28 +0200)]
media-ctl: Update copyright years

We're well into 2014 and there no going back.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agomedia-ctl: Don't install libmediactl and libv4l2subdev
Laurent Pinchart [Sat, 31 May 2014 11:12:18 +0000 (13:12 +0200)]
media-ctl: Don't install libmediactl and libv4l2subdev

The libraries APIs are not deemed to be stable yet, don't install the
libraries. We must thus compile the two libraries statically to link
media-ctl accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agomedia-ctl: Always print the full help message
Laurent Pinchart [Sat, 31 May 2014 11:08:14 +0000 (13:08 +0200)]
media-ctl: Always print the full help message

The short help text isn't descriptive enough to be useful.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agomedia-ctl: Document the --links option argument
Laurent Pinchart [Fri, 30 May 2014 23:00:34 +0000 (01:00 +0200)]
media-ctl: Document the --links option argument

The --links option take a mandatory argument. Document it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agomedia-ctl: Remove the obsolete device argument from the help text
Laurent Pinchart [Fri, 30 May 2014 22:59:17 +0000 (00:59 +0200)]
media-ctl: Remove the obsolete device argument from the help text

The standalone device argument isn't supported anymore, remove it from
the documentation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agomedia-ctl: Rename source files
Laurent Pinchart [Fri, 30 May 2014 22:51:06 +0000 (00:51 +0200)]
media-ctl: Rename source files

Prefix the library files with lib and rename main.c to media-ctl.c.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agoImport the media-ctl utility and libraries
Laurent Pinchart [Fri, 30 May 2014 15:18:36 +0000 (17:18 +0200)]
Import the media-ctl utility and libraries

This corresponds to commit 114c1b274edc40e07e9b99a435d26438f5b99943
("Fix uninitialized pointer dereference in media_device_add_entity") in
the git://git.ideasonboard.org/media-ctl.git repository.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agoSynced with latest kernel.
Hans Verkuil [Mon, 26 May 2014 06:42:24 +0000 (08:42 +0200)]
Synced with latest kernel.

This syncs changes to VIDIOC_DV_TIMINGS_CAP and VIDIOC_DV_ENUM_TIMINGS.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibdvbv5: generate the correct include in dvb-v5.c
Hans Verkuil [Mon, 26 May 2014 06:39:35 +0000 (08:39 +0200)]
libdvbv5: generate the correct include in dvb-v5.c

When dvb-v5.c is generated the #include line is incorrect: instead
of including <libdvbv5/dvb-v5.h> it should include "dvb-v5.h".

Fixed.

An earlier patch patches the dvb-v5.c source, but since that is
regenerated by 'make sync-with-kernel' I had to change it in the
code that generates the source instead.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: add support V4L2_EVENT_SOURCE_CHANGE
Hans Verkuil [Sun, 25 May 2014 14:06:31 +0000 (16:06 +0200)]
v4l2-ctl: add support V4L2_EVENT_SOURCE_CHANGE

This new event was added, add support for it to v4l2-ctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibdvbv5: fix compile error
Hans Verkuil [Sun, 25 May 2014 14:04:55 +0000 (16:04 +0200)]
libdvbv5: fix compile error

Fix the following compile error:

dvb-v5.c:6:29: fatal error: libdvbv5/dvb-v5.h: No such file or directory

by using #include "dvb-v5.h", just like the other sources that include
this header.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agosync-with-kernel: update to latest kernel headers.
Hans Verkuil [Sun, 25 May 2014 13:42:27 +0000 (15:42 +0200)]
sync-with-kernel: update to latest kernel headers.

This syncs with the latest kernel code. In particular it adds support
for V4L2_EVENT_SOURCE_CHANGE.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibdvbv5: Fix the speedup scan condition
Mauro Carvalho Chehab [Fri, 2 May 2014 13:52:29 +0000 (06:52 -0700)]
libdvbv5: Fix the speedup scan condition

The DVB table read routine has 3 operational modes: it can seek for an
specific table section, it can expect sequential table sections, or it
can wait non-sequencial sections, stopping when a section is duplicated.

The second mode (sequencial table sections) finishes the reading after
receiving all table sections from 0 to the max table section, speeding
up its reception, while being more reliant to section errors.

However, the tests for the stop condition for this mode were wrong.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: don't override a parameter when setting lna
Mauro Carvalho Chehab [Wed, 23 Apr 2014 19:00:58 +0000 (16:00 -0300)]
libdvbv5: don't override a parameter when setting lna

We should not fill the parameters before setting LNA, as, otherwise,
the first property (typically frequency) would be overriden.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibv4lconvert: Gracefully handle unknown SE401 destination formats
Gregor Jasny [Wed, 23 Apr 2014 08:12:33 +0000 (10:12 +0200)]
libv4lconvert: Gracefully handle unknown SE401 destination formats

Detected by Coverity.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
CC: Hans de Goede <hdegoede@redhat.com>
10 years agolibv4lconvert: Error out if source or destination pointers are null
Gregor Jasny [Wed, 23 Apr 2014 08:07:17 +0000 (10:07 +0200)]
libv4lconvert: Error out if source or destination pointers are null

Detected by Coverity.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agodvbv5-zap: Always initialize status variable
Gregor Jasny [Wed, 23 Apr 2014 07:52:19 +0000 (09:52 +0200)]
dvbv5-zap: Always initialize status variable

In case of an early timeout it would be used uninitialized.

Detected by Coverity.

CC: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agodvbv5-zap: Close open file descriptor in error path
Gregor Jasny [Wed, 23 Apr 2014 07:48:20 +0000 (09:48 +0200)]
dvbv5-zap: Close open file descriptor in error path

Dectected by Coverity.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
CC: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agov4l2-ctl: Do not leak framebuffer handle in error paths
Gregor Jasny [Wed, 23 Apr 2014 07:28:46 +0000 (09:28 +0200)]
v4l2-ctl: Do not leak framebuffer handle in error paths

Detected by Coverity

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibdvbv5; Fix typo in MPEG TS print function
Gregor Jasny [Wed, 23 Apr 2014 06:46:41 +0000 (08:46 +0200)]
libdvbv5; Fix typo in MPEG TS print function

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agolibdvbv5: FIx check for available adaptation field
Gregor Jasny [Wed, 23 Apr 2014 06:43:09 +0000 (08:43 +0200)]
libdvbv5: FIx check for available adaptation field

The field is only a single bit wide, so applying a the
0x2 mask will never be true.

Detected by Coverity.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
CC: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibv4l2: decomress-helper: close fds then wait for helper to exit
Hans de Goede [Tue, 22 Apr 2014 09:38:39 +0000 (11:38 +0200)]
libv4l2: decomress-helper: close fds then wait for helper to exit

Killing the helper does not always work (as it inherits its parent sigmask),
instead of meddling with the sigmask simply close the fds and wait for the
helper to cleanly exit.

Reported-by: Волков Андрей <volkov.am@ekb-info.ru>
Tested-by: Волков Андрей <volkov.am@ekb-info.ru>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agolibv4lcontrol: Add Asus F3Sc with 04f2:b012 cam as upside down false positive
Hans de Goede [Sun, 2 Mar 2014 13:57:51 +0000 (14:57 +0100)]
libv4lcontrol: Add Asus F3Sc with 04f2:b012 cam as upside down false positive

Also see:
https://bugzilla.redhat.com/show_bug.cgi?id=844999

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agolibv4lcontrol: Check control_flags before doing wildcard maching on upside_down
Hans de Goede [Sun, 2 Mar 2014 13:55:36 +0000 (14:55 +0100)]
libv4lcontrol: Check control_flags before doing wildcard maching on upside_down

Check the more specific control_flags table before doing wildcard maching on
entries in the upside_down table, and if there is a match in the control_flags
table skip the upside_down table.

This way the control flags table can be used to override false positives caused
by the upside_down table wildcard matching.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agoRevert "libdvbv5: Change license to LGPL v2.1"
Mauro Carvalho Chehab [Thu, 17 Apr 2014 20:59:39 +0000 (17:59 -0300)]
Revert "libdvbv5: Change license to LGPL v2.1"

This patch was merged by mistake. The plan is to move the license
to LGPL, but I'm still waiting for some contributors to send their
ack.

So, for now, revert this change.

This reverts commit beb426496ca0e8fbed1b67eea56686e1b60381d7.

10 years agolibdvbv5: Remove two warnings on 32 bits compilation
Mauro Carvalho Chehab [Thu, 17 Apr 2014 20:07:29 +0000 (17:07 -0300)]
libdvbv5: Remove two warnings on 32 bits compilation

tables/mpeg_pes.c: In function 'dvb_mpeg_pes_print':
tables/mpeg_pes.c:129:4: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t' [-Wformat=]
    dvb_loginfo("   - pts                      %lx (%fs)", pes->optional->pts, (float) pes->optional->pts / 90000.0);
    ^
tables/mpeg_pes.c:131:4: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t' [-Wformat=]
    dvb_loginfo("   - dts                      %lx (%fs)", pes->optional->dts, (float) pes->optional->dts/ 90000.0);
    ^

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: improve DVB header handling
André Roth [Wed, 16 Apr 2014 21:22:10 +0000 (18:22 -0300)]
libdvbv5: improve DVB header handling

the table parsers now initialize the complete table,
and do no longer rely on an already initialized table
header in the supplied buffer.

adds section length checking in PAT as well.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Change license to LGPL v2.1
Mauro Carvalho Chehab [Wed, 16 Apr 2014 13:06:41 +0000 (10:06 -0300)]
libdvbv5: Change license to LGPL v2.1

Licensing it under LGPL allows its usage on more projects. This license
is required by some other Open Source projects, like Gstreamer.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: improve CRC size handling
André Roth [Tue, 15 Apr 2014 20:33:01 +0000 (17:33 -0300)]
libdvbv5: improve CRC size handling

- provide buffer without CRC to the table parsers
- remove unneeded defines

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: build dynamic libdvbv5 by default
André Roth [Tue, 15 Apr 2014 18:39:33 +0000 (15:39 -0300)]
libdvbv5: build dynamic libdvbv5 by default

- renamed ./configure option --enable-libdvbv5 to --disable-libdvbv5
- thus libdvbv5 will be build shared by default
- cleanups in configure.ac

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: short API description
André Roth [Tue, 15 Apr 2014 18:39:32 +0000 (15:39 -0300)]
libdvbv5: short API description

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: cleanup parser API
André Roth [Tue, 15 Apr 2014 18:39:31 +0000 (15:39 -0300)]
libdvbv5: cleanup parser API

- fix initialization of dvb_table_initializers
- check return value of dvb_desc_parse
- allocate table inside the parser
- remove unneeded table_length argument

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: move table parsers to separate directory
André Roth [Tue, 15 Apr 2014 18:39:30 +0000 (20:39 +0200)]
libdvbv5: move table parsers to separate directory

move the dvb table parsers from the descriptors/ directory
to tables/ to have a nice and clear separation.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodvb-zap: fix --search argument
Mauro Carvalho Chehab [Fri, 11 Apr 2014 21:35:16 +0000 (18:35 -0300)]
dvb-zap: fix --search argument

The search argument is used to filter the monitored traffic.
Also, it requires a string as argument.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodvbv5-zap: only open the DVR interface if outputing
Mauro Carvalho Chehab [Fri, 11 Apr 2014 21:27:48 +0000 (18:27 -0300)]
dvbv5-zap: only open the DVR interface if outputing

As other processes will be reading the dvr interface, we should
not open it, just announce that the dvr interface is ready.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodvbv5-zap: better implement the --record flag
Mauro Carvalho Chehab [Fri, 11 Apr 2014 21:17:05 +0000 (18:17 -0300)]
dvbv5-zap: better implement the --record flag

Instead of outputing to STDOUT, just keep the dvr file opened,
in order to let other applications to use it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodvbv5-zap: Make dvbv5 as the default format
Mauro Carvalho Chehab [Fri, 11 Apr 2014 20:39:48 +0000 (17:39 -0300)]
dvbv5-zap: Make dvbv5 as the default format

While doc says so, dvbv5-zap was always requiring the usage of
the -I argument. Fix it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodvbv5-zap: fix usage of --record without --output
Mauro Carvalho Chehab [Fri, 11 Apr 2014 20:19:31 +0000 (17:19 -0300)]
dvbv5-zap: fix usage of --record without --output

If --output is not specified, output data to STDOUT.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: fix the area code size on ISDB-T
Mauro Carvalho Chehab [Fri, 11 Apr 2014 18:49:05 +0000 (15:49 -0300)]
libdvbv5: fix the area code size on ISDB-T

The area code has 12 bits, and not 6, accordig with the
ABNT NBR 15603-2:2007 version3 of 2009.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: move ISDB-T frq conversion to the descriptors code
Mauro Carvalho Chehab [Fri, 11 Apr 2014 18:43:50 +0000 (15:43 -0300)]
libdvbv5: move ISDB-T frq conversion to the descriptors code

Instead of having this done on several places, just do it once,
at the code that parses the ISDB-T descriptor.

This is the same as the other descriptors do.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: fix ISDB-T frequency calculus on 32 bits machines
Mauro Carvalho Chehab [Fri, 11 Apr 2014 17:27:35 +0000 (10:27 -0700)]
libdvbv5: fix ISDB-T frequency calculus on 32 bits machines

On 32 bits, the frequency got truncated and become a negative
number. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@brisa.lan>
10 years agolibdvbv5: rename descriptor functions
André Roth [Wed, 9 Apr 2014 22:27:00 +0000 (19:27 -0300)]
libdvbv5: rename descriptor functions

prefix the descriptor functions with dvb_desc
for a nice API and code completion support

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: cleanup printing of tables and descriptors
André Roth [Wed, 9 Apr 2014 22:26:59 +0000 (19:26 -0300)]
libdvbv5: cleanup printing of tables and descriptors

- use log info for table and descpritor printing
- cleanup 'out of memory' logs
- fix error condition in desc_ts_info

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: cleanup table parsers
André Roth [Wed, 9 Apr 2014 22:26:58 +0000 (19:26 -0300)]
libdvbv5: cleanup table parsers

- make the code look similar
- check for correct table ID
- ignore null packets with ID 0x1fff
- return table length, or:
- return error code on error
- update / fix Copyrights

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: make dvb_table_filter_free public
André Roth [Wed, 9 Apr 2014 22:26:57 +0000 (19:26 -0300)]
libdvbv5: make dvb_table_filter_free public

make dvb_table_filter_free public so it can be used by
applications.
fix potential double free.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: make crc32 public
André Roth [Wed, 9 Apr 2014 22:26:56 +0000 (19:26 -0300)]
libdvbv5: make crc32 public

applications reading dvb files might want to
check crc, therefore provide the crc32 function
in the header files.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: fix asprintf compile warning in dvbv5-scan
André Roth [Wed, 9 Apr 2014 22:26:55 +0000 (19:26 -0300)]
libdvbv5: fix asprintf compile warning in dvbv5-scan

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: reunite atsc_table_header and dvb_table_header
André Roth [Wed, 9 Apr 2014 22:26:54 +0000 (19:26 -0300)]
libdvbv5: reunite atsc_table_header and dvb_table_header

this solves the ambiguity when parsing the dvb/atsc header
in dvb-scan.c

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agov4l2-compliance: don't do the global format test when using libv4l2.
Hans Verkuil [Wed, 9 Apr 2014 08:03:30 +0000 (10:03 +0200)]
v4l2-compliance: don't do the global format test when using libv4l2.

This test will fail when using the wrapper library as the wrapper
library does not see when another filehandle changes the format.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibv4lconvert: fix a v4l2-compliance error
Hans Verkuil [Wed, 9 Apr 2014 07:50:10 +0000 (09:50 +0200)]
libv4lconvert: fix a v4l2-compliance error

memset frmsize->reserved to 0.

fail: v4l2-test-formats.cpp(150): frmsize.reserved not zeroed

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoINSTALL: add cross compile and install procedures for Android
Hans-Christian Egtvedt [Thu, 10 Apr 2014 15:51:45 +0000 (17:51 +0200)]
INSTALL: add cross compile and install procedures for Android

This patch adds some words in the INSTALL file about how to cross
compile some utilities (compliance, ctl, and dbg) for Android and
install the on a device running Android.

Signed-off-by: Hans-Christian Egtvedt <hegtvedt@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-dbg: add Android.mk makefile
Hans-Christian Egtvedt [Thu, 10 Apr 2014 15:51:44 +0000 (17:51 +0200)]
v4l2-dbg: add Android.mk makefile

This Android.mk makefile is used by the Android build system to compile
and link the v4l2-dbg utility.

Signed-off-by: Hans-Christian Egtvedt <hegtvedt@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: add Android.mk makefile
Hans-Christian Egtvedt [Thu, 10 Apr 2014 15:51:43 +0000 (17:51 +0200)]
v4l2-ctl: add Android.mk makefile

This Android.mk makefile is used by the Android build system to compile
and link the v4l2-ctl utility.

Signed-off-by: Hans-Christian Egtvedt <hegtvedt@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: add Android.mk makefile
Hans-Christian Egtvedt [Thu, 10 Apr 2014 15:51:42 +0000 (17:51 +0200)]
v4l2-compliance: add Android.mk makefile

This Android.mk makefile is used by the Android build system to compile
and link the v4l2-compliance utility.

Signed-off-by: Hans-Christian Egtvedt <hegtvedt@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl/dbg: include android-config.h header file if ANDROID is set
Hans-Christian Egtvedt [Fri, 11 Apr 2014 14:39:24 +0000 (16:39 +0200)]
v4l2-ctl/dbg: include android-config.h header file if ANDROID is set

If the ANDROID symbol is defined, done by Android toolchain by default,
include the android-config.h header file instead of the autogenerated
config.h header file.

Android build system is completely different from autoconf and make, and
is not capable, without some hacks, to generate the config.h header
file.

Signed-off-by: Hans-Christian Egtvedt <hegtvedt@cisco.com>
[hans.verkuil@cisco.com: moved config(-android).h include to v4l2-ctl.h]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoAdd static configuration file for Android builds
Hans-Christian Egtvedt [Thu, 10 Apr 2014 15:51:40 +0000 (17:51 +0200)]
Add static configuration file for Android builds

This patch adds an android-config.h configuration file that matches the
Android toolchain configuration.

It also includes an implementation of getsubopt, with the strchrnul
dependency, since the Android toolchain does not provide this
functionality.

Signed-off-by: Hans-Christian Egtvedt <hegtvedt@cisco.com>
[hans.verkuil@cisco.com: made functions inline]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance/ctl: drop libv4l2 dependency if NO_LIBV4L2 is defined
Hans-Christian Egtvedt [Fri, 11 Apr 2014 14:26:26 +0000 (16:26 +0200)]
v4l2-compliance/ctl: drop libv4l2 dependency if NO_LIBV4L2 is defined

This patch introduces a check for a NO_LIBV4L2 symbol in v4l2-compliance
and v4l2-ctl, which, when defined, will let the utility be built without
linking with libv4l2.

The wrapper functionality libv4l2 provides is obviously lost when
building with NO_LIBV4L2 defined.

Signed-off-by: Hans-Christian Egtvedt <hegtvedt@cisco.com>
[hans.verkuil@cisco.com: modified to reduce number of #ifdefs]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: remove unnecessary inclusion of libv4l2.h
Hans-Christian Egtvedt [Thu, 10 Apr 2014 15:51:38 +0000 (17:51 +0200)]
v4l2-ctl: remove unnecessary inclusion of libv4l2.h

These files do not utilize anything from libv4l2.h, hence the include is
not needed.

Signed-off-by: Hans-Christian Egtvedt <hegtvedt@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix modulator frequency bugs
Hans Verkuil [Mon, 7 Apr 2014 10:07:30 +0000 (12:07 +0200)]
qv4l2: fix modulator frequency bugs

When setting up the modulator frequency field the tuner capabilities were used
instead of the modulator capabilities. The field label also still contained the
frequency unit, which is now part of the input field, so that could be simplified.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: only set m_isRadio if m_isSDR is true.
Hans Verkuil [Mon, 7 Apr 2014 09:43:32 +0000 (11:43 +0200)]
qv4l2: only set m_isRadio if m_isSDR is true.

The m_isRadio bool was reset if m_isSDR was false, that's not what should
happen. Only if m_isSDR is true should the m_isRadio value be changed.

This bug caused the frame width/height etc. fields to appear for a radio
transmitter.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: fix 32-bit compilation for v4l_fd_init()
Hans Verkuil [Tue, 1 Apr 2014 15:30:22 +0000 (17:30 +0200)]
v4l2-compliance: fix 32-bit compilation for v4l_fd_init()

Since mmap and v4l2_mmap have different prototypes (why?!) we have
to make a small wrapper to ensure that it compiles for both 32 and 64
bit systems.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: add missing 'class' keyword after 'friend'
Hans Verkuil [Tue, 1 Apr 2014 06:34:15 +0000 (08:34 +0200)]
v4l2-compliance: add missing 'class' keyword after 'friend'

This led to this compile error for some compilers:

In file included from v4l2-compliance.h:31,
                 from v4l2-compliance.cpp:37:
./cv4l-helpers.h:9: error: a class-key must be used when declaring a friend
./cv4l-helpers.h:9: error: friend declaration does not name a class or function

I'm not sure why this doesn't fail for all compilers, weird.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Prabhakar Lad <prabhakar.csengg@gmail.com>
10 years agolibdvbv5: add support for tables with multiple ts_id and section gaps
André Roth [Sun, 30 Mar 2014 16:21:18 +0000 (13:21 -0300)]
libdvbv5: add support for tables with multiple ts_id and section gaps

this restores the logic for reading tables like EIT, where the
ts_id indicates the service and the sections are incremented by 8
for example. an application might wish to read a complete EIT
containing all services. in this case the function dvb_read_sections
can be used with allow_section_gaps set to 1 in the dvb_table_filter
struct.

- make struct dvb_table_filter public
- use more generic void * for tables
- make dvb_read_sections public
- fix continuous parsing when table_length > 0
- fix logging

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: fix lost ressource in atsc_eit
André Roth [Sun, 30 Mar 2014 16:21:17 +0000 (13:21 -0300)]
libdvbv5: fix lost ressource in atsc_eit

if the title of the EIT event is longer than the available data,
make sure the allocated buffer is not lost

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: remove unneeded includes
André Roth [Sun, 30 Mar 2014 16:21:16 +0000 (13:21 -0300)]
libdvbv5: remove unneeded includes

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: descriptor parser return int
André Roth [Sun, 30 Mar 2014 16:21:15 +0000 (13:21 -0300)]
libdvbv5: descriptor parser return int

If parsing a descriptor fails, let the outside world know.
Returning 0 means success, negative values indicate a parsing
error.
Free allocated memory on error.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: allow table parsers to get specific pointer to table struct
André Roth [Sun, 30 Mar 2014 16:21:14 +0000 (13:21 -0300)]
libdvbv5: allow table parsers to get specific pointer to table struct

this will allow simplifying the parser functions and
to return the number of bytes read or an error code.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: make dvb_desc_default_init and dvb_desc_default_print private
André Roth [Sun, 30 Mar 2014 16:21:13 +0000 (13:21 -0300)]
libdvbv5: make dvb_desc_default_init and dvb_desc_default_print private

dvb_desc_default_init and dvb_desc_default_print are used
internaly only, remove them from the header file.
add extern "C" to the parser functions, so they can be used
from C++ directly.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: use DVB_DESC_HEADER macro in all descriptors
André Roth [Sun, 30 Mar 2014 16:21:12 +0000 (13:21 -0300)]
libdvbv5: use DVB_DESC_HEADER macro in all descriptors

the first fields of a descriptor need to be the
type, length and the next pointer. in order to
prevent changing these fields by accident,
provide them in a macro.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: cleanup printing tables and descriptors
André Roth [Sun, 30 Mar 2014 16:21:11 +0000 (13:21 -0300)]
libdvbv5: cleanup printing tables and descriptors

- log hex values where appropriate
- cleanup indents

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agov4l2-compliance: fix function pointer prototype.
Hans Verkuil [Mon, 31 Mar 2014 15:59:13 +0000 (17:59 +0200)]
v4l2-compliance: fix function pointer prototype.

There was a conflict between the mmap function pointer prototype of
struct v4l_fd and the actual function used. Make sure it is in sync
with the prototype of v4l2_mmap.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: add support for V4L2_PIX_FMT_NV16M/61M
Hans Verkuil [Mon, 31 Mar 2014 08:44:59 +0000 (10:44 +0200)]
qv4l2: add support for V4L2_PIX_FMT_NV16M/61M

Add support for the NV16M and NV61M planar YUV 4:2:2 formats.

This is not the prettiest code. Once the (c)v4l-helpers.h are more
mature (particularly w.r.t. the v4l2-format handling) the qv4l2 code
will switch to that and that should greatly improve the code.

For now though it is good to have support for at least one multiplanar
format in qv4l2 to help testing the multiplanar API.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>