You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
878 B
55 lines
878 B
|
|
#define _LARGEFILE64_SOURCE 1
|
|
#define _FILE_OFFSET_BITS 64
|
|
|
|
|
|
#include "miniwebcam.h"
|
|
#include "video.h"
|
|
#include "convert.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <sys/types.h>
|
|
#include <dirent.h>
|
|
#include <ctype.h>
|
|
#include <fcntl.h>
|
|
|
|
#ifdef BUILD_WINDOWS
|
|
#include <winsock2.h>
|
|
#include <io.h>
|
|
#include <ws2tcpip.h>
|
|
#else
|
|
#include <arpa/inet.h>
|
|
#endif
|
|
#include <sys/stat.h>
|
|
|
|
VideoDevice::VideoDevice() {
|
|
debug ("");
|
|
pthread_mutex_init(&mtx, NULL);
|
|
};
|
|
|
|
|
|
VideoDevice::~VideoDevice() {
|
|
debug ("");
|
|
};
|
|
|
|
|
|
int VideoDevice::Lock() {
|
|
if (pthread_mutex_lock(&mtx) == 0) return 1;
|
|
else return 0;
|
|
};
|
|
|
|
int VideoDevice::UnLock() {
|
|
if (pthread_mutex_unlock(&mtx) == 0) return 1;
|
|
else return 0;
|
|
};
|
|
|
|
|
|
void VideoDevice::RefreshCtrls() {
|
|
std::list<VideoDevCtrl>::iterator i;
|
|
|
|
for (i = vidctrls.begin(); i != vidctrls.end(); i++) {
|
|
GetDevCtrl(i->id, &(i->value));
|
|
}
|
|
|
|
};
|