1 /*
2 * Copyright (c) 2011 Anton Khirnov
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 /*
22 * enumerate avoptions and format them in texinfo format
23 */
24
25 #include <string.h>
26
31
33 {
34 fprintf(stderr, "Usage: enum_options type\n"
35 "type: format codec\n");
36 exit(1);
37 }
38
40 {
41 printf(
"@item -%s @var{", o->
name);
43 case FF_OPT_TYPE_BINARY: printf("hexadecimal string"); break;
44 case FF_OPT_TYPE_STRING: printf("string"); break;
45 case FF_OPT_TYPE_INT:
46 case FF_OPT_TYPE_INT64: printf("integer"); break;
47 case FF_OPT_TYPE_FLOAT:
48 case FF_OPT_TYPE_DOUBLE: printf("float"); break;
49 case FF_OPT_TYPE_RATIONAL: printf("rational number"); break;
50 case FF_OPT_TYPE_FLAGS: printf("flags"); break;
51 default: printf("value"); break;
52 }
53 printf("} (@emph{");
54
56 printf("input");
58 printf("/");
59 }
61 printf("output");
62
63 printf("})\n");
65 printf(
"%s\n", o->
help);
66
69 printf("\nPossible values:\n@table @samp\n");
70
71 while ((u = av_next_option(&class, u)))
73 printf(
"@item %s\n%s\n", u->
name, u->
help ? u->
help :
"");
74 printf("@end table\n");
75 }
76 }
77
79 {
81
82 printf("@table @option\n");
83 while ((o = av_next_option(&class, o)))
84 if (o->
type != FF_OPT_TYPE_CONST)
86 printf("@end table\n");
87 }
88
90 {
93
94 printf("@section Generic format AVOptions\n");
96
97 printf("@section Format-specific AVOptions\n");
100 continue;
103 }
106 continue;
109 }
110 }
111
113 {
115
116 printf("@section Generic codec AVOptions\n");
118
119 printf("@section Codec-specific AVOptions\n");
122 continue;
125 }
126 }
127
128 int main(
int argc,
char **argv)
129 {
130 if (argc < 2)
132
134
135 if (!strcmp(argv[1], "format"))
137 else if (!strcmp(argv[1], "codec"))
139 else
141
142 return 0;
143 }
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static void print_option(const AVClass *class, const AVOption *o)
const char * help
short English help text
static void show_format_opts(void)
const AVClass * avformat_get_class(void)
Get the AVClass for AVFormatContext.
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
int main(int argc, char **argv)
AVCodec * av_codec_next(const AVCodec *c)
If c is NULL, returns the first registered codec, if c is non-NULL, returns the next registered codec...
static void show_opts(const AVClass *class)
const char * unit
The logical unit to which the option belongs.
AVOutputFormat * av_oformat_next(const AVOutputFormat *f)
If f is NULL, returns the first registered output format, if f is non-NULL, returns the next register...
static AVInputFormat * iformat
Libavcodec external API header.
Describe the class of an AVClass context structure.
const AVClass * priv_class
AVClass for the private context.
static void show_codec_opts(void)
void av_register_all(void)
Initialize libavformat and register all the muxers, demuxers and protocols.
static void print_usage(void)
AVInputFormat * av_iformat_next(const AVInputFormat *f)
If f is NULL, returns the first registered input format, if f is non-NULL, returns the next registere...