diff options
author | Thiago Santos <ts.santos@sisa.samsung.com> | 2014-05-22 01:47:48 -0300 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2014-05-29 10:37:59 +0200 |
commit | 0c6bb561e03c564c77510ace2dcc2a4f06c379b2 (patch) | |
tree | c2a7cfe0e35530b5ac1007744a0620c4cf373a8d /tests/examples | |
parent | 0c0379e8f03bcf9145fce3fe622d8bc71de8f045 (diff) | |
download | gstreamer-plugins-bad-0c6bb561e03c564c77510ace2dcc2a4f06c379b2.tar.gz |
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
Diffstat (limited to 'tests/examples')
-rw-r--r-- | tests/examples/mpegts/ts-parser.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/examples/mpegts/ts-parser.c b/tests/examples/mpegts/ts-parser.c index 029a27439..617e8207f 100644 --- a/tests/examples/mpegts/ts-parser.c +++ b/tests/examples/mpegts/ts-parser.c @@ -640,6 +640,30 @@ dump_ett (GstMpegTsSection * section) } static void +dump_stt (GstMpegTsSection * section) +{ + const GstMpegTsAtscSTT *stt = gst_mpegts_section_get_atsc_stt (section); + GstDateTime *dt; + gchar *dt_str = NULL; + + g_assert (stt); + + dt = gst_mpegts_atsc_stt_get_datetime_utc ((GstMpegTsAtscSTT *) stt); + if (dt) + dt_str = gst_date_time_to_iso8601_string (dt); + + g_printf (" protocol_version : 0x%04x\n", stt->protocol_version); + g_printf (" system_time : 0x%08x\n", stt->system_time); + g_printf (" gps_utc_offset : %d\n", stt->gps_utc_offset); + g_printf (" daylight saving : %d day:%d hour:%d\n", stt->ds_status, + stt->ds_dayofmonth, stt->ds_hour); + g_printf (" utc datetime : %s", dt_str); + + g_free (dt_str); + gst_date_time_unref (dt); +} + +static void dump_nit (GstMpegTsSection * section) { const GstMpegTsNIT *nit = gst_mpegts_section_get_nit (section); @@ -839,6 +863,9 @@ dump_section (GstMpegTsSection * section) case GST_MPEGTS_SECTION_ATSC_ETT: dump_ett (section); break; + case GST_MPEGTS_SECTION_ATSC_STT: + dump_stt (section); + break; default: g_printf (" Unknown section type\n"); break; |