Commit Graph

5030 Commits

Author SHA1 Message Date
Isaac Connor
278624081f Must set AVFMT_TS_NONSTRICT in oformat->flags not oc->flags 2022-04-04 16:28:46 -04:00
Isaac Connor
034dda5b6c Only bump iterators if we are pushing onto the back of the queue. If we are re-ordering, can do nothing about the iterators. Show if iterator points to the packet in dumpQueue. 2022-04-04 16:27:43 -04:00
Isaac Connor
9235b696ed Add index of packet that we have seen before 2022-04-04 16:26:52 -04:00
Isaac Connor
a689b3636d Only define av1 for newer ffmpeg 2022-04-03 17:38:27 -04:00
Isaac Connor
166ed2631f reference shared_data->recording instead of recording. Fix recording changing to ONMOTION due to use of = instead of == in an if 2022-04-03 16:53:14 -04:00
Isaac Connor
513c228ff3 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2022-04-03 16:29:15 -04:00
Isaac Connor
d1cc451037 packet size should be buffer size, not the size of a pointer... 2022-04-03 16:28:38 -04:00
Isaac Connor
162595edbc Don't try to mangle pts and dts. We will have to depend on packetqueue re-ordering 2022-04-03 16:25:05 -04:00
Isaac Connor
5a78a765d1 Add in re-ordering of packets based on dts. 2022-04-03 16:24:21 -04:00
Isaac Connor
7c5a6f9bae Cleanups. Return if we don't find a video stream. Also check for width and height on video streams 2022-04-03 16:23:51 -04:00
Isaac Connor
7dcb45b7b7 Remove debugging, code style, spacing. Free lock before notifying 2022-04-03 16:21:40 -04:00
Isaac Connor
717dfff0c4 Merge pull request #3456 from exuvo/master
ffmpeg change
2022-04-03 14:59:35 -04:00
Isaac Connor
9cb59aced9 Fix last_write_index not incrementing hence live view broken 2022-04-01 12:40:59 -04:00
Isaac Connor
585a01735a Fix lockups due to lack of locking around terminate_ 2022-04-01 09:48:20 -04:00
Isaac Connor
ed0f244c70 Don't use packet->index to calculate index into shmem. If we are skipping the increase might not be monotonic 2022-03-29 17:19:31 -04:00
Isaac Connor
39d45e527c Switch from DecodingEnabled to DecodingOption. Implement the logic in ::Decode. 2022-03-28 17:44:44 -04:00
Isaac Connor
bdffa10cc6 limit logging of full packetqueue 2022-03-27 13:14:40 -04:00
Isaac Connor
bf4d2a82d6 handle when maxfps is not specified 2022-03-27 12:17:00 -04:00
Isaac Connor
75833abbe7 Move convertContext code to it's own function for readability. Use it to clean up code in Decode 2022-03-26 20:32:05 -04:00
Isaac Connor
cc1368ba2c Move code for AVPixFormat to .cpp instead .h. Add const's so we can use it on cost Image * vars 2022-03-26 20:31:33 -04:00
Isaac Connor
f17ca48cab Default end_time to start_time on event creation so that we don't get a negative duration 2022-03-26 12:47:46 -04:00
Isaac Connor
9f404f7b97 Add test for event before calling event->Duration. 2022-03-26 12:47:26 -04:00
Isaac Connor
1c9c3d34f5 Free up raw images early when not recording also. Also free up decoded frame ram 2022-03-25 13:50:12 -04:00
Isaac Connor
8458eb741a Don't store keyframes in packetqueue if we are not recording at all. 2022-03-25 12:26:05 -04:00
Isaac Connor
99e78debf5 Use shared_data->analysing instead of analysing in tests since we could be disabled by zmu. 2022-03-21 15:58:01 -04:00
Isaac Connor
ed41e63980 Can't treat anlysing as a boolean because ANALYSING_NONE==1. Should fix zm oing motion detection when set to NONE 2022-03-20 19:13:46 -04:00
Isaac Connor
6aeb163cba Fix lock around terminate 2022-03-13 08:37:33 -04:00
Exuvo
c3b216d90e Ignore cur_dts for now 2022-03-11 21:46:59 +01:00
Exuvo
a2cf001f66 Crude fix for AVPicture being removed in ffmpeg 5 2022-03-11 21:45:34 +01:00
Exuvo
d1395dab9a Fix ffmpeg 5 const errors 2022-03-11 21:40:25 +01:00
Exuvo
9fd0a94c9f Add support for vp9 and av1 encoding 2022-03-11 13:37:27 +01:00
Isaac Connor
b103072b7e Cleanup code a bit moving variable declarations around to where they are used and removing duplicated curl free. 2022-03-10 12:24:00 -05:00
Isaac Connor
5dc4e5ddb4 Fix compile warning. Rename variables to be more descriptive and remove unused ones 2022-03-10 12:09:02 -05:00
Jonathan Bennett
9f4df40ac5 Add rtsp_quirk to Janus mountpoints.
Workaround for Vivotek and possibly other cameras that use nonstandard RTSP URIs,
2022-03-04 20:40:56 -06:00
Isaac Connor
9b9746113e If we asked for stream, keep streaming even not decoding or other problem. We will wait for the situation to change 2022-03-04 12:06:24 -05:00
Isaac Connor
eee6053293 Only startup a new event if recording==ALWAYS 2022-02-28 13:35:11 -05:00
Isaac Connor
980aaa5942 Fix case of recording events when Recording==NONE 2022-02-28 12:10:14 -05:00
Isaac Connor
e31b18a1a6 Use a define to disable y-channel use 2022-02-28 12:02:09 -05:00
Isaac Connor
cf31db0bad Merge branch 'master' into replace_function_concept 2022-02-27 14:05:34 -05:00
Isaac Connor
133553e630 Revert "Merge pull request #3119 from Carbenium/fmt"
This reverts commit 90d930c7c3, reversing
changes made to 0bcb9d276f.
2022-02-27 14:05:14 -05:00
Isaac Connor
e33b41745d Merge branch 'master' into replace_function_concept 2022-02-27 14:04:01 -05:00
Isaac Connor
c5b9ed9451 Revert "Fix zms build"
This reverts commit e6b36bb186.
2022-02-27 13:46:51 -05:00
Isaac Connor
e6b36bb186 Fix zms build 2022-02-27 10:41:42 -05:00
Isaac Connor
cad57df0bb Merge branch 'master' into fmt 2022-02-26 13:56:20 -05:00
Isaac Connor
fc21fb643e Release lock before notify 2022-02-20 10:33:13 -05:00
Isaac Connor
02ccf13c7b Merge branch 'master' of github.com:ZoneMinder/zoneminder 2022-02-20 10:32:43 -05:00
Isaac Connor
b896974a29 Should get lock before testing for connected 2022-02-20 10:32:40 -05:00
Isaac Connor
a40b305065 Merge branch 'master' into replace_function_concept 2022-02-20 09:52:03 -05:00
Ratchanan Srirattanamet
ebe502a747 db: fix dead lock in zmDbQueue::stop()
Notifying `mCondition` without taking the lock causes a race condition
in ::process() between checking `mTerminate` and waiting for the
`mCondition`, which causes a dead lock. This commit moves writing to
`mTerminate` and notifying `mCondition` under the lock to eliminate race
condition and dead lock.

