Commit Graph

45 Commits

Author SHA1 Message Date
Mr-DaveDev
ecfb537359 Remove legacy substream 2018-10-11 18:13:46 -06:00
tosiara
a47e929049 Add O_CLOEXEC flag to the open of V4L2, socket and extpipe
* Add O_CLOEXEC flag to the open of V4L2, socket and extpipe
Fixes https://github.com/Motion-Project/motion/issues/705

* Add CLOEXEC
2018-06-09 14:16:19 -06:00
Mr-DaveDev
4ff191be82 Implement Translations via Gettext
Implement translations of Motion log messages and web control using the gettext function.
2018-03-25 16:39:57 -06:00
Mr-DaveDev
288b9f7a01 pthread macro 2018-02-16 10:38:10 -07:00
jackxbritton
11e6339f44 Cross origin resource sharing (CORS) config parameter
* Add configuration parameter for a cross origin resource sharing on the Motion stream
2018-02-11 11:30:24 -07:00
Mr-DaveDev
eef702b3d7 Fix builds on musl based systems
* Fix pthread_setname_np detection

Commit 6617c6f2c8 replaced
AC_LINK_IFELSE with AC_COMPILE_IFELSE. This has broken the
pthread_setname_np detection as compilation will always succeed even if
pthread_setname_np is not available (if the function is not found, a
simple warning will be displayed in config.log).

The correct fix is to put back AC_LINK_IFELSE with -pthread in LIBS
otherwise compilation will fail on toolchain without pthread_setname_np.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

* Check for pthread_getname_np

On some toolchains (like musl), pthread_setname_np is available but not
pthread_getname_np so add this check in configure.ac

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

