buildsystem: Fix configure.ac --disable-v4l-utils option

When using AC_ARG_ENABLE with a string containing - in it, the variable created will contains a _ instead of the -.
Thus for AC_ARG_ENABLE(v4l-utils ..., the variable enable_v4l_utils must be checked.

Signed-off-by: Alain Volmat <alain.volmat@st.com>
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
libdvbv5: Fix compiler warning about signedness

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
libdvbv5: Add table ID of extra NIT/SDT tables

At least on dvb-apps, those two extra table IDs are present.
Add there at the header files, for completeness.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5/dvb-scan: Modify to use the newer TS tables parser

This code has an incomplete MPEG TS tables parser.

Also, it is not endiannes-aware.

Replace it by the newer one.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: move DVB scan handler code to a separate file

This were polluting the DVB descriptors API. They don't belong
to it anymore, with the new descriptors parsing code.

Move to a separate file.

It should be noticed that, right now, the DVB scan code is
not producing a valid scan file anymore, as those structs are
not properly initialized.

Latter patches will fix that.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: move handler code to a separate file

Move the functions that allocate/deallocate memory for the
DVB scan description data to a separate file, and better
name them, to avoid confusion with the dvb_desc used
inside the descriptors parsing API.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: move all tables structs to the handler data

As we'll use the data there, move everything parsed from
the MPEG TS tables into struct dvb_v5_descriptors.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: fixup parsing of PMT tables

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Add a parser for extension descriptors

There are some descriptors that are extensions, e. g. they
use a new descriptor range.

Add support for them, as the DVB-T2 table is one of such
extensions.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5/dvb-scan: handle allocation errors

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5/dvb-scan: be more verbose in debug mode

That helps to know what's happening, especially when there are
some crashes on it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5/dvb-scan: Fix a series of checks at buffer handling

The logic inside dvb_read_section_with_id() is rather complex,
as the same buffer is de-allocated/re-allocated multiple times.

Simplify it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5/parse_string: don't free twice

As reported by valgrind, sometimes, it was freeing the same
data twice, with was causing random troubles elsewhere.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: better handle memory errors

Avoid the risk of filling past of the buffers, by checking i
are there any space available before filling the buffers.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5/descriptors: print descriptor number in hexadecimal

Descriptors are tabled in hexadecimal. Put them in this format,
to make easier to compare with DTV and MPEG tables.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
descriptors/nit: byte struct should be packed

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5/descriptors: Make easier to read/edit the descriptors table

Instead of one big line per descriptor, break it into several lines.

This was generated by this script:

	cat lib/libdvbv5/descriptors.c |perl -ne 's/(\[.*\]\s*\=\s*\{)\s*([^\,]+)\,\s*([^\,]+)\,\s*([^\,]+)\,\s*([^\,]+)\,\s*(.*)\s+(\}\,)/$1\n\t\t.name  = $2,\n\t\t.init  = $3,\n\t\t.print = $4,\n\t\t.free  = $5\n\t\t.size  = $6,\n\t$7/g; print $_' >a && mv a lib/libdvbv5/descriptors.c
	cat lib/libdvbv5/descriptors/desc_extension.c |perl -ne 's/(\[.*\]\s*\=\s*\{)\s*([^\,]+)\,\s*([^\,]+)\,\s*([^\,]+)\,\s*([^\,]+)\,\s*(.*)\s+(\}\,)/$1\n\t\t.name  = $2,\n\t\t.init  = $3,\n\t\t.print = $4,\n\t\t.free  = $5\n\t\t.size  = $6,\n\t$7/g; print $_' >a && mv a lib/libdvbv5/descriptors/desc_extension.c

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: add support for ISDBT terrestrial system descriptor

This descriptor contains the frequency tables on ISDB-T.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: add parser for TS information descriptor

This descriptor is used on ISDB-T.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
libdvbv5: Add descriptors for virtual channel number

Those descriptors are present in some european countries and
in Brazil.

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