platform/upstream/v4l-utils.git
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>
10 years agov4l2-compliance: test control/format/codec ioctls for all inputs/outputs
Hans Verkuil [Mon, 31 Mar 2014 08:37:58 +0000 (10:37 +0200)]
v4l2-compliance: test control/format/codec ioctls for all inputs/outputs

Different inputs or outputs can support different controls, formats and codec
ioctls. So iterate over all inputs/outputs to test this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: m2m devices should have only one input and output
Hans Verkuil [Mon, 31 Mar 2014 08:33:47 +0000 (10:33 +0200)]
v4l2-compliance: m2m devices should have only one input and output

It makes no sense to have multiple inputs and outputs for a m2m device.
Check for this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: use the new cv4l-helpers.h header.
Hans Verkuil [Mon, 31 Mar 2014 08:31:50 +0000 (10:31 +0200)]
v4l2-compliance: use the new cv4l-helpers.h header.

This hides most of the single/multi planar differences, thus making it
easier to write test-cases.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: add helper headers
Hans Verkuil [Mon, 31 Mar 2014 08:22:01 +0000 (10:22 +0200)]
v4l2-compliance: add helper headers

In order to simplify working with single and multiple planar formats
these two helper headers were created: v4l-helpers.h is the C version
and cv4l-helpers.h is a C++ version on top of v4l-helpers.h.

For now this will only be used in v4l2-compliance, but the intention
is to use it elsewhere as well eventually.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibdvbv5: fix PMT parser
André Roth [Tue, 25 Mar 2014 18:20:01 +0000 (15:20 -0300)]
libdvbv5: fix PMT parser

- check for correct table ID
- parse all descriptos
- improve table printing

[m.chehab@samsung.com: fix the copyright line change]
Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add parser for ca and ca_identifier descriptors
André Roth [Tue, 25 Mar 2014 18:20:00 +0000 (15:20 -0300)]
libdvbv5: add parser for ca and ca_identifier descriptors

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add parser for CAT
André Roth [Tue, 25 Mar 2014 18:19:59 +0000 (15:19 -0300)]
libdvbv5: add parser for CAT

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add attribute packed to structs and unions
André Roth [Tue, 25 Mar 2014 18:19:58 +0000 (15:19 -0300)]
libdvbv5: add attribute packed to structs and unions

__attribute__((packed)) is needed for nested structs and
unions to get the correct size.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: fix dvb_parse_descriptors and make dvb_desc_init private
André Roth [Tue, 25 Mar 2014 18:19:57 +0000 (15:19 -0300)]
libdvbv5: fix dvb_parse_descriptors and make dvb_desc_init private

- set list pointer to NULL in case of an error
- improve size checking
- dvb_desc_init is used only internal, remove from header

[m.chehab@samsung.com: revert the change from calloc() to malloc()]
Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: remove header files from SOURCES in Makefile.am
André Roth [Tue, 25 Mar 2014 18:19:56 +0000 (15:19 -0300)]
libdvbv5: remove header files from SOURCES in Makefile.am

The header files are not needed in the Makefile.am since
automake finds the dependencies automatically. This is not
needed for installing header files either.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: shared lib and installing headers
André Roth [Fri, 28 Mar 2014 16:42:49 +0000 (17:42 +0100)]
libdvbv5: shared lib and installing headers

- move headers to subdirectory for correct install location
- fix includes in dvb table and descriptor parsers
- fix compile warnings

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: fix EIT parsing
André Roth [Tue, 25 Mar 2014 18:19:54 +0000 (15:19 -0300)]
libdvbv5: fix EIT parsing

the dvb_table_eit_event now contains the service_id,
indicating where the events belong to.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: mpeg elementary stream parsers
André Roth [Tue, 25 Mar 2014 18:19:53 +0000 (15:19 -0300)]
libdvbv5: mpeg elementary stream parsers

Implement parsers for mpeg TS, PES and ES

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: fix asprintf compile warnings
André Roth [Tue, 25 Mar 2014 18:19:52 +0000 (15:19 -0300)]
libdvbv5: fix asprintf compile warnings

