diff options
author | Thiago Santos <ts.santos@sisa.samsung.com> | 2014-05-16 15:39:48 -0300 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2014-05-29 10:37:59 +0200 |
commit | 32d802282065e3c4313501f6c87f110beaaa2014 (patch) | |
tree | ee1425cb6ace822999b4217252800c988a88e9e6 /gst | |
parent | 9eed28d3534913f8012eb4cf101b6bd8d79d7932 (diff) |
tsbase: parse the mgt and add listed EIT/ETT pids to the known psi
This will make tsbase also parse the EITs and ETTs from ATSC streams that have
their pids reported on the MGT and post to the bus
https://bugzilla.gnome.org/show_bug.cgi?id=730435
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mpegtsdemux/mpegtsbase.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gst/mpegtsdemux/mpegtsbase.c b/gst/mpegtsdemux/mpegtsbase.c index 0fef7c720..101f999e6 100644 --- a/gst/mpegtsdemux/mpegtsbase.c +++ b/gst/mpegtsdemux/mpegtsbase.c @@ -88,6 +88,8 @@ static GstStateChangeReturn mpegts_base_change_state (GstElement * element, GstStateChange transition); static gboolean mpegts_base_get_tags_from_eit (MpegTSBase * base, GstMpegTsSection * section); +static gboolean mpegts_base_parse_atsc_mgt (MpegTSBase * base, + GstMpegTsSection * section); static gboolean remove_each_program (gpointer key, MpegTSBaseProgram * program, MpegTSBase * base); @@ -915,6 +917,9 @@ mpegts_base_handle_psi (MpegTSBase * base, GstMpegTsSection * section) /* some tag xtraction + posting */ post_message = mpegts_base_get_tags_from_eit (base, section); break; + case GST_MPEGTS_SECTION_ATSC_MGT: + post_message = mpegts_base_parse_atsc_mgt (base, section); + break; default: break; } @@ -926,6 +931,29 @@ mpegts_base_handle_psi (MpegTSBase * base, GstMpegTsSection * section) gst_mpegts_section_unref (section); } +static gboolean +mpegts_base_parse_atsc_mgt (MpegTSBase * base, GstMpegTsSection * section) +{ + const GstMpegTsAtscMGT *mgt; + gint i; + + mgt = gst_mpegts_section_get_atsc_mgt (section); + if (G_UNLIKELY (mgt == NULL)) + return FALSE; + + for (i = 0; i < mgt->tables->len; ++i) { + GstMpegTsAtscMGTTable *table = g_ptr_array_index (mgt->tables, i); + + if ((table->table_type >= GST_MPEG_TS_ATSC_MGT_TABLE_TYPE_EIT0 && + table->table_type <= GST_MPEG_TS_ATSC_MGT_TABLE_TYPE_EIT127) || + (table->table_type >= GST_MPEG_TS_ATSC_MGT_TABLE_TYPE_ETT0 && + table->table_type <= GST_MPEG_TS_ATSC_MGT_TABLE_TYPE_ETT127)) { + MPEGTS_BIT_SET (base->known_psi, table->pid); + } + } + + return TRUE; +} static gboolean mpegts_base_get_tags_from_eit (MpegTSBase * base, GstMpegTsSection * section) |