platform/upstream/v4l-utils.git
9 years agoqv4l2: the helper now zeroes bytesperline
Hans Verkuil [Sat, 13 Sep 2014 09:08:34 +0000 (11:08 +0200)]
qv4l2: the helper now zeroes bytesperline

So we no longer need to do it in qv4l2.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
9 years ago(c)v4l-helpers: zero bytesperline, swap arg order
Hans Verkuil [Sat, 13 Sep 2014 09:07:40 +0000 (11:07 +0200)]
(c)v4l-helpers: zero bytesperline, swap arg order

When calling try/s_fmt optionally zero bytesperline.

Also swap the order of the last two arguments of v4l_format_s_bytesperline
and v4l_format_s_sizeimage to be consistent with other helper functions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
9 years agobuildsystem: Use latest ax_prog_doxygen from GNU Autoconf Archive
Gregor Jasny [Fri, 12 Sep 2014 11:26:36 +0000 (13:26 +0200)]
buildsystem: Use latest ax_prog_doxygen from GNU Autoconf Archive

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
9 years agolibdvbv5: group documentation into modules
Mauro Carvalho Chehab [Fri, 12 Sep 2014 01:51:27 +0000 (22:51 -0300)]
libdvbv5: group documentation into modules

In order to help digging into the documentation, put each
documented block into a group.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5 documentation review
Mauro Carvalho Chehab [Fri, 12 Sep 2014 00:26:09 +0000 (21:26 -0300)]
libdvbv5 documentation review

General cleanup at the libdvbv5 documentation, in order to fix
some minor issues.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: add support for mgt.h
Mauro Carvalho Chehab [Thu, 11 Sep 2014 22:35:56 +0000 (19:35 -0300)]
libdvbv5: add support for mgt.h

With that, all tables are documented via doxygen.

We're still missing documentation for the desc_*.h headers.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: add documentation for cat.h and atsc_header.h
Mauro Carvalho Chehab [Thu, 11 Sep 2014 22:20:16 +0000 (19:20 -0300)]
libdvbv5: add documentation for cat.h and atsc_header.h

Add tags for doxygen to process those two headers.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: don't use DVB_DESC_HEADER() macro
Mauro Carvalho Chehab [Thu, 11 Sep 2014 21:16:31 +0000 (18:16 -0300)]
libdvbv5: don't use DVB_DESC_HEADER() macro

This macro was a very bad idea, as it causes doxygen to produce
wrong data. Get rid of it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: don't use ATSC_HEADER() macro
Mauro Carvalho Chehab [Thu, 11 Sep 2014 20:37:46 +0000 (17:37 -0300)]
libdvbv5: don't use ATSC_HEADER() macro

This macro was a very bad idea, as it causes doxygen to produce
wrong data. Get rid of it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: add documentation for ATSC EIT.
Mauro Carvalho Chehab [Thu, 11 Sep 2014 20:28:40 +0000 (17:28 -0300)]
libdvbv5: add documentation for ATSC EIT.

ATSC EIT is different than the DVB EIT table. Document it, and
be sure that the DVB EIT table will be better described.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: Add a mainpage to the documentation
Mauro Carvalho Chehab [Thu, 11 Sep 2014 18:50:43 +0000 (15:50 -0300)]
libdvbv5: Add a mainpage to the documentation

Let's add a mainpage to the documentation, and do some
cleanup on other pages.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: Add documentation for EIT DVB parser
Mauro Carvalho Chehab [Thu, 11 Sep 2014 17:38:09 +0000 (14:38 -0300)]
libdvbv5: Add documentation for EIT DVB parser

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: add documentation for crc32.h
Mauro Carvalho Chehab [Thu, 11 Sep 2014 16:56:13 +0000 (13:56 -0300)]
libdvbv5: add documentation for crc32.h

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: add documentation for the NIT table parser
Mauro Carvalho Chehab [Thu, 11 Sep 2014 16:47:38 +0000 (13:47 -0300)]
libdvbv5: add documentation for the NIT table parser

Add doxygen documentation for nit.h.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: some documentation fixups for sdt.h
Mauro Carvalho Chehab [Thu, 11 Sep 2014 16:47:24 +0000 (13:47 -0300)]
libdvbv5: some documentation fixups for sdt.h

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: add documentation for sdt.h
Mauro Carvalho Chehab [Thu, 11 Sep 2014 16:09:43 +0000 (13:09 -0300)]
libdvbv5: add documentation for sdt.h

Add doxygen documentation for the contents of sdt.h.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: fix some issues at PAT documentation
Mauro Carvalho Chehab [Thu, 11 Sep 2014 16:09:34 +0000 (13:09 -0300)]
libdvbv5: fix some issues at PAT documentation

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: better comment the descriptors
Mauro Carvalho Chehab [Thu, 11 Sep 2014 15:47:42 +0000 (12:47 -0300)]
libdvbv5: better comment the descriptors

Add a @brief to each descriptor at descriptors.h, explaining from
what spec the descriptor came.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: add doxygen tags to pmt.h
Mauro Carvalho Chehab [Thu, 11 Sep 2014 02:19:24 +0000 (23:19 -0300)]
libdvbv5: add doxygen tags to pmt.h

Add documentation for the MPEG-TS PMT table parser

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agolibdvbv5: fix some cut-and-paste errors at documentation
Mauro Carvalho Chehab [Thu, 11 Sep 2014 15:22:59 +0000 (12:22 -0300)]
libdvbv5: fix some cut-and-paste errors at documentation

Forgot to rename some fields while cut-and-pasting from vct.h.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agodoxygen_libdvbv5.cfg: add header.h, vct.h and pat.h
Mauro Carvalho Chehab [Thu, 11 Sep 2014 01:47:46 +0000 (22:47 -0300)]
doxygen_libdvbv5.cfg: add header.h, vct.h and pat.h

Add those 3 headers to doxygen documentation generator.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>