00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <stddef.h>
00026 #include <string.h>
00027 #include <float.h>
00028
00029 #include "libavformat/avformat.h"
00030 #include "libavcodec/avcodec.h"
00031 #include "libavutil/opt.h"
00032
00033 static void print_usage(void)
00034 {
00035 fprintf(stderr, "Usage: enum_options type\n"
00036 "type: format codec\n");
00037 exit(1);
00038 }
00039
00040 static void print_option(const AVOption *opts, const AVOption *o, int per_stream)
00041 {
00042 printf("@item -%s%s @var{", o->name, per_stream ? "[:stream_specifier]" : "");
00043 switch (o->type) {
00044 case AV_OPT_TYPE_BINARY: printf("hexadecimal string"); break;
00045 case AV_OPT_TYPE_STRING: printf("string"); break;
00046 case AV_OPT_TYPE_INT:
00047 case AV_OPT_TYPE_INT64: printf("integer"); break;
00048 case AV_OPT_TYPE_FLOAT:
00049 case AV_OPT_TYPE_DOUBLE: printf("float"); break;
00050 case AV_OPT_TYPE_RATIONAL: printf("rational number"); break;
00051 case AV_OPT_TYPE_FLAGS: printf("flags"); break;
00052 default: printf("value"); break;
00053 }
00054 printf("} (@emph{");
00055
00056 if (o->flags & AV_OPT_FLAG_DECODING_PARAM) {
00057 printf("input");
00058 if (o->flags & AV_OPT_FLAG_ENCODING_PARAM)
00059 printf("/");
00060 }
00061 if (o->flags & AV_OPT_FLAG_ENCODING_PARAM) printf("output");
00062 if (o->flags & AV_OPT_FLAG_AUDIO_PARAM) printf(",audio");
00063 if (o->flags & AV_OPT_FLAG_VIDEO_PARAM) printf(",video");
00064 if (o->flags & AV_OPT_FLAG_SUBTITLE_PARAM) printf(",subtitles");
00065
00066 printf("})\n");
00067 if (o->help)
00068 printf("%s\n", o->help);
00069
00070 if (o->unit) {
00071 const AVOption *u;
00072 printf("\nPossible values:\n@table @samp\n");
00073
00074 for (u = opts; u->name; u++) {
00075 if (u->type == AV_OPT_TYPE_CONST && u->unit && !strcmp(u->unit, o->unit))
00076 printf("@item %s\n%s\n", u->name, u->help ? u->help : "");
00077 }
00078 printf("@end table\n");
00079 }
00080 }
00081
00082 static void show_opts(const AVOption *opts, int per_stream)
00083 {
00084 const AVOption *o;
00085
00086 printf("@table @option\n");
00087 for (o = opts; o->name; o++) {
00088 if (o->type != AV_OPT_TYPE_CONST)
00089 print_option(opts, o, per_stream);
00090 }
00091 printf("@end table\n");
00092 }
00093
00094 static void show_format_opts(void)
00095 {
00096 #include "libavformat/options_table.h"
00097
00098 printf("@section Format AVOptions\n");
00099 show_opts(options, 0);
00100 }
00101
00102 static void show_codec_opts(void)
00103 {
00104 #include "libavcodec/options_table.h"
00105
00106 printf("@section Codec AVOptions\n");
00107 show_opts(options, 1);
00108 }
00109
00110 int main(int argc, char **argv)
00111 {
00112 if (argc < 2)
00113 print_usage();
00114
00115 printf("@c DO NOT EDIT THIS FILE!\n"
00116 "@c It was generated by print_options.\n\n");
00117 if (!strcmp(argv[1], "format"))
00118 show_format_opts();
00119 else if (!strcmp(argv[1], "codec"))
00120 show_codec_opts();
00121 else
00122 print_usage();
00123
00124 return 0;
00125 }