API changes, most recent first:
+2021-04-27 - xxxxxxxxxx - lavf yyyyyyyyy - avformat.h
+ av_find_best_stream now uses a const AVCodec ** parameter
+ for the returned decoder.
+
2021-04-27 - xxxxxxxxxx - lavc yyyyyyyyy - codec.h
avcodec_find_encoder_by_name(), avcodec_find_encoder(),
avcodec_find_decoder_by_name() and avcodec_find_decoder()
int ret;
AVStream *st;
AVCodecContext *dec_ctx = NULL;
- AVCodec *dec = NULL;
+ const AVCodec *dec = NULL;
AVDictionary *opts = NULL;
ret = av_find_best_stream(fmt_ctx, type, -1, -1, &dec, 0);
static int open_input_file(const char *filename)
{
+ const AVCodec *dec;
int ret;
- AVCodec *dec;
if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
static int open_input_file(const char *filename)
{
+ const AVCodec *dec;
int ret;
- AVCodec *dec;
if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
int video_stream, ret;
AVStream *video = NULL;
AVCodecContext *decoder_ctx = NULL;
- AVCodec *decoder = NULL;
+ const AVCodec *decoder = NULL;
AVPacket packet;
enum AVHWDeviceType type;
int i;
static int open_input_file(const char *filename)
{
int ret;
- AVCodec *decoder = NULL;
+ const AVCodec *decoder = NULL;
AVStream *video = NULL;
if ((ret = avformat_open_input(&ifmt_ctx, filename, NULL, NULL)) < 0) {
enum AVMediaType type,
int wanted_stream_nb,
int related_stream,
- AVCodec **decoder_ret,
+ const AVCodec **decoder_ret,
int flags);
/**
int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
int wanted_stream_nb, int related_stream,
- AVCodec **decoder_ret, int flags)
+ const AVCodec **decoder_ret, int flags)
{
int i, nb_streams = ic->nb_streams;
int ret = AVERROR_STREAM_NOT_FOUND;
}
}
if (decoder_ret)
- *decoder_ret = (AVCodec*)best_decoder;
+ *decoder_ret = best_decoder;
return ret;
}