From 626535f6a169e2d821b969e0ea77125ba7482113 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Thu, 25 Feb 2021 07:45:51 +0100 Subject: avcodec/codec, allcodecs: Constify the AVCodec API Signed-off-by: Andreas Rheinhardt Signed-off-by: James Almer --- tests/api/api-band-test.c | 2 +- tests/api/api-flac-test.c | 10 +++++----- tests/api/api-h264-test.c | 2 +- tests/api/api-seek-test.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/api/api-band-test.c b/tests/api/api-band-test.c index 717c9441a4..b00e2927a9 100644 --- a/tests/api/api-band-test.c +++ b/tests/api/api-band-test.c @@ -66,7 +66,7 @@ static void draw_horiz_band(AVCodecContext *ctx, const AVFrame *fr, int offset[4 static int video_decode(const char *input_filename) { - AVCodec *codec = NULL; + const AVCodec *codec = NULL; AVCodecContext *ctx= NULL; AVCodecParameters *origin_par = NULL; uint8_t *byte_buffer = NULL; diff --git a/tests/api/api-flac-test.c b/tests/api/api-flac-test.c index f3bfbc95b5..88b15e8722 100644 --- a/tests/api/api-flac-test.c +++ b/tests/api/api-flac-test.c @@ -48,7 +48,7 @@ static int generate_raw_frame(uint16_t *frame_data, int i, int sample_rate, return 0; } -static int init_encoder(AVCodec *enc, AVCodecContext **enc_ctx, +static int init_encoder(const AVCodec *enc, AVCodecContext **enc_ctx, int64_t ch_layout, int sample_rate) { AVCodecContext *ctx; @@ -78,7 +78,7 @@ static int init_encoder(AVCodec *enc, AVCodecContext **enc_ctx, return 0; } -static int init_decoder(AVCodec *dec, AVCodecContext **dec_ctx, +static int init_decoder(const AVCodec *dec, AVCodecContext **dec_ctx, int64_t ch_layout) { AVCodecContext *ctx; @@ -105,8 +105,8 @@ static int init_decoder(AVCodec *dec, AVCodecContext **dec_ctx, return 0; } -static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, - AVCodecContext *dec_ctx) +static int run_test(const AVCodec *enc, const AVCodec *dec, + AVCodecContext *enc_ctx, AVCodecContext *dec_ctx) { AVPacket *enc_pkt; AVFrame *in_frame, *out_frame; @@ -244,7 +244,7 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, int main(void) { - AVCodec *enc = NULL, *dec = NULL; + const AVCodec *enc = NULL, *dec = NULL; AVCodecContext *enc_ctx = NULL, *dec_ctx = NULL; uint64_t channel_layouts[] = {AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT1_BACK, AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_STEREO_DOWNMIX}; int sample_rates[] = {8000, 44100, 48000, 192000}; diff --git a/tests/api/api-h264-test.c b/tests/api/api-h264-test.c index 6f13e773f9..b9230c65cb 100644 --- a/tests/api/api-h264-test.c +++ b/tests/api/api-h264-test.c @@ -32,7 +32,7 @@ static int video_decode_example(const char *input_filename) { - AVCodec *codec = NULL; + const AVCodec *codec = NULL; AVCodecContext *ctx= NULL; AVCodecParameters *origin_par = NULL; AVFrame *fr = NULL; diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c index bb9f5c89b3..696af9cdfc 100644 --- a/tests/api/api-seek-test.c +++ b/tests/api/api-seek-test.c @@ -184,7 +184,7 @@ static long int read_seek_range(const char *string_with_number) static int seek_test(const char *input_filename, const char *start, const char *end) { - AVCodec *codec = NULL; + const AVCodec *codec = NULL; AVCodecContext *ctx= NULL; AVCodecParameters *origin_par = NULL; AVPacket *pkt = NULL; -- cgit v1.2.3