Commit Graph

633 Commits

Author SHA1 Message Date
Mr Dave
320732d97b Update manual 2015-09-05 23:34:50 -06:00
Mr Dave
33b7d4f045 Clean tabs for issue 071831 patch 2015-09-05 13:08:41 -06:00
Mr Dave
0f45a713a7 Remote preview fixes 2015-09-05 10:09:55 -06:00
Mr Dave
cb7dcc3018 Add preview to webcontrol 2015-09-04 20:39:09 -06:00
Mr Dave
90a97c05eb Ffmpeg container fixes 2015-09-04 16:49:38 -06:00
Mr Dave
6a1b258763 Remove depreciated deinterlace option 2015-09-04 13:03:25 -06:00
Ximin Luo
5ad825efef Fix build for Debian GNU/kFreeBSD which defines __FreeBSD_kernel__ but not BSD 2015-09-04 12:32:20 -06:00
Ximin Luo
d09bdd19e0 To include a linux-specific header like linux/types.h, one should test for the presence of linux rather than the absence of BSD. 2015-09-04 12:32:20 -06:00
Mr Dave
a02eb47860 Add additional container options 2015-09-04 12:16:15 -06:00
Mr Dave
cc19f88f7f Updated gitignore 2015-09-04 11:22:52 -06:00
Mr Dave
a7ec135777 Changelog for hackeron fix for SOI on Netcams 2015-09-03 20:33:15 -06:00
hackeron
6861a82840 Handle junk data at beginning of JPEG images 2015-09-03 20:29:50 -06:00
hackeron
e7f4b96892 Update netcam.h 2015-09-03 20:29:50 -06:00
hackeron
ccfc14296e Update netcam.c 2015-09-03 20:29:50 -06:00
Mr Dave
cc8e451311 Update CHANGELOG 2015-08-31 20:53:05 -06:00
Mr Dave
4745d63de2 Merge branch 'jdodgen-lastsnap' into unstable 2015-08-31 19:15:09 -06:00
Mr Dave
9f963c4e22 Merge branch 'lastsnap' of https://github.com/jdodgen/motion into jdodgen-lastsnap 2015-08-31 19:14:32 -06:00
Mr Dave
124e8e302a Logitech MJPEG patch 2015-08-30 23:37:48 -06:00
Mr Dave
ab7d7e717b Add revisions to CHANGELOG 2015-08-28 18:09:10 -06:00
Mr Dave
e683b5776b Merge branch 'jdodgen-v4l2-patch' into unstable 2015-08-26 23:02:09 -06:00
Mr Dave
56cff51146 Merge branch 'v4l2-patch' of https://github.com/jdodgen/motion into jdodgen-v4l2-patch 2015-08-26 23:01:40 -06:00
Mr Dave
f97354185a Merge branch 'jdodgen-sqlite-patch' into unstable 2015-08-26 22:49:04 -06:00
Mr Dave
3c98e1deec Merge branch 'sqlite-patch' of https://github.com/jdodgen/motion into jdodgen-sqlite-patch 2015-08-26 22:48:25 -06:00
Mr Dave
c7fced7983 Revise install instructions 2015-08-26 22:30:25 -06:00
Mr Dave
f9a5d1cc5c Add the new options to motion-dist.conf 2015-08-26 21:18:49 -06:00
Mr Dave
e991c53bd6 Revision for clean build 2015-08-26 21:13:15 -06:00
Mr Dave
a97095420e event.c cleanup 2015-08-26 21:09:36 -06:00
Mr Dave
8d116c33fc Merge branch 'dfries-unstable' into unstable 2015-08-26 21:01:07 -06:00
Mr Dave
03f54ccc89 Merge branch 'unstable' of https://github.com/dfries/motion into dfries-unstable 2015-08-26 19:24:10 -06:00
Mr Dave
1ce82991ee Merge branch 'mterzo-master' of https://github.com/tosiara/motion into tosiara-mterzo-master 2015-08-26 19:13:57 -06:00
Mr Dave
4750579af2 ffmpeg.c fix GOP size 2015-08-26 19:09:12 -06:00
David Fries
12433edb3f add ffmpeg_duplicate_frames option
This lets the user decide which video problems they would rather see.
In my case a Raspberry Pi 2 with a 640x480 webcam sometimes can keep
up with 10fps so I don't want to set the framerate any lower, but
then sometimes it can't and with duplicate frames it looks like the
video output freezes every second.
2015-08-23 16:50:47 -05:00
David Fries
63e585dc76 add power_line_frequency configuration item
The USB webcam I have defaults to the wrong setting causing visible
flickering degrading the image quality.  This allows setting the
value to any of the currently available options or -1 to by default
not modify the value.
2015-08-23 16:50:47 -05:00
David Fries
a3104af8d0 accept a width specifier to mystrftime
Allow the user to specify field widths to keep the strings from
jumping around as the width changes.  This makes the values easier
to read.
2015-08-23 16:50:47 -05:00
David Fries
740f3cc73f alg_labeling give diffs feedback even when not over the threshold
This is especially useful when picking a threshold to see how
close to the threshold it was.
2015-08-23 16:50:47 -05:00
David Fries
37360d858d fix dangling pointer cnt->current_image after resize
cnt->current_image because a dangling pointer after image_ring_resize
because it is pointing to cnt->imgs.image_ring which is reallocated in
that routine.  motion_loop will then store cnt->current_image in
old_image which it can then read from.

