From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 20/20] fftools/ffmpeg_[de]mux: constify all uses of OptionsContext
Date: Tue, 18 Oct 2022 14:37:01 +0200
Message-ID: <20221018123701.25002-20-anton@khirnov.net> (raw)
In-Reply-To: <20221018123701.25002-1-anton@khirnov.net>
---
fftools/ffmpeg.h | 4 ++--
fftools/ffmpeg_demux.c | 6 +++---
fftools/ffmpeg_mux_init.c | 42 +++++++++++++++++++--------------------
fftools/ffmpeg_opt.c | 2 +-
4 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 8a50cd8d4b..0724914f27 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -715,7 +715,7 @@ int hwaccel_decode_init(AVCodecContext *avctx);
*/
int of_stream_init(OutputFile *of, OutputStream *ost);
int of_write_trailer(OutputFile *of);
-int of_open(OptionsContext *o, const char *filename);
+int of_open(const OptionsContext *o, const char *filename);
void of_close(OutputFile **pof);
/*
@@ -734,7 +734,7 @@ int64_t of_filesize(OutputFile *of);
AVChapter * const *
of_get_chapters(OutputFile *of, unsigned int *nb_chapters);
-int ifile_open(OptionsContext *o, const char *filename);
+int ifile_open(const OptionsContext *o, const char *filename);
void ifile_close(InputFile **f);
/**
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 4ce92862cb..eb9fa9132b 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -452,7 +452,7 @@ void ifile_close(InputFile **pf)
av_freep(pf);
}
-static const AVCodec *choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st,
+static const AVCodec *choose_decoder(const OptionsContext *o, AVFormatContext *s, AVStream *st,
enum HWAccelID hwaccel_id, enum AVHWDeviceType hwaccel_device_type)
{
@@ -514,7 +514,7 @@ static int guess_input_channel_layout(InputStream *ist)
/* Add all the streams from the given input file to the global
* list of input streams. */
-static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
+static void add_input_streams(const OptionsContext *o, AVFormatContext *ic)
{
int i, ret;
@@ -756,7 +756,7 @@ static void dump_attachment(AVStream *st, const char *filename)
avio_close(out);
}
-int ifile_open(OptionsContext *o, const char *filename)
+int ifile_open(const OptionsContext *o, const char *filename)
{
Demuxer *d;
InputFile *f;
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 7c19cb7442..0ddb7b94dc 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -97,7 +97,7 @@ static int check_opt_bitexact(void *ctx, const AVDictionary *opts,
return 0;
}
-static int choose_encoder(OptionsContext *o, AVFormatContext *s,
+static int choose_encoder(const OptionsContext *o, AVFormatContext *s,
OutputStream *ost, const AVCodec **enc)
{
enum AVMediaType type = ost->st->codecpar->codec_type;
@@ -170,7 +170,7 @@ static int get_preset_file_2(const char *preset_name, const char *codec_name, AV
return ret;
}
-static OutputStream *new_output_stream(Muxer *mux, OptionsContext *o,
+static OutputStream *new_output_stream(Muxer *mux, const OptionsContext *o,
enum AVMediaType type, int source_index)
{
AVFormatContext *oc = mux->fc;
@@ -368,7 +368,7 @@ static OutputStream *new_output_stream(Muxer *mux, OptionsContext *o,
return ost;
}
-static char *get_ost_filters(OptionsContext *o, AVFormatContext *oc,
+static char *get_ost_filters(const OptionsContext *o, AVFormatContext *oc,
OutputStream *ost)
{
AVStream *st = ost->st;
@@ -388,7 +388,7 @@ static char *get_ost_filters(OptionsContext *o, AVFormatContext *oc,
"null" : "anull");
}
-static void check_streamcopy_filters(OptionsContext *o, AVFormatContext *oc,
+static void check_streamcopy_filters(const OptionsContext *o, AVFormatContext *oc,
const OutputStream *ost, enum AVMediaType type)
{
if (ost->filters_script || ost->filters) {
@@ -419,7 +419,7 @@ static void parse_matrix_coeffs(uint16_t *dest, const char *str)
}
}
-static OutputStream *new_video_stream(Muxer *mux, OptionsContext *o, int source_index)
+static OutputStream *new_video_stream(Muxer *mux, const OptionsContext *o, int source_index)
{
AVFormatContext *oc = mux->fc;
AVStream *st;
@@ -658,7 +658,7 @@ static OutputStream *new_video_stream(Muxer *mux, OptionsContext *o, int source_
return ost;
}
-static OutputStream *new_audio_stream(Muxer *mux, OptionsContext *o, int source_index)
+static OutputStream *new_audio_stream(Muxer *mux, const OptionsContext *o, int source_index)
{
AVFormatContext *oc = mux->fc;
AVStream *st;
@@ -756,7 +756,7 @@ static OutputStream *new_audio_stream(Muxer *mux, OptionsContext *o, int source_
return ost;
}
-static OutputStream *new_data_stream(Muxer *mux, OptionsContext *o, int source_index)
+static OutputStream *new_data_stream(Muxer *mux, const OptionsContext *o, int source_index)
{
OutputStream *ost;
@@ -769,7 +769,7 @@ static OutputStream *new_data_stream(Muxer *mux, OptionsContext *o, int source_i
return ost;
}
-static OutputStream *new_unknown_stream(Muxer *mux, OptionsContext *o, int source_index)
+static OutputStream *new_unknown_stream(Muxer *mux, const OptionsContext *o, int source_index)
{
OutputStream *ost;
@@ -782,14 +782,14 @@ static OutputStream *new_unknown_stream(Muxer *mux, OptionsContext *o, int sourc
return ost;
}
-static OutputStream *new_attachment_stream(Muxer *mux, OptionsContext *o, int source_index)
+static OutputStream *new_attachment_stream(Muxer *mux, const OptionsContext *o, int source_index)
{
OutputStream *ost = new_output_stream(mux, o, AVMEDIA_TYPE_ATTACHMENT, source_index);
ost->finished = 1;
return ost;
}
-static OutputStream *new_subtitle_stream(Muxer *mux, OptionsContext *o, int source_index)
+static OutputStream *new_subtitle_stream(Muxer *mux, const OptionsContext *o, int source_index)
{
AVStream *st;
OutputStream *ost;
@@ -811,7 +811,7 @@ static OutputStream *new_subtitle_stream(Muxer *mux, OptionsContext *o, int sour
return ost;
}
-static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
+static void init_output_filter(OutputFilter *ofilter, const OptionsContext *o,
Muxer *mux)
{
OutputStream *ost;
@@ -852,7 +852,7 @@ static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
avfilter_inout_free(&ofilter->out_tmp);
}
-static void map_auto_video(Muxer *mux, OptionsContext *o)
+static void map_auto_video(Muxer *mux, const OptionsContext *o)
{
AVFormatContext *oc = mux->fc;
InputStream *ist;
@@ -898,7 +898,7 @@ static void map_auto_video(Muxer *mux, OptionsContext *o)
new_video_stream(mux, o, idx);
}
-static void map_auto_audio(Muxer *mux, OptionsContext *o)
+static void map_auto_audio(Muxer *mux, const OptionsContext *o)
{
AVFormatContext *oc = mux->fc;
InputStream *ist;
@@ -937,7 +937,7 @@ static void map_auto_audio(Muxer *mux, OptionsContext *o)
new_audio_stream(mux, o, idx);
}
-static void map_auto_subtitle(Muxer *mux, OptionsContext *o)
+static void map_auto_subtitle(Muxer *mux, const OptionsContext *o)
{
AVFormatContext *oc = mux->fc;
char *subtitle_codec_name = NULL;
@@ -975,7 +975,7 @@ static void map_auto_subtitle(Muxer *mux, OptionsContext *o)
}
}
-static void map_auto_data(Muxer *mux, OptionsContext *o)
+static void map_auto_data(Muxer *mux, const OptionsContext *o)
{
AVFormatContext *oc = mux->fc;
/* Data only if codec id match */
@@ -989,7 +989,7 @@ static void map_auto_data(Muxer *mux, OptionsContext *o)
}
}
-static void map_manual(Muxer *mux, OptionsContext *o, const StreamMap *map)
+static void map_manual(Muxer *mux, const OptionsContext *o, const StreamMap *map)
{
InputStream *ist;
@@ -1062,7 +1062,7 @@ loop_end:
}
}
-static void create_streams(Muxer *mux, OptionsContext *o)
+static void create_streams(Muxer *mux, const OptionsContext *o)
{
int auto_disable_v = o->video_disable;
int auto_disable_a = o->audio_disable;
@@ -1194,7 +1194,7 @@ static int setup_sync_queues(Muxer *mux, AVFormatContext *oc, int64_t buf_size_u
return 0;
}
-static void of_add_attachments(Muxer *mux, OptionsContext *o)
+static void of_add_attachments(Muxer *mux, const OptionsContext *o)
{
OutputStream *ost;
int err;
@@ -1487,7 +1487,7 @@ static int copy_chapters(InputFile *ifile, OutputFile *ofile, AVFormatContext *o
static int copy_metadata(const char *outspec, const char *inspec,
AVFormatContext *oc, AVFormatContext *ic,
int *metadata_global_manual, int *metadata_streams_manual,
- int *metadata_chapters_manual, OptionsContext *o)
+ int *metadata_chapters_manual, const OptionsContext *o)
{
AVDictionary **meta_in = NULL;
AVDictionary **meta_out = NULL;
@@ -1567,7 +1567,7 @@ static int copy_metadata(const char *outspec, const char *inspec,
return 0;
}
-static void copy_meta(Muxer *mux, OptionsContext *o)
+static void copy_meta(Muxer *mux, const OptionsContext *o)
{
OutputFile *of = &mux->of;
AVFormatContext *oc = mux->fc;
@@ -1703,7 +1703,7 @@ static int set_dispositions(OutputFile *of, AVFormatContext *ctx)
return 0;
}
-int of_open(OptionsContext *o, const char *filename)
+int of_open(const OptionsContext *o, const char *filename)
{
Muxer *mux;
AVFormatContext *oc;
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 38916304bc..d8de283fc2 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -1186,7 +1186,7 @@ static const OptionGroupDef groups[] = {
};
static int open_files(OptionGroupList *l, const char *inout,
- int (*open_file)(OptionsContext*, const char*))
+ int (*open_file)(const OptionsContext*, const char*))
{
int i, ret;
--
2.35.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2022-10-18 12:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 12:36 [FFmpeg-devel] [PATCH 01/20] fftools/ffmpeg_opt: move opening input files to ffmpeg_demux.c Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 02/20] fftools/ffmpeg_demux: add demuxer private data Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 03/20] fftools/ffmpeg: drop init_input_threads() Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 04/20] fftools/ffmpeg: move closing the input file into a separate function Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 05/20] fftools/ffmpeg: drop free_input_threads() Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 06/20] fftools/ffmpeg: move threading fields from InputFile to Demuxer Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 07/20] fftools/ffmpeg: move duration/time_base " Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 08/20] fftools/ffmpeg_demux: do not log to the demuxer context Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 09/20] fftools/ffmpeg: move nb_streams_warn from InputFile to Demuxer Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 10/20] fftools/ffmpeg_demux: log when the demuxer thread terminates Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 11/20] fftools/ffmpeg: factor out copying metadata/chapters from of_open() Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 12/20] fftools/ffmpeg_mux_init: avoid modifying OptionsContext.chapters_input_file Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 13/20] fftools/ffmpeg_mux_init: constify metadata specifier arguments Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 14/20] fftools/ffmpeg_mux_init: drop a duplicated block in copy_metadata() Anton Khirnov
2022-10-18 21:51 ` Michael Niedermayer
2022-11-08 12:46 ` Anton Khirnov
2022-11-14 9:24 ` Anton Khirnov
2022-11-14 22:21 ` Michael Niedermayer
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 15/20] fftools/ffmpeg_mux_init: stop using OptionsContext as storage " Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 16/20] fftools/ffmpeg_mux_init: stop modifying some OptionsContext fields Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 17/20] fftools/ffmpeg_mux_init: move code creating streams into a new function Anton Khirnov
2022-10-18 12:36 ` [FFmpeg-devel] [PATCH 18/20] fftools/ffmpeg_mux_init: stop modifying OptionsContext.*_disable Anton Khirnov
2022-10-18 12:37 ` [FFmpeg-devel] [PATCH 19/20] fftools/ffmpeg_demux: stop modifying OptionsContext Anton Khirnov
2022-10-18 12:37 ` Anton Khirnov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221018123701.25002-20-anton@khirnov.net \
--to=anton@khirnov.net \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git