mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
Make show_banner() and show_version() print both the compile-time and the
link-time/run-time libav* version numbers. Originally committed as revision 14737 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
850a8d42ab
commit
9a10927279
33
cmdutils.c
33
cmdutils.c
@ -196,18 +196,30 @@ void print_error(const char *filename, int err)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent) \
|
||||||
|
version= libname##_version(); \
|
||||||
|
fprintf(outstream, "%slib%-10s %2d.%2d.%2d / %2d.%2d.%2d\n", indent? " " : "", #libname, \
|
||||||
|
LIB##LIBNAME##_VERSION_MAJOR, LIB##LIBNAME##_VERSION_MINOR, LIB##LIBNAME##_VERSION_MICRO, \
|
||||||
|
version >> 16, version >> 8 & 0xff, version & 0xff);
|
||||||
|
|
||||||
|
void print_all_lib_versions(FILE* outstream, int indent)
|
||||||
|
{
|
||||||
|
unsigned int version;
|
||||||
|
PRINT_LIB_VERSION(outstream, avutil, AVUTIL, indent);
|
||||||
|
PRINT_LIB_VERSION(outstream, avcodec, AVCODEC, indent);
|
||||||
|
PRINT_LIB_VERSION(outstream, avformat, AVFORMAT, indent);
|
||||||
|
PRINT_LIB_VERSION(outstream, avdevice, AVDEVICE, indent);
|
||||||
|
#if ENABLE_AVFILTER
|
||||||
|
PRINT_LIB_VERSION(outstream, avfilter, AVFILTER, indent);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void show_banner(void)
|
void show_banner(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-2008 Fabrice Bellard, et al.\n",
|
fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-2008 Fabrice Bellard, et al.\n",
|
||||||
program_name, program_birth_year);
|
program_name, program_birth_year);
|
||||||
fprintf(stderr, " configuration: " FFMPEG_CONFIGURATION "\n");
|
fprintf(stderr, " configuration: " FFMPEG_CONFIGURATION "\n");
|
||||||
fprintf(stderr, " libavutil version: " AV_STRINGIFY(LIBAVUTIL_VERSION) "\n");
|
print_all_lib_versions(stderr, 1);
|
||||||
fprintf(stderr, " libavcodec version: " AV_STRINGIFY(LIBAVCODEC_VERSION) "\n");
|
|
||||||
fprintf(stderr, " libavformat version: " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\n");
|
|
||||||
fprintf(stderr, " libavdevice version: " AV_STRINGIFY(LIBAVDEVICE_VERSION) "\n");
|
|
||||||
#if ENABLE_AVFILTER
|
|
||||||
fprintf(stderr, " libavfilter version: " AV_STRINGIFY(LIBAVFILTER_VERSION) "\n");
|
|
||||||
#endif
|
|
||||||
fprintf(stderr, " built on " __DATE__ " " __TIME__);
|
fprintf(stderr, " built on " __DATE__ " " __TIME__);
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
fprintf(stderr, ", gcc: " __VERSION__ "\n");
|
fprintf(stderr, ", gcc: " __VERSION__ "\n");
|
||||||
@ -217,13 +229,8 @@ void show_banner(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void show_version(void) {
|
void show_version(void) {
|
||||||
/* TODO: add function interface to avutil and avformat avdevice*/
|
|
||||||
printf("%s " FFMPEG_VERSION "\n", program_name);
|
printf("%s " FFMPEG_VERSION "\n", program_name);
|
||||||
printf("libavutil %d\n"
|
print_all_lib_versions(stdout, 0);
|
||||||
"libavcodec %d\n"
|
|
||||||
"libavformat %d\n"
|
|
||||||
"libavdevice %d\n",
|
|
||||||
LIBAVUTIL_BUILD, avcodec_version(), LIBAVFORMAT_BUILD, LIBAVDEVICE_BUILD);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_license(void)
|
void show_license(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user