diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-28 13:21:55 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-28 13:21:55 +0100 |
commit | 121059214ba508e9d51dc64b537eec7f44809d1c (patch) | |
tree | bf5e1cfdfe177a1fd4b839c7680749948634d3f2 /src | |
parent | 438c177a21e10149fd947cc1611a078723aae6e6 (diff) | |
download | dabmux-121059214ba508e9d51dc64b537eec7f44809d1c.tar.gz dabmux-121059214ba508e9d51dc64b537eec7f44809d1c.tar.bz2 dabmux-121059214ba508e9d51dc64b537eec7f44809d1c.zip |
Change FIG0/13 handling for MOT slideshow
Diffstat (limited to 'src')
-rw-r--r-- | src/DabMux.cpp | 45 | ||||
-rw-r--r-- | src/DabMux.h | 11 | ||||
-rw-r--r-- | src/MuxElements.h | 5 |
3 files changed, 59 insertions, 2 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp index de5b00f..7b6530d 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -1495,9 +1495,50 @@ int main(int argc, char *argv[]) goto EXIT; } - if ((*subchannel)->type != 3) continue; + if ((*subchannel)->type == 0) { // audio + if (fig0 == NULL) { + fig0 = (FIGtype0*)&etiFrame[index]; + fig0->FIGtypeNumber = 0; + fig0->Length = 1; + fig0->CN = 0; + fig0->OE = 0; + fig0->PD = 1; + fig0->Extension = 13; + index += 2; + figSize += 2; + } + + FIG0_13_longAppInfo* info = + (FIG0_13_longAppInfo*)&etiFrame[index]; + info->SId = htonl((*component)->serviceId); + info->SCIdS = (*component)->SCIdS; + info->No = 1; + index += 5; + figSize += 5; + fig0->Length += 5; + + FIG0_13_app* app = (FIG0_13_app*)&etiFrame[index]; + app->setType(FIG0_13_APPTYPE_SLIDESHOW); + app->length = 4; + app->xpad = 0x0cbc0000; + /* xpad meaning + CA = 0 + CAOrg = 0 + Rfu = 0 + AppTy(5) = 12 (MOT, start of X-PAD data group) + DG = 1 (MSC data groups not used) + Rfu = 0 + DSCTy(6) = 60 (MOT) + CAOrg(16) = 0 + */ + + index += 2 + app->length; + figSize += 2 + app->length; + fig0->Length += 2 + app->length; + } + else if ((*subchannel)->type == 3 && // packet + (*component)->packet.appType != 0xffff) { - if ((*component)->packet.appType != 0xffff) { if (fig0 == NULL) { fig0 = (FIGtype0*)&etiFrame[index]; fig0->FIGtypeNumber = 0; diff --git a/src/DabMux.h b/src/DabMux.h index 7bc9481..3c03add 100644 --- a/src/DabMux.h +++ b/src/DabMux.h @@ -311,6 +311,7 @@ struct FIG_01_SubChannel_LongF { } PACKED; +// See EN 300 401, Clause 8.1.20 for the FIG0_13 description struct FIG0_13_shortAppInfo { uint16_t SId; uint8_t No:4; @@ -333,8 +334,18 @@ struct FIG0_13_app { typeHigh = type >> 3; typeLow = type & 0x1f; } + uint32_t xpad; } PACKED; +#define FIG0_13_APPTYPE_SLIDESHOW 0x2 +#define FIG0_13_APPTYPE_WEBSITE 0x3 +#define FIG0_13_APPTYPE_TPEG 0x4 +#define FIG0_13_APPTYPE_DGPS 0x5 +#define FIG0_13_APPTYPE_TMC 0x6 +#define FIG0_13_APPTYPE_EPG 0x7 +#define FIG0_13_APPTYPE_DABJAVA 0x8 +// 0x441 is Frauenhofer IIS Journaline + struct FIGtype1_0 { uint8_t Length:5; diff --git a/src/MuxElements.h b/src/MuxElements.h index c416314..d3227e9 100644 --- a/src/MuxElements.h +++ b/src/MuxElements.h @@ -127,6 +127,11 @@ struct dabSubchannel { const char* inputName; DabInputBase* input; unsigned char id; + /* The type is: + * 0 for mpeg, dabplus + * 1 for data, dmb + * 3 for packet + */ unsigned char type; uint16_t startAddress; uint16_t bitrate; |