Commit graph

19 commits

Author SHA1 Message Date
Mathieu Duponchelle 09749192d8 mpegts: extend support for ATSC tables
Adds constructors for the following sections:

STT: System Time Table
MGT: Master Guide Table
RRT: Rating Region Table

Also adds parsing code for RRT
2019-05-30 13:53:05 +00:00
Tim-Philipp Müller b6411ae74c libs: fix API export/import and 'inconsistent linkage' on MSVC
For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

While we're at it, add new GST_API_EXPORT in config.h and use
that for GST_*_API decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-24 14:45:56 +01:00
Luis de Bethencourt f76d1a2514 mpegts: remove storage of never used values
Both _parse_atsc_mgt() and  _parse_atsc_vct () change the value of the variable
data just before returning. The new value is never used since data is a pointer
declared at the beginning of the function and going out of scope just after the
new value is stored.

https://bugzilla.gnome.org/show_bug.cgi?id=739404
2014-10-30 23:19:59 +00:00
Sebastian Rasmussen fba6ebaae2 mpegts: No need to check for NULL before calling g_free()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732789
2014-07-09 12:04:17 +02:00
Thiago Santos 1d233b7516 mpegts: atsc: fix leak of short name 2014-07-08 15:43:32 -03:00
Sebastian Dröge 426f9e6097 mpegts: Fix memory leaks in the test and the library
Currently uses g_boxed_free() in the unit test, this needs to
be fixed properly when cleaning up the API.

https://bugzilla.gnome.org/show_bug.cgi?id=730914
2014-06-29 21:34:50 +02:00
Thiago Santos e6244874ab mpegts: atsc: avoid calling g_convert with 0-sized input
Avoids an assertion. The cached string will be assigned an empty string
as its value when size is 0.
2014-06-27 12:50:27 -03:00
Edward Hervey 22dfd9aef3 mpegts: Unify API : GstMpegts / gst_mpegts_ / GST_*_MPEGTS_
It was previously a mix and match of both variants, introducing just too much
confusion.

The prefix are from now on:
* GstMpegts for structures and type names (and not GstMpegTs)
* gst_mpegts_ for functions (and not gst_mpeg_ts_)
* GST_MPEGTS_ for enums/flags (and not GST_MPEG_TS_)
* GST_TYPE_MPEGTS_ for types (and not GST_TYPE_MPEG_TS_)

The rationale for chosing that is:
* the namespace is shorter/direct (it's mpegts, not mpeg_ts nor mpeg-ts)
* the namespace is one word under Gst
* it's shorter (yah)
2014-06-25 14:50:05 +02:00
Edward Hervey a57005abbc mpegts: Remove unneeded NULL check
Allocating those structures is done in all code paths leading there

CID #1219860
CID #1219861
CID #1219862
CID #1219863
CID #1219864
2014-06-02 08:24:08 +02:00
Thiago Santos fa1eb09520 mpegts: atsc: add missing field to ETT table
Set the subtable_extension as ett_table_id_extension
for ETT tables as it is used by it

https://bugzilla.gnome.org/show_bug.cgi?id=730435
2014-05-29 10:38:00 +02:00
Thiago Santos 1cab60b713 mpegts: atsc: add atsc's EIT table parsing
ATSC has its own version of the EIT table (DVB also has one).

This patch adds parsing for the ATSC EIT table and also fixed
the section identification to mark it as the ATSC one.

The implementation aws refactored to reuse some common internal
structures from ETT.

Also adds its dumping function to ts-parser example

https://bugzilla.gnome.org/show_bug.cgi?id=730435
2014-05-29 10:38:00 +02:00
Thiago Santos 0c6bb561e0 mpegts: atsc: add STT table parsing
Adds the system time table structure and functions for convenient parsing of
it and for getting the UTC datetime that it represents. Also adds its
information dumping to the ts-parser example

https://bugzilla.gnome.org/show_bug.cgi?id=730435
2014-05-29 10:37:59 +02:00
Thiago Santos 0c0379e8f0 mpegts: atsc: add encoding conversion for UTF-16 ETT strings
https://bugzilla.gnome.org/show_bug.cgi?id=730435
2014-05-29 10:37:59 +02:00
Thiago Santos 7ced36eccd mpegts: atsc: add ETT structures and parsing
ETT (extended text table) contains ATSC text information with descriptions
of virtual channels and events. The text can be internationalized and also
compressed.

https://bugzilla.gnome.org/show_bug.cgi?id=730435
2014-05-29 10:37:59 +02:00
Thiago Santos 9eed28d353 mpegts: add atsc MGT section parsing
Add a parsing function for MGT and also detect the EIT tables
for ATSC, the EIT pids are reported inside the MGT and we are still
only relying only on the table id for detecting it. In the future we
would want to also check the pid and compare with whatever the MGT
previously reported to confirm that it is indeed the EIT.

https://bugzilla.gnome.org/show_bug.cgi?id=730435
2014-05-29 10:37:59 +02:00
Thiago Santos 8f6a3c0a99 mpegts: atsc: rename TVCT to VCT as it is the same as CVCT
Make the ATSC section parse handle both TVCT and CVCT as they are
nearly the same struct (CVCT uses 2 reserved bits that are ignored
in TVCT).

This is changing the glib type and the struct name but TVCT wasn't
released in a stable package yet so there should be no problem.

Also includes some parsing fixes and changes short_name to be
directly stored as utf8 rather than utf16

https://bugzilla.gnome.org/show_bug.cgi?id=730642
2014-05-29 10:37:59 +02:00
Thiago Santos f99fe4747e mpegts: sections: prevent assertion when packet parsing fails
the descriptors entry can be left as NULL and freeing the structure
will fail (assertion happens)
2014-05-15 19:25:06 -03:00
Tim-Philipp Müller 990efe1fc0 mpegts: for loop initial declarations are only allowed in C99 mode
Fixes compiler warnings.
2014-04-16 00:28:37 +01:00
Stefan Ringel f566d17202 mpegts: add atsc terrestrial virtual channel table
https://bugzilla.gnome.org/show_bug.cgi?id=727460
2014-04-10 09:09:38 +02:00