mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-02 08:09:35 +02:00
x
git-svn-id: svn://elaine/murooma/trunk@174 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
6d29618701
commit
c6896b46ea
7 changed files with 25 additions and 0 deletions
53
client/stream.h
Normal file
53
client/stream.h
Normal file
|
@ -0,0 +1,53 @@
|
|||
#ifndef STREAM_H
|
||||
#define STREAM_H
|
||||
|
||||
|
||||
#include <deque>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include "doubleBuffer.h"
|
||||
#include "chunk.h"
|
||||
#include "timeUtils.h"
|
||||
#include "queue.h"
|
||||
|
||||
|
||||
class Stream
|
||||
{
|
||||
public:
|
||||
Stream();
|
||||
void addChunk(Chunk* chunk);
|
||||
void getPlayerChunk(short* outputBuffer, double outputBufferDacTime, unsigned long framesPerBuffer);
|
||||
void setBufferLen(size_t bufferLenMs);
|
||||
void setLatency(size_t latency);
|
||||
|
||||
private:
|
||||
time_point_ms getNextPlayerChunk(short* outputBuffer, unsigned long framesPerBuffer, int correction = 0);
|
||||
void getSilentPlayerChunk(short* outputBuffer, unsigned long framesPerBuffer);
|
||||
void updateBuffers(int age);
|
||||
void resetBuffers();
|
||||
|
||||
long lastTick;
|
||||
float sleep;
|
||||
|
||||
// int correction;
|
||||
Queue<std::shared_ptr<Chunk>> chunks;
|
||||
DoubleBuffer<int>* pCardBuffer;
|
||||
DoubleBuffer<int>* pMiniBuffer;
|
||||
DoubleBuffer<int>* pBuffer;
|
||||
DoubleBuffer<int>* pShortBuffer;
|
||||
std::shared_ptr<Chunk> chunk;
|
||||
|
||||
int median;
|
||||
int shortMedian;
|
||||
time_t lastUpdate;
|
||||
int bufferMs;
|
||||
int latencyMs;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue