qv4l2: Clean up icon distribution list

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Prepare for 1.3.90 release

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Start v4l-utils 1.3.91 development cycle

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
libdvbv5: Remove dvbsat_polarization_name (same as dvb_sat_pol_name)

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Rename and hide charset definitions

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Hide unused and unexposed cnr_to_qual_s tables

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Make dummy_fe static

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
v4l2-compliance: require G/S_PRIORITY support for m2m devices

M2M devices didn't support G/S_PRIORITY in the past, but after a
recent kernel change they gained prio support. While that was
actually unintended I realized that it does make sense there as well
since it makes it possible for a filehandle to get exclusive access
to the M2M hardware. So drop the exception for M2M devices.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
libdvbv5: be coherent with parse_string.h header

This header is included on several places without being
used. Also, always use it with as <parse_string.h>.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Move charsets to be inside the parms struct

Instead of using global vars and expose them to the library API,
move the charset definition to be part of the parms struct.

The default changesets can vary from Country to Country.

Also, the output changeset should match whatever is defined at
the system. So, applications may need to change them.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: move internal parameters to a separate structure

We don't want that struct dvb_v5_fe_parms size to change on
future versions of the API. Due to that, move all parameters
that shouldn't be visible to userspace into a private structure,
called struct dvb_v5_fe_parms_priv.

With this change, the dvb-fe will now allocate memory for the
private struct, but only the non-priv fields are visible at
the external structure.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Properly document struct dvb_v5_fe_parms

Now that all elements there are public, document the contents
of the structure.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Fix parameters dvb_add_parms_for_sys()

The way this function is declared, userspace cannot
actually use, as the properties are opaque.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Fix return values for dvb_fe_get_event()

On most places at dvb-fe, the error values are positive
numbers. Fix it also at dvb_fe_get_event().

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Add documentation for dvb-fe.h

Add documentation for the functions and data structures that should
be used for DVB frontend setup with dvb-fe.h

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: add the private structure to the tree

Changeset b8c9e78 forgot to include dvb-fe-priv.h.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Rename internally-defined poll function as dvb_poll

poll() is the name of a glibc function. Rename it as dvb_poll().

That should likely fix a Coverity warning:

278     		do {
>>>     CID 1233564:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
>>>     Passing "&parms->p" to function "poll" which uses it as an array. This might corrupt or misinterpret adjacent memory locations. [Note: The source code implementation of the function has been overridden by a builtin model.]
279     			available = poll(&parms->p, dmx_fd, timeout);
280     		} while (available < 0 && errno == EOVERFLOW);

Also, as this function is static, use the private struct directly.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: fix a memory leak at descriptors

If we call dvb_fe_dummy(), we need to free it latter.

*** CID 1233565:  Resource leak  (RESOURCE_LEAK)
/lib/libdvbv5/descriptors.c: 79 in dvb_desc_default_print()
73
74     static void dvb_desc_default_print(struct dvb_v5_fe_parms *parms, const struct dvb_desc *desc)
75     {
76     	if (!parms)
77     		parms = dvb_fe_dummy();
78     	dvb_hexdump(parms, "|           ", desc->data, desc->length);
>>>     CID 1233565:  Resource leak  (RESOURCE_LEAK)
>>>     Returning without freeing "parms" leaks the storage that it points to.
79     }
80

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: reimplement the spaces filling logic

Coverity doesn't like this construction:

1371		for (i = strlen(hex); i < 49; i++)
CID 1228899 (#1 of 1): Out-of-bounds access (OVERRUN)20. overrun-buffer-arg: Overrunning array spaces of 50 bytes by passing it to a function which accesses it at byte offset 50 using argument 50UL.
1372                        strncat(spaces, " ", sizeof(spaces));
1373                ascii[j] = '\0';
1374                dvb_loginfo("%s%s %s %s", prefix, hex, spaces, ascii);

Neither do I: strncat implementation is complex and have likely
a loop inside it, in order to find the end of the array. So, this
likely have O(n^2) complexity for no good reason.

Reimplement the logic. This should likely make coverty happy too.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Don't go past the size of dvb_v5_name

As reported by Coverity:

4. cond_between: Checking cmd < 256 implies that cmd has the value which is between 0 and 255 (inclusive) on the true branch.
460        if (cmd >= 0 && cmd < DTV_USER_COMMAND_START)
CID 1054605 (#1 of 1): Out-of-bounds read (OVERRUN)5. overrun-local: Overrunning array dvb_v5_name of 71 8-byte elements at element index 255 (byte offset 2040) using index cmd (which evaluates to 255).
461                return dvb_v5_name[cmd];
462        else if (cmd >= 0 && cmd <= DTV_MAX_STAT_COMMAND)
463                return dvb_user_name[cmd - DTV_USER_COMMAND_START];
464        return NULL;

This wouldn't be a problem if the function was just internal,
but this is part of the public functions.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>