platform/upstream/v4l-utils.git
10 years agolibdvbv5: add doxygen tags to pat.h
Mauro Carvalho Chehab [Thu, 11 Sep 2014 01:47:23 +0000 (22:47 -0300)]
libdvbv5: add doxygen tags to pat.h

Add documentation for the MPEG-TS table parser

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add doxygen tags to vct.h
Mauro Carvalho Chehab [Thu, 11 Sep 2014 01:15:35 +0000 (22:15 -0300)]
libdvbv5: add doxygen tags to vct.h

Add documentation for the ATSC VCT table parser

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add doxygen tags for header.h
Mauro Carvalho Chehab [Thu, 11 Sep 2014 01:14:50 +0000 (22:14 -0300)]
libdvbv5: add doxygen tags for header.h

Add documentation for the MPEG-TS headers.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agov4l2-compliance: fix buffer state test
Hans Verkuil [Wed, 10 Sep 2014 07:14:03 +0000 (09:14 +0200)]
v4l2-compliance: fix buffer state test

This test checks that a buffer can only be in a single state,
i.e. it can't be both QUEUED and DONE. But it also counted ERROR
as a separate state, but that's incorrect. ERROR is a separate
flag, independent of state.

Fix this test accordingly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoStart v4l-utils 1.5.0 development cycle
Gregor Jasny [Mon, 8 Sep 2014 07:40:27 +0000 (09:40 +0200)]
Start v4l-utils 1.5.0 development cycle

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agoPrepare for 1.4.0 release v4l-utils-1.4.0
Gregor Jasny [Mon, 8 Sep 2014 06:58:54 +0000 (08:58 +0200)]
Prepare for 1.4.0 release

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agolibdvbv5 doxygen: Some improvements for dvb-scan.h and descriptors.h
Mauro Carvalho Chehab [Sun, 7 Sep 2014 18:07:29 +0000 (15:07 -0300)]
libdvbv5 doxygen: Some improvements for dvb-scan.h and descriptors.h

There are some troubles caused by a wrong macro expansion at
doxygen. Fix them.

Also, tag the code examples as such.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Add more data about the descriptors definition
Mauro Carvalho Chehab [Sun, 7 Sep 2014 14:51:58 +0000 (11:51 -0300)]
libdvbv5: Add more data about the descriptors definition

Better document descriptors.h by adding the specs used by the
descriptors found on this header at the javadoc macro.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoir-keytable: Genrate stable map file by sorting directory before parsing
Gregor Jasny [Sun, 7 Sep 2014 17:35:11 +0000 (19:35 +0200)]
ir-keytable: Genrate stable map file by sorting directory before parsing

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agov4l2-ctl: Distribute vivid-tpg.h.patch
Gregor Jasny [Sun, 7 Sep 2014 16:59:21 +0000 (18:59 +0200)]
v4l2-ctl: Distribute vivid-tpg.h.patch

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agomedia-ctl: process pkgconfig files
Gregor Jasny [Sun, 7 Sep 2014 16:55:21 +0000 (18:55 +0200)]
media-ctl: process pkgconfig files

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agocontrib: Add au0828 directory to extra distribution list
Gregor Jasny [Sun, 7 Sep 2014 16:51:04 +0000 (18:51 +0200)]
contrib: Add au0828 directory to extra distribution list

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agolibdvbv5: Add dvb-fe-priv.h to sources list
Gregor Jasny [Sun, 7 Sep 2014 16:46:50 +0000 (18:46 +0200)]
libdvbv5: Add dvb-fe-priv.h to sources list

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agolibdvbv5: Add doxygen config file to distribution list
Gregor Jasny [Sun, 7 Sep 2014 16:40:56 +0000 (18:40 +0200)]
libdvbv5: Add doxygen config file to distribution list

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agolibdvbv5: add documentation for descriptors.h
Mauro Carvalho Chehab [Sun, 7 Sep 2014 14:45:46 +0000 (11:45 -0300)]
libdvbv5: add documentation for descriptors.h

Add javadoc headers to document the content of descriptors.h,
and makes doxygen to generate the data (almost) properly.

Not sure why, but struct dvb_descriptor is not being
parsed properly by doxygen.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: get rid of bcd_to_int()
Mauro Carvalho Chehab [Sun, 7 Sep 2014 14:03:46 +0000 (11:03 -0300)]
libdvbv5: get rid of bcd_to_int()

