Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
WebCamSource.h
1#pragma once
2
3#include "Module.h"
4
6{
7public:
8 WebCamSourceProps(int _cameraId = -1, uint32_t _width = 640, uint32_t _height = 480, int _fps = 30) : ModuleProps(), width(_width), height(_height), cameraId(_cameraId), fps(_fps) {}
9 uint32_t width = 640;
10 uint32_t height = 480;
11 int cameraId = -1;
12 int fps = 30;
13
15 {
16 return ModuleProps::getSerializeSize() + sizeof(width) + sizeof(height) + sizeof(cameraId) + sizeof(fps);
17 }
18
19private:
21
22 template <class Archive>
23 void serialize(Archive &ar, const unsigned int version)
24 {
25 ar &boost::serialization::base_object<ModuleProps>(*this);
26 ar &width &height &cameraId &fps;
27 }
28};
29
30class WebCamSource : public Module
31{
32public:
34 virtual ~WebCamSource();
35 bool init();
36 bool term();
37
38 void setProps(WebCamSourceProps &props);
40
41protected:
42 bool produce();
43 bool validateOutputPins();
44 bool handlePropsChange(frame_sp &frame);
45
46private:
47 class Detail;
48 std::shared_ptr<Detail> mDetail;
49};
Definition Module.h:33
virtual size_t getSerializeSize()
Definition Module.h:101
Definition Module.h:151
Definition WebCamSource.h:6
void serialize(Archive &ar, const unsigned int version)
Definition WebCamSource.h:23
int fps
Definition WebCamSource.h:12
uint32_t width
Definition WebCamSource.h:9
WebCamSourceProps(int _cameraId=-1, uint32_t _width=640, uint32_t _height=480, int _fps=30)
Definition WebCamSource.h:8
size_t getSerializeSize()
Definition WebCamSource.h:14
friend class boost::serialization::access
Definition WebCamSource.h:20
int cameraId
Definition WebCamSource.h:11
uint32_t height
Definition WebCamSource.h:10
Definition WebCamSource.cpp:7
Definition WebCamSource.h:31
void setProps(WebCamSourceProps &props)
Definition WebCamSource.cpp:105
bool term()
Definition WebCamSource.cpp:81
bool validateOutputPins()
Definition WebCamSource.cpp:61
bool produce()
Definition WebCamSource.cpp:86
bool init()
Definition WebCamSource.cpp:71
virtual ~WebCamSource()
Definition WebCamSource.cpp:59
WebCamSourceProps getProps()
Definition WebCamSource.cpp:97
std::shared_ptr< Detail > mDetail
Definition WebCamSource.h:48
bool handlePropsChange(frame_sp &frame)
Definition WebCamSource.cpp:110
WebCamSource(WebCamSourceProps props)
Definition WebCamSource.cpp:51