- allow logging in dvb_vchannel
- get rid of compile warings about unused asprintf return value

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: support info info log via dvb_loginfo
André Roth [Tue, 25 Mar 2014 18:19:51 +0000 (15:19 -0300)]
libdvbv5: support info info log via dvb_loginfo

dvb_loginfo log support without setting output color.

Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Frequency is unsigned. use %u to print it
Mauro Carvalho Chehab [Sun, 16 Mar 2014 11:40:00 +0000 (08:40 -0300)]
libdvbv5: Frequency is unsigned. use %u to print it

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodvbv5-zap: only start audio filtering if audio PID > 0
Mauro Carvalho Chehab [Sat, 15 Mar 2014 12:08:09 +0000 (09:08 -0300)]
dvbv5-zap: only start audio filtering if audio PID > 0

When used with -P, audio filter PID is zero. Yet, it is
currently starting an audio PID filter. This could cause
troubles with some hardware filters.

As PID is always bigger than zero, this patch should fix
the issue.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibv4lconvert: remove broken ALTERNATE handling
Hans Verkuil [Mon, 3 Mar 2014 23:05:23 +0000 (00:05 +0100)]
libv4lconvert: remove broken ALTERNATE handling

The V4L2 specification used to say that if field == V4L2_FIELD_ALTERNATE, the
height would have to be divided by two. This is incorrect, the height is that of
a single field. This has been corrected in the spec, now this code in libv4lconvert
needs to be removed as well.

Tested with both bttv and saa7146, the only two drivers supporting FIELD_ALTERNATE
today.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: add G/S_EDID tests.
Hans Verkuil [Fri, 14 Mar 2014 14:56:05 +0000 (15:56 +0100)]
v4l2-compliance: add G/S_EDID tests.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: add test setting all enumerated timings.
Hans Verkuil [Fri, 14 Mar 2014 14:12:42 +0000 (15:12 +0100)]
v4l2-compliance: add test setting all enumerated timings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: rename old v4l2_subdev_edid and VIDIOC_SUBDEV_G/S_EDID
Hans Verkuil [Fri, 14 Mar 2014 11:45:28 +0000 (12:45 +0100)]
v4l2-ctl: rename old v4l2_subdev_edid and VIDIOC_SUBDEV_G/S_EDID

I forgot to rename those old names to the new ones.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Martin Bugge <marbugge@cisco.com>
10 years agov4l2-ctl: add --clear-edid option.
Hans Verkuil [Fri, 14 Mar 2014 10:36:19 +0000 (11:36 +0100)]
v4l2-ctl: add --clear-edid option.

Also make sure the --set-edid doesn't accidentally clear the EDID if the
file contains no data.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: add EDID get and set options
Martin Bugge [Fri, 14 Mar 2014 10:17:17 +0000 (11:17 +0100)]
v4l2-ctl: add EDID get and set options

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l-utils: sync to latest kernel headers
Hans Verkuil [Fri, 14 Mar 2014 09:05:23 +0000 (10:05 +0100)]
v4l-utils: sync to latest kernel headers

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l-utils: bugfix memory chunk
Stefan Ringel [Tue, 4 Mar 2014 19:50:32 +0000 (16:50 -0300)]
v4l-utils: bugfix memory chunk

>From a5cfa1881de152a887d195e8c880dcca3e6b766e Mon Sep 17 00:00:00 2001

Bug 1070855 - [abrt] v4l-utils: parse_string(): dvbv5-scan killed by SIGABRT
https://bugzilla.redhat.com/show_bug.cgi?id=1070855

Signed-off-by: Stefan Ringel <linuxtv@stefanringel.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agov4l2-ctl: fix printing of buffer flags
Hans Verkuil [Tue, 11 Mar 2014 07:34:33 +0000 (08:34 +0100)]
v4l2-ctl: fix printing of buffer flags

Don't include timestamp_type and src masks with the buffer flags, those
are handled separately.