This function used to be needed by some descriptors, but it
is now unused. Remove it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Provide a quality indicator for DVB-T
Mauro Carvalho Chehab [Sun, 7 Sep 2014 14:02:33 +0000 (11:02 -0300)]
libdvbv5: Provide a quality indicator for DVB-T

Add a logic to provide a quality indicator for DVB-T

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Fix dvb_get_pmt_pid()
Mauro Carvalho Chehab [Sun, 7 Sep 2014 13:44:19 +0000 (10:44 -0300)]
libdvbv5: Fix dvb_get_pmt_pid()

A previous patch broke it, by not renaming the name of the
file descriptor. Also, don't close the descriptor on error.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5 doxygen: Fix a few file descriptions
Mauro Carvalho Chehab [Sun, 7 Sep 2014 13:21:05 +0000 (10:21 -0300)]
libdvbv5 doxygen: Fix a few file descriptions

Some file descriptions weren't ok. Fix them.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: improve doxygen documentation
Mauro Carvalho Chehab [Sun, 7 Sep 2014 12:24:00 +0000 (09:24 -0300)]
libdvbv5: improve doxygen documentation

Add more tags to the header files, in order to improve the
documentation output.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: fix dvb_get_pmt_pid API
Mauro Carvalho Chehab [Sun, 7 Sep 2014 11:48:35 +0000 (08:48 -0300)]
libdvbv5: fix dvb_get_pmt_pid API

All functions on the demux API uses an opened fd, except for
dvb_get_pmt_pid() that were using a filename.

Change it to make the API coherent.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Properly document macros at dvb-v5-std.h
Mauro Carvalho Chehab [Sun, 7 Sep 2014 05:22:44 +0000 (02:22 -0300)]
libdvbv5: Properly document macros at dvb-v5-std.h

Macros require some special things to be properly parsed
by doxygen.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Fix function definitions at doxygen book
Mauro Carvalho Chehab [Sun, 7 Sep 2014 05:15:19 +0000 (02:15 -0300)]
libdvbv5: Fix function definitions at doxygen book

Parsing functions require some changes, otherwise the files
aren't properly parsed by doxygen.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoIgnore the generate doxygen-doc directory
Mauro Carvalho Chehab [Sun, 7 Sep 2014 04:25:13 +0000 (01:25 -0300)]
Ignore the generate doxygen-doc directory

This directory is autogenerated by the doxygen targets.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Improve doxygen format
Mauro Carvalho Chehab [Sun, 7 Sep 2014 04:16:15 +0000 (01:16 -0300)]
libdvbv5: Improve doxygen format

Use a better template to generate Doxygen documentation.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoAdd support to generate Doxygen documentation for libdvbv5
Mauro Carvalho Chehab [Sun, 7 Sep 2014 02:16:44 +0000 (23:16 -0300)]
Add support to generate Doxygen documentation for libdvbv5

Add a way to auto-generate documentation for libdvbv5 using
Doxygen.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Convert documentation to javadoc format
Mauro Carvalho Chehab [Sun, 7 Sep 2014 01:10:29 +0000 (22:10 -0300)]
libdvbv5: Convert documentation to javadoc format

We were using the documentation format as described inside
the Kernel. However, using javadoc format makes easier for
some tools like doxygen to parse. So, use it instead.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Document the last undocumented structs at dvb-file.h
Mauro Carvalho Chehab [Sun, 7 Sep 2014 03:28:38 +0000 (00:28 -0300)]
libdvbv5: Document the last undocumented structs at dvb-file.h

With this addition, Doxygen should now be able to generate
documentation for all structs at the selected files.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Document the libdvbv5 properties
Mauro Carvalho Chehab [Sun, 7 Sep 2014 00:23:47 +0000 (21:23 -0300)]
libdvbv5: Document the libdvbv5 properties

Document the userspace properties defined inside libdvbv5.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add documentation for the DVB scan functions
Mauro Carvalho Chehab [Sun, 7 Sep 2014 00:01:03 +0000 (21:01 -0300)]
libdvbv5: add documentation for the DVB scan functions

Explain how the DVB scan functions should be used, and
provide some usage examples.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: remove unused parameter at dvb_scan_alloc_handler_table()
Mauro Carvalho Chehab [Sat, 6 Sep 2014 23:29:27 +0000 (20:29 -0300)]
libdvbv5: remove unused parameter at dvb_scan_alloc_handler_table()