* Revision for detection of XSI vs GNU variants of strerror
2017-12-09 15:42:16 -07:00
MrDave
5aa9002a93 Log Authentication Failures
1.  Add IP logging for authentication failures using MD5
2017-10-28 19:10:38 -06:00
Mr-DaveDev
69ad4fb350 High Resolution (#522)
* High Resolution

Refactor the netcam_rtsp module and associated image variables to allow for processing a dual stream from rtsp cameras.

Continue the process of segregating the functionality of the netcams into distinct modules based upon their function.
2017-10-28 17:29:16 -06:00
genius3000
07e3df36d7 WIP: Log client IP (stream, webcontrol) where useful (#434)
* Log failed authentication requests and add IP to standard read log
2017-10-22 18:11:37 -06:00
tosiara
7d8ba03cfc Motion substream (#454)
Add option to output a sub-stream from Motion
2017-10-15 10:29:43 -06:00
tosiara
910412f175 Changed MOTION_LOG macro (#428)
* Changed MOTION_LOG macro and remover "%s:" from the format string
Function name will be now auto added

* Re-applied log-update after conflict resolution

* Some old style logging still remaining, updated
2017-07-30 17:07:40 -06:00
Mr-Dave
dbd7282dad Merge pull request #239 from jogu/macos
Macos port fixes
2016-10-30 20:32:03 -06:00
Fabrice Fontaine
0da5428bdf Rename base64_encode
base64_encode is already defined in gnutls so rename it as
motion_base64_encode to prevent a definition clash when linking
statically with gnutls

Fixes:
  - http://autobuild.buildroot.org/results/592672b8826f4c731c50d29725da964d876573c4

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
2016-10-30 19:30:46 +01:00
Joseph Heenan
c175892e3c Correct bad format string in handle_md5_digest
Format string for size_t is %zu
2016-10-23 12:44:41 +01:00
Joseph Heenan
10258c4434 Tidyup http_bindsock
Make sure we pass IPPROTO_TCP, and check all the socket operations for
success.
2016-10-23 12:44:41 +01:00
Joseph Heenan
841f8500d6 MacOS: Fix socket binding
macOS's bind() insists that the size argument passed is correct for
the type of socket in use.

Also update the relevant MOTION_LOG to include errno.
2016-10-23 12:44:41 +01:00
Joseph Heenan
ab5835d435 MacOS: Add support for Mac variant of pthread_setname_np
We add a simple wrapper #define to hide the difference between the
Mac and other platforms version of this function. The tests should
cover all our supported platforms, so remove the configure test.
2016-10-23 12:44:41 +01:00
Joseph Heenan
536027127f Add missing 'const' to recent IPv6 fixes
Produces a warning in developer builds otherwise
2016-10-12 08:21:28 +01:00
Sebastiaan Lokhorst
2984a15e29 Put back option to disable IPv6 2016-10-08 23:34:08 +02:00
Sebastiaan Lokhorst
4b3bc5fc44 Reuse socket when it's still open. Properly close socket when binding/listening fails. 2016-09-29 14:16:32 +02:00
Sebastiaan Lokhorst
2c139baaca Tweak variable names. 2016-09-28 11:37:39 +02:00
Sebastiaan Lokhorst
0a7139f928 Rename option back to ipv6_enabled (now only effects localhost) 2016-09-27 01:22:53 +02:00
Sebastiaan Lokhorst
69345a4e6f Improve debug output 2016-09-26 16:10:51 +02:00
Sebastiaan Lokhorst
ab12095d4e Rewrite sockets to be much simpler and properly support IPv6.
Remove option ipv6_enabled (IPv6 is always enabled)
Add option localhost_ipv4 (the user must choose to listen to IPv4 and IPv6 localhost, only relevant when the localhost option is set to on)
2016-09-25 18:00:47 +02:00
Sebastiaan Lokhorst
aa7ba3984e Cleanup HTML. 2016-09-22 18:36:00 +02:00
Joseph Heenan
31ddc67672 Add camera_name setting to allow each camera to be given a name
Based on a commit originally by Chris Roberts <86montecarlo@gmail.com>

camera_name allows naming of threads, is displayed in the motion control
webpage, and a new specifier (%$) added enabling it to be used for
filenames and such.

The changes I have made since Chris's commit:

1. Change format specifier for threadname from %E to %$

This avoids clashing with any known strftime format specifiers.
(According to the Debian stable strftime man page - it seems we've
already used all spare letters to mean other things.)

2. Behaviour if camera_name is not set is now unchanged

(Previous it would display "thread 1 -- NULL" if the thread name was
unset, and I don't believe how printf deals with NULL values for %s
specifiers is guaranteed.)

3. Thread name is reflected into the system thread name

Uses pthread_setname_np. There's a autoconf test for it, which looks
for the version that takes the thread id and thread name. I believe
this should work on all recent linux, and maybe other platforms too.

(It won't work on macOS; autoconf will disable it - but I deliberately
always use the pthread_setname_np(pthread_self(), name) form so that
it could easily be adapted for macOS in the future.)

4. The parameter has been renamed from thread_name to camera_name, as
that seems to better reflect how the user will see it.
2016-09-10 21:50:46 +01:00
Alfred Klomp
a36801e6dd free(): remove unnecessary NULL pointer checks
Calling free() on a NULL pointer is a completely harmless. Reduce code
complexity by removing the unnecessary checks.
2014-10-15 23:46:37 +02:00
Alfred Klomp
ccdeee0073 mymalloc(): don't cast return value; void* is always promoted 2014-10-15 21:59:38 +02:00
Dave
976fe425a5 Removed compiler warnings and small bug fix for webhttpd.c 2014-06-13 20:47:13 -06:00
Dave
048791e449 Merge tosiara/rtsp branch (commit 46cfcf31d, 2014/05/21) 2014-06-13 19:52:34 -06:00
Angel Carpintero
32f1e8832b Remove not used variable and added better detection of ffmpeg libraries 2014-02-24 06:35:43 +01:00
Angel Carpintero
d8063fb1df - Change default log level to 6 / NTC
- Reviewed log levels to make motion less verbose and move most of them to NTC level.
2010-05-23 00:01:05 +02:00
AngelCarpintero
f7469950d0 Added a macro MOTION_LOG , no need to add __FUNCTION__ anymore. 2010-04-04 21:50:50 +00:00
AngelCarpintero
79cf297cd4 Implemented http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionLog 2010-04-03 19:34:23 +00:00
AngelCarpintero
6d35a01104 Make cosmetic changes in comments, description of functions and fix some code to be compliant with CODE STANDARD 2010-03-29 19:24:57 +00:00
AngelCarpintero
4bca8c16c0 Fix print of size_t using %Zu 2009-12-03 18:47:13 +00:00
AngelCarpintero
55d4ae9bb2 http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionStreamAuthPatch 2009-11-23 10:36:07 +00:00
AngelCarpintero
62c3e2db4a Added ipv6_enabled and little patch for BSD 2009-07-20 10:53:36 +00:00
AngelCarpintero
0f71dabed4 Added the option logfile to log message to text file. Removed level -1 to log to stderr, don't use always short 2009-03-09 04:36:17 +00:00
AngelCarpintero
c2044fbe09 Apply new code standard ( chuck 2 ) 2008-07-16 20:34:23 +00:00
AngelCarpintero
406ade0aa8 - Fix round robin in BSD switching to METEOR_CAP_SINGLE
- Some improvements in capture code , added better logging
- Disable IPV6 in BSD  
- Free mutex in web control on error
2008-07-09 11:05:22 +00:00
AngelCarpintero
dc27136cbe Update log adding function name , remove setup_mode as a login level. Added servo_position() and check limits to avoid overflow maxN , minN 2008-07-07 13:53:42 +00:00
AngelCarpintero
48aa7acbee Fix typos , log message , track_move no need to be called from motion when no active ( auto tracking ) , reverse center 2008-07-03 02:09:30 +00:00
AngelCarpintero
7cfadbe5e2 Autodetec x86_64 libs first in configure, more code standard and clean source code, insolate logger 2008-05-18 14:23:50 +00:00
AngelCarpintero
f7903d3896 Rename webcam to stream ( files , functions and options ) 2008-05-14 09:04:35 +00:00