Reallocations are rare, once in init to size 1, then once to the final
size.  I apparently have a bad USB link and I was seeing a crash
pointing to bad data, after that camera started, then had an error and
crashed in process_image_ring(cnt, IMAGE_BUFFER_FLUSH);
it hadn't yet resized to the normal ring buffer size.  That got me
trying valgrind with a ring buffer size limit of 1 which found this
bug.
2015-08-23 16:50:47 -05:00
David Fries
ea7e94863a get the thread out of the xioctl loop
As long as errno is EINTR (and that must be the case when the USB
device is still there, but the transfers are failing), the thread
keeps looping running the ioctl when it isn't going to succeed, so
give it access to the finish variable to only loop if the thread isn't
supposed to be going away, and then keep sendig SIGVTALRM to break out
of the ioctl when the thread is supposed to be exiting.  With this fix
the webcam was no longer crashing, which let the webcam without a
problem continue to stream.
2015-08-23 16:50:47 -05:00
David Fries
bbd2f3f813 redo watchdog termination logic, wait for the thread to cleanup
I apparently have some marginal USB hardware and motion has been
crashing every couple of days in the memcpy at the end of alg.c as
both cnt->imgs.ref and cnt->imgs.image_virgin were NULL pointers.
This was just after the main thread watchdog timer called
pthread_cancel on that thread.  The problem is pthread_cancel can't
possibly kill a thread running on another CPU atomically, although in
this case it's a single core processor and I think pthread_cancel was
releasing it from the ioctl and it would then run to completition.

This modifies the code to not cleanup that content's resources until
that thread is no longer running.  If it runs to completition a normal
restart will happen, if it doesn't the main thread will check once a
second until it no longer is running, cleanup and restart, but it
can't cleanup with that thread running.
2015-08-23 16:50:47 -05:00
David Fries
bab15abfee count webcontrol as a thread to avoid a crash
On a SIGHUP restart the main thread waits to restart until all worker
threads are finished executing, except webcontrol wasn't included.
If it was still running (such as reading a web request), it would
have a dangling context pointer after cnt_list was freed leading to a
crash.  This counts that thread in the running threads, as a
termination webcontrol_finish variable to terminate it indepdent of
the device thread, and creates a webcontrol_running to identify when
it is running.
2015-08-23 16:50:47 -05:00
David Fries
0629d9db61 set motion capture thread running in the main thread
I identified this while debugging, the thread was created, but hadn't
yet set its state to running before the main thread checked the running
variable and started another thread for the same device.  That
resulted in a crash.  Set running in the main thread, to avoid this
race condition.
2015-08-23 16:50:47 -05:00
David Fries
23d6354d53 ftp_send_type send type like the function comment says
The function comment says it will send 'I' or 'A', but it was
only sending 'I', even though the function did everything, but
put it in the snprintf (which could be skipped for a fixed string).
2015-08-23 16:50:47 -05:00
David Fries
cf88e025ab typo fix, unused variable cleanup, etc
motion.c bad spelling, to "an image"
webhttpd.c consolidate the timeout to the top of the file as I needed
to change it for testing
2015-08-23 16:50:47 -05:00
jdodgen
5eb3da4050 Fixed mull pointer causing segfault 2015-08-21 09:25:51 -07:00
jdodgen
72aef1fb65 Added ifdef around shared sqlite handle assignment 2015-06-10 14:50:38 -07:00
jdodgen
310cac7c68 Reverting tab to spaces fix 2015-06-10 14:36:58 -07:00
jdodgen
ef60ae4a11 reverting tab to space 2015-06-10 09:54:09 -07:00
jdodgen
2ab6ef6e81 reverting tab to space 2015-06-10 09:51:35 -07:00
jdodgen
7273caec6d reverting motion.h tab to spaces fix 2015-06-10 09:34:46 -07:00
jdodgen
6177885e13 another tab reversion 2015-06-10 09:14:36 -07:00
jdodgen
ad3344edad reverting tab to spaces changes 2015-06-10 09:02:42 -07:00