diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-03-05 23:29:57 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-03-05 23:29:57 +0100 |
commit | 0957760c42cc04d9c295b649b039015186b25609 (patch) | |
tree | d142ad6434b459e79359a2ad3121a7f6f68a77f0 /src/dabOutput | |
parent | fd8748e1a9b49f2c6ca83247db97d6bb30a48ef6 (diff) | |
download | dabmux-0957760c42cc04d9c295b649b039015186b25609.tar.gz dabmux-0957760c42cc04d9c295b649b039015186b25609.tar.bz2 dabmux-0957760c42cc04d9c295b649b039015186b25609.zip |
Replace clock_gettime with std::chrono for EDI
Diffstat (limited to 'src/dabOutput')
-rw-r--r-- | src/dabOutput/dabOutput.h | 2 | ||||
-rw-r--r-- | src/dabOutput/dabOutputSimul.cpp | 3 | ||||
-rw-r--r-- | src/dabOutput/edi/TagItems.cpp | 8 | ||||
-rw-r--r-- | src/dabOutput/edi/TagItems.h | 10 |
4 files changed, 13 insertions, 10 deletions
diff --git a/src/dabOutput/dabOutput.h b/src/dabOutput/dabOutput.h index 6756027..5f02f76 100644 --- a/src/dabOutput/dabOutput.h +++ b/src/dabOutput/dabOutput.h @@ -2,7 +2,7 @@ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2013, 2014 Matthias P. Braendli + Copyright (C) 2016 Matthias P. Braendli http://mpb.li http://opendigitalradio.org diff --git a/src/dabOutput/dabOutputSimul.cpp b/src/dabOutput/dabOutputSimul.cpp index 04ce536..347b29c 100644 --- a/src/dabOutput/dabOutputSimul.cpp +++ b/src/dabOutput/dabOutputSimul.cpp @@ -2,7 +2,7 @@ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2013 Matthias P. Braendli + Copyright (C) 2016 Matthias P. Braendli http://mpb.li SIMUL throttling output. It guarantees correct frame generation rate @@ -90,3 +90,4 @@ int DabOutputSimul::Write(void* buffer, int size) return size; } + diff --git a/src/dabOutput/edi/TagItems.cpp b/src/dabOutput/edi/TagItems.cpp index f3e8404..54e996b 100644 --- a/src/dabOutput/edi/TagItems.cpp +++ b/src/dabOutput/edi/TagItems.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2013,2014 Matthias P. Braendli + Copyright (C) 2016 Matthias P. Braendli http://mpb.li EDI output. @@ -131,6 +131,12 @@ std::vector<uint8_t> TagDETI::Assemble() return packet; } +void TagDETI::set_seconds(std::chrono::system_clock::time_point t) +{ + std::time_t posix_timestamp_1_jan_2000 = 946684800; + seconds = std::chrono::system_clock::to_time_t(t) - posix_timestamp_1_jan_2000; +} + std::vector<uint8_t> TagESTn::Assemble() { diff --git a/src/dabOutput/edi/TagItems.h b/src/dabOutput/edi/TagItems.h index 50d5e99..6a8470b 100644 --- a/src/dabOutput/edi/TagItems.h +++ b/src/dabOutput/edi/TagItems.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013,2014 Matthias P. Braendli + Copyright (C) 2016 Matthias P. Braendli http://mpb.li EDI output. @@ -30,6 +30,7 @@ #include "config.h" #include "Eti.h" #include <vector> +#include <chrono> #include <string> #include <stdint.h> @@ -98,12 +99,7 @@ class TagDETI : public TagItem */ uint32_t seconds; - void set_seconds(struct timespec tv) - { - time_t posix_timestamp_1_jan_2000 = 946684800; - seconds = tv.tv_sec - posix_timestamp_1_jan_2000; - } - + void set_seconds(std::chrono::system_clock::time_point t); /* TSTA: Shall be the 24 least significant bits of the Time Stamp * (TIST) field from the STI-D(LI) Frame. The full definition for the |