-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStreaming.h
More file actions
36 lines (34 loc) · 755 Bytes
/
Streaming.h
File metadata and controls
36 lines (34 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include "utils.h"
#include "Configuration.h"
#include <WiFiUdp.h>
#include "TimeClock.h"
#include "DataTypes.h"
#define FRAMES_TO_INTERPOLATE (1)
class Streaming : ConfigurationObserver{
SINGLETON_H(Streaming)
private:
unsigned long start;
unsigned long stop;
unsigned long bytesReceived;
unsigned long lastArrivedPacketTimestamp;
Configuration* configuration;
TimeClock* clock;
void setup();
vector<Frame*> buffer;
vector<Frame*> lastFramesBuffer;
int lastFrameIndex;
public:
WiFiUDP udp;
Streaming();
void configure();
bool frame();
void bufferFrame();
Frame* frameToPlay();
byte* dataBuffer;
int packetSize;
void configurationChanged();
void updateBufferStat();
~Streaming();
bool active;
};