Commit Graph

70 Commits

Author SHA1 Message Date
Peter Keresztes Schmidt 65656de6ce db: Adjust the query methods to accept std::strings 2021-07-06 10:20:46 +02:00
Peter Keresztes Schmidt c60b577aec Convert more char array buffers to std::string
Remove now unused ZM_SQL_*SIZE defines
2021-07-06 10:20:46 +02:00
Peter Keresztes Schmidt 531694bf8d RtspThread: Add missing static_cast when fprinting duration .count() 2021-06-14 20:09:30 +02:00
Peter Keresztes Schmidt d69afc9672 misc: Convert time(nullptr) calls to std::chrono 2021-06-13 23:22:51 +02:00
Peter Keresztes Schmidt 6114d40593 misc: Replace usleep with std::this_thread::sleep_for 2021-06-13 23:22:51 +02:00
Peter Keresztes Schmidt 3e8b10d813 zm::Select: Convert API to std::chrono 2021-06-13 23:22:51 +02:00
Peter Keresztes Schmidt 46155942c1 Misc: Rename namespace ZM to zm
We had a mixture of both spellings. Unify it according to our code-style.
2021-06-06 19:11:11 +02:00
Peter Keresztes Schmidt 2d71743372 FFmpeg: Remove code paths required only by 2.8 and older
With Xenial support dropped we require FFmpeg 3.2 and newer.
2021-06-05 20:40:12 +02:00
Peter Keresztes Schmidt 7d15396833 Build: Promote libavformat to a required dependency
FFmpeg is an integral component of ZM. Promote the appropriate libraries to required dependencies.
This reduces the possible build configurations greatly and thus maintenance burden.
2021-06-05 14:25:27 +02:00
Peter Keresztes Schmidt 68bedfe48f Fix logging format string mismatches
* Remove SZFMTD format macro and use %zu instead for size_t. %zu is understood by every compiler nowadays.
2021-04-30 00:26:24 +02:00
Peter Keresztes Schmidt 0203e744a5 RtspThread: Fix a stack-buffer-overflow reported by ASAN
==8109==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fab9b156480 at pc 0x7fabaebef57b bp 0x7fab9b154640 sp 0x7fab9b153df0
READ of size 32 at 0x7fab9b156480 thread T2
    #0 0x7fabaebef57a  (/lib/x86_64-linux-gnu/libasan.so.5+0xb857a)
    #1 0x561c0a9e24eb in bool std::__equal<true>::equal<char>(char const*, char const*, char const*) /usr/include/c++/8/bits/stl_algobase.h:814
    #2 0x561c0a9dfa8e in bool std::__equal_aux<char*, char*>(char*, char*, char*) /usr/include/c++/8/bits/stl_algobase.h:831
    #3 0x561c0a9dd982 in bool std::equal<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >
, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(__gnu_cxx::__normal_iterator<char*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::c
har_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
> >) /usr/include/c++/8/bits/stl_algobase.h:1049
    #4 0x561c0a9cf75a in RtspThread::Run() /root/zoneminder/src/zm_rtsp.cpp:411
    #5 0x561c0a9df6e9 in void std::__invoke_impl<void, void (RtspThread::*)(), RtspThread*>(std::__invoke_memfun_deref, void (RtspThread::*&&)(), RtspThread*&
&) /usr/include/c++/8/bits/invoke.h:73
    #6 0x561c0a9dd4ae in std::__invoke_result<void (RtspThread::*)(), RtspThread*>::type std::__invoke<void (RtspThread::*)(), RtspThread*>(void (RtspThread::
*&&)(), RtspThread*&&) (/root/zoneminder/cmake-build-debug-remote/src/zmc+0x1544ae)
    #7 0x561c0a9e6a1a in decltype (__invoke((_S_declval<0ul>)(), (_S_declval<1ul>)())) std:🧵:_Invoker<std::tuple<void (RtspThread::*)(), RtspThread*> >
::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) /usr/include/c++/8/thread:244
    #8 0x561c0a9e698d in std:🧵:_Invoker<std::tuple<void (RtspThread::*)(), RtspThread*> >::operator()() /usr/include/c++/8/thread:253
    #9 0x561c0a9e68ff in std:🧵:_State_impl<std:🧵:_Invoker<std::tuple<void (RtspThread::*)(), RtspThread*> > >::_M_run() /usr/include/c++/8/threa
d:196
    #10 0x7fabaca57b2e  (/lib/x86_64-linux-gnu/libstdc++.so.6+0xbbb2e)
    #11 0x7fabae50dfa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
    #12 0x7fabac7354ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)