The verbose parameter is never used. Remove it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Remove an unused parameter at struct dvb_v5_descriptors
Mauro Carvalho Chehab [Sat, 6 Sep 2014 22:46:01 +0000 (19:46 -0300)]
libdvbv5: Remove an unused parameter at struct dvb_v5_descriptors

verbose field is only initialized but never used. Remove it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Document dvb-log.h and dvb-sat.h
Mauro Carvalho Chehab [Sat, 6 Sep 2014 22:32:34 +0000 (19:32 -0300)]
libdvbv5: Document dvb-log.h and dvb-sat.h

Add documentation to those two additional headers.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Add documentation for other functions at dvb-file.h
Mauro Carvalho Chehab [Sat, 6 Sep 2014 21:49:22 +0000 (18:49 -0300)]
libdvbv5: Add documentation for other functions at dvb-file.h

Add description for the functions related to properties filling,
and ancillary functions at dvb-file.h.

The only two functions missing descriptions are the ones that
are mostly internal to the library (yet, they might be useful
externally, so let's keep them at the public header).

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add documentation about format read/write functions
Mauro Carvalho Chehab [Sat, 6 Sep 2014 16:11:51 +0000 (13:11 -0300)]
libdvbv5: add documentation about format read/write functions

Document the most useful functions to read/write DVB channel
files.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: move PTABLE macro to the *.c files
Mauro Carvalho Chehab [Sat, 6 Sep 2014 15:56:38 +0000 (12:56 -0300)]
libdvbv5: move PTABLE macro to the *.c files

This macro is not generic enough to be part of the library.
Also, its name can cause conflicts with other packages.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: rename enum file_formats to dvb_file_formats
Mauro Carvalho Chehab [Sat, 6 Sep 2014 15:40:23 +0000 (12:40 -0300)]
libdvbv5: rename enum file_formats to dvb_file_formats

file_formats is a too generic name, and can conflict with some
other symbol defined on another library.

So, rename it to dvb_file_formats.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodvb-file.h: prepend parsing structs with "dvb_"
Mauro Carvalho Chehab [Sat, 6 Sep 2014 15:32:50 +0000 (12:32 -0300)]
dvb-file.h: prepend parsing structs with "dvb_"

In order to avoid possible conflicts with other APIs, let's
prepend everything with dvb_.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Add a description for DVB file entries
Mauro Carvalho Chehab [Sat, 6 Sep 2014 15:02:51 +0000 (12:02 -0300)]
libdvbv5: Add a description for DVB file entries

Start documenting the contents of dvb-file.h. On this patch,
adds documentation to the structs that are visible by
most libdvbv5 applications.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: rename struct el_pid
Mauro Carvalho Chehab [Sat, 6 Sep 2014 14:34:15 +0000 (11:34 -0300)]
libdvbv5: rename struct el_pid

This name is not good enough, as this struct name is
visible outside the DVB API. So, better name it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add documentation for dvb-demux.h
Mauro Carvalho Chehab [Sat, 6 Sep 2014 13:47:31 +0000 (10:47 -0300)]
libdvbv5: add documentation for dvb-demux.h

Now that we're exposing the library, better to have some
documentation for it.

While here, update the copyrights at the header.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodvbv5-zap: remove an unused var
Mauro Carvalho Chehab [Sat, 6 Sep 2014 05:24:08 +0000 (02:24 -0300)]
dvbv5-zap: remove an unused var

status var is never used at get_show_stats().

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodvbv5-zap: Be sure to get stats before printing
Mauro Carvalho Chehab [Sat, 6 Sep 2014 05:13:44 +0000 (02:13 -0300)]
dvbv5-zap: Be sure to get stats before printing

On several places, the application is just showing the last value.
Be sure to refresh the stats before printing.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodvbv5-zap: keep monitoring stats at DVB record mode
Mauro Carvalho Chehab [Sat, 6 Sep 2014 04:51:10 +0000 (01:51 -0300)]
dvbv5-zap: keep monitoring stats at DVB record mode

Instead of just waiting, keep monitoring the DVB stats.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: fix a corner case reported by Coverity
Mauro Carvalho Chehab [Sat, 6 Sep 2014 03:24:43 +0000 (00:24 -0300)]
libdvbv5: fix a corner case reported by Coverity

As Coverity reports:

305      if (table->size) {
306      for (j = 0; j < table->size; j++)
>>>     CID 1237263:  Dereference after null check  (FORWARD_NULL)
>>>     Passing null pointer "p" to "strcasecmp", which dereferences it.
307      if (!table->table[j] || !strcasecmp(table->table[j], p))
308      break;

This actually never happens in practice, as table->size is always
zero when the default_value is set (with is the only case where
the code can be called.

Yet, to avoid potential future issues, add an extra check if
the pointer p is valid.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Fix the property limits check
Mauro Carvalho Chehab [Sat, 6 Sep 2014 03:28:50 +0000 (00:28 -0300)]
libdvbv5: Fix the property limits check

As reported by Coverity:

474      if (cmd >= DTV_USER_COMMAND_START && cmd <= DTV_MAX_STAT_COMMAND)
>>>     CID 1237264:  Out-of-bounds read  (OVERRUN)
>>>     Overrunning array "dvb_user_attr_names" of 13 8-byte elements at element index 260 (byte offset 2080) using index "cmd - 256" (which evaluates to 260).
475      return dvb_user_attr_names[cmd - DTV_USER_COMMAND_START];
476      return NULL;

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: make sure that all needed properties are filled
Mauro Carvalho Chehab [Fri, 5 Sep 2014 18:50:43 +0000 (15:50 -0300)]
libdvbv5: make sure that all needed properties are filled

Sometimes, some DVB files don't have all properties. Instead of
not initializing them and causing latter problems, initialize
such vars with default values.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add support for PLS code/mode for file read/write
Mauro Carvalho Chehab [Fri, 5 Sep 2014 16:03:44 +0000 (13:03 -0300)]
libdvbv5: add support for PLS code/mode for file read/write

Those parameters are found on some DVB-S2 tables at the
dtv-scan-tables. Those aren't used by libdvbv5, but we need to
parse, in order to preserve those fields when reading/writing
files with the legacy format.

So, add partial support for them.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: MIS default should be zero
Mauro Carvalho Chehab [Fri, 5 Sep 2014 16:00:37 +0000 (13:00 -0300)]
libdvbv5: MIS default should be zero

On DVB-S2, when MIS is not specified, that means that it should
be equal to zero. Fix it at the legacy import logic.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: use default values if an entry is missing
Mauro Carvalho Chehab [Fri, 5 Sep 2014 15:49:17 +0000 (12:49 -0300)]
libdvbv5: use default values if an entry is missing

On optional properties, instead of generating an error, just
use the default value on writing.

Also fixes a bug where it goes past the end of the table, when
a property is not found.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: avoid checking past data
Mauro Carvalho Chehab [Fri, 5 Sep 2014 14:51:53 +0000 (11:51 -0300)]
libdvbv5: avoid checking past data

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Fix the error message when a props is not found
Mauro Carvalho Chehab [Fri, 5 Sep 2014 14:42:44 +0000 (11:42 -0300)]
libdvbv5: Fix the error message when a props is not found

The acessed data when a property is not found on write
format oneline is wrong. Use dvb_cmd_name() to get the right
one, and uses the field that came from table->prop.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Add MIS to DVB-S2 properties
Mauro Carvalho Chehab [Fri, 5 Sep 2014 14:24:23 +0000 (11:24 -0300)]
libdvbv5: Add MIS to DVB-S2 properties

MIS is a property of DVB-S2 standard. Add it to the
list of the valid properties.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: better document dvb-v5-std.h
Mauro Carvalho Chehab [Fri, 5 Sep 2014 13:41:38 +0000 (10:41 -0300)]
libdvbv5: better document dvb-v5-std.h

Reorganize the header to better document it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Split libdvbv5 properties from stats
Mauro Carvalho Chehab [Fri, 5 Sep 2014 13:37:24 +0000 (10:37 -0300)]
libdvbv5: Split libdvbv5 properties from stats

As newer needs are added to the library, we want to be able
to add new commands and new stats independently.

So, we need to split the properties into two different ranges,
or otherwise a new libdvbv5 command property would break
userspace, by renumbering the statistics.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoqv4l2: fix bug in setting the audio mode
Hans Verkuil [Fri, 5 Sep 2014 13:15:30 +0000 (15:15 +0200)]
qv4l2: fix bug in setting the audio mode

Instead of s_tuner it called g_tuner, and that doesn't work of course.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibdvbv5: fix parsing of the default_value
Mauro Carvalho Chehab [Fri, 5 Sep 2014 02:46:14 +0000 (23:46 -0300)]
libdvbv5: fix parsing of the default_value

The parameters were wrong filled. Fix it. While here, add some
parenthesis at the expressions that check for it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoStop using the legacy name for PLP/MIS property
Mauro Carvalho Chehab [Fri, 5 Sep 2014 02:38:14 +0000 (23:38 -0300)]
Stop using the legacy name for PLP/MIS property

Use DTV_STREAM_ID instead of the legacy name.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Fix delivery system for channel on DVB-T2 format
Mauro Carvalho Chehab [Fri, 5 Sep 2014 02:22:45 +0000 (23:22 -0300)]
libdvbv5: Fix delivery system for channel on DVB-T2 format

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Add support for parsing DVB-T2 channel format
Mauro Carvalho Chehab [Fri, 5 Sep 2014 01:34:26 +0000 (22:34 -0300)]
libdvbv5: Add support for parsing DVB-T2 channel format

Some tables at dtv-scan-tables use T2 as a delimiter for
DVB-T2. Add support for it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add support for optional MIS parameter
Mauro Carvalho Chehab [Fri, 5 Sep 2014 01:32:23 +0000 (22:32 -0300)]
libdvbv5: add support for optional MIS parameter

Some files at dtv-scan-tables have some optional fields.
The first one is part of the DVBv5 API. It is called
Multistream (MIS), and it is mapped as DTV_STREAM_ID
at the DVBv5 API.

Add support for it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add support for optional parameters on oneline formats
Mauro Carvalho Chehab [Fri, 5 Sep 2014 01:27:58 +0000 (22:27 -0300)]
libdvbv5: add support for optional parameters on oneline formats

Some oneline formats have optional parameters. Add support
for them.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: remove some commented dead code
Mauro Carvalho Chehab [Fri, 5 Sep 2014 01:26:40 +0000 (22:26 -0300)]
libdvbv5: remove some commented dead code

There are some dead code at dvb-file.c. Remove them

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: only use emulated formats if the original one is not found
Mauro Carvalho Chehab [Fri, 5 Sep 2014 00:40:31 +0000 (21:40 -0300)]
libdvbv5: only use emulated formats if the original one is not found

Now that we've added DVB-S2 scan-s2 format, we want that the
format conversion tool to be able to write to that format too.

So, instead of emulating DVB-S channels, write them using
the new format.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Fix modulation formats for legacy channel on DVB-S2
Mauro Carvalho Chehab [Thu, 4 Sep 2014 22:49:36 +0000 (19:49 -0300)]
libdvbv5: Fix modulation formats for legacy channel on DVB-S2

DVB scan-s2 format uses a different names from the ones originally
defined. Fix it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: don't write polarization and user parms twice
Mauro Carvalho Chehab [Thu, 4 Sep 2014 21:41:00 +0000 (18:41 -0300)]
libdvbv5: don't write polarization and user parms twice

Currently, there are two loops printing user cmds. This is not
needed, and will just write duplicate values at the output.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add support for parsing scan-s2 DVB-S2 channels
Mauro Carvalho Chehab [Thu, 4 Sep 2014 21:24:27 +0000 (18:24 -0300)]
libdvbv5: add support for parsing scan-s2 DVB-S2 channels

This format also specifies rolloff and modulation. Add
support for it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Improve parsing of dvb channel format
Mauro Carvalho Chehab [Thu, 4 Sep 2014 21:02:21 +0000 (18:02 -0300)]
libdvbv5: Improve parsing of dvb channel format

Some channel files also use tabs as delimiter, like
dvb-c/ch-GGA-Pratteln

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoCopy the vivid-tpg* sources from the kernel
Hans Verkuil [Wed, 3 Sep 2014 09:24:33 +0000 (11:24 +0200)]
Copy the vivid-tpg* sources from the kernel

This keeps the test pattern generator in v4l-utils in sync with the
tpg in the vivid kernel driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoAdd the generated lib/include/dvb-frontend.h to .gitignore
Hans Verkuil [Wed, 3 Sep 2014 09:23:44 +0000 (11:23 +0200)]
Add the generated lib/include/dvb-frontend.h to .gitignore

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l-utils: sync-with-kernel
Hans Verkuil [Wed, 3 Sep 2014 09:15:21 +0000 (11:15 +0200)]
v4l-utils: sync-with-kernel

Update headers to the latest kernel version.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl/qv4l2: sync to latest vivid-tpg code
Hans Verkuil [Wed, 3 Sep 2014 09:14:10 +0000 (11:14 +0200)]
v4l2-ctl/qv4l2: sync to latest vivid-tpg code

This updates vivid-tpg to the latest kernel version.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agodvbv5-zap: close dvr_fd at the end of do_traffic_monitor()
Mauro Carvalho Chehab [Tue, 2 Sep 2014 01:48:22 +0000 (22:48 -0300)]
dvbv5-zap: close dvr_fd at the end of do_traffic_monitor()

As reported by Coverity:

685        close (fd);
CID 1054585 (#1-3 of 3): Resource leak (RESOURCE_LEAK)35. leaked_handle: Handle variable dvr_fd going out of scope leaks the handle.
686        return 0;
687}
688

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: add a missing return
Mauro Carvalho Chehab [Mon, 1 Sep 2014 23:39:45 +0000 (20:39 -0300)]
libdvbv5: add a missing return

Changeset 0097e30 fixed a Coverity bug that were causing a
memory leak in the case that the DVB dummy logic happens.
However, I forgot to add a return there, causing another
bug, also reported by Coverity:

*** CID 1233758:  Use after free  (USE_AFTER_FREE)
/lib/libdvbv5/descriptors.c: 81 in dvb_desc_default_print()
75     {
76      if (!parms) {
77      parms = dvb_fe_dummy();
78      dvb_hexdump(parms, "|           ", desc->data, desc->length);
79      free(parms);
80      }

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Allocate channel earlier
Mauro Carvalho Chehab [Mon, 1 Sep 2014 00:01:56 +0000 (21:01 -0300)]
libdvbv5: Allocate channel earlier

As reported by Coverity:

CID 1228897 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)14. var_deref_model: Passing null pointer channel to get_program_and_store, which dereferences it. [show details]
1129                        rc = get_program_and_store(parms, *dvb_file, dvb_scan_handler,
1130                                                   service_id, channel, NULL,
1131                                                   get_detected, get_nit);

Well, get_program_and_store() explicitly tests if channel is null or
not, but it does it too late.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Fix changeset 04accf23
Mauro Carvalho Chehab [Mon, 1 Sep 2014 00:06:40 +0000 (21:06 -0300)]
libdvbv5: Fix changeset 04accf23

The check for the array size is wrong. Fix it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Don't go past the size of dvb_v5_attr_names
Mauro Carvalho Chehab [Sun, 31 Aug 2014 23:57:51 +0000 (20:57 -0300)]
libdvbv5: Don't go past the size of dvb_v5_attr_names

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.
469        if (cmd >= 0 && cmd < DTV_USER_COMMAND_START)

CID 1054610 (#1 of 1): Out-of-bounds read (OVERRUN)5. overrun-local: Overrunning array dvb_v5_attr_names of 70 8-byte elements at element index 255 (byte offset 2040) using index cmd (which evaluates to 255).
470                return dvb_v5_attr_names[cmd];
471        else if (cmd >= 0 && cmd <= DTV_MAX_STAT_COMMAND)
472                return dvb_user_attr_names[cmd - DTV_USER_COMMAND_START];
473        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>
10 years agolibdvbv5: Don't go past the size of dvb_v5_name
Mauro Carvalho Chehab [Sun, 31 Aug 2014 23:53:30 +0000 (20:53 -0300)]
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>
10 years agolibdvbv5: reimplement the spaces filling logic
Mauro Carvalho Chehab [Sun, 31 Aug 2014 23:08:53 +0000 (20:08 -0300)]
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>
10 years agolibdvbv5: fix a memory leak at descriptors
Mauro Carvalho Chehab [Sun, 31 Aug 2014 22:55:12 +0000 (19:55 -0300)]
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>
10 years agolibdvbv5: Rename internally-defined poll function as dvb_poll
Mauro Carvalho Chehab [Sun, 31 Aug 2014 22:49:08 +0000 (19:49 -0300)]
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>
10 years agolibdvbv5: add the private structure to the tree
Mauro Carvalho Chehab [Sat, 30 Aug 2014 20:29:06 +0000 (17:29 -0300)]
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>
10 years agolibdvbv5: Add documentation for dvb-fe.h
Mauro Carvalho Chehab [Sat, 30 Aug 2014 20:22:03 +0000 (17:22 -0300)]
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>
10 years agolibdvbv5: Fix return values for dvb_fe_get_event()
Mauro Carvalho Chehab [Sat, 30 Aug 2014 20:16:45 +0000 (17:16 -0300)]
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>
10 years agolibdvbv5: Fix parameters dvb_add_parms_for_sys()
Mauro Carvalho Chehab [Sat, 30 Aug 2014 20:15:35 +0000 (17:15 -0300)]
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>
10 years agolibdvbv5: Properly document struct dvb_v5_fe_parms
Mauro Carvalho Chehab [Sat, 30 Aug 2014 18:18:32 +0000 (15:18 -0300)]
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>
10 years agolibdvbv5: move internal parameters to a separate structure
Mauro Carvalho Chehab [Sat, 30 Aug 2014 16:41:32 +0000 (13:41 -0300)]
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>
10 years agolibdvbv5: Move charsets to be inside the parms struct
Mauro Carvalho Chehab [Sat, 30 Aug 2014 14:05:37 +0000 (11:05 -0300)]
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>
10 years agolibdvbv5: be coherent with parse_string.h header
Mauro Carvalho Chehab [Sat, 30 Aug 2014 14:03:05 +0000 (11:03 -0300)]
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>
10 years agov4l2-compliance: require G/S_PRIORITY support for m2m devices
Hans Verkuil [Mon, 25 Aug 2014 12:53:47 +0000 (14:53 +0200)]
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>
10 years agolibdvbv5: Make dummy_fe static
Gregor Jasny [Sat, 23 Aug 2014 16:42:43 +0000 (13:42 -0300)]
libdvbv5: Make dummy_fe static

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Hide unused and unexposed cnr_to_qual_s tables
Gregor Jasny [Sat, 23 Aug 2014 16:42:41 +0000 (13:42 -0300)]
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>
10 years agolibdvbv5: Rename and hide charset definitions
Gregor Jasny [Sat, 23 Aug 2014 16:42:40 +0000 (13:42 -0300)]
libdvbv5: Rename and hide charset definitions

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Remove dvbsat_polarization_name (same as dvb_sat_pol_name)
Gregor Jasny [Sat, 23 Aug 2014 16:42:39 +0000 (13:42 -0300)]
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>
10 years agoStart v4l-utils 1.3.91 development cycle
Gregor Jasny [Fri, 22 Aug 2014 15:41:30 +0000 (17:41 +0200)]
Start v4l-utils 1.3.91 development cycle

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agoPrepare for 1.3.90 release v4l-utils-1.3.90
Gregor Jasny [Fri, 22 Aug 2014 15:03:39 +0000 (17:03 +0200)]
Prepare for 1.3.90 release

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agoqv4l2: Clean up icon distribution list
Gregor Jasny [Fri, 22 Aug 2014 15:20:12 +0000 (17:20 +0200)]
qv4l2: Clean up icon distribution list

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agoqv4l2: reset bytesperline when changing pixelformat.
Hans Verkuil [Wed, 13 Aug 2014 14:20:19 +0000 (16:20 +0200)]
qv4l2: reset bytesperline when changing pixelformat.

When changing the width or the pixelformat, make sure to zero bytesperline
when setting the format to force the driver to recalculate bytesperline.

This was done for the width, but not the pixelformat.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix broken SDR support
Hans Verkuil [Mon, 11 Aug 2014 15:18:27 +0000 (17:18 +0200)]
qv4l2: fix broken SDR support

Commit fb1334e60cf2541c630e15c4883cd0eabf0581b5 broke the SDR support.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl/qv4l2: fix movement counter calculation
Hans Verkuil [Mon, 11 Aug 2014 14:06:17 +0000 (16:06 +0200)]
v4l2-ctl/qv4l2: fix movement counter calculation

The calculation that determines the 'scrolling' of the test pattern
could 'jump': the counters could become negative and taking the
modulus of a negative number doesn't always do what you expect.

Ensure that the step values are always positive to prevent this issue.

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