projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9461e4b
)
lavf: Constify AVInputFormat pointer.
author
Carl Eugen Hoyos
<ceffmpeg@gmail.com>
Wed, 20 Mar 2019 17:52:38 +0000
(18:52 +0100)
committer
Carl Eugen Hoyos
<ceffmpeg@gmail.com>
Wed, 20 Mar 2019 17:52:38 +0000
(18:52 +0100)
libavformat/allformats.c
patch
|
blob
|
history
libavformat/avformat.h
patch
|
blob
|
history
libavformat/avidec.c
patch
|
blob
|
history
libavformat/dashdec.c
patch
|
blob
|
history
libavformat/format.c
patch
|
blob
|
history
libavformat/hls.c
patch
|
blob
|
history
libavformat/img2dec.c
patch
|
blob
|
history
libavformat/mpeg.c
patch
|
blob
|
history
libavformat/rtpdec_asf.c
patch
|
blob
|
history
libavformat/sapdec.c
patch
|
blob
|
history
libavformat/utils.c
patch
|
blob
|
history
diff --git
a/libavformat/allformats.c
b/libavformat/allformats.c
index
0684498
..
d316a05
100644
(file)
--- a/
libavformat/allformats.c
+++ b/
libavformat/allformats.c
@@
-210,6
+210,7
@@
extern AVInputFormat ff_ivr_demuxer;
extern AVInputFormat ff_jacosub_demuxer;
extern AVOutputFormat ff_jacosub_muxer;
extern AVInputFormat ff_jv_demuxer;
extern AVInputFormat ff_jacosub_demuxer;
extern AVOutputFormat ff_jacosub_muxer;
extern AVInputFormat ff_jv_demuxer;
+extern AVInputFormat ff_kux_demuxer;
extern AVOutputFormat ff_latm_muxer;
extern AVInputFormat ff_lmlm4_demuxer;
extern AVInputFormat ff_loas_demuxer;
extern AVOutputFormat ff_latm_muxer;
extern AVInputFormat ff_lmlm4_demuxer;
extern AVInputFormat ff_loas_demuxer;
@@
-583,7
+584,11
@@
AVInputFormat *av_iformat_next(const AVInputFormat *f)
ff_thread_once(&av_format_next_init, av_format_init_next);
if (f)
ff_thread_once(&av_format_next_init, av_format_init_next);
if (f)
+#if FF_API_AVIOFORMAT
return f->next;
return f->next;
+#else
+ return (AVInputFormat *) f->next;
+#endif
else {
void *opaque = NULL;
return (AVInputFormat *)av_demuxer_iterate(&opaque);
else {
void *opaque = NULL;
return (AVInputFormat *)av_demuxer_iterate(&opaque);
@@
-595,7
+600,11
@@
AVOutputFormat *av_oformat_next(const AVOutputFormat *f)
ff_thread_once(&av_format_next_init, av_format_init_next);
if (f)
ff_thread_once(&av_format_next_init, av_format_init_next);
if (f)
+#if FF_API_AVIOFORMAT
return f->next;
return f->next;
+#else
+ return (AVOutputFormat *) f->next;
+#endif
else {
void *opaque = NULL;
return (AVOutputFormat *)av_muxer_iterate(&opaque);
else {
void *opaque = NULL;
return (AVOutputFormat *)av_muxer_iterate(&opaque);
diff --git
a/libavformat/avformat.h
b/libavformat/avformat.h
index
9ddac9d
..
8ed72af
100644
(file)
--- a/
libavformat/avformat.h
+++ b/
libavformat/avformat.h
@@
-681,7
+681,7
@@
typedef struct AVInputFormat {
* New public fields should be added right above.
*****************************************************************
*/
* New public fields should be added right above.
*****************************************************************
*/
- struct AVInputFormat *next;
+
ff_const59
struct AVInputFormat *next;
/**
* Raw demuxers store their codec ID here.
/**
* Raw demuxers store their codec ID here.
@@
-1351,7
+1351,7
@@
typedef struct AVFormatContext {
*
* Demuxing only, set by avformat_open_input().
*/
*
* Demuxing only, set by avformat_open_input().
*/
- struct AVInputFormat *iformat;
+
ff_const59
struct AVInputFormat *iformat;
/**
* The output container format.
/**
* The output container format.
@@
-2227,7
+2227,7
@@
int avformat_alloc_output_context2(AVFormatContext **ctx, ff_const59 AVOutputFor
/**
* Find AVInputFormat based on the short name of the input format.
*/
/**
* Find AVInputFormat based on the short name of the input format.
*/
-AVInputFormat *av_find_input_format(const char *short_name);
+
ff_const59
AVInputFormat *av_find_input_format(const char *short_name);
/**
* Guess the file format.
/**
* Guess the file format.
@@
-2236,7
+2236,7
@@
AVInputFormat *av_find_input_format(const char *short_name);
* @param is_opened Whether the file is already opened; determines whether
* demuxers with or without AVFMT_NOFILE are probed.
*/
* @param is_opened Whether the file is already opened; determines whether
* demuxers with or without AVFMT_NOFILE are probed.
*/
-AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
+
ff_const59
AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
/**
* Guess the file format.
/**
* Guess the file format.
@@
-2250,7
+2250,7
@@
AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
* If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended
* to retry with a larger probe buffer.
*/
* If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended
* to retry with a larger probe buffer.
*/
-AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
+
ff_const59
AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
/**
* Guess the file format.
/**
* Guess the file format.
@@
-2259,7
+2259,7
@@
AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
* demuxers with or without AVFMT_NOFILE are probed.
* @param score_ret The score of the best detection.
*/
* demuxers with or without AVFMT_NOFILE are probed.
* @param score_ret The score of the best detection.
*/
-AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score_ret);
+
ff_const59
AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score_ret);
/**
* Probe a bytestream to determine the input format. Each time a probe returns
/**
* Probe a bytestream to determine the input format. Each time a probe returns
@@
-2277,14
+2277,14
@@
AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score
* the maximal score is AVPROBE_SCORE_MAX
* AVERROR code otherwise
*/
* the maximal score is AVPROBE_SCORE_MAX
* AVERROR code otherwise
*/
-int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
+int av_probe_input_buffer2(AVIOContext *pb,
ff_const59
AVInputFormat **fmt,
const char *url, void *logctx,
unsigned int offset, unsigned int max_probe_size);
/**
* Like av_probe_input_buffer2() but returns 0 on success
*/
const char *url, void *logctx,
unsigned int offset, unsigned int max_probe_size);
/**
* Like av_probe_input_buffer2() but returns 0 on success
*/
-int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
+int av_probe_input_buffer(AVIOContext *pb,
ff_const59
AVInputFormat **fmt,
const char *url, void *logctx,
unsigned int offset, unsigned int max_probe_size);
const char *url, void *logctx,
unsigned int offset, unsigned int max_probe_size);
@@
-2307,7
+2307,7
@@
int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
*
* @note If you want to use custom IO, preallocate the format context and set its pb field.
*/
*
* @note If you want to use custom IO, preallocate the format context and set its pb field.
*/
-int avformat_open_input(AVFormatContext **ps, const char *url, AVInputFormat *fmt, AVDictionary **options);
+int avformat_open_input(AVFormatContext **ps, const char *url,
ff_const59
AVInputFormat *fmt, AVDictionary **options);
attribute_deprecated
int av_demuxer_open(AVFormatContext *ic);
attribute_deprecated
int av_demuxer_open(AVFormatContext *ic);
diff --git
a/libavformat/avidec.c
b/libavformat/avidec.c
index
3f07479
..
24aef6b
100644
(file)
--- a/
libavformat/avidec.c
+++ b/
libavformat/avidec.c
@@
-1068,7
+1068,7
@@
static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt)
uint8_t desc[256];
int score = AVPROBE_SCORE_EXTENSION, ret;
AVIStream *ast = st->priv_data;
uint8_t desc[256];
int score = AVPROBE_SCORE_EXTENSION, ret;
AVIStream *ast = st->priv_data;
- AVInputFormat *sub_demuxer;
+
ff_const59
AVInputFormat *sub_demuxer;
AVRational time_base;
int size;
AVIOContext *pb = avio_alloc_context(pkt->data + 7,
AVRational time_base;
int size;
AVIOContext *pb = avio_alloc_context(pkt->data + 7,
diff --git
a/libavformat/dashdec.c
b/libavformat/dashdec.c
index
89acd58
..
f800683
100644
(file)
--- a/
libavformat/dashdec.c
+++ b/
libavformat/dashdec.c
@@
-1851,7
+1851,7
@@
static void close_demux_for_component(struct representation *pls)
static int reopen_demux_for_component(AVFormatContext *s, struct representation *pls)
{
DASHContext *c = s->priv_data;
static int reopen_demux_for_component(AVFormatContext *s, struct representation *pls)
{
DASHContext *c = s->priv_data;
- AVInputFormat *in_fmt = NULL;
+
ff_const59
AVInputFormat *in_fmt = NULL;
AVDictionary *in_fmt_opts = NULL;
uint8_t *avio_ctx_buffer = NULL;
int ret = 0, i;
AVDictionary *in_fmt_opts = NULL;
uint8_t *avio_ctx_buffer = NULL;
int ret = 0, i;
diff --git
a/libavformat/format.c
b/libavformat/format.c
index
102535f
..
78b384a
100644
(file)
--- a/
libavformat/format.c
+++ b/
libavformat/format.c
@@
-115,7
+115,7
@@
enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_
return AV_CODEC_ID_NONE;
}
return AV_CODEC_ID_NONE;
}
-AVInputFormat *av_find_input_format(const char *short_name)
+
ff_const59
AVInputFormat *av_find_input_format(const char *short_name)
{
const AVInputFormat *fmt = NULL;
void *i = 0;
{
const AVInputFormat *fmt = NULL;
void *i = 0;
@@
-125,12
+125,12
@@
AVInputFormat *av_find_input_format(const char *short_name)
return NULL;
}
return NULL;
}
-AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened,
+
ff_const59
AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened,
int *score_ret)
{
AVProbeData lpd = *pd;
const AVInputFormat *fmt1 = NULL;
int *score_ret)
{
AVProbeData lpd = *pd;
const AVInputFormat *fmt1 = NULL;
- AVInputFormat *fmt = NULL;
+
ff_const59
AVInputFormat *fmt = NULL;
int score, score_max = 0;
void *i = 0;
const static uint8_t zerobuffer[AVPROBE_PADDING_SIZE];
int score, score_max = 0;
void *i = 0;
const static uint8_t zerobuffer[AVPROBE_PADDING_SIZE];
@@
-202,10
+202,10
@@
AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened,
return fmt;
}
return fmt;
}
-AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)
+
ff_const59
AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)
{
int score_ret;
{
int score_ret;
- AVInputFormat *fmt = av_probe_input_format3(pd, is_opened, &score_ret);
+
ff_const59
AVInputFormat *fmt = av_probe_input_format3(pd, is_opened, &score_ret);
if (score_ret > *score_max) {
*score_max = score_ret;
return fmt;
if (score_ret > *score_max) {
*score_max = score_ret;
return fmt;
@@
-213,13
+213,13
@@
AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
return NULL;
}
return NULL;
}
-AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened)
+
ff_const59
AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened)
{
int score = 0;
return av_probe_input_format2(pd, is_opened, &score);
}
{
int score = 0;
return av_probe_input_format2(pd, is_opened, &score);
}
-int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
+int av_probe_input_buffer2(AVIOContext *pb,
ff_const59
AVInputFormat **fmt,
const char *filename, void *logctx,
unsigned int offset, unsigned int max_probe_size)
{
const char *filename, void *logctx,
unsigned int offset, unsigned int max_probe_size)
{
@@
-309,7
+309,7
@@
fail:
return ret < 0 ? ret : score;
}
return ret < 0 ? ret : score;
}
-int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
+int av_probe_input_buffer(AVIOContext *pb,
ff_const59
AVInputFormat **fmt,
const char *filename, void *logctx,
unsigned int offset, unsigned int max_probe_size)
{
const char *filename, void *logctx,
unsigned int offset, unsigned int max_probe_size)
{
diff --git
a/libavformat/hls.c
b/libavformat/hls.c
index
8975a87
..
0721b40
100644
(file)
--- a/
libavformat/hls.c
+++ b/
libavformat/hls.c
@@
-1868,7
+1868,7
@@
static int hls_read_header(AVFormatContext *s)
/* Open the demuxer for each playlist */
for (i = 0; i < c->n_playlists; i++) {
struct playlist *pls = c->playlists[i];
/* Open the demuxer for each playlist */
for (i = 0; i < c->n_playlists; i++) {
struct playlist *pls = c->playlists[i];
- AVInputFormat *in_fmt = NULL;
+
ff_const59
AVInputFormat *in_fmt = NULL;
if (!(pls->ctx = avformat_alloc_context())) {
ret = AVERROR(ENOMEM);
if (!(pls->ctx = avformat_alloc_context())) {
ret = AVERROR(ENOMEM);
diff --git
a/libavformat/img2dec.c
b/libavformat/img2dec.c
index
ecec498
..
685f0cd
100644
(file)
--- a/
libavformat/img2dec.c
+++ b/
libavformat/img2dec.c
@@
-424,7
+424,7
@@
int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
if (par->codec_id == AV_CODEC_ID_NONE) {
AVProbeData pd = { 0 };
if (par->codec_id == AV_CODEC_ID_NONE) {
AVProbeData pd = { 0 };
- AVInputFormat *ifmt;
+
const
AVInputFormat *ifmt;
uint8_t header[PROBE_BUF_MIN + AVPROBE_PADDING_SIZE];
int ret;
int score = 0;
uint8_t header[PROBE_BUF_MIN + AVPROBE_PADDING_SIZE];
int ret;
int score = 0;
diff --git
a/libavformat/mpeg.c
b/libavformat/mpeg.c
index
c147fa7
..
9efe1bf
100644
(file)
--- a/
libavformat/mpeg.c
+++ b/
libavformat/mpeg.c
@@
-722,7
+722,7
@@
static int vobsub_read_header(AVFormatContext *s)
int stream_id = -1;
char id[64] = {0};
char alt[MAX_LINE_SIZE] = {0};
int stream_id = -1;
char id[64] = {0};
char alt[MAX_LINE_SIZE] = {0};
- AVInputFormat *iformat;
+
ff_const59
AVInputFormat *iformat;
if (!vobsub->sub_name) {
char *ext;
if (!vobsub->sub_name) {
char *ext;
diff --git
a/libavformat/rtpdec_asf.c
b/libavformat/rtpdec_asf.c
index
54ffef6
..
e58f026
100644
(file)
--- a/
libavformat/rtpdec_asf.c
+++ b/
libavformat/rtpdec_asf.c
@@
-106,7
+106,7
@@
int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
AVDictionary *opts = NULL;
int len = strlen(p) * 6 / 8;
char *buf = av_mallocz(len);
AVDictionary *opts = NULL;
int len = strlen(p) * 6 / 8;
char *buf = av_mallocz(len);
- AVInputFormat *iformat;
+
ff_const59
AVInputFormat *iformat;
if (!buf)
return AVERROR(ENOMEM);
if (!buf)
return AVERROR(ENOMEM);
diff --git
a/libavformat/sapdec.c
b/libavformat/sapdec.c
index
7a6c8bf
..
4005276
100644
(file)
--- a/
libavformat/sapdec.c
+++ b/
libavformat/sapdec.c
@@
-68,7
+68,7
@@
static int sap_read_header(AVFormatContext *s)
uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
int port;
int ret, i;
uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
int port;
int ret, i;
- AVInputFormat* infmt;
+
ff_const59
AVInputFormat* infmt;
if (!ff_network_init())
return AVERROR(EIO);
if (!ff_network_init())
return AVERROR(EIO);
diff --git
a/libavformat/utils.c
b/libavformat/utils.c
index
9dc5706
..
9b3f0d2
100644
(file)
--- a/
libavformat/utils.c
+++ b/
libavformat/utils.c
@@
-357,7
+357,7
@@
static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st,
{ 0 }
};
int score;
{ 0 }
};
int score;
- AVInputFormat *fmt = av_probe_input_format3(pd, 1, &score);
+
const
AVInputFormat *fmt = av_probe_input_format3(pd, 1, &score);
if (fmt) {
int i;
if (fmt) {
int i;
@@
-535,7
+535,7
@@
FF_ENABLE_DEPRECATION_WARNINGS
int avformat_open_input(AVFormatContext **ps, const char *filename,
int avformat_open_input(AVFormatContext **ps, const char *filename,
- AVInputFormat *fmt, AVDictionary **options)
+
ff_const59
AVInputFormat *fmt, AVDictionary **options)
{
AVFormatContext *s = *ps;
int i, ret = 0;
{
AVFormatContext *s = *ps;
int i, ret = 0;
@@
-2163,7
+2163,7
@@
static int64_t ff_read_timestamp(AVFormatContext *s, int stream_index, int64_t *
int ff_seek_frame_binary(AVFormatContext *s, int stream_index,
int64_t target_ts, int flags)
{
int ff_seek_frame_binary(AVFormatContext *s, int stream_index,
int64_t target_ts, int flags)
{
- AVInputFormat *avif = s->iformat;
+
const
AVInputFormat *avif = s->iformat;
int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit;
int64_t ts_min, ts_max, ts;
int index;
int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit;
int64_t ts_min, ts_max, ts;
int index;