2021-04-11 11:37:03 +02:00
Peter Keresztes Schmidt 545f0dbb96 utils: cleanup Base64Encode 2021-04-04 00:39:40 +02:00
Peter Keresztes Schmidt e330f8553d utils: cleanup Split and Join 2021-04-04 00:30:18 +02:00
Peter Keresztes Schmidt 39a896f5b6 utils: cleanup StartsWith 2021-04-03 23:51:12 +02:00
Peter Keresztes Schmidt 664cd649f8 utils: cleanup Trim (was trimSet) and TrimSpaces 2021-04-03 23:30:59 +02:00
Peter Keresztes Schmidt 8f0431d85b RtpDataThread: Convert to std::thread 2021-03-03 23:31:53 +01:00
Peter Keresztes Schmidt 71edb9d830 RtpCtrlThread: Convert to std::thread 2021-03-03 23:31:53 +01:00
Peter Keresztes Schmidt ff2bfb58da RtspThread: Fix an unguarded SQL query causing race conditions 2021-03-03 23:31:53 +01:00
Peter Keresztes Schmidt 8f941c75cd RtspThread: Convert to std::thread 2021-03-03 23:31:53 +01:00
Peter Keresztes Schmidt a66a9a6f10 Rtsp: Use AvStream.codecpar if available
.codec has been deprecated in libavf 57.33.100
2021-02-10 00:21:23 +01:00
Peter Keresztes Schmidt 4056782954 Comms: Move all classes to ZM:: namespace
The Socket class collides with a class named the same way from liblive555. This confuses the linker and links the wrong object leading to a crash when connecting to the RTSP server.
2021-02-09 14:45:33 +01:00
Isaac Connor 87c3a862e2 remove our copies of min() and max(). Use std::min() and std::max() 2021-02-06 16:02:09 -05:00
Peter Keresztes Schmidt 0dbc39ee25 Cleanup and reorganize includes
With this commit a unified structure for includes is introduced.
The general rules:
 * Only include what you need
 * Include wherever possible in the cpp and forward-declare in the header

 The includes are sorted in a local to global fashion. This means for the include order:
  0. If cpp file: The corresponding h file and an empty line
  1. Includes from the project sorted alphabetically
  2. System/library includes sorted alphabetically
  3. Conditional includes
2021-02-04 18:02:01 +01:00
Isaac Connor 63a6bdaac1 spacing 2021-01-29 09:53:48 -05:00
Isaac Connor c4b80e61bc code comments 2021-01-27 16:14:17 -05:00
Isaac Connor 16662f79ce spacing and code stylez 2020-12-27 12:03:44 -05:00
Peter Keresztes Schmidt 8f980a1168 Convert NULL/0 to nullptr
The 0 -> nullptr changes should definitely improve readability.
2020-08-26 22:03:40 +02:00
Isaac Connor b1b258ab9b Code Style and use backtick escapes on sql column names, specifically Function 2020-05-07 13:43:05 -04:00
Isaac Connor 28269eccc3 Fix Remote RTSP Method on newer ffmpeg 2019-04-28 12:05:32 -04:00
Isaac Connor 5120c6f540 remove compile warning by assigning AV_CODEC_NONE to the codec_id. 2018-11-13 18:13:55 -05:00
Isaac Connor 159c0a7165 moer cppcheck fixes 2017-11-17 07:52:26 -05:00
Isaac Connor 23b40da598 fix whitespacing causing a warning when compiling. In this case braces are not neccessary. 2017-01-11 14:25:12 -05:00
Andy Bauer 254fcbcef7 update gpl 2 mailing address in source files 2016-12-26 09:23:16 -06:00
Isaac Connor fd896acd50 Merge branch 'RTSP-IPv6' of https://github.com/schrorg/ZoneMinder into schrorg-RTSP-IPv6 2016-05-06 08:32:21 -04:00
Isaac Connor 03b1ced568 tabs to spaces and use 2space indenting 2016-04-04 10:11:48 -04:00
SteveGilvarry af76d19646 Add a constrained namespace implementation around Authenticator class to prevent conflict with libvlc live555. 2015-12-18 01:47:10 +11:00
Robin Daermann 4c773472bd Add support for IPv6 in RTSP code
Monitors with source type 'remote' can now be accessed over IPv6. This
code uses getaddrinfo(3) now instead of gethostbyname(3) - and changes a
lot of networking stuff which should be tested thoroughly.
2015-11-04 16:41:47 +01:00
Andrew Bauer 22dc049bf4 remove Info statement used for testing 2015-08-21 10:34:23 -05:00
Andrew Bauer a2d7ac86fe add rtsp_describe to RtspThread class 2015-08-21 10:29:54 -05:00
Isaac Connor ec6c6b3ace typo fix 2015-06-22 09:26:17 -04:00
Emmanuel Papin a36b4aa65d Implement version check for ffmpeg and libav (address issue #580) 2015-05-29 17:38:02 +02:00
Dmitry Smirnov eddada011c spelling corrections (thanks, /usr/bin/codespell) 2015-04-19 20:38:23 +10:00
Isaac Connor 084e2a8b8f when auth is needed, try command again before dying. 2015-03-02 10:47:52 -05:00
Isaac Connor 3c5b1fd07f fix extra slash when adding trackurl to controlurl 2015-02-26 10:22:21 -05:00
Isaac Connor 0355191c6c Merge pull request #687 from knnniggett/rtsp-content-base
process RTSP DESCRIBE response header
2015-02-21 17:44:49 -05:00
Andrew Bauer 6c65c89643 Merge pull request #711 from SteveGilvarry/720_avformat_free_context_version_check
Fixes #710 Added libavformat version check around free context functions
2015-02-18 07:26:18 -06:00
SteveGilvarry 83cc398a24 Added libavformat version check around free context functions 2015-02-18 23:25:31 +11:00
Andrew Bauer 82af43f5fb process RTSP DESCRIBE response header 2015-01-31 08:31:27 -06:00
Isaac Connor 56c82cfbb5 Save 1 or more calls to time(NULL) 2015-01-28 12:33:05 -05:00
Andrew Bauer 97ee989a94 Parse multiple streams in RTP-Info 2014-12-02 19:33:05 -06:00