I also made a small change when capturing: if verbose is true then also
dump the contents of buffers marked with state ERROR.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: increase max width/height to 4K resolution.
Hans Verkuil [Tue, 4 Mar 2014 07:25:58 +0000 (08:25 +0100)]
qv4l2: increase max width/height to 4K resolution.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: add support for custom bytesperline values.
Hans Verkuil [Mon, 10 Mar 2014 23:53:30 +0000 (00:53 +0100)]
v4l2-ctl: add support for custom bytesperline values.

The V4L2 API allows application to select a bytesperline value that's larger
than what the driver gives you, effectively padding each line.

Add support to v4l2-ctl to set custom bytesperline values when trying/setting
new formats.

This also fixes a bug where setting multiplanar formats failed: in the *_cmd
function the is_multiplanar global variable isn't set yet because the device
hasn't been opened. So it always assumed a single planar format.

The fixed code is actually cleaner than what I had before.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl/compliance: use the correct mmap/munmap functions.
Hans Verkuil [Sat, 8 Mar 2014 11:25:35 +0000 (12:25 +0100)]
v4l2-ctl/compliance: use the correct mmap/munmap functions.

If the libv4l2 wrapper library is used, then use v4l2_munmap instead of munmap.

For DMABUF file descriptors always use mmap/munmap since these buffers are not
known to libv4l2.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: support menu controls with more than 32 items
Hans Verkuil [Sat, 8 Mar 2014 11:25:13 +0000 (12:25 +0100)]
v4l2-compliance: support menu controls with more than 32 items

v4l2-compliance would fail if it encounters menu controls with more
than 32 items. This patch improves that behavior by allowing any
number of items, although only up to 64 will be tested.

This is because v4l2-compliance uses a bitmask for the valid menu
items which is now 64 bits.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: use QDoubleSpinBox for frequency inputs
Hans Verkuil [Fri, 7 Mar 2014 09:54:32 +0000 (10:54 +0100)]
qv4l2: use QDoubleSpinBox for frequency inputs

This gives finer frequency control and looks better as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: add SDR support.
Hans Verkuil [Thu, 6 Mar 2014 21:17:06 +0000 (22:17 +0100)]
qv4l2: add SDR support.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: add 1HZ support when setting the frequency.
Hans Verkuil [Thu, 6 Mar 2014 20:14:52 +0000 (21:14 +0100)]
v4l2-compliance: add 1HZ support when setting the frequency.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibdvbv5: reimplement the logic that gets a full section
Mauro Carvalho Chehab [Thu, 6 Mar 2014 12:31:27 +0000 (09:31 -0300)]
libdvbv5: reimplement the logic that gets a full section

The logic that gets a full section is broken: it expects to
receive the sections in order, and not to receive the same
section segment twice.

Reimplement it.

As a side effect, it no longer needs to wait for a section
repeat, with speeds up the code.

On my tests with an ATSC signal, before this patch, scanning
to a single frequency was spending 1.850 secs. After the
patch, dvbv5-scan is now spending 1.432 secs.

That means a 418 ms save per frequency.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: better document some MPEG TS fields
Mauro Carvalho Chehab [Thu, 6 Mar 2014 13:21:22 +0000 (10:21 -0300)]
libdvbv5: better document some MPEG TS fields

Unfortunately, some names on this table don't reflect the names at the
MPEG specs. Yet, we want to be clear what they mean, so let's improve
the comments at the header.h and add a better description when debug
is enabled.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoRevert "dvb-scan: don't handle NIT table by default on ATSC"
Mauro Carvalho Chehab [Tue, 18 Feb 2014 12:48:41 +0000 (21:48 +0900)]
Revert "dvb-scan: don't handle NIT table by default on ATSC"

This changeset is actually wrong, as it would prevent to get
the frequenct descriptors from NIT table. So, better to revert
it.

This reverts commit d91894aa2207ac0863bb4afc4594020280ddfa3b.

