[FFmpeg-devel] [PATCH 1/5] lavf: add av_ prefix to dump_format()
Anton Khirnov
anton
Sun Feb 6 15:46:46 CET 2011
---
ffmpeg.c | 10 +++++-----
ffprobe.c | 2 +-
libavformat/avformat.h | 15 +++++++++++----
libavformat/movenchint.c | 2 +-
libavformat/output-example.c | 2 +-
libavformat/utils.c | 10 ++++++++++
libavformat/version.h | 3 +++
7 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/ffmpeg.c b/ffmpeg.c
index f78e658..d445504 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1982,7 +1982,7 @@ static int transcode(AVFormatContext **output_files,
for(i=0;i<nb_output_files;i++) {
os = output_files[i];
if (!os->nb_streams && !(os->oformat->flags & AVFMT_NOSTREAMS)) {
- dump_format(output_files[i], i, output_files[i]->filename, 1);
+ av_dump_format(output_files[i], i, output_files[i]->filename, 1);
fprintf(stderr, "Output file #%d does not contain any stream\n", i);
ret = AVERROR(EINVAL);
goto fail;
@@ -2033,7 +2033,7 @@ static int transcode(AVFormatContext **output_files,
/* Sanity check that the stream types match */
if (ist_table[ost->source_index]->st->codec->codec_type != ost->st->codec->codec_type) {
int i= ost->file_index;
- dump_format(output_files[i], i, output_files[i]->filename, 1);
+ av_dump_format(output_files[i], i, output_files[i]->filename, 1);
fprintf(stderr, "Codec type mismatch for mapping #%d.%d -> #%d.%d\n",
stream_maps[n].file_index, stream_maps[n].stream_index,
ost->file_index, ost->index);
@@ -2084,7 +2084,7 @@ static int transcode(AVFormatContext **output_files,
}
if (!found) {
int i= ost->file_index;
- dump_format(output_files[i], i, output_files[i]->filename, 1);
+ av_dump_format(output_files[i], i, output_files[i]->filename, 1);
fprintf(stderr, "Could not find input stream matching output stream #%d.%d\n",
ost->file_index, ost->index);
ffmpeg_exit(1);
@@ -2464,7 +2464,7 @@ static int transcode(AVFormatContext **output_files,
/* dump the file output parameters - cannot be done before in case
of stream copy */
for(i=0;i<nb_output_files;i++) {
- dump_format(output_files[i], i, output_files[i]->filename, 1);
+ av_dump_format(output_files[i], i, output_files[i]->filename, 1);
}
/* dump the stream mapping */
@@ -3314,7 +3314,7 @@ static void opt_input_file(const char *filename)
input_files_ts_offset[nb_input_files] = input_ts_offset - (copy_ts ? 0 : timestamp);
/* dump the file content */
if (verbose >= 0)
- dump_format(ic, nb_input_files, filename, 0);
+ av_dump_format(ic, nb_input_files, filename, 0);
nb_input_files++;
diff --git a/ffprobe.c b/ffprobe.c
index 2c99e5a..94b1d9b 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -277,7 +277,7 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
return err;
}
- dump_format(fmt_ctx, 0, filename, 0);
+ av_dump_format(fmt_ctx, 0, filename, 0);
/* bind a decoder to each input stream */
for (i = 0; i < fmt_ctx->nb_streams; i++) {
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 83289e4..f354539 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1446,10 +1446,17 @@ int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
*/
int av_write_trailer(AVFormatContext *s);
-void dump_format(AVFormatContext *ic,
- int index,
- const char *url,
- int is_output);
+#if FF_API_DUMP_FORMAT
+attribute_deprecated void dump_format(AVFormatContext *ic,
+ int index,
+ const char *url,
+ int is_output);
+#endif
+
+void av_dump_format(AVFormatContext *ic,
+ int index,
+ const char *url,
+ int is_output);
#if FF_API_PARSE_FRAME_PARAM
/**
diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c
index 5b07aa6..cdfb276 100644
--- a/libavformat/movenchint.c
+++ b/libavformat/movenchint.c
@@ -57,7 +57,7 @@ fail:
av_log(s, AV_LOG_WARNING,
"Unable to initialize hinting of stream %d\n", src_index);
av_freep(&track->enc);
- /* Set a default timescale, to avoid crashes in dump_format */
+ /* Set a default timescale, to avoid crashes in av_dump_format */
track->timescale = 90000;
return ret;
}
diff --git a/libavformat/output-example.c b/libavformat/output-example.c
index 06207ed..edb5c87 100644
--- a/libavformat/output-example.c
+++ b/libavformat/output-example.c
@@ -481,7 +481,7 @@ int main(int argc, char **argv)
exit(1);
}
- dump_format(oc, 0, filename, 1);
+ av_dump_format(oc, 0, filename, 1);
/* now that all the parameters are set, we can open the audio and
video codecs and allocate the necessary encode buffers */
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d12bbc2..b5e2322 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3233,11 +3233,21 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out
dump_metadata(NULL, st->metadata, " ");
}
+#if FF_API_DUMP_FORMAT
void dump_format(AVFormatContext *ic,
int index,
const char *url,
int is_output)
{
+ av_dump_format(ic, index, url, is_output);
+}
+#endif
+
+void av_dump_format(AVFormatContext *ic,
+ int index,
+ const char *url,
+ int is_output)
+{
int i;
uint8_t *printed = av_mallocz(ic->nb_streams);
if (ic->nb_streams && !printed)
diff --git a/libavformat/version.h b/libavformat/version.h
index 603d7cf..ff5f9be 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -89,5 +89,8 @@
#ifndef FF_API_OLD_AVIO
#define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 53)
#endif
+#ifndef FF_API_DUMP_FORMAT
+#define FF_API_DUMP_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 54)
+#endif
#endif //AVFORMAT_VERSION_H
--
1.7.2.3
More information about the ffmpeg-devel
mailing list