History

avformat: Constify the API wrt AV(In|Out)putFormat

Also constify AVProbeData.

Andreas Rheinhardt committed 5 years ago

Commit 56450a01 parent f0c7fa229 files · +84 −78Browse files

Unified · Split

29 files
  1. doc/APIchanges +11 −0
  2. doc/examples/muxing.c +1 −1
  3. doc/examples/remuxing.c +1 −1
  4. fftools/ffmpeg_opt.c +7 −5
  5. fftools/ffplay.c +4 −3
  6. fftools/ffprobe.c +1 −1
  7. libavdevice/internal.h +1 −1
  8. libavdevice/utils.c +1 −1
  9. libavfilter/lavfutils.c +1 −1
  10. libavfilter/src_movie.c +1 −1
  11. libavformat/avformat.h +19 −25
  12. libavformat/avidec.c +1 −1
  13. libavformat/dashdec.c +1 −1
  14. libavformat/fifo.c +2 −2
  15. libavformat/format.c +17 −16
  16. libavformat/hdsenc.c +1 −1
  17. libavformat/hls.c +1 −1
  18. libavformat/hlsenc.c +2 −2
  19. libavformat/mpeg.c +1 −1
  20. libavformat/mux.c +1 −1
  21. libavformat/rtpdec_asf.c +1 −1
  22. libavformat/rtpenc_chain.c +1 −1
  23. libavformat/rtpenc_mpegts.c +2 −2
  24. libavformat/sapdec.c +1 −1
  25. libavformat/segment.c +1 −1
  26. libavformat/smoothstreamingenc.c +1 −1
  27. libavformat/utils.c +1 −1
  28. libavformat/version.h +0 −3
  29. libavformat/webm_chunk.c +1 −1
