summaryrefslogtreecommitdiff
path: root/multimedia/zoneminder-h264/files/patch-ffmpeg4
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-h264/files/patch-ffmpeg4
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-h264/files/patch-ffmpeg4')
-rw-r--r--multimedia/zoneminder-h264/files/patch-ffmpeg4122
1 files changed, 122 insertions, 0 deletions
diff --git a/multimedia/zoneminder-h264/files/patch-ffmpeg4 b/multimedia/zoneminder-h264/files/patch-ffmpeg4
new file mode 100644
index 000000000000..6822f34a6728
--- /dev/null
+++ b/multimedia/zoneminder-h264/files/patch-ffmpeg4
@@ -0,0 +1,122 @@
+Partially based on https://github.com/ZoneMinder/zoneminder/commit/e17bcb9178d0
+
+--- src/zm_mpeg.cpp.orig 2017-02-21 21:28:53 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-02-21 21:28:53 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;
+--- src/zm_videostore.cpp.orig 2017-02-21 21:28:53 UTC
++++ src/zm_videostore.cpp
+@@ -113,7 +113,11 @@ VideoStore::VideoStore(const char *filename_in, const
+
+ video_st->codec->codec_tag = 0;
+ if (oc->oformat->flags & AVFMT_GLOBALHEADER) {
++#if LIBAVCODEC_VERSION_CHECK(56, 35, 0, 64, 0)
++ video_st->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
++#else
+ video_st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
++#endif
+ }
+
+ if ( orientation ) {
+@@ -146,7 +150,11 @@ VideoStore::VideoStore(const char *filename_in, const
+ }
+ audio_st->codec->codec_tag = 0;
+ if (oc->oformat->flags & AVFMT_GLOBALHEADER) {
++#if LIBAVCODEC_VERSION_CHECK(56, 35, 0, 64, 0)
++ audio_st->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
++#else
+ audio_st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
++#endif
+ }
+ }
+ } else {
+@@ -283,6 +291,7 @@ int VideoStore::writeVideoFramePacket(AVPacket *ipkt,
+
+ /*opkt.flags |= AV_PKT_FLAG_KEY;*/
+
++#if !LIBAVCODEC_VERSION_CHECK(57, 0, 0, 0, 0)
+ if (video_st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (fmt->flags & AVFMT_RAWPICTURE)) {
+ /* store AVPicture in AVPacket, as expected by the output format */
+ avpicture_fill(&pict, opkt.data, video_st->codec->pix_fmt, video_st->codec->width, video_st->codec->height);
+@@ -290,6 +299,7 @@ int VideoStore::writeVideoFramePacket(AVPacket *ipkt,
+ opkt.size = sizeof(AVPicture);
+ opkt.flags |= AV_PKT_FLAG_KEY;
+ }
++#endif
+
+ memcpy(&safepkt, &opkt, sizeof(AVPacket));
+