1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-20 20:09:11 +00:00

multimedia/motion: unbreak with ffmpeg 4.0

ffmpeg.c:442:25: error: use of undeclared identifier 'CODEC_FLAG_QSCALE'
            c->flags |= CODEC_FLAG_QSCALE;
                        ^
ffmpeg.c:450:17: error: use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER'
    c->flags |= CODEC_FLAG_GLOBAL_HEADER;
                ^
ffmpeg.c:492:40: error: use of undeclared identifier 'AVFMT_RAWPICTURE'
    if (!(ffmpeg->oc->oformat->flags & AVFMT_RAWPICTURE)) {
                                       ^
ffmpeg.c:708:38: error: use of undeclared identifier 'AVFMT_RAWPICTURE'
    if (ffmpeg->oc->oformat->flags & AVFMT_RAWPICTURE) {
                                     ^

PR:		227726
This commit is contained in:
Jan Beich 2018-04-27 14:56:16 +00:00
parent a96b55f5ba
commit 41624773e8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=468433

View File

@ -0,0 +1,53 @@
Upstream fix from 4.1.* causes too many merge conflicts.
https://github.com/Motion-Project/motion/commit/b5c3a73cc62e
https://github.com/Motion-Project/motion/commit/9b93a417e37e
--- ffmpeg.c.orig 2016-10-25 01:39:24 UTC
+++ ffmpeg.c
@@ -439,7 +439,7 @@ struct ffmpeg *ffmpeg_open(const char *ffmpeg_video_co
/* The selection of 8000 in the else is a subjective number based upon viewing output files */
if (vbr > 0){
ffmpeg->vbr =(int)(((100-vbr)*(100-vbr)*(100-vbr) * 8000) / 1000000) + 1;
- c->flags |= CODEC_FLAG_QSCALE;
+ c->flags |= AV_CODEC_FLAG_QSCALE;
c->global_quality=ffmpeg->vbr;
}
}
@@ -447,7 +447,7 @@ struct ffmpeg *ffmpeg_open(const char *ffmpeg_video_co
MOTION_LOG(INF, TYPE_ENCODER, NO_ERRNO, "%s vbr/crf for codec: %d", ffmpeg->vbr);
if (strcmp(ffmpeg_video_codec, "ffv1") == 0) c->strict_std_compliance = -2;
- c->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
retcd = avcodec_open2(c, codec, &opts);
if (retcd < 0) {
@@ -489,7 +489,10 @@ struct ffmpeg *ffmpeg_open(const char *ffmpeg_video_co
}
ffmpeg->video_outbuf = NULL;
- if (!(ffmpeg->oc->oformat->flags & AVFMT_RAWPICTURE)) {
+#ifdef AVFMT_RAWPICTURE
+ if (!(ffmpeg->oc->oformat->flags & AVFMT_RAWPICTURE))
+#endif
+ {
ffmpeg->video_outbuf_size = ffmpeg->c->width * 512;
ffmpeg->video_outbuf = mymalloc(ffmpeg->video_outbuf_size);
}
@@ -705,12 +708,15 @@ int ffmpeg_put_frame(struct ffmpeg *ffmpeg, AVFrame *p
gettimeofday(&tv1, NULL);
av_init_packet(&pkt); /* Init static structure. */
+#ifdef AVFMT_RAWPICTURE
if (ffmpeg->oc->oformat->flags & AVFMT_RAWPICTURE) {
pkt.stream_index = ffmpeg->video_st->index;
pkt.flags |= AV_PKT_FLAG_KEY;
pkt.data = (uint8_t *)pic;
pkt.size = sizeof(AVPicture);
- } else {
+ } else
+#endif
+ {
pkt.data = NULL;
pkt.size = 0;
retcd = avcodec_encode_video2(AVSTREAM_CODEC_PTR(ffmpeg->video_st),