summaryrefslogtreecommitdiff
path: root/libavformat/format.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-25 03:11:32 +0100
committerJames Almer <jamrial@gmail.com>2021-04-27 10:43:08 -0300
commit56450a0ee4fdda160f4039fc2ae33edfd27765c9 (patch)
treea7566fa8dba9d38e4c748db1d1e673aee09c5244 /libavformat/format.c
parentf0c7fa2c484e197dae05fbda70a15b5e2ce81e9a (diff)
avformat: Constify the API wrt AV(In|Out)putFormat
Also constify AVProbeData. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/format.c')
-rw-r--r--libavformat/format.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/libavformat/format.c b/libavformat/format.c
index c47490c8eb..cc214741bd 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -48,8 +48,8 @@ int av_match_ext(const char *filename, const char *extensions)
return 0;
}
-ff_const59 AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
- const char *mime_type)
+const AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
+ const char *mime_type)
{
const AVOutputFormat *fmt = NULL;
AVOutputFormat *fmt_found = NULL;
@@ -84,12 +84,12 @@ ff_const59 AVOutputFormat *av_guess_format(const char *short_name, const char *f
return fmt_found;
}
-enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_name,
+enum AVCodecID av_guess_codec(const AVOutputFormat *fmt, const char *short_name,
const char *filename, const char *mime_type,
enum AVMediaType type)
{
if (av_match_name("segment", fmt->name) || av_match_name("ssegment", fmt->name)) {
- ff_const59 AVOutputFormat *fmt2 = av_guess_format(NULL, filename, NULL);
+ const AVOutputFormat *fmt2 = av_guess_format(NULL, filename, NULL);
if (fmt2)
fmt = fmt2;
}
@@ -115,7 +115,7 @@ enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_
return AV_CODEC_ID_NONE;
}
-ff_const59 AVInputFormat *av_find_input_format(const char *short_name)
+const AVInputFormat *av_find_input_format(const char *short_name)
{
const AVInputFormat *fmt = NULL;
void *i = 0;
@@ -125,12 +125,12 @@ ff_const59 AVInputFormat *av_find_input_format(const char *short_name)
return NULL;
}
-ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int is_opened,
- int *score_ret)
+const AVInputFormat *av_probe_input_format3(const AVProbeData *pd,
+ int is_opened, int *score_ret)
{
AVProbeData lpd = *pd;
const AVInputFormat *fmt1 = NULL;
- ff_const59 AVInputFormat *fmt = NULL;
+ const AVInputFormat *fmt = NULL;
int score, score_max = 0;
void *i = 0;
const static uint8_t zerobuffer[AVPROBE_PADDING_SIZE];
@@ -191,7 +191,7 @@ ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int
}
if (score > score_max) {
score_max = score;
- fmt = (AVInputFormat*)fmt1;
+ fmt = fmt1;
} else if (score == score_max)
fmt = NULL;
}
@@ -202,10 +202,11 @@ ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int
return fmt;
}
-ff_const59 AVInputFormat *av_probe_input_format2(ff_const59 AVProbeData *pd, int is_opened, int *score_max)
+const AVInputFormat *av_probe_input_format2(const AVProbeData *pd,
+ int is_opened, int *score_max)
{
int score_ret;
- ff_const59 AVInputFormat *fmt = av_probe_input_format3(pd, is_opened, &score_ret);
+ const AVInputFormat *fmt = av_probe_input_format3(pd, is_opened, &score_ret);
if (score_ret > *score_max) {
*score_max = score_ret;
return fmt;
@@ -213,15 +214,15 @@ ff_const59 AVInputFormat *av_probe_input_format2(ff_const59 AVProbeData *pd, int
return NULL;
}
-ff_const59 AVInputFormat *av_probe_input_format(ff_const59 AVProbeData *pd, int is_opened)
+const AVInputFormat *av_probe_input_format(const AVProbeData *pd, int is_opened)
{
int score = 0;
return av_probe_input_format2(pd, is_opened, &score);
}
-int av_probe_input_buffer2(AVIOContext *pb, ff_const59 AVInputFormat **fmt,
- const char *filename, void *logctx,
- unsigned int offset, unsigned int max_probe_size)
+int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt,
+ const char *filename, void *logctx,
+ unsigned int offset, unsigned int max_probe_size)
{
AVProbeData pd = { filename ? filename : "" };
uint8_t *buf = NULL;
@@ -309,7 +310,7 @@ fail:
return ret < 0 ? ret : score;
}
-int av_probe_input_buffer(AVIOContext *pb, ff_const59 AVInputFormat **fmt,
+int av_probe_input_buffer(AVIOContext *pb, const AVInputFormat **fmt,
const char *filename, void *logctx,
unsigned int offset, unsigned int max_probe_size)
{