v4l2-ctl: use libv4l2 wrapper for mmap as well.

The streaming code didn't use v4l2_mmap if the -w option was specified.
Correct this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
libdvbv5: Fix a warning at isdb_desc_partial_reception_free

descriptors.c:1175:3: warning: initialization from incompatible pointer type [enabled by default]
   .free  = isdb_desc_partial_reception_free,
   ^
descriptors.c:1175:3: warning: (near initialization for 'dvb_descriptors[251].free') [enabled by default]

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: fix retrieve parameters for ISDB-T

ERROR    command MODULATION (4) not found during retrieve
ERROR    command INNER_FEC (9) not found during retrieve

Those parameters are per-layer, and not global.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
qv4l2: fix broken VBI support

Using qv4l2 with a vbi node broke when the pixel aspect ratio code was added.
Pixel aspect doesn't apply to vbi, and that wasn't checked.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
libdvbv5/dvb-fe: Fall back to v3 if needed

if FE_GET_PROPERTY gets error, fallback to DVBv3 stats

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Only discard the services not found

If the PAT table describes a service ID, but it doesn't exist, just
discard it, and not all services after that.

This helps to be a little more resillient to broken PAT tables.

Caught with a test signal that was captured by a friend in Rio. The
tables describe a SD stream that it is not present on the TS.

$ dvbv5-scan ~mchehab/isdb-teste -F -G -T2
INFO     Scanning frequency #1 479142857
Lock   (0x1f) Signal= 78.83% C/N= 0.38% UCB= 252 postBER= 0
INFO     Service Globo HD, provider (null): digital television
INFO     Service Globo SD, provider (null): digital television
WARNING  Service ID 59201 not found on PMT!
INFO     Service Globo 1Seg, provider (null): user defined

Not sure if this is due to some capture error or not, but it is better
to be able to capture the 1Seg stream in any case, and just discard the
broken Service ID.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
dvb-fe: fix using a DVB-T file for ISDB-T

When a DVB-T channel file is used, and the frontend has ISDB-T
instead, put it into ISDB-T auto search mode.

That is better than let the Kernel to use the compatibility mode,
as the output files will have the proper ISDB-T fields.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
dvb: simplify the logic that sets a (compat) DTV delivery system

Instead of using a loop, just call the existing function for
retrieve a parameter inside an entry.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
dvb-scan: remove ISDB-T hack from it

This hack is not needed/desired, as it overrides what userspace
specified:
	- if channel file is a DVBv3 file, those values are already
	  filled by the compatibility standard code;
	- if channel file is in DVBv5 format, it may override any
ISDB-T parameter.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
libdvbv5: fix get_frontend logic

The patch that added a cache var for get/set broke the get frontend
data logic, as it doesn't copy data back from cache. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>