aboutsummaryrefslogtreecommitdiffstats
path: root/src/EtiReader.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-20 01:20:41 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-20 01:20:41 +0100
commit28ddaa742d1a815c8c07d17b2a79fbfb964fdc1d (patch)
treef22941e989bb775aacda52876c97ada7b899a7dd /src/EtiReader.cpp
parent95f556cf0797ab4c23f431e5c8c5accfa7f4c30b (diff)
parentf52b0e13f61a947c26236504ffb4b072352abc04 (diff)
downloaddabmod-28ddaa742d1a815c8c07d17b2a79fbfb964fdc1d.tar.gz
dabmod-28ddaa742d1a815c8c07d17b2a79fbfb964fdc1d.tar.bz2
dabmod-28ddaa742d1a815c8c07d17b2a79fbfb964fdc1d.zip
Merge branch 'outputRefactoring' into next
Diffstat (limited to 'src/EtiReader.cpp')
-rw-r--r--src/EtiReader.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/EtiReader.cpp b/src/EtiReader.cpp
index d84ed1f..17f4953 100644
--- a/src/EtiReader.cpp
+++ b/src/EtiReader.cpp
@@ -54,10 +54,9 @@ enum ETI_READER_STATE {
EtiReader::EtiReader(
- double& tist_offset_s,
- unsigned tist_delay_stages) :
+ double& tist_offset_s) :
state(EtiReaderStateSync),
- myTimestampDecoder(tist_offset_s, tist_delay_stages),
+ myTimestampDecoder(tist_offset_s),
eti_fc_valid(false)
{
rcs.enrol(&myTimestampDecoder);
@@ -281,6 +280,8 @@ int EtiReader::loadEtiData(const Buffer& dataIn)
myTimestampDecoder.updateTimestampEti(eti_fc.FP & 0x3,
eti_eoh.MNSC, getPPSOffset(), eti_fc.FCT);
+ myFicSource->loadTimestamp(myTimestampDecoder.getTimestamp());
+
return dataIn.getLength() - input_size;
}
@@ -290,11 +291,6 @@ bool EtiReader::sourceContainsTimestamp()
/* See ETS 300 799, Annex C.2.2 */
}
-void EtiReader::calculateTimestamp(struct frame_timestamp& ts)
-{
- myTimestampDecoder.calculateTimestamp(ts);
-}
-
uint32_t EtiReader::getPPSOffset()
{
if (!sourceContainsTimestamp()) {
@@ -309,9 +305,8 @@ uint32_t EtiReader::getPPSOffset()
}
EdiReader::EdiReader(
- double& tist_offset_s,
- unsigned tist_delay_stages) :
- m_timestamp_decoder(tist_offset_s, tist_delay_stages)
+ double& tist_offset_s) :
+ m_timestamp_decoder(tist_offset_s)
{
rcs.enrol(&m_timestamp_decoder);
}
@@ -359,11 +354,6 @@ bool EdiReader::sourceContainsTimestamp()
return m_fc.tsta != 0xFFFFFF;
}
-void EdiReader::calculateTimestamp(struct frame_timestamp& ts)
-{
- m_timestamp_decoder.calculateTimestamp(ts);
-}
-
bool EdiReader::isFrameReady()
{
return m_frameReady;
@@ -533,8 +523,9 @@ void EdiReader::assemble()
const std::time_t posix_timestamp_1_jan_2000 = 946684800;
auto utc_ts = posix_timestamp_1_jan_2000 + m_seconds - m_utco;
- m_timestamp_decoder.updateTimestampEdi(
- utc_ts, m_fc.tsta, m_fc.fct());
+ m_timestamp_decoder.updateTimestampEdi(utc_ts, m_fc.tsta, m_fc.fct(), m_fc.fp);
+
+ myFicSource->loadTimestamp(m_timestamp_decoder.getTimestamp());
m_frameReady = true;
}