10 years agov4l2-compliance: add SDR compliance tests.
Hans Verkuil [Wed, 5 Mar 2014 22:42:01 +0000 (23:42 +0100)]
v4l2-compliance: add SDR compliance tests.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: support SDR capture streaming.
Hans Verkuil [Wed, 5 Mar 2014 21:44:15 +0000 (22:44 +0100)]
v4l2-ctl: support SDR capture streaming.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: add missing v4l2-ctl-sdr.cpp file.
Hans Verkuil [Wed, 5 Mar 2014 21:45:17 +0000 (22:45 +0100)]
v4l2-ctl: add missing v4l2-ctl-sdr.cpp file.

Oops! Forgot to do a git add...

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: add timestamp source tests.
Hans Verkuil [Wed, 5 Mar 2014 21:15:39 +0000 (22:15 +0100)]
v4l2-compliance: add timestamp source tests.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: add timestamp source support.
Hans Verkuil [Wed, 5 Mar 2014 20:41:02 +0000 (21:41 +0100)]
v4l2-ctl: add timestamp source support.

Show the timestamp source when receiving a buffer.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: implement list SDR buffers command
Hans Verkuil [Wed, 5 Mar 2014 20:36:05 +0000 (21:36 +0100)]
v4l2-ctl: implement list SDR buffers command

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: add support for SDR FMT
Hans Verkuil [Wed, 5 Mar 2014 20:35:26 +0000 (21:35 +0100)]
v4l2-ctl: add support for SDR FMT

Add support for FMT IOCTL operations used for SDR receivers.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: add tuner support for SDR tuners
Antti Palosaari [Sun, 9 Feb 2014 06:05:52 +0000 (08:05 +0200)]
v4l2-ctl: add tuner support for SDR tuners

Add initial SDR support for tuner related operations.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l-utils: sync with latest kernel headers.
Hans Verkuil [Wed, 5 Mar 2014 20:31:04 +0000 (21:31 +0100)]
v4l-utils: sync with latest kernel headers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix incorrect handling of fields
Hans Verkuil [Mon, 3 Mar 2014 14:02:35 +0000 (15:02 +0100)]
qv4l2: fix incorrect handling of fields

I assumed that the format height stays the same when the field value
changes to TOP/BOTTOM/ALTERNATE, but it turns out that the height will
match that of the field height.

So update qv4l2 to match what drivers actually do.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix incorrect call to s_fmt when disabling width/height
Hans Verkuil [Mon, 3 Mar 2014 09:44:57 +0000 (10:44 +0100)]
qv4l2: fix incorrect call to s_fmt when disabling width/height

When the frame width and height fields are disabled because we start
streaming, the editingFinished event is triggered as well, which
causes an attempt to change the format. This causes EBUSY warnings
because it really isn't allowed to do that anymore. Check if the
field is really enabled before we change the format, thus squashing
the warnings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibv4lconvert: Add ASUS A7M to upside down table
Gregor Jasny [Fri, 28 Feb 2014 17:20:03 +0000 (18:20 +0100)]
libv4lconvert: Add ASUS A7M to upside down table

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agov4l2-compliance: more nasty evil stream I/O checks
Hans Verkuil [Fri, 28 Feb 2014 17:15:26 +0000 (18:15 +0100)]
v4l2-compliance: more nasty evil stream I/O checks

After queuing buffers, then calling STREAMOFF without having called STREAMON
we should be able to queue those buffers again.

After queuing buffers, then calling REQBUFS without having called STREAMON
all the old buffers should be freed correctly: good check for making sure all
the vb2 ops stay balanced.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: add tests for queuing operations with invalid indices.
Hans Verkuil [Fri, 28 Feb 2014 16:37:41 +0000 (17:37 +0100)]
v4l2-compliance: add tests for queuing operations with invalid indices.

Check what happens when queuing/preparing an already queued/prepared buffer,
or if the buffer index is out of range.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: disable what shouldn't be touched while streaming.
Hans Verkuil [Fri, 28 Feb 2014 13:35:04 +0000 (14:35 +0100)]
qv4l2: disable what shouldn't be touched while streaming.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix frequency handling
Hans Verkuil [Fri, 28 Feb 2014 11:50:51 +0000 (12:50 +0100)]
qv4l2: fix frequency handling

