Commit Graph

82 Commits

Author SHA1 Message Date
Isaac Connor
4f2dc894d5 get rid of got_packet to quiet cppcheck 2022-07-14 10:35:22 -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
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
Isaac Connor
037771539d spacing, return a success value from setupCodec instead of using Fatal 2022-01-10 17:36:49 -05:00
Peter Keresztes Schmidt
7c6a6ac309 VideoStream: Convert internals to std::chrono 2021-06-13 23:20:24 +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
762476ec76 Build: Promote libswscale 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:27:31 +02:00
Peter Keresztes Schmidt
a9ad5c5eee Build: Promote libavcodec 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:54 +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
d9568a98c0 Drop zm_thread which has been replaced by STL implementations 2021-03-04 10:55:46 +01:00
Isaac Connor
010674b3dd Fix use of local mem in return value reported by cppcheck 2021-02-06 20:11:38 -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
Peter Keresztes Schmidt
5a57efdfe2 Replace deprecated C header includes with the C++ ones. 2021-02-04 05:39:03 +01: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
4d4fab46d6 Spacing, use FFMpegInit instead of deprecated ffmpeg calls 2020-08-05 19:17:00 -04:00
Isaac Connor
8518278476 coverity scan fixes/cleanups 2018-04-12 11:29:35 -04:00
Isaac Connor
882a242b76 Fix mpeg streaming. 2018-01-31 14:35:00 -05:00
Isaac Connor
5f0db60c38 quiet coverity 2017-12-12 13:25:41 -05:00
Isaac Connor
3c44c1f9be quiet coverity by returning after Panic 2017-12-12 13:19:23 -05:00
Isaac Connor
64816aa005 fixes from cppcheck. 2017-11-18 16:00:10 -05:00
Isaac Connor
159c0a7165 moer cppcheck fixes 2017-11-17 07:52:26 -05:00
APHW2 MFGENG
e17bcb9178 updates for mast ffmpeg 2017-11-07 18:21:51 -08:00
Isaac Connor
83219d3e34 define av_frame_free to av_freep on older ffmpeg. Undo c++11 requirements. 2017-04-13 09:47:19 -04:00
Isaac Connor
0d5910644e whitespace and braces fixes. Also add some braces to fixup a compiler error about the else not doing what it should be. 2017-01-11 14:18:11 -05:00
Isaac Connor
5ae34a7561 Merge branch 'master' into storageareas 2017-01-02 09:39:10 -05:00
Andy Bauer
254fcbcef7 update gpl 2 mailing address in source files 2016-12-26 09:23:16 -06:00
Isaac Connor
c3628a8dfd Merge branch 'updated-console' into storageareas 2016-05-03 14:34:58 -04:00
Steve Gilvarry
8452c4bce5 Fix tab to spaces merge issues 2016-04-29 21:27:28 +10:00
Isaac Connor
03b1ced568 tabs to spaces and use 2space indenting 2016-04-04 10:11:48 -04:00
SteveGilvarry
5f4441878e Coded_Frame deprecation all examples were no lomger setting AV_PKT_FLAG_KEY, is it on the packet already. 2016-03-03 17:16:06 +11:00
SteveGilvarry
2122d6e443 Fix all the av_picture related deprecations 2016-03-03 01:03:55 +11:00
SteveGilvarry
51914994f7 Migrating from av_free/av_freep to av_frame_free using libavcodec version
check. Also replaced recently deprecated av_free_packet with av_packet_unref.
2015-11-04 15:30:14 +11:00
Dmitry Smirnov
0ff7a4e616 Replace deprecated FFmpeg API
Fixes FTBFS with ffmpeg-2.9; compatible with ffmpeg-2.8.

Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803850
2015-11-03 11:58:23 +11:00
Emmanuel Papin
818a5256e4 Readd checking of micro version in zm_mpeg.cpp to fix compilation issue 2015-05-29 19:23:00 +02: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
Dmitry Smirnov
6bbe42c5eb build: fix FTBFS with format-hardening
~~~~
x86_64-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include -I/usr/include -I/usr/include -D__STDC_CONSTANT_MACROS -Wall -finline-functions -fomit-frame-pointer -I/usr/include -D__STDC_CONSTANT_MACROS -D_FORTIFY_SOURCE=2 -D__STDC_CONSTANT_MACROS -D__STDC_CONSTANT_MACROS -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -DZM_FFMPEG_CVS -DHAVE_LIBCRYPTO -MT zm_mpeg.o -MD -MP -MF .deps/zm_mpeg.Tpo -c -o zm_mpeg.o zm_mpeg.cpp
zm_mpeg.cpp: In member function ‘void VideoStream::SetupFormat()’:
zm_mpeg.cpp:112:56: error: format not a string literal and no format arguments [-Werror=format-security]
snprintf( s->filename, sizeof(s->filename), filename );
                                                     ^
zm_mpeg.cpp:112:56: error: format not a string literal and no format arguments [-Werror=format-security]
~~~~

Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
2015-03-30 15:27:37 +11:00
Isaac Connor
4613fd46a4 fix a reorder warning 2015-02-05 11:03:26 -05:00
Isaac Connor
9d636ad128 fix zms crash due to buffer_copy_size never being initialized 2015-01-29 15:32:50 -05:00
Isaac Connor
8a33f78243 bugfix; coredump if no codec name was specified in url. 2014-10-15 14:35:01 -04:00
Isaac Connor
2a71973307 make zm compile using libav on ubunut 14.04 2014-10-15 13:23:29 -04:00
Andy Bauer
549360cabd Merge branch 'zms/videostream-improvements' of https://github.com/Sune1337/ZoneMinder into Sune1337-zms/videostream-improvements
Conflicts:
	src/zm_ffmpeg.h
	src/zm_mpeg.cpp
2014-10-11 15:38:38 -05:00
Sune1337
48b361b1eb - Arrays should be deleted using "delete[]" and not "delete" 2014-04-28 17:20:37 +02:00
Sune1337
a4f597696a - render video using double buffers
this is to deliver frames more accurately to the client
2014-04-26 18:25:48 +02:00
Sune1337
448d287240 - use _AVCODECID_NONE instead of CODEC_ID_NONE 2014-04-25 23:22:53 +02:00
Sune1337
3155d621d0 - Removed an unreferenced variable
- fixed compilation issue with sws_..isSupported when compiling with ffmpeg 0.5
2014-04-25 22:57:29 +02:00
Sune1337
4767326484 A variable was referenced as a pointer when it was not. 2014-04-25 22:27:56 +02:00
Sune1337
04b8ecf0a7 Support streaming with zms (using ffmpeg) better
* ZoneMinder compiles with ffmpeg 0.5..master
    * Make VideoStream class able to stream through ffmpeg better.
    * Ability to use fixed quality instead of fixed bitrate (by specifying bitrate 0...100)
    * Format url parameter supports <format>/<encoder> syntax

Details:
    - Redefine av_err2str to a to avoid compiler warning on newer g++'s
    - When using rtp format; if ffmpeg does not have a default codec, use CODEC_ID_MPEG4. (because this is what the default is as of 2.2 when this code was written)
    - Specify ofc->packet_size if rtp format is requested
    - Video generated in a thread to guarantee a constant fps.
    - Move _AVCODECID definition into zm_ffmpeg.h (and use instead of (AV)CodecID
    - Call avformat_network_init because ffmpeg warns about it beeing required soon.
    - increase VideoStream::video_outbuf_size to 4MiB to be able to encode larger pictures
2014-04-25 22:12:58 +02:00