The user has no business modifying the underlying AVCodec.
Unified · Split
| @@ -638,8 +638,9 @@ void assert_avoptions(AVDictionary *m); · 637 unmodified lines | |||
| 638 | 638 | ||
| 639 | int guess_input_channel_layout(InputStream *ist); | 639 | int guess_input_channel_layout(InputStream *ist); |
| 640 | 640 | ||
| 641 | enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, AVCodec *codec, enum AVPixelFormat target); | 641 | enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, |
| 642 | void choose_sample_fmt(AVStream *st, AVCodec *codec); | 642 | const AVCodec *codec, enum AVPixelFormat target); |
| 643 | void choose_sample_fmt(AVStream *st, const AVCodec *codec); | ||
| 643 | 644 | ||
| 644 | int configure_filtergraph(FilterGraph *fg); | 645 | int configure_filtergraph(FilterGraph *fg); |
| 645 | int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out); | 646 | int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out); |
| @@ -60,7 +60,8 @@ static const enum AVPixelFormat *get_compliance_unofficial_pix_fmts(enum AVCodec · 59 unmodified lines | |||
| 60 | } | 60 | } |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx, AVCodec *codec, enum AVPixelFormat target) | 63 | enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx, |
| 64 | const AVCodec *codec, enum AVPixelFormat target) | ||
| 64 | { | 65 | { |
| 65 | if (codec && codec->pix_fmts) { | 66 | if (codec && codec->pix_fmts) { |
| 66 | const enum AVPixelFormat *p = codec->pix_fmts; | 67 | const enum AVPixelFormat *p = codec->pix_fmts; |
| @@ -90,7 +91,7 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx, AVCod · 23 unmodified lines | |||
| 90 | return target; | 91 | return target; |
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | void choose_sample_fmt(AVStream *st, AVCodec *codec) | 94 | void choose_sample_fmt(AVStream *st, const AVCodec *codec) |
| 94 | { | 95 | { |
| 95 | if (codec && codec->sample_fmts) { | 96 | if (codec && codec->sample_fmts) { |
| 96 | const enum AVSampleFormat *p = codec->sample_fmts; | 97 | const enum AVSampleFormat *p = codec->sample_fmts; |
| @@ -46,7 +46,7 @@ static av_cold int init(AVCodecContext *avctx) · 45 unmodified lines | |||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | if(a->is_mjpeg) { | 48 | if(a->is_mjpeg) { |
| 49 | AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_MJPEG); | 49 | const AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_MJPEG); |
| 50 | AVDictionary *thread_opt = NULL; | 50 | AVDictionary *thread_opt = NULL; |
| 51 | if (!codec) { | 51 | if (!codec) { |
| 52 | av_log(avctx, AV_LOG_ERROR, "MJPEG codec not found\n"); | 52 | av_log(avctx, AV_LOG_ERROR, "MJPEG codec not found\n"); |
| @@ -695,7 +695,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code · 694 unmodified lines | |||
| 695 | if ((avctx->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) && | 695 | if ((avctx->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) && |
| 696 | avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { | 696 | avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { |
| 697 | const char *codec_string = av_codec_is_encoder(codec) ? "encoder" : "decoder"; | 697 | const char *codec_string = av_codec_is_encoder(codec) ? "encoder" : "decoder"; |
| 698 | AVCodec *codec2; | 698 | const AVCodec *codec2; |
| 699 | av_log(avctx, AV_LOG_ERROR, | 699 | av_log(avctx, AV_LOG_ERROR, |
| 700 | "The %s '%s' is experimental but experimental codecs are not enabled, " | 700 | "The %s '%s' is experimental but experimental codecs are not enabled, " |
| 701 | "add '-strict %d' if you want to use it.\n", | 701 | "add '-strict %d' if you want to use it.\n", |
| @@ -1193,7 +1193,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 491 unmodified lines | |||
| 1193 | const char *avcodec_get_name(enum AVCodecID id) | 1193 | const char *avcodec_get_name(enum AVCodecID id) |
| 1194 | { | 1194 | { |
| 1195 | const AVCodecDescriptor *cd; | 1195 | const AVCodecDescriptor *cd; |
| 1196 | AVCodec *codec; | 1196 | const AVCodec *codec; |
| 1197 | 1197 | ||
| 1198 | if (id == AV_CODEC_ID_NONE) | 1198 | if (id == AV_CODEC_ID_NONE) |
| 1199 | return "none"; | 1199 | return "none"; |
| @@ -27,7 +27,7 @@ int ff_load_image(uint8_t *data[4], int linesize[4], · 26 unmodified lines | |||
| 27 | { | 27 | { |
| 28 | AVInputFormat *iformat = NULL; | 28 | AVInputFormat *iformat = NULL; |
| 29 | AVFormatContext *format_ctx = NULL; | 29 | AVFormatContext *format_ctx = NULL; |
| 30 | AVCodec *codec; | 30 | const AVCodec *codec; |
| 31 | AVCodecContext *codec_ctx = NULL; | 31 | AVCodecContext *codec_ctx = NULL; |
| 32 | AVCodecParameters *par; | 32 | AVCodecParameters *par; |
| 33 | AVFrame *frame = NULL; | 33 | AVFrame *frame = NULL; |
| @@ -155,7 +155,7 @@ static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec) · 154 unmodified lines | |||
| 155 | 155 | ||
| 156 | static int open_stream(AVFilterContext *ctx, MovieStream *st) | 156 | static int open_stream(AVFilterContext *ctx, MovieStream *st) |
| 157 | { | 157 | { |
| 158 | AVCodec *codec; | 158 | const AVCodec *codec; |
| 159 | int ret; | 159 | int ret; |
| 160 | 160 | ||
| 161 | codec = avcodec_find_decoder(st->st->codecpar->codec_id); | 161 | codec = avcodec_find_decoder(st->st->codecpar->codec_id); |
| @@ -102,7 +102,7 @@ static int config_props(AVFilterLink *inlink) · 101 unmodified lines | |||
| 102 | { | 102 | { |
| 103 | AVFilterContext *ctx = inlink->dst; | 103 | AVFilterContext *ctx = inlink->dst; |
| 104 | MCDeintContext *mcdeint = ctx->priv; | 104 | MCDeintContext *mcdeint = ctx->priv; |
| 105 | AVCodec *enc; | 105 | const AVCodec *enc; |
| 106 | AVCodecContext *enc_ctx; | 106 | AVCodecContext *enc_ctx; |
| 107 | AVDictionary *opts = NULL; | 107 | AVDictionary *opts = NULL; |
| 108 | int ret; | 108 | int ret; |
| @@ -302,7 +302,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx) · 301 unmodified lines | |||
| 302 | AVDictionary *codec_opts = NULL; | 302 | AVDictionary *codec_opts = NULL; |
| 303 | AVFormatContext *fmt = NULL; | 303 | AVFormatContext *fmt = NULL; |
| 304 | AVCodecContext *dec_ctx = NULL; | 304 | AVCodecContext *dec_ctx = NULL; |
| 305 | AVCodec *dec = NULL; | 305 | const AVCodec *dec; |
| 306 | const AVCodecDescriptor *dec_desc; | 306 | const AVCodecDescriptor *dec_desc; |
| 307 | AVStream *st; | 307 | AVStream *st; |
| 308 | AVPacket pkt; | 308 | AVPacket pkt; |
| @@ -316,7 +316,7 @@ static int config_input(AVFilterLink *inlink) · 315 unmodified lines | |||
| 316 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); | 316 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); |
| 317 | int i; | 317 | int i; |
| 318 | 318 | ||
| 319 | AVCodec *enc = avcodec_find_encoder(AV_CODEC_ID_SNOW); | 319 | const AVCodec *enc = avcodec_find_encoder(AV_CODEC_ID_SNOW); |
| 320 | if (!enc) { | 320 | if (!enc) { |
| 321 | av_log(ctx, AV_LOG_ERROR, "SNOW encoder not found.\n"); | 321 | av_log(ctx, AV_LOG_ERROR, "SNOW encoder not found.\n"); |
| 322 | return AVERROR(EINVAL); | 322 | return AVERROR(EINVAL); |