-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcamera_thread.h
More file actions
54 lines (36 loc) · 1.07 KB
/
Copy pathcamera_thread.h
File metadata and controls
54 lines (36 loc) · 1.07 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
#ifndef _CAMERA_THREAD_
#define _CAMERA_THREAD_
#include "predef.h"
class Network;
class CameraController;
class Command;
class TCP_Socket;
class UDP_Socket;
class CameraThread
{
public :
CameraThread();
~CameraThread();
void Start(int camnum);
static void* thread_fn(void* arg);
void addTestPacket(char packet, int camnum);
private:
static void Update(int camnum);
static int UpdateCommand(int camnum);
static int parsePacket(int camnum, char* buf);
static bool StartUpload(int camnum);
static size_t read_callback(void* ptr, size_t size, size_t nmemb, void* userp);
pthread_t threadid;
static Command command[MAX_CAMERA];
static Network network[MAX_CAMERA];
static TCP_Socket tcpsocket[MAX_CAMERA];
static UDP_Socket udpsocket[MAX_CAMERA];
static CameraController* cameras[MAX_CAMERA];
static CAMERA_STATE camera_state[MAX_CAMERA];
static bool exitthread[MAX_CAMERA];
static pthread_mutex_t mutex_lock[MAX_CAMERA];
static pthread_mutex_t exitmutex_lock[MAX_CAMERA];
static int upload_progress[MAX_CAMERA];
static char camera_serverid[MAX_CAMERA];
};
#endif