diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2022-02-18 20:20:06 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2022-02-18 20:24:16 +0300 |
commit | af6a1b08e3f0d0070ac9423868d2d3f81057717a (patch) | |
tree | 57bfa6025b063480d5014d0b40e2985df915229e /source/blender/imbuf | |
parent | 82c3bef7655bb115f739842b815a2ee1c40a9320 (diff) |
VSE: Refactor our code to be compatible with ffmpeg 5.0
In ffmpeg 5.0, several variables were made const to try to prevent bad API usage.
Removed some dead code that wasn't used anymore as well.
Reviewed By: Richard Antalik
Differential Revision: http://developer.blender.org/D14063
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/IMB_anim.h | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/indexer.c | 13 | ||||
-rw-r--r-- | source/blender/imbuf/intern/util.c | 2 |
4 files changed, 7 insertions, 12 deletions
diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h index c4e2ad9da7f..67fdb841317 100644 --- a/source/blender/imbuf/intern/IMB_anim.h +++ b/source/blender/imbuf/intern/IMB_anim.h @@ -124,7 +124,7 @@ struct anim { #ifdef WITH_FFMPEG AVFormatContext *pFormatCtx; AVCodecContext *pCodecCtx; - AVCodec *pCodec; + const AVCodec *pCodec; AVFrame *pFrame; int pFrameComplete; AVFrame *pFrameRGB; diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 38dbb9bfc47..0d0ac798d3a 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -508,7 +508,7 @@ static int startffmpeg(struct anim *anim) { int i, video_stream_index; - AVCodec *pCodec; + const AVCodec *pCodec; AVFormatContext *pFormatCtx = NULL; AVCodecContext *pCodecCtx; AVRational frame_rate; diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 00e96e7840b..55f1eced70f 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -493,7 +493,7 @@ struct proxy_output_ctx { AVFormatContext *of; AVStream *st; AVCodecContext *c; - AVCodec *codec; + const AVCodec *codec; struct SwsContext *sws_ctx; AVFrame *frame; int cfra; @@ -525,12 +525,9 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg( rv->st = avformat_new_stream(rv->of, NULL); rv->st->id = 0; - rv->c = avcodec_alloc_context3(NULL); - rv->c->codec_type = AVMEDIA_TYPE_VIDEO; - rv->c->codec_id = AV_CODEC_ID_H264; + rv->codec = avcodec_find_encoder(AV_CODEC_ID_H264); - rv->of->oformat->video_codec = rv->c->codec_id; - rv->codec = avcodec_find_encoder(rv->c->codec_id); + rv->c = avcodec_alloc_context3(rv->codec); if (!rv->codec) { fprintf(stderr, @@ -542,8 +539,6 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg( return NULL; } - avcodec_get_context_defaults3(rv->c, rv->codec); - rv->c->width = width; rv->c->height = height; rv->c->gop_size = 10; @@ -794,7 +789,7 @@ typedef struct FFmpegIndexBuilderContext { AVFormatContext *iFormatCtx; AVCodecContext *iCodecCtx; - AVCodec *iCodec; + const AVCodec *iCodec; AVStream *iStream; int videoStream; diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 18ed4710e78..96005ed0a0d 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -267,7 +267,7 @@ static int isffmpeg(const char *filepath) AVFormatContext *pFormatCtx = NULL; unsigned int i; int videoStream; - AVCodec *pCodec; + const AVCodec *pCodec; if (BLI_path_extension_check_n(filepath, ".swf", |