diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-12-24 11:11:42 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-12-24 11:11:42 +0100 |
commit | c76de2b69d2fce16e6ccb2e2ef5ee5e858f84e5b (patch) | |
tree | 4f4938f831fac5c65ab57b5abcac11f152d3af59 /src/dabOutput/edi/Interleaver.h | |
parent | e1acfdd90d331e032170fba70a73a0588d6121cc (diff) | |
download | dabmux-c76de2b69d2fce16e6ccb2e2ef5ee5e858f84e5b.tar.gz dabmux-c76de2b69d2fce16e6ccb2e2ef5ee5e858f84e5b.tar.bz2 dabmux-c76de2b69d2fce16e6ccb2e2ef5ee5e858f84e5b.zip |
Move fragments into interleaver instead of copying them
Diffstat (limited to 'src/dabOutput/edi/Interleaver.h')
-rw-r--r-- | src/dabOutput/edi/Interleaver.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dabOutput/edi/Interleaver.h b/src/dabOutput/edi/Interleaver.h index 1a2e26d..51a584f 100644 --- a/src/dabOutput/edi/Interleaver.h +++ b/src/dabOutput/edi/Interleaver.h @@ -43,23 +43,25 @@ namespace edi { class Interleaver { public: + using fragment_vec = std::vector<PFTFragment>; + /* Configure the interleaver to use latency_frames number of AF * packets for interleaving. Total delay through the interleaver * will be latency_frames * 24ms */ void SetLatency(size_t latency_frames); - /* Push the fragments for an AF Packet into the interleaver */ - void PushFragments(const std::vector< PFTFragment > &fragments); - - std::vector< PFTFragment > Interleave(void); + /* Move the fragments for an AF Packet into the interleaver and + * return interleaved fragments to be transmitted. + */ + fragment_vec Interleave(fragment_vec &fragments); private: size_t m_latency = 0; size_t m_fragment_count = 0; size_t m_interleave_offset = 0; size_t m_stride = 0; - std::deque<std::vector<PFTFragment> > m_buffer; + std::deque<fragment_vec> m_buffer; }; } |