This is not theoretical. It has caused zmu to hang at exit on a
Raspberry Pi 4, exhuasting PHP-FPM process pool. The stacks below are
captured when running ZoneMinder 1.36.12-focal1 on Ubuntu 20.04:

(gdb) thread apply all bt

Thread 2 (Thread 0xffff80c1c880 (LWP 259988)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0xaaaae0584e80 <dbQueue+176>) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0xaaaae0584e28 <dbQueue+88>, cond=0xaaaae0584e58 <dbQueue+136>) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0xaaaae0584e58 <dbQueue+136>, mutex=0xaaaae0584e28 <dbQueue+88>) at pthread_cond_wait.c:638
#3  0x0000ffff8700d670 in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /lib/aarch64-linux-gnu/libstdc++.so.6
#4  0x0000aaaae0438f08 in zmDbQueue::process (this=0xaaaae0584dd0 <dbQueue>) at ./src/zm_db.cpp:250
#5  0x0000ffff87013fac in ?? () from /lib/aarch64-linux-gnu/libstdc++.so.6
#6  0x0000ffff891264fc in start_thread (arg=0xffffe60d84bf) at pthread_create.c:477
#7  0x0000ffff86dd767c in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78

Thread 1 (Thread 0xffff80c23010 (LWP 259987)):
#0  __pthread_clockjoin_ex (threadid=281472841926784, thread_return=0x0, clockid=0, abstime=<optimized out>, block=<optimized out>) at pthread_join_common.c:145
#1  0x0000ffff87014240 in std::thread::join() () from /lib/aarch64-linux-gnu/libstdc++.so.6
#2  0x0000aaaae04314d0 in exit_zmu (exit_code=0) at ./src/zmu.cpp:200
#3  0x0000aaaae042f4c8 in main (argc=<optimized out>, argv=<optimized out>) at ./src/zmu.cpp:797
2022-02-20 09:58:03 +00:00
Isaac Connor
fe69261f10 Include MonitorId as second argument of EventStartCommand and EventEndCOmmand at @baudneo's request. 2022-02-19 15:33:05 -05:00