-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathimpl.cpp
More file actions
38 lines (29 loc) · 730 Bytes
/
impl.cpp
File metadata and controls
38 lines (29 loc) · 730 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
37
38
#include "interface.h"
#include <Poco/Random.h>
#include <stdio.h>
namespace example {
void Monitor::run() {
Poco::Random rnd;
rnd.seed();
while (true) {
Poco::Thread::sleep(rnd.next(1000));
sprintf ((char *)buf, "hello %d\n", rnd.next(10));
if (frameNotifier != NULL) frameNotifier->newFrame();
}
}
void Monitor::mon_init (unsigned char* image_buffer) {
buf = image_buffer;
mon_this = new Monitor();
mon_this->setMonBuf(buf);
main_thread.start(*mon_this);
}
void Monitor::mon_register(IFrameCB* frameNotify) {
mon_this->setMonRegister(frameNotify);
}
void Monitor::setMonBuf(unsigned char* buffer) {
buf = buffer;
}
void Monitor::setMonRegister(IFrameCB* frameNotify) {
frameNotifier = frameNotify;
}
}