doc/APIchanges+11−0
@@ -14,6 +14,17 @@ libavutil: 2017-10-21 · 13 unmodified lines
1414
1515
1616 API changes, most recent first:
17+
18+2021-04-27 - xxxxxxxxxx - lavf yyyyyyyyy - avformat.h
19+ Constified the pointers to AVInputFormats and AVOutputFormats
20+ in AVFormatContext, avformat_alloc_output_context2(),
21+ av_find_input_format(), av_probe_input_format(),
22+ av_probe_input_format2(), av_probe_input_format3(),
23+ av_probe_input_buffer2(), av_probe_input_buffer(),
24+ avformat_open_input(), av_guess_format() and av_guess_codec().
25+ Furthermore, constified the AVProbeData in av_probe_input_format(),
26+ av_probe_input_format2() and av_probe_input_format3().
27+
1728 2021-04-19 - xxxxxxxxxx - lavu 56.74.100 - tx.h
1829 Add AV_TX_FULL_IMDCT and AV_TX_UNALIGNED.
1930
doc/examples/muxing.c+1−1
@@ -536,8 +536,8 @@ static void close_stream(AVFormatContext *oc, OutputStream *ost) · 535 unmodified lines
536536 int main(int argc, char **argv)
537537 {
538538 OutputStream video_st = { 0 }, audio_st = { 0 };
539+ const AVOutputFormat *fmt;
539540 const char *filename;
540− AVOutputFormat *fmt;
541541 AVFormatContext *oc;
542542 AVCodec *audio_codec, *video_codec;
543543 int ret;
doc/examples/remuxing.c+1−1
@@ -45,7 +45,7 @@ static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt, cons · 44 unmodified lines
4545
4646 int main(int argc, char **argv)
4747 {
48− AVOutputFormat *ofmt = NULL;
48+ const AVOutputFormat *ofmt = NULL;
4949 AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL;
5050 AVPacket pkt;
5151 const char *in_filename, *out_filename;
fftools/ffmpeg_opt.c+7−5
@@ -1068,7 +1068,7 @@ static int open_input_file(OptionsContext *o, const char *filename) · 1067 unmodified lines
10681068 {
10691069 InputFile *f;
10701070 AVFormatContext *ic;
1071− AVInputFormat *file_iformat = NULL;
1071+ const AVInputFormat *file_iformat = NULL;
10721072 int err, i, ret;
10731073 int64_t timestamp;
10741074 AVDictionary *unused_opts = NULL;
@@ -1117,20 +1117,22 @@ static int open_input_file(OptionsContext *o, const char *filename) · 42 unmodified lines
11171117 av_dict_set_int(&o->g->format_opts, "sample_rate", o->audio_sample_rate[o->nb_audio_sample_rate - 1].u.i, 0);
11181118 }
11191119 if (o->nb_audio_channels) {
1120+ const AVClass *priv_class;
11201121 /* because we set audio_channels based on both the "ac" and
11211122 * "channel_layout" options, we need to check that the specified
11221123 * demuxer actually has the "channels" option before setting it */
1123− if (file_iformat && file_iformat->priv_class &&
1124− av_opt_find(&file_iformat->priv_class, "channels", NULL, 0,
1124+ if (file_iformat && (priv_class = file_iformat->priv_class) &&
1125+ av_opt_find(&priv_class, "channels", NULL, 0,
11251126 AV_OPT_SEARCH_FAKE_OBJ)) {
11261127 av_dict_set_int(&o->g->format_opts, "channels", o->audio_channels[o->nb_audio_channels - 1].u.i, 0);
11271128 }
11281129 }
11291130 if (o->nb_frame_rates) {
1131+ const AVClass *priv_class;
11301132 /* set the format-level framerate option;
11311133 * this is important for video grabbers, e.g. x11 */
1132− if (file_iformat && file_iformat->priv_class &&
1133− av_opt_find(&file_iformat->priv_class, "framerate", NULL, 0,
1134+ if (file_iformat && (priv_class = file_iformat->priv_class) &&
1135+ av_opt_find(&priv_class, "framerate", NULL, 0,
11341136 AV_OPT_SEARCH_FAKE_OBJ)) {
11351137 av_dict_set(&o->g->format_opts, "framerate",
11361138 o->frame_rates[o->nb_frame_rates - 1].u.str, 0);
fftools/ffplay.c+4−3
@@ -203,7 +203,7 @@ typedef struct Decoder { · 202 unmodified lines
203203
204204 typedef struct VideoState {
205205 SDL_Thread *read_tid;
206− AVInputFormat *iformat;
206+ const AVInputFormat *iformat;
207207 int abort_request;
208208 int force_refresh;
209209 int paused;
@@ -308,7 +308,7 @@ typedef struct VideoState { · 98 unmodified lines
308308 } VideoState;
309309
310310 /* options specified by the user */
311−static AVInputFormat *file_iformat;
311+static const AVInputFormat *file_iformat;
312312 static const char *input_filename;
313313 static const char *window_title;
314314 static int default_width = 640;
@@ -3075,7 +3075,8 @@ static int read_thread(void *arg) · 2760 unmodified lines
30753075 return 0;
30763076 }
30773077
3078−static VideoState *stream_open(const char *filename, AVInputFormat *iformat)
3078+static VideoState *stream_open(const char *filename,
3079+ const AVInputFormat *iformat)
30793080 {
30803081 VideoState *is;
30813082
fftools/ffprobe.c+1−1
@@ -257,7 +257,7 @@ static const OptionDef *options; · 256 unmodified lines
257257 /* FFprobe context */
258258 static const char *input_filename;
259259 static const char *print_input_filename;
260−static AVInputFormat *iformat = NULL;
260+static const AVInputFormat *iformat = NULL;
261261
262262 static struct AVHashContext *hash;
263263
libavdevice/internal.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #include "libavformat/avformat.h"
2323
2424 av_warn_unused_result
25−int ff_alloc_input_device_context(struct AVFormatContext **avctx, struct AVInputFormat *iformat,
25+int ff_alloc_input_device_context(struct AVFormatContext **avctx, const AVInputFormat *iformat,
2626 const char *format);
2727
2828 #endif
libavdevice/utils.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 #include "libavutil/opt.h"
2121 #include "libavformat/avformat.h"
2222
23−int ff_alloc_input_device_context(AVFormatContext **avctx, AVInputFormat *iformat, const char *format)
23+int ff_alloc_input_device_context(AVFormatContext **avctx, const AVInputFormat *iformat, const char *format)
2424 {
2525 AVFormatContext *s;
2626 int ret = 0;
libavfilter/lavfutils.c+1−1
@@ -26,7 +26,7 @@ int ff_load_image(uint8_t *data[4], int linesize[4], · 25 unmodified lines
2626 int *w, int *h, enum AVPixelFormat *pix_fmt,
2727 const char *filename, void *log_ctx)
2828 {
29− AVInputFormat *iformat = NULL;
29+ const AVInputFormat *iformat = NULL;
3030 AVFormatContext *format_ctx = NULL;
3131 const AVCodec *codec;
3232 AVCodecContext *codec_ctx = NULL;
libavfilter/src_movie.c+1−1
@@ -205,7 +205,7 @@ static int guess_channel_layout(MovieStream *st, int st_index, void *log_ctx) · 204 unmodified lines
205205 static av_cold int movie_common_init(AVFilterContext *ctx)
206206 {
207207 MovieContext *movie = ctx->priv;
208− AVInputFormat *iformat = NULL;
208+ const AVInputFormat *iformat = NULL;
209209 int64_t timestamp;
210210 int nb_streams = 1, ret, i;
211211 char default_streams[16], *stream_specs, *spec, *cursor;
libavformat/avformat.h+19−25
@@ -525,15 +525,6 @@ typedef struct AVOutputFormat { · 524 unmodified lines
525525 * New public fields should be added right above.
526526 *****************************************************************
527527 */
528− /**
529− * The ff_const59 define is not part of the public API and will
530− * be removed without further warning.
531− */
532−#if FF_API_AVIOFORMAT
533−#define ff_const59
534−#else
535−#define ff_const59 const
536−#endif
537528 /**
538529 * size of private data so that it can be allocated in the wrapper
539530 */
@@ -1235,14 +1226,14 @@ typedef struct AVFormatContext { · 695 unmodified lines
12351226 *
12361227 * Demuxing only, set by avformat_open_input().
12371228 */
1238− ff_const59 struct AVInputFormat *iformat;
1229+ const struct AVInputFormat *iformat;
12391230
12401231 /**
12411232 * The output container format.
12421233 *
12431234 * Muxing only, must be set by the caller before avformat_write_header().
12441235 */
1245− ff_const59 struct AVOutputFormat *oformat;
1236+ const struct AVOutputFormat *oformat;
12461237
12471238 /**
12481239 * Format private data. This is an AVOptions-enabled struct
@@ -2088,7 +2079,7 @@ AVProgram *av_new_program(AVFormatContext *s, int id); · 839 unmodified lines
20882079 * @return >= 0 in case of success, a negative AVERROR code in case of
20892080 * failure
20902081 */
2091−int avformat_alloc_output_context2(AVFormatContext **ctx, ff_const59 AVOutputFormat *oformat,
2082+int avformat_alloc_output_context2(AVFormatContext **ctx, const AVOutputFormat *oformat,
20922083 const char *format_name, const char *filename);
20932084
20942085 /**
@@ -2099,7 +2090,7 @@ int avformat_alloc_output_context2(AVFormatContext **ctx, ff_const59 AVOutputFor · 4 unmodified lines
20992090 /**
21002091 * Find AVInputFormat based on the short name of the input format.
21012092 */
2102−ff_const59 AVInputFormat *av_find_input_format(const char *short_name);
2093+const AVInputFormat *av_find_input_format(const char *short_name);
21032094
21042095 /**
21052096 * Guess the file format.
@@ -2108,7 +2099,7 @@ ff_const59 AVInputFormat *av_find_input_format(const char *short_name); · 2 unmodified lines
21082099 * @param is_opened Whether the file is already opened; determines whether
21092100 * demuxers with or without AVFMT_NOFILE are probed.
21102101 */
2111−ff_const59 AVInputFormat *av_probe_input_format(ff_const59 AVProbeData *pd, int is_opened);
2102+const AVInputFormat *av_probe_input_format(const AVProbeData *pd, int is_opened);
21122103
21132104 /**
21142105 * Guess the file format.
@@ -2122,7 +2113,8 @@ ff_const59 AVInputFormat *av_probe_input_format(ff_const59 AVProbeData *pd, int · 7 unmodified lines
21222113 * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended
21232114 * to retry with a larger probe buffer.
21242115 */
2125−ff_const59 AVInputFormat *av_probe_input_format2(ff_const59 AVProbeData *pd, int is_opened, int *score_max);
2116+const AVInputFormat *av_probe_input_format2(const AVProbeData *pd,
2117+ int is_opened, int *score_max);
21262118
21272119 /**
21282120 * Guess the file format.
@@ -2131,7 +2123,8 @@ ff_const59 AVInputFormat *av_probe_input_format2(ff_const59 AVProbeData *pd, int · 2 unmodified lines
21312123 * demuxers with or without AVFMT_NOFILE are probed.
21322124 * @param score_ret The score of the best detection.
21332125 */
2134−ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int is_opened, int *score_ret);
2126+const AVInputFormat *av_probe_input_format3(const AVProbeData *pd,
2127+ int is_opened, int *score_ret);
21352128
21362129 /**
21372130 * Probe a bytestream to determine the input format. Each time a probe returns
@@ -2149,14 +2142,14 @@ ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int · 11 unmodified lines
21492142 * the maximal score is AVPROBE_SCORE_MAX
21502143 * AVERROR code otherwise
21512144 */
2152−int av_probe_input_buffer2(AVIOContext *pb, ff_const59 AVInputFormat **fmt,
2145+int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt,
21532146 const char *url, void *logctx,
21542147 unsigned int offset, unsigned int max_probe_size);
21552148
21562149 /**
21572150 * Like av_probe_input_buffer2() but returns 0 on success
21582151 */
2159−int av_probe_input_buffer(AVIOContext *pb, ff_const59 AVInputFormat **fmt,
2152+int av_probe_input_buffer(AVIOContext *pb, const AVInputFormat **fmt,
21602153 const char *url, void *logctx,
21612154 unsigned int offset, unsigned int max_probe_size);
21622155
@@ -2179,7 +2172,8 @@ int av_probe_input_buffer(AVIOContext *pb, ff_const59 AVInputFormat **fmt, · 16 unmodified lines
21792172 *
21802173 * @note If you want to use custom IO, preallocate the format context and set its pb field.
21812174 */
2182−int avformat_open_input(AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options);
2175+int avformat_open_input(AVFormatContext **ps, const char *url,
2176+ const AVInputFormat *fmt, AVDictionary **options);
21832177
21842178 #if FF_API_DEMUXER_OPEN
21852179 /**
@@ -2570,16 +2564,16 @@ int av_write_trailer(AVFormatContext *s); · 384 unmodified lines
25702564 * @param mime_type if non-NULL checks if mime_type matches with the
25712565 * MIME type of the registered formats
25722566 */
2573−ff_const59 AVOutputFormat *av_guess_format(const char *short_name,
2574− const char *filename,
2575− const char *mime_type);
2567+const AVOutputFormat *av_guess_format(const char *short_name,
2568+ const char *filename,
2569+ const char *mime_type);
25762570
25772571 /**
25782572 * Guess the codec ID based upon muxer and filename.
25792573 */
2580−enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_name,
2581− const char *filename, const char *mime_type,
2582− enum AVMediaType type);
2574+enum AVCodecID av_guess_codec(const AVOutputFormat *fmt, const char *short_name,
2575+ const char *filename, const char *mime_type,
2576+ enum AVMediaType type);
25832577
25842578 /**
25852579 * Get timing information for the data currently output.
libavformat/avidec.c+1−1
@@ -1092,7 +1092,7 @@ static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt) · 1091 unmodified lines
10921092 uint8_t desc[256];
10931093 int score = AVPROBE_SCORE_EXTENSION, ret;
10941094 AVIStream *ast = st->priv_data;
1095− ff_const59 AVInputFormat *sub_demuxer;
1095+ const AVInputFormat *sub_demuxer;
10961096 AVRational time_base;
10971097 int size;
10981098 AVProbeData pd;
libavformat/dashdec.c+1−1
@@ -1879,7 +1879,7 @@ static void close_demux_for_component(struct representation *pls) · 1878 unmodified lines
18791879 static int reopen_demux_for_component(AVFormatContext *s, struct representation *pls)
18801880 {
18811881 DASHContext *c = s->priv_data;
1882− ff_const59 AVInputFormat *in_fmt = NULL;
1882+ const AVInputFormat *in_fmt = NULL;
18831883 AVDictionary *in_fmt_opts = NULL;
18841884 uint8_t *avio_ctx_buffer = NULL;
18851885 int ret = 0, i;
libavformat/fifo.c+2−2
@@ -469,7 +469,7 @@ static void *fifo_consumer_thread(void *data) · 468 unmodified lines
469469 return NULL;
470470 }
471471
472−static int fifo_mux_init(AVFormatContext *avf, ff_const59 AVOutputFormat *oformat,
472+static int fifo_mux_init(AVFormatContext *avf, const AVOutputFormat *oformat,
473473 const char *filename)
474474 {
475475 FifoContext *fifo = avf->priv_data;
@@ -508,7 +508,7 @@ static int fifo_mux_init(AVFormatContext *avf, ff_const59 AVOutputFormat *oforma · 32 unmodified lines
508508 static int fifo_init(AVFormatContext *avf)
509509 {
510510 FifoContext *fifo = avf->priv_data;
511− ff_const59 AVOutputFormat *oformat;
511+ const AVOutputFormat *oformat;
512512 int ret = 0;
513513
514514 if (fifo->recovery_wait_streamtime && !fifo->drop_pkts_on_overflow) {
libavformat/format.c+17−16
@@ -48,8 +48,8 @@ int av_match_ext(const char *filename, const char *extensions) · 47 unmodified lines
4848 return 0;
4949 }
5050
51−ff_const59 AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
52− const char *mime_type)
51+const AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
52+ const char *mime_type)
5353 {
5454 const AVOutputFormat *fmt = NULL;
5555 AVOutputFormat *fmt_found = NULL;
@@ -84,12 +84,12 @@ ff_const59 AVOutputFormat *av_guess_format(const char *short_name, const char *f · 28 unmodified lines
8484 return fmt_found;
8585 }
8686
87−enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_name,
87+enum AVCodecID av_guess_codec(const AVOutputFormat *fmt, const char *short_name,
8888 const char *filename, const char *mime_type,
8989 enum AVMediaType type)
9090 {
9191 if (av_match_name("segment", fmt->name) || av_match_name("ssegment", fmt->name)) {
92− ff_const59 AVOutputFormat *fmt2 = av_guess_format(NULL, filename, NULL);
92+ const AVOutputFormat *fmt2 = av_guess_format(NULL, filename, NULL);
9393 if (fmt2)
9494 fmt = fmt2;
9595 }
@@ -115,7 +115,7 @@ enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_ · 19 unmodified lines
115115 return AV_CODEC_ID_NONE;
116116 }
117117
118−ff_const59 AVInputFormat *av_find_input_format(const char *short_name)
118+const AVInputFormat *av_find_input_format(const char *short_name)
119119 {
120120 const AVInputFormat *fmt = NULL;
121121 void *i = 0;
@@ -125,12 +125,12 @@ ff_const59 AVInputFormat *av_find_input_format(const char *short_name) · 3 unmodified lines
125125 return NULL;
126126 }
127127
128−ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int is_opened,
129− int *score_ret)
128+const AVInputFormat *av_probe_input_format3(const AVProbeData *pd,
129+ int is_opened, int *score_ret)
130130 {
131131 AVProbeData lpd = *pd;
132132 const AVInputFormat *fmt1 = NULL;
133− ff_const59 AVInputFormat *fmt = NULL;
133+ const AVInputFormat *fmt = NULL;
134134 int score, score_max = 0;
135135 void *i = 0;
136136 const static uint8_t zerobuffer[AVPROBE_PADDING_SIZE];
@@ -191,7 +191,7 @@ ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int · 54 unmodified lines
191191 }
192192 if (score > score_max) {
193193 score_max = score;
194− fmt = (AVInputFormat*)fmt1;
194+ fmt = fmt1;
195195 } else if (score == score_max)
196196 fmt = NULL;
197197 }
@@ -202,10 +202,11 @@ ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int · 4 unmodified lines
202202 return fmt;
203203 }
204204
205−ff_const59 AVInputFormat *av_probe_input_format2(ff_const59 AVProbeData *pd, int is_opened, int *score_max)
205+const AVInputFormat *av_probe_input_format2(const AVProbeData *pd,
206+ int is_opened, int *score_max)
206207 {
207208 int score_ret;
208− ff_const59 AVInputFormat *fmt = av_probe_input_format3(pd, is_opened, &score_ret);
209+ const AVInputFormat *fmt = av_probe_input_format3(pd, is_opened, &score_ret);
209210 if (score_ret > *score_max) {
210211 *score_max = score_ret;
211212 return fmt;
@@ -213,15 +214,15 @@ ff_const59 AVInputFormat *av_probe_input_format2(ff_const59 AVProbeData *pd, int · 1 unmodified line
213214 return NULL;
214215 }
215216
216−ff_const59 AVInputFormat *av_probe_input_format(ff_const59 AVProbeData *pd, int is_opened)
217+const AVInputFormat *av_probe_input_format(const AVProbeData *pd, int is_opened)
217218 {
218219 int score = 0;
219220 return av_probe_input_format2(pd, is_opened, &score);
220221 }
221222
222−int av_probe_input_buffer2(AVIOContext *pb, ff_const59 AVInputFormat **fmt,
223− const char *filename, void *logctx,
224− unsigned int offset, unsigned int max_probe_size)
223+int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt,
224+ const char *filename, void *logctx,
225+ unsigned int offset, unsigned int max_probe_size)
225226 {
226227 AVProbeData pd = { filename ? filename : "" };
227228 uint8_t *buf = NULL;
@@ -309,7 +310,7 @@ fail: · 81 unmodified lines
309310 return ret < 0 ? ret : score;
310311 }
311312
312−int av_probe_input_buffer(AVIOContext *pb, ff_const59 AVInputFormat **fmt,
313+int av_probe_input_buffer(AVIOContext *pb, const AVInputFormat **fmt,
313314 const char *filename, void *logctx,
314315 unsigned int offset, unsigned int max_probe_size)
315316 {
libavformat/hdsenc.c+1−1
@@ -313,8 +313,8 @@ static void close_file(AVFormatContext *s, OutputStream *os) · 312 unmodified lines
313313 static int hds_write_header(AVFormatContext *s)
314314 {
315315 HDSContext *c = s->priv_data;
316+ const AVOutputFormat *oformat;
316317 int ret = 0, i;
317− ff_const59 AVOutputFormat *oformat;
318318
319319 if (mkdir(s->url, 0777) == -1 && errno != EEXIST) {
320320 av_log(s, AV_LOG_ERROR , "Failed to create directory %s\n", s->url);
libavformat/hls.c+1−1
@@ -1957,8 +1957,8 @@ static int hls_read_header(AVFormatContext *s) · 1956 unmodified lines
19571957 /* Open the demuxer for each playlist */
19581958 for (i = 0; i < c->n_playlists; i++) {
19591959 struct playlist *pls = c->playlists[i];
1960+ const AVInputFormat *in_fmt = NULL;
19601961 char *url;
1961− ff_const59 AVInputFormat *in_fmt = NULL;
19621962
19631963 if (!(pls->ctx = avformat_alloc_context())) {
19641964 ret = AVERROR(ENOMEM);
libavformat/hlsenc.c+2−2
@@ -119,8 +119,8 @@ typedef struct VariantStream { · 118 unmodified lines
119119 unsigned var_stream_idx;
120120 unsigned number;
121121 int64_t sequence;
122− ff_const59 AVOutputFormat *oformat;
123− ff_const59 AVOutputFormat *vtt_oformat;
122+ const AVOutputFormat *oformat;
123+ const AVOutputFormat *vtt_oformat;
124124 AVIOContext *out;
125125 AVIOContext *out_single_file;
126126 int packets_written;
libavformat/mpeg.c+1−1
@@ -732,6 +732,7 @@ static int vobsub_read_header(AVFormatContext *s) · 731 unmodified lines
732732 {
733733 int i, ret = 0, header_parsed = 0, langidx = 0;
734734 VobSubDemuxContext *vobsub = s->priv_data;
735+ const AVInputFormat *iformat;
735736 size_t fname_len;
736737 AVBPrint header;
737738 int64_t delay = 0;
@@ -739,7 +740,6 @@ static int vobsub_read_header(AVFormatContext *s) · 1 unmodified line
739740 int stream_id = -1;
740741 char id[64] = {0};
741742 char alt[MAX_LINE_SIZE] = {0};
742− ff_const59 AVInputFormat *iformat;
743743
744744 if (!vobsub->sub_name) {
745745 char *ext;
libavformat/mux.c+1−1
@@ -133,7 +133,7 @@ enum AVChromaLocation ff_choose_chroma_location(AVFormatContext *s, AVStream *st · 132 unmodified lines
133133
134134 }
135135
136−int avformat_alloc_output_context2(AVFormatContext **avctx, ff_const59 AVOutputFormat *oformat,
136+int avformat_alloc_output_context2(AVFormatContext **avctx, const AVOutputFormat *oformat,
137137 const char *format, const char *filename)
138138 {
139139 AVFormatContext *s = avformat_alloc_context();
libavformat/rtpdec_asf.c+1−1
@@ -106,7 +106,7 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p) · 105 unmodified lines
106106 AVDictionary *opts = NULL;
107107 int len = strlen(p) * 6 / 8;
108108 char *buf = av_mallocz(len);
109− ff_const59 AVInputFormat *iformat;
109+ const AVInputFormat *iformat;
110110
111111 if (!buf)
112112 return AVERROR(ENOMEM);
libavformat/rtpenc_chain.c+1−1
@@ -31,7 +31,7 @@ int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s, · 30 unmodified lines
3131 {
3232 AVFormatContext *rtpctx = NULL;
3333 int ret;
34− ff_const59 AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
34+ const AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
3535 uint8_t *rtpflags;
3636 AVDictionary *opts = NULL;
3737
libavformat/rtpenc_mpegts.c+2−2
@@ -56,8 +56,8 @@ static int rtp_mpegts_write_header(AVFormatContext *s) · 55 unmodified lines
5656 {
5757 MuxChain *chain = s->priv_data;
5858 AVFormatContext *mpegts_ctx = NULL, *rtp_ctx = NULL;
59− ff_const59 AVOutputFormat *mpegts_format = av_guess_format("mpegts", NULL, NULL);
60− ff_const59 AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
59+ const AVOutputFormat *mpegts_format = av_guess_format("mpegts", NULL, NULL);
60+ const AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
6161 int i, ret = AVERROR(ENOMEM);
6262 AVStream *st;
6363 AVDictionary *mpegts_muxer_options = NULL;
libavformat/sapdec.c+1−1
@@ -65,9 +65,9 @@ static int sap_read_header(AVFormatContext *s) · 64 unmodified lines
6565 struct SAPState *sap = s->priv_data;
6666 char host[1024], path[1024], url[1024];
6767 uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
68+ const AVInputFormat *infmt;
6869 int port;
6970 int ret, i;
70− ff_const59 AVInputFormat* infmt;
7171
7272 if (!ff_network_init())
7373 return AVERROR(EIO);
libavformat/segment.c+1−1
@@ -72,7 +72,7 @@ typedef struct SegmentContext { · 71 unmodified lines
7272 int segment_idx_wrap; ///< number after which the index wraps
7373 int segment_idx_wrap_nb; ///< number of time the index has wraped
7474 int segment_count; ///< number of segment files already written
75− ff_const59 AVOutputFormat *oformat;
75+ const AVOutputFormat *oformat;
7676 AVFormatContext *avf;
7777 char *format; ///< format to use for output segment files
7878 AVDictionary *format_options;
libavformat/smoothstreamingenc.c+1−1
@@ -283,7 +283,7 @@ static int ism_write_header(AVFormatContext *s) · 282 unmodified lines
283283 {
284284 SmoothStreamingContext *c = s->priv_data;
285285 int ret = 0, i;
286− ff_const59 AVOutputFormat *oformat;
286+ const AVOutputFormat *oformat;
287287
288288 if (mkdir(s->url, 0777) == -1 && errno != EEXIST) {
289289 av_log(s, AV_LOG_ERROR, "mkdir failed\n");
libavformat/utils.c+1−1
@@ -545,7 +545,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 544 unmodified lines
545545
546546
547547 int avformat_open_input(AVFormatContext **ps, const char *filename,
548− ff_const59 AVInputFormat *fmt, AVDictionary **options)
548+ const AVInputFormat *fmt, AVDictionary **options)
549549 {
550550 AVFormatContext *s = *ps;
551551 int i, ret = 0;
libavformat/version.h+0−3
@@ -97,9 +97,6 @@ · 96 unmodified lines
9797 #ifndef FF_API_LAVF_MP4A_LATM
9898 #define FF_API_LAVF_MP4A_LATM (LIBAVFORMAT_VERSION_MAJOR < 59)
9999 #endif
100−#ifndef FF_API_AVIOFORMAT
101−#define FF_API_AVIOFORMAT (LIBAVFORMAT_VERSION_MAJOR < 59)
102−#endif
103100 #ifndef FF_API_DEMUXER_OPEN
104101 #define FF_API_DEMUXER_OPEN (LIBAVFORMAT_VERSION_MAJOR < 59)
105102 #endif
libavformat/webm_chunk.c+1−1
@@ -50,7 +50,7 @@ typedef struct WebMChunkContext { · 49 unmodified lines
5050 static int webm_chunk_init(AVFormatContext *s)
5151 {
5252 WebMChunkContext *wc = s->priv_data;
53− ff_const59 AVOutputFormat *oformat;
53+ const AVOutputFormat *oformat;
5454 AVFormatContext *oc;
5555 AVStream *st, *ost = s->streams[0];
5656 AVDictionary *dict = NULL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t