-
Notifications
You must be signed in to change notification settings - Fork 1
/
ofkVideoStreamWrapper.h
executable file
·65 lines (47 loc) · 1.15 KB
/
ofkVideoStreamWrapper.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
#include "ofMain.h"
#include "ofkUDPjpegReceiver.h"
/*
Wrap camera video Stream and UDP Jpeg Stream
TODO : debug the behaivor in windows
*/
#ifdef WIN32
#define USE_VIDEO_GRABBER
#else
#endif
class ofkVideoStreamWrapper
{
public:
enum VideoStreamMode
{
VIDEOSTREAM_CAMERA,
VIDEOSTREAM_UDPRECIEVE,
VIDEOSTREAM_FILE
};
ofkVideoStreamWrapper(void);
~ofkVideoStreamWrapper(void);
void init(VideoStreamMode mode);
void init(string VideoFilePath);
void renderDebug();
ofPixelsRef getPixel();
ofTexture& getTexture();
void setStreamMode(VideoStreamMode mode);
bool isFrameNew();
void update(); //-> this will be protected. Event Driven
private:
VideoStreamMode mVideoStreamMode;
void initVideoGrabber(int deviceID, int w, int h);
void initUDPjpegReceiver();
void onReceiveImgae(ofkPixelsWithIP & pix);
//Video Grab
#ifdef USE_VIDEO_GRABBER
ofVideoGrabber vidGrabber;
#endif
ofVideoPlayer vidPlayer;
//jpeg Stream
ofkUDPjpegReceiver mUDPjpegReceiver;
ofkPixelsWithIP mPixelsWithIP;
bool isUDPjpegReceiverNew;
ofImage errImage;
ofTexture mReceivedPixelTexture;
};