Revisions to configuration options.
1. Revise config options to be `movie_` and `picture_`
2. Revise config options to align with topic and code.
* motion_video_pipe, ipv6_enabled, rtsp_uses_tcp
* switchfilter, logfile, process_id_file
3. Revise depreciated options to still be valid for webcontrol and config files.
4. Revise distributed config files to only include most common options
5. Revise sequence of config options to be arranged by topic.
6. Revise code to use names consistent with config parms.
7. Revise manual, guide and code to specify same default values.
8. Update guide and manual to reflect revised option names.
Implement micro-httpd for providing webcontrol and streams
1. Add tls support for webcontrol and streams. aka ssl/tls, https
2. Add functionality to provide streams on single port
3. Add functionality for additional authentication methods of webcontrol.
4. Add functionality for providing static images
5. Update documentation for new functionality.
6. Resolve issue with stream_preview_newline
7. Add functionality for specifying camera in webcontrol and streams via camera_id
8. Depreciated functionality to specify substream via port
9. Add functionality to specify substream via a URL
10. Revise `quit` to only be available via text (programmatic) interface
11. Added functionality for CORS header on webcontrol interface
Closes#526Closes#661Closes#709Closes#737Closes#750
The default setting for 'output_pictures' option was changed
from 'on' to 'off', but the docs had not been updated.
This change brings the docs into agreement with the new default.
When using the single 'motion.conf' file for a single camera setup,
the webu actions are skipping over the only thread due to assuming
that thread '0' is just motion and all cameras are subsequent.
This leaves the webu actions useless to the default single camera,
single config setup.
Fix this by checking that more than one camera thread exists to use
the thread loop, using the given thread number ('0') otherwise.
* Status and Text UI get
* Additional webu text revisions
1. Only provide webcontrol parms in the list on the main thread.
2. Use main configuration values when parm is not in camera specific config file
3. Break out of loop once parm is found in get
4. Check for numeric thread number when requesting status
5. Send result messages when user requests actions/track/set
* Add event listener for completed pause/start
In commit da556d7 (store the value of 'camera_dir'), a memory leak
was introduced due to not freeing this memory in context_destroy().
I followed the advice in PR #639 to correct this.
Valgrind was used to find this leak and test for successful fixing.
Config included a 'camera_dir' with two camera config files.
Command ran: valgrind --leak-check=full ./bin/motion -n
Before:
HEAP SUMMARY:
in use at exit: 91,538 bytes in 13 blocks
total heap usage: 4,227 allocs, 4,214 frees, 20,448,321 bytes allocated
126 bytes in 3 blocks are definitely lost in loss record 8 of 11
at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x406A6D: mymalloc (motion.c:3401)
by 0x40D0CF: mystrdup (conf.c:2687)
by 0x40D30C: mystrcpy (conf.c:2664)
by 0x40D30C: copy_string (conf.c:2470)
by 0x40D565: read_camera_dir (conf.c:2883)
by 0x40CA10: conf_process (conf.c:2034)
by 0x40D850: conf_load (conf.c:2236)
by 0x407063: cntlist_create (motion.c:2876)
by 0x407063: motion_startup (motion.c:2930)
by 0x4052B7: main (motion.c:3128)
LEAK SUMMARY:
definitely lost: 126 bytes in 3 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 0 bytes in 0 blocks
still reachable: 91,412 bytes in 10 blocks
suppressed: 0 bytes in 0 blocks
After:
HEAP SUMMARY:
in use at exit: 91,412 bytes in 10 blocks
total heap usage: 4,201 allocs, 4,191 frees, 20,447,579 bytes allocated
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 0 bytes in 0 blocks
still reachable: 91,412 bytes in 10 blocks
suppressed: 0 bytes in 0 blocks
* Rename 'lightswitch' to 'lightswitch_percent' and properly deprecate the old option
* Add 'lightswitch_frames' for how many frames to ignore Defaulting to the original '5' and set a hard range of '1-1000'
* Updated config guide and supplied example config
Also updated the 'lightswitch_percent' comments in the config to match those in conf.c
Closes#686
Use the same timestamp for FILECREATE and FILECLOSE events
Propagate timestamp to the FILECREATE and FILECLOSE events, so the
timestamp available for the "Conversion Specifiers" for SQL queries
matches the timestamp used in filenames.
Move FILE_CREATE event call from picture.c:put_picture() to its calling functions in event.c.
Add new option to execute a SQL query on the FILECLOSE event
Don't try to execute empty sqlquery strings
Always clear result with PQclear
Improve Postgresql error handling
Don't regard PGRES_TUPLES_OK status as error.
Print Postgresql error status and error message on error.
* Open guide in new window or tab
* Pad the bottom of header-center for a smoother look
* Pad the bottom of 'main-content' below 'live-preview'
* Dropdown
* Allow closing the dropdown menus by clicking elsewhere on the page
1. Revert to just capturing time directly rather than in a routine.
2. Check for null format context pointer before writing trailer.
3. Terminate movie when lost connection.
4. Clean up context when failed resize.
5. Unlock mutex on failed first image.
6. Fix memory leak when recovering from watchdog timeout.