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
|
class Channel1: public mimodsp::plugin::IBrain
{
public:
Channel1() = default;
const char *Name() const override
{
return "Channel1";
}
bool open(const std::string &setup) override
{
handle = quadcamera_open();
return true;
}
bool process(
const mimodsp::plugin::VideoFrameRack &input,
mimodsp::plugin::VideoFrameRack &output) override
{
if ((input.getChannels() >= 4) && (output.getChannels() >= 1)) {
/*
* Check the resolution of the all channels.
*/
mimodsp::plugin::VideoFormat vf1 =
input.getChannelVideoFrame(0).getVideoFormat();
/*
* Execute the GPU kernel.
*/
quadcamera_execute_uyvy_to_uyvy(handle,
vf1.getPictureWidth(),
vf1.getPictureHeight(),
input.getChannelVideoFrame(0).getBuffer(),
input.getChannelVideoFrame(1).getBuffer(),
input.getChannelVideoFrame(2).getBuffer(),
input.getChannelVideoFrame(3).getBuffer(),
output.getChannelVideoFrame(0).getBuffer());
}
return true;
}
bool close() override
{
quadcamera_close(handle);
return true;
}
private:
QUADCAMERA *handle;
};
|