Several bugs: the frequency validation wasn't done correctly allowing
out-of-range frequencies to be set, and the frequencies tables were
never shown due to a wrong condition.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: QUERYSTD returns STD_UNKNOWN if there is no standard
Hans Verkuil [Fri, 28 Feb 2014 09:54:34 +0000 (10:54 +0100)]
qv4l2: QUERYSTD returns STD_UNKNOWN if there is no standard

Replace STD_ALL by STD_UNKNOWN in the qv4l2 checked for whether there is a
signal or not.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: initialize comboboxes with sensible initial sizes.
Hans Verkuil [Thu, 27 Feb 2014 07:54:21 +0000 (08:54 +0100)]
qv4l2: initialize comboboxes with sensible initial sizes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: improve format matching code.
Hans Verkuil [Thu, 27 Feb 2014 07:29:51 +0000 (08:29 +0100)]
v4l2-compliance: improve format matching code.

Do a precise match based on the format type and print the values for
v4l2_pix_format if they are different.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: check for presence of a tuner/modulator
Hans Verkuil [Thu, 27 Feb 2014 07:28:57 +0000 (08:28 +0100)]
v4l2-compliance: check for presence of a tuner/modulator

If an input needs a tuner or an output needs a modulator, then test
that at least one tuner or modulator was found.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: add check if the shader function is available.
Hans Verkuil [Wed, 26 Feb 2014 19:41:57 +0000 (20:41 +0100)]
qv4l2: add check if the shader function is available.

Skip formats that need a shader if there isn't any. Particularly useful
when running qv4l2 over ssh.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: support top/bottom/alternate field settings.
Hans Verkuil [Fri, 28 Feb 2014 13:41:15 +0000 (14:41 +0100)]
qv4l2: support top/bottom/alternate field settings.

Compensate for the half-height by changing the pixel aspect ratio. This
ensures that they are still shown at the right picture aspect ratio.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: two field related fixes
Hans Verkuil [Tue, 25 Feb 2014 22:20:48 +0000 (23:20 +0100)]
qv4l2: two field related fixes

Update the field combobox when changing inputs.

Don't clear the field combobox unless at least one valid field could
be found. This to prevent the combobox from clearing when trying to
change it while streaming is in progress.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoAdd a parser for drxj
Mauro Carvalho Chehab [Wed, 26 Feb 2014 18:07:47 +0000 (15:07 -0300)]
Add a parser for drxj

This is actually the same parser as the drxk one, except that
it is using the DRX-J map table.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agov4l-utils: ran sync-with-kernel which added the fb.h header.
Hans Verkuil [Wed, 26 Feb 2014 12:17:15 +0000 (13:17 +0100)]
v4l-utils: ran sync-with-kernel which added the fb.h header.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agosync-with-kernel should also copy fb.h
Hans Verkuil [Wed, 26 Feb 2014 12:14:03 +0000 (13:14 +0100)]
sync-with-kernel should also copy fb.h

The v4l2-ctl utility uses it for some of the overlay operations, and
we have to make sure we use the latest fb.h kernel so it will compile
correctly on older kernels.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: ignore buffers with flag V4L2_BUF_FLAG_ERROR.
Hans Verkuil [Tue, 25 Feb 2014 19:13:12 +0000 (20:13 +0100)]
qv4l2: ignore buffers with flag V4L2_BUF_FLAG_ERROR.

Such buffers should just be requeued.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: skip captured buffers with flag V4L2_BUF_FLAG_ERROR
Hans Verkuil [Tue, 25 Feb 2014 19:09:48 +0000 (20:09 +0100)]
v4l2-ctl: skip captured buffers with flag V4L2_BUF_FLAG_ERROR

These buffers contain invalid data, so just QBUF them again.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: add tests for output buffer error checking
Hans Verkuil [Tue, 25 Feb 2014 08:47:15 +0000 (09:47 +0100)]
v4l2-compliance: add tests for output buffer error checking

Add tests to check that wrong data_offset and bytesused values will
return errors.

And if bytesused == 0, then it should be replaced by the buffer length.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: improve clip checking
Hans Verkuil [Tue, 25 Feb 2014 07:48:32 +0000 (08:48 +0100)]
v4l2-compliance: improve clip checking

