diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-25 09:45:51 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-04-27 16:43:14 +0300 |
commit | 626535f6a169e2d821b969e0ea77125ba7482113 (patch) | |
tree | bfab6bbc7157ec5163ed8ae3bf3978f74f4fdd3e /doc/examples | |
parent | 14fa0a4efbc989619860ed8ec0fd33dcdae558b0 (diff) |
avcodec/codec, allcodecs: Constify the AVCodec API
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'doc/examples')
-rw-r--r-- | doc/examples/demuxing_decoding.c | 2 | ||||
-rw-r--r-- | doc/examples/muxing.c | 10 | ||||
-rw-r--r-- | doc/examples/transcode_aac.c | 4 | ||||
-rw-r--r-- | doc/examples/transcoding.c | 4 | ||||
-rw-r--r-- | doc/examples/vaapi_encode.c | 2 | ||||
-rw-r--r-- | doc/examples/vaapi_transcode.c | 4 |
6 files changed, 14 insertions, 12 deletions
diff --git a/doc/examples/demuxing_decoding.c b/doc/examples/demuxing_decoding.c index db5e0cb951..55fdb2555c 100644 --- a/doc/examples/demuxing_decoding.c +++ b/doc/examples/demuxing_decoding.c @@ -149,7 +149,7 @@ static int open_codec_context(int *stream_idx, { int ret, stream_index; AVStream *st; - AVCodec *dec = NULL; + const AVCodec *dec = NULL; AVDictionary *opts = NULL; ret = av_find_best_stream(fmt_ctx, type, -1, -1, NULL, 0); diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c index 014359e2ca..fe1b9ded21 100644 --- a/doc/examples/muxing.c +++ b/doc/examples/muxing.c @@ -121,7 +121,7 @@ static int write_frame(AVFormatContext *fmt_ctx, AVCodecContext *c, /* Add an output stream. */ static void add_stream(OutputStream *ost, AVFormatContext *oc, - AVCodec **codec, + const AVCodec **codec, enum AVCodecID codec_id) { AVCodecContext *c; @@ -242,7 +242,8 @@ static AVFrame *alloc_audio_frame(enum AVSampleFormat sample_fmt, return frame; } -static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg) +static void open_audio(AVFormatContext *oc, const AVCodec *codec, + OutputStream *ost, AVDictionary *opt_arg) { AVCodecContext *c; int nb_samples; @@ -405,7 +406,8 @@ static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height) return picture; } -static void open_video(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg) +static void open_video(AVFormatContext *oc, const AVCodec *codec, + OutputStream *ost, AVDictionary *opt_arg) { int ret; AVCodecContext *c = ost->enc; @@ -539,7 +541,7 @@ int main(int argc, char **argv) const AVOutputFormat *fmt; const char *filename; AVFormatContext *oc; - AVCodec *audio_codec, *video_codec; + const AVCodec *audio_codec, *video_codec; int ret; int have_video = 0, have_audio = 0; int encode_video = 0, encode_audio = 0; diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c index 73786ab59b..711076b5a5 100644 --- a/doc/examples/transcode_aac.c +++ b/doc/examples/transcode_aac.c @@ -60,7 +60,7 @@ static int open_input_file(const char *filename, AVCodecContext **input_codec_context) { AVCodecContext *avctx; - AVCodec *input_codec; + const AVCodec *input_codec; int error; /* Open the input file to read from it. */ @@ -144,7 +144,7 @@ static int open_output_file(const char *filename, AVCodecContext *avctx = NULL; AVIOContext *output_io_context = NULL; AVStream *stream = NULL; - AVCodec *output_codec = NULL; + const AVCodec *output_codec = NULL; int error; /* Open the output file to write to it. */ diff --git a/doc/examples/transcoding.c b/doc/examples/transcoding.c index 6ca3089330..3a97426e2c 100644 --- a/doc/examples/transcoding.c +++ b/doc/examples/transcoding.c @@ -77,7 +77,7 @@ static int open_input_file(const char *filename) for (i = 0; i < ifmt_ctx->nb_streams; i++) { AVStream *stream = ifmt_ctx->streams[i]; - AVCodec *dec = avcodec_find_decoder(stream->codecpar->codec_id); + const AVCodec *dec = avcodec_find_decoder(stream->codecpar->codec_id); AVCodecContext *codec_ctx; if (!dec) { av_log(NULL, AV_LOG_ERROR, "Failed to find decoder for stream #%u\n", i); @@ -122,7 +122,7 @@ static int open_output_file(const char *filename) AVStream *out_stream; AVStream *in_stream; AVCodecContext *dec_ctx, *enc_ctx; - AVCodec *encoder; + const AVCodec *encoder; int ret; unsigned int i; diff --git a/doc/examples/vaapi_encode.c b/doc/examples/vaapi_encode.c index 46bca1b3fe..e232fa579a 100644 --- a/doc/examples/vaapi_encode.c +++ b/doc/examples/vaapi_encode.c @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) FILE *fin = NULL, *fout = NULL; AVFrame *sw_frame = NULL, *hw_frame = NULL; AVCodecContext *avctx = NULL; - AVCodec *codec = NULL; + const AVCodec *codec = NULL; const char *enc_name = "h264_vaapi"; if (argc < 5) { diff --git a/doc/examples/vaapi_transcode.c b/doc/examples/vaapi_transcode.c index 5a1a704a8e..e9b33eede0 100644 --- a/doc/examples/vaapi_transcode.c +++ b/doc/examples/vaapi_transcode.c @@ -142,7 +142,7 @@ end: return ret; } -static int dec_enc(AVPacket *pkt, AVCodec *enc_codec) +static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec) { AVFrame *frame; int ret = 0; @@ -226,9 +226,9 @@ fail: int main(int argc, char **argv) { + const AVCodec *enc_codec; int ret = 0; AVPacket *dec_pkt; - AVCodec *enc_codec; if (argc != 4) { fprintf(stderr, "Usage: %s <input file> <encode codec> <output file>\n" |