Revision 86074ed1

View differences:

cmdutils.c
26 26
#include "avformat.h"
27 27
#include "cmdutils.h"
28 28
#include "avstring.h"
29
#include "version.h"
29 30

  
30 31
#undef exit
31 32

  
......
152 153
    }
153 154
}
154 155

  
156
void show_banner(const char *program_name, int program_birth_year)
157
{
158
    fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-2007 Fabrice Bellard, et al.\n",
159
            program_name, program_birth_year);
160
    fprintf(stderr, "  configuration: " FFMPEG_CONFIGURATION "\n");
161
    fprintf(stderr, "  libavutil version: " AV_STRINGIFY(LIBAVUTIL_VERSION) "\n");
162
    fprintf(stderr, "  libavcodec version: " AV_STRINGIFY(LIBAVCODEC_VERSION) "\n");
163
    fprintf(stderr, "  libavformat version: " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\n");
164
    fprintf(stderr, "  built on " __DATE__ " " __TIME__);
165
#ifdef __GNUC__
166
    fprintf(stderr, ", gcc: " __VERSION__ "\n");
167
#else
168
    fprintf(stderr, ", using a non-gcc compiler\n");
169
#endif
170
}
171

  
172
void show_version(const char *program_name) {
173
     /* TODO: add function interface to avutil and avformat */
174
    printf("%s " FFMPEG_VERSION "\n", program_name);
175
    printf("libavutil   %d\n"
176
           "libavcodec  %d\n"
177
           "libavformat %d\n",
178
           LIBAVUTIL_BUILD, avcodec_build(), LIBAVFORMAT_BUILD);
179
}
180

  
155 181
void show_license(void)
156 182
{
157 183
#ifdef CONFIG_GPL
cmdutils.h
65 65
void print_error(const char *filename, int err);
66 66

  
67 67
/**
68
 * Prints the banner of the program on stderr. The banner message
69
 * depends on the current versions of the repository and of the libav*
70
 * libraries.
71
 * @param program_name Name of the program.
72
 * @param program_birth_year Year of birth of the program.
73
 */
74
void show_banner(const char *program_name, int program_birth_year);
75

  
76
/**
77
 * Prints the version of the program on stdout. The version message
78
 * depends on the current versions of the repository and of the libav*
79
 * libraries.
80
 * @param program_name Name of the program.
81
 */
82
void show_version(const char *program_name);
83

  
84
/**
68 85
 * Prints on stdout the license of the program, which depends on the license of
69 86
 * the compiled libav* libraries.
70 87
 */
ffmpeg.c
63 63

  
64 64
#undef exit
65 65

  
66
static const char program_name[] = "FFmpeg";
67
static const int program_birth_year = 2000;
68

  
66 69
/* select an input stream for an output stream */
67 70
typedef struct AVStreamMap {
68 71
    int file_index;
......
3564 3567

  
3565 3568
static void opt_show_version(void)
3566 3569
{
3567
    /* TODO: add function interface to avutil and avformat */
3568
    fprintf(stderr, "ffmpeg      " FFMPEG_VERSION "\n"
3569
           "libavutil   %d\n"
3570
           "libavcodec  %d\n"
3571
           "libavformat %d\n",
3572
           LIBAVUTIL_BUILD, avcodec_build(), LIBAVFORMAT_BUILD);
3570
    show_version(program_name);
3573 3571
    exit(0);
3574 3572
}
3575 3573

  
......
3736 3734
    { NULL, },
3737 3735
};
3738 3736

  
3739
static void show_banner(void)
3740
{
3741
    fprintf(stderr, "FFmpeg version " FFMPEG_VERSION ", Copyright (c) 2000-2007 Fabrice Bellard, et al.\n");
3742
    fprintf(stderr, "  configuration: " FFMPEG_CONFIGURATION "\n");
3743
    fprintf(stderr, "  libavutil version: " AV_STRINGIFY(LIBAVUTIL_VERSION) "\n");
3744
    fprintf(stderr, "  libavcodec version: " AV_STRINGIFY(LIBAVCODEC_VERSION) "\n");
3745
    fprintf(stderr, "  libavformat version: " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\n");
3746
    fprintf(stderr, "  built on " __DATE__ " " __TIME__);
3747
#ifdef __GNUC__
3748
    fprintf(stderr, ", gcc: " __VERSION__ "\n");
3749
#else
3750
    fprintf(stderr, ", using a non-gcc compiler\n");
3751
#endif
3752
}
3753

  
3754 3737
static void opt_show_license(void)
3755 3738
{
3756 3739
    show_license();
......
3866 3849
    avformat_opts = av_alloc_format_context();
3867 3850
    sws_opts = sws_getContext(16,16,0, 16,16,0, sws_flags, NULL,NULL,NULL);
3868 3851

  
3869
    show_banner();
3852
    show_banner(program_name, program_birth_year);
3870 3853
    if (argc <= 1) {
3871 3854
        show_help();
3872 3855
        exit(1);
ffserver.c
53 53

  
54 54
#undef exit
55 55

  
56
static const char program_name[] = "FFserver";
57
static const int program_birth_year = 2000;
58

  
56 59
/* maximum number of simultaneous HTTP connections */
57 60
#define HTTP_MAX_CONNECTIONS 2000
58 61

  
......
4313 4316
        return 0;
4314 4317
}
4315 4318

  
4316
static void show_banner(void)
4317
{
4318
    printf("ffserver version " FFMPEG_VERSION ", Copyright (c) 2000-2006 Fabrice Bellard, et al.\n");
4319
}
4320

  
4321 4319
static void show_help(void)
4322 4320
{
4323
    show_banner();
4321
    show_banner(program_name, program_birth_year);
4324 4322
    printf("usage: ffserver [-L] [-h] [-f configfile]\n"
4325 4323
           "Hyper fast multi format Audio/Video streaming server\n"
4326 4324
           "\n"
......
4375 4373
            break;
4376 4374
        switch(c) {
4377 4375
        case 'L':
4378
            show_banner();
4376
            show_banner(program_name, program_birth_year);
4379 4377
            show_license();
4380 4378
            exit(0);
4381 4379
        case '?':

Also available in: Unified diff