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.
67 lines
1.4 KiB
67 lines
1.4 KiB
|
|
|
|
#ifndef _CONFIGURATION_H_
|
|
#define _CONFIGURATION_H_
|
|
|
|
#include <UDPTCPNetwork.h>
|
|
#include <string>
|
|
|
|
#include "config.h"
|
|
|
|
#define DEFAULT_HTTP_PORT 8080
|
|
#define DEFAULT_HTTPS_PORT 8081
|
|
#define DEFAULT_CONFIG_FILE "/etc/miniwebcam/miniwebcam.conf"
|
|
#define DEFAULT_SSL_KEY "/etc/miniwebcam/ssl-key.pem"
|
|
#define DEFAULT_SSL_CERT "/etc/miniwebcam/ssl-cert.pem"
|
|
#define DEFAULT_VDEV_IOMODE 1
|
|
#define DEFAULT_VDEV_DEVICE "/dev/video0"
|
|
#define DEFAULT_VDEV_WIDTH 1920
|
|
#define DEFAULT_VDEV_HEIGHT 1080
|
|
#define DEFAULT_WEB_WIDTH -1
|
|
#define DEFAULT_WEB_HEIGHT -1
|
|
|
|
#define CONF_INITFLAGS_PRINT 0x0001
|
|
#define CONF_INITFLAGS_HELP 0x0002
|
|
|
|
class Configuration {
|
|
private:
|
|
public:
|
|
int http_port;
|
|
int https_port;
|
|
std::string ssl_key;
|
|
std::string ssl_cert;
|
|
int runasdaemon;
|
|
std::string filename;
|
|
int initflags;
|
|
|
|
int web_height;
|
|
int web_width;
|
|
int web_imagerefresh;
|
|
|
|
int vdev_height;
|
|
int vdev_width;
|
|
int vdev_iomode;
|
|
std::string vdev_device;
|
|
std::string vdev_cdevice;
|
|
std::string vdev_format;
|
|
std::string vdev_dumpfile;
|
|
std::string vdev_dumppath;
|
|
|
|
Configuration();
|
|
~Configuration();
|
|
|
|
int LoadArgs(int argc, char **argv);
|
|
int LoadFile(std::string fn);
|
|
|
|
int GetInitFlags() { return initflags; };
|
|
std::string GetFilename() { return filename; };
|
|
|
|
int PrintConfig(); // print current configuration
|
|
void Help(); // print Help
|
|
};
|
|
|
|
extern Configuration config;
|
|
|
|
#endif
|
|
|