summaryrefslogtreecommitdiff
path: root/tests/api
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-25 07:45:51 +0100
committerJames Almer <jamrial@gmail.com>2021-04-27 10:43:14 -0300
commit626535f6a169e2d821b969e0ea77125ba7482113 (patch)
treebfab6bbc7157ec5163ed8ae3bf3978f74f4fdd3e /tests/api
parent14fa0a4efbc989619860ed8ec0fd33dcdae558b0 (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 'tests/api')
-rw-r--r--tests/api/api-band-test.c2
-rw-r--r--tests/api/api-flac-test.c10
-rw-r--r--tests/api/api-h264-test.c2
-rw-r--r--tests/api/api-seek-test.c2
4 files changed, 8 insertions, 8 deletions
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;