diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-01-22 14:08:58 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-01-22 14:08:58 +0100 |
commit | 74e2beb5b80470a26054c8c51665996b10303f68 (patch) | |
tree | 55032f4b62aea432d03c8a49adfab51740b4640b /fig0_25.cpp | |
parent | e05c1b5903709651aac348fd5144de3ccbbd77a3 (diff) | |
download | etisnoop-74e2beb5b80470a26054c8c51665996b10303f68.tar.gz etisnoop-74e2beb5b80470a26054c8c51665996b10303f68.tar.bz2 etisnoop-74e2beb5b80470a26054c8c51665996b10303f68.zip |
Add repetition rate analyser
Diffstat (limited to 'fig0_25.cpp')
-rw-r--r-- | fig0_25.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/fig0_25.cpp b/fig0_25.cpp index 7e6b69b..7859868 100644 --- a/fig0_25.cpp +++ b/fig0_25.cpp @@ -28,11 +28,28 @@ #include <cstdio> #include <cstring> #include <map> +#include <unordered_set> + +static std::unordered_set<int> services_seen; + +bool fig0_25_is_complete(int services_id) +{ + bool complete = services_seen.count(services_id); + + if (complete) { + services_seen.clear(); + } + else { + services_seen.insert(services_id); + } + + return complete; +} // FIG 0/25 fig0.oe() Announcement support // ETSI EN 300 401 8.1.10.5.1 -void fig0_25(fig0_common_t& fig0, int indent) +bool fig0_25(fig0_common_t& fig0, int indent) { uint32_t key; uint16_t SId, Asu_flags, EId; @@ -40,11 +57,13 @@ void fig0_25(fig0_common_t& fig0, int indent) char tmpbuf[256]; char desc[256]; uint8_t* f = fig0.f; + bool complete = false; while (i < (fig0.figlen - 4)) { // iterate over other ensembles announcement support // SId, Asu flags, Rfu, Number of EIds SId = ((uint16_t)f[i] << 8) | (uint16_t)f[i+1]; + complete |= fig0_25_is_complete(SId); Asu_flags = ((uint16_t)f[i+2] << 8) | (uint16_t)f[i+3]; Rfu = (f[i+4] >> 4); Number_EIds = (f[i+4] & 0x0F); @@ -87,5 +106,7 @@ void fig0_25(fig0_common_t& fig0, int indent) } } } + + return complete; } |