diff --git a/conf.c b/conf.c index 45f098e5..842ece4e 100644 --- a/conf.c +++ b/conf.c @@ -29,151 +29,142 @@ #include "motion.h" -#if (defined(BSD) && !defined(PWCBSD)) +#if (defined(__FreeBSD__) && !defined(PWCBSD)) #include "video_freebsd.h" #else #include "video.h" -#endif /* BSD */ +#endif #define EXTENSION ".conf" -#ifndef HAVE_GET_CURRENT_DIR_NAME -char *get_current_dir_name(void) -{ - char *buf = mymalloc(MAXPATHLEN); - getwd(buf); - return buf; -} -#endif - #define stripnewline(x) {if ((x)[strlen(x)-1]=='\n') (x)[strlen(x) - 1] = 0; } struct config conf_template = { - camera_name: NULL, - width: DEF_WIDTH, - height: DEF_HEIGHT, - quality: DEF_QUALITY, - camera_id: 0, - rotate_deg: 0, - max_changes: DEF_CHANGES, - threshold_tune: 0, - output_pictures: "on", - motion_img: 0, - emulate_motion: 0, - event_gap: DEF_EVENT_GAP, - max_movie_time: DEF_MAXMOVIETIME, - snapshot_interval: 0, - locate_motion_mode: "off", - locate_motion_style: "box", - input: IN_DEFAULT, - norm: 0, - frame_limit: DEF_MAXFRAMERATE, - quiet: 1, - picture_type: "jpeg", - noise: DEF_NOISELEVEL, - noise_tune: 1, - minimum_frame_time: 0, - lightswitch: 0, - autobright: 0, - brightness: 0, - contrast: 0, - saturation: 0, - hue: 0, - power_line_frequency: -1, - roundrobin_frames: 1, - roundrobin_skip: 1, - pre_capture: 0, - post_capture: 0, - switchfilter: 0, - ffmpeg_output: 0, - extpipe: NULL, - useextpipe: 0, - ffmpeg_output_debug: 0, - ffmpeg_bps: DEF_FFMPEG_BPS, - ffmpeg_vbr: DEF_FFMPEG_VBR, - ffmpeg_video_codec: DEF_FFMPEG_CODEC, + .camera_name = NULL, + .width = DEF_WIDTH, + .height = DEF_HEIGHT, + .quality = DEF_QUALITY, + .camera_id = 0, + .rotate_deg = 0, + .max_changes = DEF_CHANGES, + .threshold_tune = 0, + .output_pictures = "on", + .motion_img = 0, + .emulate_motion = 0, + .event_gap = DEF_EVENT_GAP, + .max_movie_time = DEF_MAXMOVIETIME, + .snapshot_interval = 0, + .locate_motion_mode = "off", + .locate_motion_style = "box", + .input = IN_DEFAULT, + .norm = 0, + .frame_limit = DEF_MAXFRAMERATE, + .quiet = 1, + .picture_type = "jpeg", + .noise = DEF_NOISELEVEL, + .noise_tune = 1, + .minimum_frame_time = 0, + .lightswitch = 0, + .autobright = 0, + .brightness = 0, + .contrast = 0, + .saturation = 0, + .hue = 0, + .power_line_frequency = -1, + .roundrobin_frames = 1, + .roundrobin_skip = 1, + .pre_capture = 0, + .post_capture = 0, + .switchfilter = 0, + .ffmpeg_output = 0, + .extpipe = NULL, + .useextpipe = 0, + .ffmpeg_output_debug = 0, + .ffmpeg_bps = DEF_FFMPEG_BPS, + .ffmpeg_vbr = DEF_FFMPEG_VBR, + .ffmpeg_video_codec = DEF_FFMPEG_CODEC, #ifdef HAVE_SDL sdl_threadnr: 0, #endif - ipv6_enabled: 0, - stream_port: 0, - stream_quality: 50, - stream_motion: 0, - stream_maxrate: 1, - stream_localhost: 1, - stream_limit: 0, - stream_auth_method: 0, - stream_authentication: NULL, - stream_preview_scale: 25, - stream_preview_newline: 0, - webcontrol_port: 0, - webcontrol_localhost: 1, - webcontrol_html_output: 1, - webcontrol_authentication: NULL, - frequency: 0, - tuner_number: 0, - timelapse: 0, - timelapse_mode: DEF_TIMELAPSE_MODE, -#if (defined(BSD)) + .ipv6_enabled = 0, + .stream_port = 0, + .stream_quality = 50, + .stream_motion = 0, + .stream_maxrate = 1, + .stream_localhost = 1, + .stream_limit = 0, + .stream_auth_method = 0, + .stream_authentication = NULL, + .stream_preview_scale = 25, + .stream_preview_newline = 0, + .webcontrol_port = 0, + .webcontrol_localhost = 1, + .webcontrol_html_output = 1, + .webcontrol_authentication = NULL, + .frequency = 0, + .tuner_number = 0, + .timelapse = 0, + .timelapse_mode = DEF_TIMELAPSE_MODE, +#if (defined(__FreeBSD__)) tuner_device: NULL, #endif - video_device: VIDEO_DEVICE, - v4l2_palette: DEF_PALETTE, - vidpipe: NULL, - filepath: NULL, - imagepath: DEF_IMAGEPATH, - moviepath: DEF_MOVIEPATH, - snappath: DEF_SNAPPATH, - timepath: DEF_TIMEPATH, - on_event_start: NULL, - on_event_end: NULL, - mask_file: NULL, - smart_mask_speed: 0, + .video_device = VIDEO_DEVICE, + .v4l2_palette = DEF_PALETTE, + .vidpipe = NULL, + .filepath = NULL, + .imagepath = DEF_IMAGEPATH, + .moviepath = DEF_MOVIEPATH, + .snappath = DEF_SNAPPATH, + .timepath = DEF_TIMEPATH, + .on_event_start = NULL, + .on_event_end = NULL, + .mask_file = NULL, + .smart_mask_speed = 0, #if defined(HAVE_MYSQL) || defined(HAVE_PGSQL) || defined(HAVE_SQLITE3) - sql_log_image: 1, - sql_log_snapshot: 1, - sql_log_movie: 0, - sql_log_timelapse: 0, - sql_query: DEF_SQL_QUERY, - database_type: NULL, - database_dbname: NULL, - database_host: "localhost", - database_user: NULL, - database_password: NULL, - database_port: 0, - database_busy_timeout: 0, + .sql_log_image = 1, + .sql_log_snapshot = 1, + .sql_log_movie = 0, + .sql_log_timelapse = 0, + .sql_query = DEF_SQL_QUERY, + .database_type = NULL, + .database_dbname = NULL, + .database_host = "localhost", + .database_user = NULL, + .database_password = NULL, + .database_port = 0, + .database_busy_timeout = 0, #endif /* defined(HAVE_MYSQL) || defined(HAVE_PGSQL) || define(HAVE_SQLITE3) */ - on_picture_save: NULL, - on_motion_detected: NULL, - on_area_detected: NULL, - on_movie_start: NULL, - on_movie_end: NULL, - on_camera_lost: NULL, - motionvidpipe: NULL, - netcam_url: NULL, - netcam_userpass: NULL, - netcam_keepalive: "off", - netcam_proxy: NULL, - netcam_tolerant_check: 0, - rtsp_uses_tcp: 1, + .on_picture_save = NULL, + .on_motion_detected = NULL, + .on_area_detected = NULL, + .on_movie_start = NULL, + .on_movie_end = NULL, + .on_camera_lost = NULL, + .motionvidpipe = NULL, + .netcam_url = NULL, + .netcam_userpass = NULL, + .netcam_keepalive = "off", + .netcam_proxy = NULL, + .netcam_tolerant_check = 0, + .rtsp_uses_tcp = 1, #ifdef HAVE_MMAL mmalcam_name: NULL, mmalcam_control_params: NULL, #endif - text_changes: 0, - text_left: NULL, - text_right: DEF_TIMESTAMP, - text_event: DEF_EVENTSTAMP, - text_double: 0, - despeckle_filter: NULL, - area_detect: NULL, - minimum_motion_frames: 1, - exif_text: NULL, - pid_file: NULL, - log_file: NULL, - log_level: LEVEL_DEFAULT+10, - log_type_str: NULL, - camera_dir: sysconfdir"/conf.d" + .text_changes = 0, + .text_left = NULL, + .text_right = DEF_TIMESTAMP, + .text_event = DEF_EVENTSTAMP, + .text_double = 0, + .despeckle_filter = NULL, + .area_detect = NULL, + .minimum_motion_frames = 1, + .exif_text = NULL, + .pid_file = NULL, + .log_file = NULL, + .log_level = LEVEL_DEFAULT+10, + .log_type_str = NULL, + .camera_dir = sysconfdir"/conf.d" }; @@ -310,7 +301,7 @@ config_param config_params[] = { copy_int, print_int }, -#if (defined(BSD)) +#if (defined(__FreeBSD__)) { "tunerdevice", "# Tuner device to be used for capturing using tuner as source (default /dev/tuner0)\n" @@ -2009,20 +2000,19 @@ struct context **conf_load(struct context **cnt) } if (!fp) { /* Command-line didn't work, try current dir. */ - char *path = NULL; + char path[PATH_MAX]; if (cnt[0]->conf_filename[0]) MOTION_LOG(ALR, TYPE_ALL, SHOW_ERRNO, "%s: Configfile %s not found - trying defaults.", filename); - if ((path = get_current_dir_name()) == NULL) { - MOTION_LOG(ERR, TYPE_ALL, SHOW_ERRNO, "%s: Error get_current_dir_name"); + if (getcwd(path, sizeof(path)) == NULL) { + MOTION_LOG(ERR, TYPE_ALL, SHOW_ERRNO, "%s: Error getcwd"); exit(-1); } snprintf(filename, PATH_MAX, "%s/motion.conf", path); fp = fopen (filename, "r"); - free(path); } if (!fp) { /* Specified file does not exist... try default file. */ diff --git a/conf.h b/conf.h index 1e940df6..c453bdec 100644 --- a/conf.h +++ b/conf.h @@ -177,8 +177,4 @@ char *mystrdup(const char *); char *mystrcpy(char *, const char *); struct context **copy_string(struct context **, const char *, int); -#ifndef HAVE_GET_CURRENT_DIR_NAME -char *get_current_dir_name(void); -#endif - #endif /* _INCLUDE_CONF_H */ diff --git a/configure.ac b/configure.ac index 7658a275..f14974d2 100644 --- a/configure.ac +++ b/configure.ac @@ -207,18 +207,6 @@ else echo fi - -if test "x$PTHREAD_SUPPORT" = "xyes"; then - AC_MSG_CHECKING([[for pthread_setname_np]]) - CFLAGS="$TEMP_CFLAGS" - LIBS="$TEMP_LIBS" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[#include ]], [[ pthread_setname_np(pthread_self(), "name")]])], - [AC_DEFINE([[HAVE_PTHREAD_SETNAME_NP]], [[1]], [Define if you have pthread_setname_np function.]) - AC_MSG_RESULT([[yes]])], - [AC_MSG_RESULT([[no]])] ) -fi - # # Check for sdl library # @@ -781,8 +769,6 @@ fi AC_HEADER_STDC AC_CHECK_HEADERS(stdio.h unistd.h stdint.h fcntl.h time.h signal.h sys/ioctl.h sys/mman.h linux/videodev.h linux/videodev2.h sys/param.h sys/types.h sys/videoio.h) -AC_CHECK_FUNCS(get_current_dir_name) - # Check if v4l2 is available SUPPORTED_V4L2=false SUPPORTED_V4L2_old=false diff --git a/event.c b/event.c index 8ca59b0f..36b99631 100644 --- a/event.c +++ b/event.c @@ -11,7 +11,7 @@ #include "ffmpeg.h" /* must be first to avoid 'shadow' warning */ #include "picture.h" /* already includes motion.h */ #include "event.h" -#if (!defined(BSD)) +#if (!defined(__FreeBSD__)) #include "video.h" #endif @@ -317,7 +317,7 @@ static void event_sdl_put(struct context *cnt, #endif -#if defined(HAVE_LINUX_VIDEODEV_H) && !defined(WITHOUT_V4L) && !defined(BSD) +#if defined(HAVE_LINUX_VIDEODEV_H) && !defined(WITHOUT_V4L) && !defined(__FreeBSD__) static void event_vid_putpipe(struct context *cnt, motion_event type ATTRIBUTE_UNUSED, unsigned char *img, char *dummy ATTRIBUTE_UNUSED, void *devpipe, @@ -328,7 +328,7 @@ static void event_vid_putpipe(struct context *cnt, MOTION_LOG(ERR, TYPE_EVENTS, SHOW_ERRNO, "%s: Failed to put image into video pipe"); } } -#endif /* !WITHOUT_V4L && !BSD */ +#endif /* !WITHOUT_V4L && !__FreeBSD__ */ const char *imageext(struct context *cnt) { @@ -973,7 +973,7 @@ struct event_handlers event_handlers[] = { event_sdl_put }, #endif -#if defined(HAVE_LINUX_VIDEODEV_H) && !defined(WITHOUT_V4L) && !defined(BSD) +#if defined(HAVE_LINUX_VIDEODEV_H) && !defined(WITHOUT_V4L) && !defined(__FreeBSD__) { EVENT_IMAGE, event_vid_putpipe @@ -982,7 +982,7 @@ struct event_handlers event_handlers[] = { EVENT_IMAGEM, event_vid_putpipe }, -#endif /* !WITHOUT_V4L && !BSD */ +#endif /* !WITHOUT_V4L && !__FreeBSD__ */ { EVENT_STREAM, event_stream_put diff --git a/logger.c b/logger.c index fffa4da0..96b7eb3a 100644 --- a/logger.c +++ b/logger.c @@ -191,12 +191,8 @@ void motion_log(int level, unsigned int type, int errno_flag, const char *fmt, . */ errno_save = errno; -#ifdef HAVE_PTHREAD_SETNAME_NP char threadname[32] = "unknown"; pthread_getname_np(pthread_self(), threadname, sizeof(threadname)); -#else /* HAVE_PTHREAD_SETNAME_NP */ - const char *threadname = ""; -#endif /* HAVE_PTHREAD_SETNAME_NP */ /* * Prefix the message with the log level string, log type string, diff --git a/motion.c b/motion.c index 0182fb7c..805c4904 100644 --- a/motion.c +++ b/motion.c @@ -9,7 +9,7 @@ #include "ffmpeg.h" #include "motion.h" -#if (defined(BSD) && !defined(PWCBSD)) +#if (defined(__FreeBSD__) && !defined(PWCBSD)) #include "video_freebsd.h" #else #include "video.h" @@ -789,7 +789,7 @@ static int motion_init(struct context *cnt) /* create a reference frame */ alg_update_reference_frame(cnt, RESET_REF_FRAME); -#if defined(HAVE_LINUX_VIDEODEV_H) && !defined(WITHOUT_V4L) && !defined(BSD) +#if defined(HAVE_LINUX_VIDEODEV_H) && !defined(WITHOUT_V4L) && !defined(__FreeBSD__) /* open video loopback devices if enabled */ if (cnt->conf.vidpipe) { MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "%s: Opening video loopback device for normal pictures"); @@ -814,7 +814,7 @@ static int motion_init(struct context *cnt) return -1; } } -#endif /* !WITHOUT_V4L && !BSD */ +#endif /* !WITHOUT_V4L && !__FreeBSD__ */ #if defined(HAVE_MYSQL) || defined(HAVE_PGSQL) || defined(HAVE_SQLITE3) if (cnt->conf.database_type) { @@ -1104,16 +1104,14 @@ static void *motion_loop(void *arg) unsigned int get_image = 1; /* Flag used to signal that we capture new image when we run the loop */ struct image_data *old_image; -#ifdef HAVE_PTHREAD_SETNAME_NP { char tname[16]; snprintf(tname, sizeof(tname), "ml%d%s%s", cnt->threadnr, cnt->conf.camera_name ? ":" : "", cnt->conf.camera_name ? cnt->conf.camera_name : ""); - pthread_setname_np(pthread_self(), tname); + MOTION_PTHREAD_SETNAME(tname); } -#endif /* * Next two variables are used for snapshot and timelapse feature @@ -2322,11 +2320,11 @@ static void become_daemon(void) MOTION_LOG(ERR, TYPE_ALL, SHOW_ERRNO, "%s: Could not change directory"); -#if (defined(BSD)) +#if (defined(__FreeBSD__)) setpgrp(0, getpid()); #else setpgrp(); -#endif /* BSD */ +#endif /* __FreeBSD__ */ if ((i = open("/dev/tty", O_RDWR)) >= 0) { @@ -3227,7 +3225,7 @@ size_t mystrftime(const struct context *cnt, char *s, size_t max, const char *us break; case 'C': // text_event - if (cnt->text_event_string && cnt->text_event_string[0]) + if (cnt->text_event_string[0]) snprintf(tempstr, PATH_MAX, "%*s", width, cnt->text_event_string); else diff --git a/motion.h b/motion.h index b67add3a..fa55f3f1 100644 --- a/motion.h +++ b/motion.h @@ -70,6 +70,13 @@ #include "sdl.h" #endif +#ifdef __APPLE__ +#define MOTION_PTHREAD_SETNAME(name) pthread_setname_np(name) +#elif defined(__FreeBSD__) +#define MOTION_PTHREAD_SETNAME(name) pthread_set_name_np(pthread_self(), name) +#else +#define MOTION_PTHREAD_SETNAME(name) pthread_setname_np(pthread_self(), name) +#endif /** * ATTRIBUTE_UNUSED: diff --git a/netcam.c b/netcam.c index 38d4ca3b..e6fddf1d 100644 --- a/netcam.c +++ b/netcam.c @@ -948,7 +948,7 @@ static int netcam_connect(netcam_context_ptr netcam, int err_flag) } /* Now the connect call will return immediately. */ - ret = connect(netcam->sock, &server, sizeof(server)); + ret = connect(netcam->sock, (struct sockaddr *)&server, sizeof(server)); back_err = errno; /* Save the errno from connect */ /* If the connect failed with anything except EINPROGRESS, error. */ @@ -1767,16 +1767,14 @@ static void *netcam_handler_loop(void *arg) netcam_context_ptr netcam = arg; struct context *cnt = netcam->cnt; /* Needed for the SETUP macro :-( */ -#ifdef HAVE_PTHREAD_SETNAME_NP { char tname[16]; snprintf(tname, sizeof(tname), "nc%d%s%s", cnt->threadnr, cnt->conf.camera_name ? ":" : "", cnt->conf.camera_name ? cnt->conf.camera_name : ""); - pthread_setname_np(pthread_self(), tname); + MOTION_PTHREAD_SETNAME(tname); } -#endif /* Store the corresponding motion thread number in TLS also for this * thread (necessary for 'MOTION_LOG' to function properly). diff --git a/netcam_rtsp.c b/netcam_rtsp.c index abbc689f..c3e1a846 100644 --- a/netcam_rtsp.c +++ b/netcam_rtsp.c @@ -458,7 +458,6 @@ static int netcam_rtsp_open_context(netcam_context_ptr netcam){ return -1; } -#ifdef HAVE_PTHREAD_SETNAME_NP /* there is no way to set the avcodec thread names, but they inherit * our thread name - so temporarily change our thread name to the * desired name */ @@ -470,15 +469,12 @@ static int netcam_rtsp_open_context(netcam_context_ptr netcam){ netcam->cnt->threadnr, netcam->cnt->conf.camera_name ? ":" : "", netcam->cnt->conf.camera_name ? netcam->cnt->conf.camera_name : ""); - pthread_setname_np(pthread_self(), newtname); -#endif + MOTION_PTHREAD_SETNAME(newtname); retcd = netcam_open_codec(&netcam->rtsp->video_stream_index, netcam->rtsp->format_context, AVMEDIA_TYPE_VIDEO); -#ifdef HAVE_PTHREAD_SETNAME_NP - pthread_setname_np(pthread_self(), curtname); + MOTION_PTHREAD_SETNAME(curtname); } -#endif if (retcd < 0) { if (netcam->rtsp->status == RTSP_NOTCONNECTED){ diff --git a/stream.c b/stream.c index ca201ace..7ffb301a 100644 --- a/stream.c +++ b/stream.c @@ -179,9 +179,7 @@ static void* handle_basic_auth(void* param) "Pragma: no-cache\r\n" "WWW-Authenticate: Basic realm=\""STREAM_REALM"\"\r\n\r\n"; -#ifdef HAVE_PTHREAD_SETNAME_NP - pthread_setname_np(pthread_self(), "handle_basic_auth"); -#endif + MOTION_PTHREAD_SETNAME("handle_basic_auth"); pthread_mutex_lock(&stream_auth_mutex); p->thread_count++; @@ -436,9 +434,7 @@ static void* handle_md5_digest(void* param) "\n" "\n"; -#ifdef HAVE_PTHREAD_SETNAME_NP - pthread_setname_np(pthread_self(), "handle_md5_digest"); -#endif + MOTION_PTHREAD_SETNAME("handle_md5_digest"); pthread_mutex_lock(&stream_auth_mutex); p->thread_count++; @@ -577,7 +573,7 @@ Error: "Content-Type: text/html\r\n" "Keep-Alive: timeout=%i\r\n" "Connection: keep-alive\r\n" - "Content-Length: %Zu\r\n\r\n", + "Content-Length: %zu\r\n\r\n", request_auth_response_template, server_nonce, KEEP_ALIVE_TIMEOUT, strlen(auth_failed_html_template)); if (write(p->sock, buffer, strlen(buffer)) < 0) @@ -717,15 +713,33 @@ Error: */ int http_bindsock(int port, int local, int ipv6_enabled) { - int sd = socket(ipv6_enabled?AF_INET6:AF_INET, SOCK_STREAM, 0); + int sd = socket(ipv6_enabled?AF_INET6:AF_INET, SOCK_STREAM, IPPROTO_TCP); + + if (sd == -1) + { + MOTION_LOG(CRT, TYPE_STREAM, SHOW_ERRNO, "%s: error creating socket"); + return -1; + } int yes = 1, no = 0; - setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)); + if (setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) != 0) + { + MOTION_LOG(CRT, TYPE_STREAM, SHOW_ERRNO, "%s: setting SO_REUSEADDR to yes failed"); + /* we can carry on even if this failed */ + } + if (ipv6_enabled) - setsockopt(sd, IPPROTO_IPV6, IPV6_V6ONLY, &no, sizeof(no)); + { + if (setsockopt(sd, IPPROTO_IPV6, IPV6_V6ONLY, &no, sizeof(no)) != 0) + { + MOTION_LOG(CRT, TYPE_STREAM, SHOW_ERRNO, "%s: setting IPV6_V6ONLY to no failed"); + /* we can carry on even if this failed */ + } + } const char *addr_str; struct sockaddr_storage sin; + socklen_t sinsize; bzero(&sin, sizeof(struct sockaddr_storage)); sin.ss_family = ipv6_enabled?AF_INET6:AF_INET; if (ipv6_enabled) { @@ -739,6 +753,7 @@ int http_bindsock(int port, int local, int ipv6_enabled) addr_str = "any IPv4/IPv6 address"; sin6->sin6_addr = in6addr_any; } + sinsize = sizeof(*sin6); } else { struct sockaddr_in *sin4 = (struct sockaddr_in*)&sin; sin4->sin_family = AF_INET; @@ -750,10 +765,11 @@ int http_bindsock(int port, int local, int ipv6_enabled) addr_str = "any IPv4 address"; sin4->sin_addr.s_addr = htonl(INADDR_ANY); } + sinsize = sizeof(*sin4); } - if (bind(sd, (struct sockaddr*)&sin, sizeof(sin)) != 0) { - MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO, "%s: error binding on %s port %d", addr_str, port); + if (bind(sd, (struct sockaddr*)&sin, sinsize) != 0) { + MOTION_LOG(CRT, TYPE_STREAM, SHOW_ERRNO, "%s: error binding on %s port %d", addr_str, port); close(sd); return -1; } diff --git a/track.c b/track.c index cc0a709c..3bc77197 100644 --- a/track.c +++ b/track.c @@ -17,25 +17,25 @@ struct trackoptions track_template = { - dev: -1, /* dev open */ - port: NULL, /* char *port */ - motorx: 0, /* int motorx */ - motory: 0, /* int motory */ - maxx: 0, /* int maxx; */ - maxy: 0, /* int maxy; */ - minx: 0, /* int minx; */ - miny: 0, /* int miny; */ - homex: 128, /* int homex; */ - homey: 128, /* int homey; */ - motorx_reverse: 0, /* int reversed x servo; */ - motory_reverse: 0, /* int reversed y servo; */ - speed: TRACK_SPEED, /* speed */ - stepsize: TRACK_STEPSIZE, /* stepsize */ - active: 0, /* auto tracking active */ - minmaxfound: 0, /* flag for minmax values stored for pwc based camera */ - step_angle_x: 10, /* UVC step angle in degrees X-axis that camera moves during auto tracking */ - step_angle_y: 10, /* UVC step angle in degrees Y-axis that camera moves during auto tracking */ - move_wait: 10 /* number of frames to disable motion detection after camera moving */ + .dev = -1, /* dev open */ + .port = NULL, /* char *port */ + .motorx = 0, /* int motorx */ + .motory = 0, /* int motory */ + .maxx = 0, /* int maxx; */ + .maxy = 0, /* int maxy; */ + .minx = 0, /* int minx; */ + .miny = 0, /* int miny; */ + .homex = 128, /* int homex; */ + .homey = 128, /* int homey; */ + .motorx_reverse = 0, /* int reversed x servo; */ + .motory_reverse = 0, /* int reversed y servo; */ + .speed = TRACK_SPEED, /* speed */ + .stepsize = TRACK_STEPSIZE, /* stepsize */ + .active = 0, /* auto tracking active */ + .minmaxfound = 0, /* flag for minmax values stored for pwc based camera */ + .step_angle_x = 10, /* UVC step angle in degrees X-axis that camera moves during auto tracking */ + .step_angle_y = 10, /* UVC step angle in degrees Y-axis that camera moves during auto tracking */ + .move_wait = 10 /* number of frames to disable motion detection after camera moving */ }; diff --git a/webhttpd.c b/webhttpd.c index 36e8bebb..f95a6f85 100644 --- a/webhttpd.c +++ b/webhttpd.c @@ -435,7 +435,7 @@ static unsigned int config(char *pointer, char *res, unsigned int length_uri, /*call list*/ if (cnt[0]->conf.webcontrol_html_output) { send_template_ini_client(client_socket, ini_template); - sprintf(res, "<– back

\nCamera %d%s%s\n<– back", thread); send_template(client_socket, res); send_template_end_client(client_socket); } else { @@ -567,9 +567,9 @@ static unsigned int config(char *pointer, char *res, unsigned int length_uri, conf_cmdparse(cnt + thread, config_params[i].param_name, Value); if (cnt[0]->conf.webcontrol_html_output) { sprintf(res, - "<– back" + "<– back" "

\nCamera %d%s%s\n" - "