~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to ffmpeg/cmdutils.h

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc, Andrew Starr-Bochicchio, Lionel Le Folgoc
  • Date: 2008-12-26 00:10:06 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081226001006-2040ls9680bd1blt
Tags: 1.1.7-0.2ubuntu1
[ Andrew Starr-Bochicchio ]
* Merge from debian-multimedia (LP: #298547), Ubuntu Changes:
 - For ffmpeg-related build-deps, fix versionized dependencies
   as the ubuntu versioning is different than debian-multimedia's.

[ Lionel Le Folgoc ]
* LP: #311412 is fixed since the 1.1.7~rc1-0.1 revision.
* debian/patches/03_ffmpeg.diff: updated to fix FTBFS due to libswscale API
  change (cherry-pick from Gentoo #234383).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
20
 */
21
21
 
22
 
#ifndef _CMD_UTILS_H
23
 
#define _CMD_UTILS_H
 
22
#ifndef FFMPEG_CMDUTILS_H
 
23
#define FFMPEG_CMDUTILS_H
 
24
 
 
25
#include <inttypes.h>
 
26
 
 
27
/**
 
28
 * Parses a string and returns its corresponding value as a double.
 
29
 * Exits from the application if the string cannot be correctly
 
30
 * parsed or the corresponding value is invalid.
 
31
 *
 
32
 * @param context the context of the value to be set (e.g. the
 
33
 * corresponding commandline option name)
 
34
 * @param numstr the string to be parsed
 
35
 * @param type the type (OPT_INT64 or OPT_FLOAT) as which the
 
36
 * string should be parsed
 
37
 * @param min the minimum valid accepted value
 
38
 * @param max the maximum valid accepted value
 
39
 */
 
40
double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max);
 
41
 
 
42
/**
 
43
 * Parses a string specifying a time and returns its corresponding
 
44
 * value as a number of microseconds. Exits from the application if
 
45
 * the string cannot be correctly parsed.
 
46
 *
 
47
 * @param context the context of the value to be set (e.g. the
 
48
 * corresponding commandline option name)
 
49
 * @param timestr the string to be parsed
 
50
 * @param is_duration a flag which tells how to interpret \p timestr, if
 
51
 * not zero \p timestr is interpreted as a duration, otherwise as a
 
52
 * date
 
53
 *
 
54
 * @see parse_date()
 
55
 */
 
56
int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration);
24
57
 
25
58
typedef struct {
26
59
    const char *name;
36
69
#define OPT_FLOAT  0x0100
37
70
#define OPT_SUBTITLE 0x0200
38
71
#define OPT_FUNC2  0x0400
 
72
#define OPT_INT64  0x0800
39
73
     union {
40
74
        void (*func_arg)(const char *); //FIXME passing error code as int return would be nicer then exit() in the func
41
75
        int *int_arg;
42
76
        char **str_arg;
43
77
        float *float_arg;
44
78
        int (*func2_arg)(const char *, const char *);
 
79
        int64_t *int64_arg;
45
80
    } u;
46
81
    const char *help;
47
82
    const char *argname;
48
83
} OptionDef;
49
84
 
50
85
void show_help_options(const OptionDef *options, const char *msg, int mask, int value);
51
 
void parse_options(int argc, char **argv, const OptionDef *options);
52
 
void parse_arg_file(const char *filename);
 
86
 
 
87
/**
 
88
 * Parses the command line arguments.
 
89
 * @param options Array with the definitions required to interpret every
 
90
 * option of the form: -<option_name> [<argument>]
 
91
 * @param parse_arg_function Name of the function called to process every
 
92
 * argument without a leading option name flag. NULL if such arguments do
 
93
 * not have to be processed.
 
94
 */
 
95
void parse_options(int argc, char **argv, const OptionDef *options,
 
96
                   void (* parse_arg_function)(const char*));
 
97
 
53
98
void print_error(const char *filename, int err);
54
99
 
55
 
#endif /* _CMD_UTILS_H */
 
100
/**
 
101
 * Prints the program banner to stderr. The banner contents depend on the
 
102
 * current version of the repository and of the libav* libraries used by
 
103
 * the program.
 
104
 * @param program_name name of the program
 
105
 * @param program_birth_year year of birth of the program
 
106
 */
 
107
void show_banner(const char *program_name, int program_birth_year);
 
108
 
 
109
/**
 
110
 * Prints the version of the program to stdout. The version message
 
111
 * depends on the current versions of the repository and of the libav*
 
112
 * libraries.
 
113
 * @param program_name name of the program
 
114
 */
 
115
void show_version(const char *program_name);
 
116
 
 
117
/**
 
118
 * Prints the license of the program to stdout. The license depends on
 
119
 * the license of the libraries compiled into the program.
 
120
 */
 
121
void show_license(void);
 
122
 
 
123
#endif /* FFMPEG_CMDUTILS_H */