Commit Graph

106 Commits

Author SHA1 Message Date
Peter Keresztes Schmidt 7a4c34ec7e RemoteCameraHttp: Fix a log message 2021-03-18 20:02:20 +01:00
Isaac Connor 079d3361a2 Rework to read content_length bytes at once. Micro-optimisation 2021-03-17 15:52:55 -04:00
Peter Keresztes Schmidt 0796a2262e Utils: Replace stringtf with a type-safe version that can't overflow 2021-03-06 00:12:18 +01:00
Peter Keresztes Schmidt d9568a98c0 Drop zm_thread which has been replaced by STL implementations 2021-03-04 10:55:46 +01:00
Isaac Connor b87d859f72 Set the packet's stream_index to the packetqueue stream. Rename get_ functions to get 2021-03-03 12:06:34 -05:00
Isaac Connor 449b547f2b Use buffer.head() instead of casting 2021-03-01 16:49:27 -05:00
Peter Keresztes Schmidt 814953b331 Fix warnings reported by -Wimplicit-fallthrough
Note: Once C++17 is supported switch to the standard conform [[fallthrough]] attribute.
For the time being [[gnu::fallthrough]] can be used since it is supported by GCC and Clang [1].

[1] https://clang.llvm.org/docs/AttributeReference.html#fallthrough
2021-02-27 00:29:35 +01:00
Isaac Connor 6c013f0e65 Put back includes needed on FreeBSD. Fixes #3165 2021-02-22 08:03:10 -05:00
Isaac Connor 3dab7d3ecc Don't need to Disconnect when Capture will return -1, as we will call Close() which calls Disconnect() 2021-02-19 12:08:48 -05:00
Peter Keresztes Schmidt 35514649c9 Monitor: Make audio and video streams directly accessible
Also remove Camera::getId() which returend the monitor ID. Since a camera is owned by an monitor, there is no need for this. Also it causes a circular include.
2021-02-11 19:22:22 +01:00
Peter Keresztes Schmidt f43507dce0 Use the power of smart pointers to manage Monitor instances 2021-02-07 21:20:45 +01:00
Isaac Connor 513739aeb5
Merge pull request #3127 from Carbenium/header-cleanup
Cleanup and reorganize includes
2021-02-04 12:52:04 -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 ac42aa2488 Setup mVideoStream and mVideoStreamId and set it in packet. 2021-02-04 10:27:56 -05:00
Peter Keresztes Schmidt 5a57efdfe2 Replace deprecated C header includes with the C++ ones. 2021-02-04 05:39:03 +01:00
Isaac Connor ab65a65dfb use camel case on video_stream and audio_stream 2021-01-28 10:45:53 -05:00
Isaac Connor 6271971912 Use get_videoStream in zm_camera 2021-01-27 16:13:43 -05:00
Isaac Connor 518270a9ac Must set keyframe and codec_type of zm_packet 2021-01-27 12:50:17 -05:00
Isaac Connor e28c724742 fix return values of Prime, Pre and PostCapture 2021-01-27 12:07:35 -05:00
Isaac Connor a39a656373 Merge branch 'master' into zma_to_thread 2020-09-29 11:02:40 -04: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 bf2cb5fb1f Add PrimeCapture to zm_remote_camera_http. PrimeCapture is used to determine if we can connect and so by not implementing it, monitors like this say capturing even though they are not. 2020-08-08 10:21:06 -04:00
Isaac Connor 5fb56c9f57 Merge branch 'master' into zma_to_thread 2020-08-07 17:52:43 -04:00
Isaac Connor a19990f4d7 Merge branch 'release-1.34' 2020-08-06 11:57:35 -04:00
Isaac Connor d8cd4386cf rename GetOptEncoderParams to GetOptEncoderParams to GetOptEncoderParamsVec so that we can get at the std::string if we want to.
Use EncoderParams when setting movflags in VideoStore.

Move the content of this option to a help popup so that we can remove the comments from it. av_dict_parse doesn't handle the hash tag as a comment.
2020-07-30 15:06:05 -04:00
Isaac Connor 4ff341a0f5 Merge branch 'master' into zma_to_thread 2020-05-02 18:03:42 -04:00
Isaac Connor c488756eb8 Merge branch 'master' into fix_remote_http 2020-02-19 14:42:24 -05:00
Isaac Connor 0afcbe626c remove redundant logging line. Connect() will do the logging 2020-01-13 12:51:30 -05:00
Isaac Connor 09fcbad666 Merge branch 'master' into zma_to_thread 2019-11-30 14:59:39 -05:00
Isaac Connor ce37fce99c spacing 2019-09-20 08:19:57 -04:00
Isaac Connor 28dafd5931 Merge branch 'storageareas' into zma_to_thread 2018-12-26 12:02:00 -05:00
Isaac Connor af501128f2 fix invalid use of %s. Pass the buffer as the format string instead of a ... param 2018-11-29 10:54:01 -05:00
Isaac Connor be0767b4cd Merge branch 'storageareas' of github.com:/connortechnology/ZoneMinder into storageareas 2018-11-06 15:27:17 -05:00
Isaac Connor 5a933a93c2 clean up static vars and google code style 2018-11-06 15:27:10 -05:00
Isaac Connor 17c091f9f9 Google code style and add a debug showing the # of addresses in hp 2018-11-02 10:26:39 -04:00
Isaac Connor 315b1bc11e Implement a GetData function and use it to simplify the code everywhere we want to get more data. 2018-07-10 11:48:08 -04:00
Isaac Connor f6139d33ed Merge branch 'storageareas' into zma_to_thread 2018-05-05 12:25:11 -04:00
Isaac Connor 8bdc68dc65 include zm_signal.h so that we have access to zm_terminate. Use zm_terminate to break out of endless loops. Add incoming bytes counts 2018-04-25 10:49:35 -04:00
Isaac Connor d8e4b0abfb Merge branch 'storageareas' into zma_to_thread
Conflicts:
	scripts/zmwatch.pl.in
	src/zm_ffmpeg_camera.cpp
	src/zm_monitor.cpp
	src/zmc.cpp
2018-02-06 10:34:17 -05:00
Isaac Connor af67e3b686 whitespace 2018-02-04 11:54:25 -08:00
Isaac Connor ef5e296144 some fixes 2017-11-17 14:30:38 -05:00
Isaac Connor 159c0a7165 moer cppcheck fixes 2017-11-17 07:52:26 -05:00
Isaac Connor 0e7f475ce8 merge work from zma_to_thread, but not the zma_to_thread part 2017-11-12 11:42:34 -05:00
Isaac Connor cab8c4cd5e cleanup Monitor::Capture. Cleanup the return values from Capture and CaptureAndRecord. <0 is error, 0 is things ok, but no video frame. > 0 means we have a frame. Plus google code style 2017-11-03 13:49:42 -04:00
Isaac Connor 1dbf599f10 add a cast to get rid of build warning 2017-04-05 10:36:44 -04:00
Isaac Connor 7b8ff44163 Merge branch 'storageareas' of github.com:connortechnology/ZoneMinder into storageareas 2017-03-20 15:04:54 -04:00
Isaac Connor 816b0a9e01 add getsockopt test 2017-03-20 15:04:05 -04:00
Isaac Connor d135216ac7 Merge branch 'master' into storageareas 2017-02-15 09:30:35 -05:00
Isaac Connor d5bb6f3210 remove line that causes endless reading when doing single image mode 2017-02-11 09:57:36 -05:00
Isaac Connor 5d03e9f50e Merge branch 'fix_1743_Edimax' into storageareas 2017-01-11 10:34:08 -05:00