Fix and improve the clip checking code for video overlays.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: bypass libv4l2 for expbuf handling.
Hans Verkuil [Sun, 23 Feb 2014 09:58:27 +0000 (10:58 +0100)]
v4l2-compliance: bypass libv4l2 for expbuf handling.

You don't want to go through libv4l2 for calling VIDIOC_EXPBUF, just use the
low-level ioctl call for this.

Also add a missing close() for the expbuf node.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: lower default framecount to 60.
Hans Verkuil [Sun, 23 Feb 2014 13:47:53 +0000 (14:47 +0100)]
v4l2-compliance: lower default framecount to 60.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: change one warn to info.
Hans Verkuil [Sun, 23 Feb 2014 11:55:41 +0000 (12:55 +0100)]
v4l2-compliance: change one warn to info.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: reopen node after each streaming test.
Hans Verkuil [Sun, 23 Feb 2014 09:49:52 +0000 (10:49 +0100)]
v4l2-compliance: reopen node after each streaming test.

This should clear any bad state left by the previous test.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: fix check for correct return code for STREAMON.
Hans Verkuil [Sun, 23 Feb 2014 09:39:12 +0000 (10:39 +0100)]
v4l2-compliance: fix check for correct return code for STREAMON.

STREAMON when no buffers have been created should return EINVAL.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: fill output buffers.
Hans Verkuil [Mon, 24 Feb 2014 15:27:51 +0000 (16:27 +0100)]
v4l2-compliance: fill output buffers.

In order to test whether memory-to-memory devices that copy buffer data
from the incoming stream to the outcoming stream really do that right
we fill in the output buffer fields and check if when they arrive they
still have the same information.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: add M2M streaming support
Hans Verkuil [Mon, 24 Feb 2014 15:21:17 +0000 (16:21 +0100)]
v4l2-compliance: add M2M streaming support

Add test support for memory-to-memory devices. This assumes fairly simple
setups where there is a 1-to-1 mapping between buffers sent to the device
and the buffers you get back.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: improve the overlay support
Hans Verkuil [Mon, 24 Feb 2014 15:08:44 +0000 (16:08 +0100)]
v4l2-ctl: improve the overlay support

It is now possible to specify clip lists and a bitmap.

With the --find-fb option it can find which fb device is associated with
the overlay.

And --set-fbuf can specify which fb device to open to fill in the framebuffer
information.

Dropped the old output overlay options: each video node can only be a video
overlay or an output video overlay, not both at the same time. So there is
no need to support both options.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: the colorspace can now be set for outputs.
Hans Verkuil [Mon, 24 Feb 2014 15:07:27 +0000 (16:07 +0100)]
v4l2-ctl: the colorspace can now be set for outputs.

The colorspace field can now be specified for output formats.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: add streaming between two video devices using dmabuf
Hans Verkuil [Mon, 24 Feb 2014 14:57:42 +0000 (15:57 +0100)]
v4l2-ctl: add streaming between two video devices using dmabuf

Implement support to streaming from one device to another, either using
mmap -> dmabuf, dmabuf -> mmap or userptr -> userptr. In all three
cases there is no need to copy from one buffer to another.

Eventually all combinations should be possible, but that requires more
work (a copy function) and the code could use some serious refactoring
before doing that.

The basic idea is to specify the video output device using --out-device.
And if you want one of the two sides to use dmabuf for streaming, then
specify --stream(-out)-dmabuf:

v4l2-ctl -d /dev/video0 -e /dev/video1 --stream-mmap=3 --stream-out-dmabuf

It will try to export the dmabuf file descriptors for 3 (the number given
to --stream-mmap) buffers and use those for the output stream buffers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: set timestamp for output buffers.
Hans Verkuil [Mon, 24 Feb 2014 14:53:49 +0000 (15:53 +0100)]
v4l2-ctl: set timestamp for output buffers.

When streaming to a VIDEO_OUTPUT device, and if the timestamp mask of the
buffer is V4L2_BUF_FLAG_TIMESTAMP_COPY, then we need to set a timestamp.

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