summaryrefslogtreecommitdiff
path: root/multimedia/zoneminder
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2018-05-02 18:30:13 +0000
committerJan Beich <jbeich@FreeBSD.org>2018-05-02 18:30:13 +0000
commit68e8abc92d631535c89df2e850c5816b57b4c6f9 (patch)
tree1adee35c697e1ecc187f76a73be9ae251beaf29e /multimedia/zoneminder
parentUpdate Mojolicious to 7.77 (diff)
multimedia/zoneminder{,-h264}: unbreak with ffmpeg 4.0
src/zm_mpeg.cpp:243:19: error: use of undeclared identifier 'CODEC_FLAG_QSCALE' c->flags |= CODEC_FLAG_QSCALE; ^ src/zm_mpeg.cpp:268:19: error: use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER' c->flags |= CODEC_FLAG_GLOBAL_HEADER; ^ src/zm_mpeg.cpp:428:22: error: use of undeclared identifier 'AVFMT_RAWPICTURE' if ( !(of->flags & AVFMT_RAWPICTURE) ) ^ src/zm_mpeg.cpp:675:20: error: use of undeclared identifier 'AVFMT_RAWPICTURE' if ( of->flags & AVFMT_RAWPICTURE ) ^ src/zm_sdp.cpp:497:38: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE' packet_size, 0, FF_INPUT_BUFFER_PADDING_SIZE); ^ src/zm_videostore.cpp:116:31: error: use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER' video_st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; ^ src/zm_videostore.cpp:149:35: error: use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER' audio_st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; ^ src/zm_videostore.cpp:286:74: error: use of undeclared identifier 'AVFMT_RAWPICTURE' if (video_st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (fmt->flags & AVFMT_RAWPICTURE)) { ^ PR: 227726 Reported by: antoine (via exp-run)
Notes
Notes: svn path=/head/; revision=468862
Diffstat (limited to 'multimedia/zoneminder')
-rw-r--r--multimedia/zoneminder/Makefile1
-rw-r--r--multimedia/zoneminder/files/patch-ffmpeg480
2 files changed, 80 insertions, 1 deletions
diff --git a/multimedia/zoneminder/Makefile b/multimedia/zoneminder/Makefile
index 82cf361e0f9d..6561171bf80c 100644
--- a/multimedia/zoneminder/Makefile
+++ b/multimedia/zoneminder/Makefile
@@ -10,7 +10,6 @@ COMMENT= Complete security camera solution, fully web based with image analysis
LICENSE= GPLv2
-BROKEN= fails to build with ffmpeg 4.0
CONFLICTS_INSTALL= zoneminder-h264
ZM_DEPENDS= p5-DBI>=0:databases/p5-DBI \
diff --git a/multimedia/zoneminder/files/patch-ffmpeg4 b/multimedia/zoneminder/files/patch-ffmpeg4
new file mode 100644
index 000000000000..83e49595e080
--- /dev/null
+++ b/multimedia/zoneminder/files/patch-ffmpeg4
@@ -0,0 +1,80 @@
+Partially based on https://github.com/ZoneMinder/zoneminder/commit/e17bcb9178d0
+
+--- src/zm_mpeg.cpp.orig 2017-05-09 14:54:48 UTC
++++ src/zm_mpeg.cpp
+@@ -240,7 +240,11 @@ void VideoStream::SetupCodec( int colours, int subpixe
+ {
+ // Quality based bitrate control (VBR). Scale is 1..31 where 1 is best.
+ // This gets rid of artifacts in the beginning of the movie; and well, even quality.
++#if LIBAVCODEC_VERSION_CHECK(56, 35, 0, 64, 0)
++ c->flags |= AV_CODEC_FLAG_QSCALE;
++#else
+ c->flags |= CODEC_FLAG_QSCALE;
++#endif
+ c->global_quality = FF_QP2LAMBDA * (31 - (31 * (bitrate / 100.0)));
+ }
+ else
+@@ -265,7 +269,11 @@ void VideoStream::SetupCodec( int colours, int subpixe
+
+ // some formats want stream headers to be separate
+ if ( of->flags & AVFMT_GLOBALHEADER )
++#if LIBAVCODEC_VERSION_CHECK(56, 35, 0, 64, 0)
++ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
++#else
+ c->flags |= CODEC_FLAG_GLOBAL_HEADER;
++#endif
+ }
+ else
+ {
+@@ -425,7 +433,9 @@ void VideoStream::OpenStream( )
+ }
+
+ video_outbuf = NULL;
++#if !LIBAVCODEC_VERSION_CHECK(57, 0, 0, 0, 0)
+ if ( !(of->flags & AVFMT_RAWPICTURE) )
++#endif
+ {
+ /* allocate output buffer */
+ /* XXX: API change will be done */
+@@ -672,6 +682,7 @@ double VideoStream::ActuallyEncodeFrame( const uint8_t
+ AVPacket *pkt = packet_buffers[packet_index];
+ av_init_packet( pkt );
+ int got_packet = 0;
++#if !LIBAVCODEC_VERSION_CHECK(57, 0, 0, 0, 0)
+ if ( of->flags & AVFMT_RAWPICTURE )
+ {
+ #if LIBAVCODEC_VERSION_CHECK(52, 30, 2, 30, 2)
+@@ -685,6 +696,7 @@ double VideoStream::ActuallyEncodeFrame( const uint8_t
+ got_packet = 1;
+ }
+ else
++#endif
+ {
+ opicture_ptr->pts = c->frame_number;
+ opicture_ptr->quality = c->global_quality;
+--- src/zm_sdp.cpp.orig 2017-05-09 14:54:48 UTC
++++ src/zm_sdp.cpp
+@@ -483,7 +483,11 @@ AVFormatContext *SessionDescriptor::generateFormatCont
+ uint8_t *dest =
+ (uint8_t *)av_malloc(packet_size + sizeof(start_sequence) +
+ stream->codec->extradata_size +
++#if LIBAVCODEC_VERSION_CHECK(57, 0, 0, 0, 0)
++ AV_INPUT_BUFFER_PADDING_SIZE);
++#else
+ FF_INPUT_BUFFER_PADDING_SIZE);
++#endif
+ if(dest) {
+ if(stream->codec->extradata_size) {
+ // av_realloc?
+@@ -494,7 +498,11 @@ AVFormatContext *SessionDescriptor::generateFormatCont
+ memcpy(dest+stream->codec->extradata_size, start_sequence, sizeof(start_sequence));
+ memcpy(dest+stream->codec->extradata_size+sizeof(start_sequence), decoded_packet, packet_size);
+ memset(dest+stream->codec->extradata_size+sizeof(start_sequence)+
++#if LIBAVCODEC_VERSION_CHECK(57, 0, 0, 0, 0)
++ packet_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
++#else
+ packet_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
++#endif
+
+ stream->codec->extradata= dest;
+ stream->codec->extradata_size+= sizeof(start_sequence)+packet_size;