Added DTSC rate limiter. Closes #12
This commit is contained in:
parent
a2adfdcd7d
commit
ee41aa7cd0
2 changed files with 7 additions and 0 deletions
|
@ -23,6 +23,12 @@ DTSC::Stream::Stream(unsigned int rbuffers){
|
|||
buffercount = rbuffers;
|
||||
}
|
||||
|
||||
/// Returns the time in milliseconds of the last received packet.
|
||||
/// This is _not_ the time this packet was received, only the stored time.
|
||||
unsigned int DTSC::Stream::getTime(){
|
||||
return buffers.front().getContentP("time")->NumValue();
|
||||
}
|
||||
|
||||
/// Attempts to parse a packet from the given std::string buffer.
|
||||
/// Returns true if successful, removing the parsed part from the buffer string.
|
||||
/// Returns false if invalid or not enough data is in the buffer.
|
||||
|
|
|
@ -129,6 +129,7 @@ namespace DTSC{
|
|||
std::string & outPacket(unsigned int num);
|
||||
std::string & outHeader();
|
||||
Ring * getRing();
|
||||
unsigned int getTime();
|
||||
void dropRing(Ring * ptr);
|
||||
private:
|
||||
std::deque<DTSC::DTMI> buffers;
|
||||
|
|
Loading…
Add table
Reference in a new issue