diff options
author | Stefan Pöschel <github@basicmaster.de> | 2017-08-24 10:57:41 +0200 |
---|---|---|
committer | Stefan Pöschel <github@basicmaster.de> | 2017-08-24 10:57:41 +0200 |
commit | ea629edd86ed9358243a673845b62a1be7d6a6b3 (patch) | |
tree | f5b2b17fe6f1a12215be85bc113b1d6b42b71e36 | |
parent | 65b6c374e716878c46f7ff8ee86f25a5807c29cd (diff) | |
download | ODR-PadEnc-ea629edd86ed9358243a673845b62a1be7d6a6b3.tar.gz ODR-PadEnc-ea629edd86ed9358243a673845b62a1be7d6a6b3.tar.bz2 ODR-PadEnc-ea629edd86ed9358243a673845b62a1be7d6a6b3.zip |
PAD: add function to check if specific DG in queue
The function allows to check e.g. if the previous slide is still in
transmission, in order to postpone the transmission of the current one.
-rw-r--r-- | src/pad_common.cpp | 7 | ||||
-rw-r--r-- | src/pad_common.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/pad_common.cpp b/src/pad_common.cpp index 13a96ef..f5da635 100644 --- a/src/pad_common.cpp +++ b/src/pad_common.cpp @@ -111,6 +111,13 @@ bool PADPacketizer::QueueFilled() { return !queue.empty(); } +bool PADPacketizer::QueueContainsDG(int apptype_start) { + for(std::deque<DATA_GROUP*>::const_iterator it = queue.cbegin(); it != queue.cend(); it++) + if((*it)->apptype_start == apptype_start) + return true; + return false; +} + pad_t* PADPacketizer::GetPAD() { bool pad_flushable = false; diff --git a/src/pad_common.h b/src/pad_common.h index 5ee2d80..95134bd 100644 --- a/src/pad_common.h +++ b/src/pad_common.h @@ -120,6 +120,7 @@ public: void AddDG(DATA_GROUP* dg, bool prepend); void AddDGs(const std::vector<DATA_GROUP*>& dgs, bool prepend); bool QueueFilled(); + bool QueueContainsDG(int apptype_start); pad_t* GetPAD(); void WriteAllPADs(int output_fd, int limit = -1, bool output_sole_fpad = false); |