aboutsummaryrefslogtreecommitdiffstats
path: root/src/AVTInput.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-12-04 14:53:54 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-12-04 14:53:54 +0100
commitc89b5e3c0d9515f07892af464bd6c60fb3427c36 (patch)
tree18c7573859606dada82e56d5115cd5d1e71129db /src/AVTInput.h
parent814ec3abaede73ea38c7130333c7bc0a18e05d91 (diff)
downloadODR-SourceCompanion-c89b5e3c0d9515f07892af464bd6c60fb3427c36.tar.gz
ODR-SourceCompanion-c89b5e3c0d9515f07892af464bd6c60fb3427c36.tar.bz2
ODR-SourceCompanion-c89b5e3c0d9515f07892af464bd6c60fb3427c36.zip
Timestamp arrival of UDP packets
Diffstat (limited to 'src/AVTInput.h')
-rw-r--r--src/AVTInput.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/AVTInput.h b/src/AVTInput.h
index e925a80..fd6cf02 100644
--- a/src/AVTInput.h
+++ b/src/AVTInput.h
@@ -37,6 +37,7 @@
#include <string>
#include <queue>
#include <vector>
+#include <chrono>
#define DEF_BR 64
@@ -79,12 +80,12 @@ class AVTInput
*/
int setDabPlusParameters(int bitrate, int channels, int sample_rate, bool sbr, bool ps);
- /*! Read incomming frames from the encoder, reorder and reassemble then into DAB+ superframes
+ /*! Read incoming frames from the encoder, reorder and reassemble then into DAB+ superframes
*! Give the next reassembled audio frame (120ms for DAB+)
*
* \return the size of the frame or 0 if none are available yet
*/
- ssize_t getNextFrame(std::vector<uint8_t> &buf);
+ size_t getNextFrame(std::vector<uint8_t> &buf, std::chrono::system_clock::time_point& ts);
/*! Store a new PAD frame.
*! Frames are sent to the encoder on request
@@ -118,6 +119,7 @@ class AVTInput
bool _frameAligned = false;
std::vector<uint8_t> _currentFrame;
int32_t _nbFrames = 0;
+ std::chrono::system_clock::time_point _frameZeroTimestamp;
size_t _currentFrameSize = 0;
bool _parseURI(const char* uri, std::string& address, long& port);