From 4acf7a34c202293884739b40af699943d7e8e9d9 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 29 Jan 2019 15:55:17 +0100 Subject: Add partial FIG2 label support Add support for Ensemble label, programme services and components, although the implementation for the component label is not properly tested. (data services still to be done) Neither short labels nor UCS-2 are not yet implemented. Also, support for draftETSI TS 103 176 which redefines the meaning of Rfa is still pending. --- src/fig/FIG1.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/fig/FIG1.cpp') diff --git a/src/fig/FIG1.cpp b/src/fig/FIG1.cpp index 8f41239..7171a87 100644 --- a/src/fig/FIG1.cpp +++ b/src/fig/FIG1.cpp @@ -3,7 +3,7 @@ 2011, 2012 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2015 + Copyright (C) 2019 Matthias P. Braendli, matthias.braendli@mpb.li Implementation of FIG1 @@ -37,6 +37,12 @@ FillStatus FIG1_0::fill(uint8_t *buf, size_t max_size) auto ensemble = m_rti->ensemble; size_t remaining = max_size; + if (not ensemble->label.has_fig1_label()) { + fs.complete_fig_transmitted = true; + fs.num_bytes_written = 0; + return fs; + } + if (remaining < 22) { fs.num_bytes_written = 0; return fs; @@ -83,15 +89,15 @@ FillStatus FIG1_1::fill(uint8_t *buf, size_t max_size) // Rotate through the subchannels until there is no more // space - for (; service != ensemble->services.end(); - ++service) { - + for (; service != ensemble->services.end(); ++service) { if (remaining < 4 + 16 + 2) { break; } - if ((*service)->getType(ensemble) == subchannel_type_t::Audio) { - auto fig1_1 = (FIGtype1_1 *)buf; + if ((*service)->getType(ensemble) == subchannel_type_t::Audio and + (*service)->label.has_fig1_label()) { + + auto fig1_1 = (FIGtype1_1*)buf; fig1_1->FIGtypeNumber = 1; fig1_1->Length = 21; @@ -148,9 +154,8 @@ FillStatus FIG1_4::fill(uint8_t *buf, size_t max_size) /* We check in the config parser if the primary component has * a label, which is forbidden since V2.1.1 */ - if (not (*component)->label.long_label().empty() ) { + if ((*component)->label.has_fig1_label() ) { if ((*service)->getType(ensemble) == subchannel_type_t::Audio) { - if (remaining < 5 + 16 + 2) { break; } @@ -173,7 +178,6 @@ FillStatus FIG1_4::fill(uint8_t *buf, size_t max_size) remaining -= 5; } else { // Data - if (remaining < 7 + 16 + 2) { break; } @@ -237,7 +241,8 @@ FillStatus FIG1_5::fill(uint8_t *buf, size_t max_size) break; } - if ((*service)->getType(ensemble) != subchannel_type_t::Audio) { + if ((*service)->getType(ensemble) != subchannel_type_t::Audio and + (*service)->label.has_fig1_label()) { auto fig1_5 = (FIGtype1_5 *)buf; fig1_5->FIGtypeNumber = 1; fig1_5->Length = 23; -- cgit v1.2.3