This repository was archived by the owner on Apr 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideoSource.h
More file actions
84 lines (68 loc) · 1.76 KB
/
VideoSource.h
File metadata and controls
84 lines (68 loc) · 1.76 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* VideoSource.h
*
* Created on: 2011-5-13
* Author: simophin
*/
#ifndef VIDEOSOURCE_H_
#define VIDEOSOURCE_H_
#include <map>
#include "RString.h"
#include "IODevice.h"
#include "VideoInfo.h"
#include "VideoProvider.h"
#include "ImageFormat.h"
#include "Geometry.h"
#include "FrameRate.h"
class ImageBuffer;
class Error;
class VideoSource{
public:
VideoSource();
virtual ~VideoSource();
class Info {
public:
VideoInfo info;
VideoProvider::Info providerInfo;
};
class ImageParam {
public:
ImageFormat pixFmt;
Geometry geo;
FrameRate fps;
};
class Buffer {
friend class VideoSource;
public:
unsigned char * buf;
size_t size;
int index;
void *priv;
Buffer()
:index(-1),priv(0),
buf(0),size(0) {}
bool isValid () {
return (index >= 0);
}
};
typedef std::map<String,String> Option;
Error init (const Option &options = Option(), int ms = -1);
Error getInformation(Info &,int ms = -1) const;
Error getImageParam(ImageParam &,int ms = -1) const;
Error setImageParam(ImageParam &, int ms = -1);
Error startCapture(int ms = -1);
Error stopCapture(int ms = -1);
Error putBuffer(const Buffer &, int ms = -1);
Error getFilledBuffer (Buffer &,int ms = -1);
class Impl;
protected:
virtual Error doInit (const Option &options, int ms) = 0;
virtual Error doGetInformation(Info &,int ms) const = 0;
virtual Error doGetImageParam(ImageParam &,int ms) const = 0;
virtual Error doSetImageParam(ImageParam &,int ms) = 0;
virtual Error doStartCapture(int ms) = 0;
virtual Error doStopCapture(int ms) = 0;
virtual Error doPutBuffer(const Buffer &, int ms) = 0;
virtual Error doGetFilledBuffer (Buffer &,int ms) = 0;
};
#endif /* VIDEOSOURCE_H_ */