annotate opts.c @ 1125:0980ae063f4e libavcodec

restoring OS/2 compatibility patch by ("Slavik Gnatenko" <miracle9 at newmail dot ru>)
author michaelni
date Tue, 11 Mar 2003 12:09:13 +0000
parents 64c7c76ed17c
children 300961b1ef4f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
962
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
1 /*
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
2 * LGPL
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
3 */
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
4
1106
1e39f273ecd6 per file doxy
michaelni
parents: 1058
diff changeset
5 /**
1e39f273ecd6 per file doxy
michaelni
parents: 1058
diff changeset
6 * @file opts.c
1e39f273ecd6 per file doxy
michaelni
parents: 1058
diff changeset
7 * options parser.
962
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
8 * typical parsed command line:
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
9 * msmpeg4:bitrate=720000:qmax=16
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
10 *
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
11 */
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
12
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
13 #include "avcodec.h"
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
14
1125
0980ae063f4e restoring OS/2 compatibility patch by ("Slavik Gnatenko" <miracle9 at newmail dot ru>)
michaelni
parents: 1124
diff changeset
15 #ifdef CONFIG_OS2
0980ae063f4e restoring OS/2 compatibility patch by ("Slavik Gnatenko" <miracle9 at newmail dot ru>)
michaelni
parents: 1124
diff changeset
16 #define strcasecmp(s1,s2) stricmp(s1,s2)
0980ae063f4e restoring OS/2 compatibility patch by ("Slavik Gnatenko" <miracle9 at newmail dot ru>)
michaelni
parents: 1124
diff changeset
17 #endif
0980ae063f4e restoring OS/2 compatibility patch by ("Slavik Gnatenko" <miracle9 at newmail dot ru>)
michaelni
parents: 1124
diff changeset
18
1124
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
19 const AVOption avoptions_common[] = {
1114
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
20 AVOPTION_CODEC_FLAG("bit_exact", "use only bit-exact stuff", flags, CODEC_FLAG_BITEXACT, 0),
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
21 AVOPTION_CODEC_FLAG("mm_force", "force mm flags", dsp_mask, FF_MM_FORCE, 0),
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
22 #ifdef HAVE_MMX
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
23 AVOPTION_CODEC_FLAG("mm_mmx", "mask MMX feature", dsp_mask, FF_MM_MMX, 0),
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
24 AVOPTION_CODEC_FLAG("mm_3dnow", "mask 3DNow feature", dsp_mask, FF_MM_3DNOW, 0),
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
25 AVOPTION_CODEC_FLAG("mm_mmxext", "mask MMXEXT (MMX2) feature", dsp_mask, FF_MM_MMXEXT, 0),
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
26 AVOPTION_CODEC_FLAG("mm_sse", "mask SSE feature", dsp_mask, FF_MM_SSE, 0),
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
27 AVOPTION_CODEC_FLAG("mm_sse2", "mask SSE2 feature", dsp_mask, FF_MM_SSE2, 0),
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
28 #endif
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
29 AVOPTION_END()
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
30 };
962
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
31
1124
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
32 const AVOption avoptions_workaround_bug[] = {
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
33 AVOPTION_CODEC_FLAG("bug_autodetect", "workaround bug autodetection", workaround_bugs, FF_BUG_AUTODETECT, 1),
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
34 AVOPTION_CODEC_FLAG("bug_old_msmpeg4", "workaround old msmpeg4 bug", workaround_bugs, FF_BUG_OLD_MSMPEG4, 0),
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
35 AVOPTION_CODEC_FLAG("bug_xvid_ilace", "workaround XviD interlace bug", workaround_bugs, FF_BUG_XVID_ILACE, 0),
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
36 AVOPTION_CODEC_FLAG("bug_ump4", "workaround ump4 bug", workaround_bugs, FF_BUG_UMP4, 0),
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
37 AVOPTION_CODEC_FLAG("bug_no_padding", "workaround padding bug", workaround_bugs, FF_BUG_NO_PADDING, 0),
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
38 AVOPTION_CODEC_FLAG("bug_ac_vlc", "workaround ac VLC bug", workaround_bugs, FF_BUG_AC_VLC, 0),
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
39 AVOPTION_CODEC_FLAG("bug_qpel_chroma", "workaround qpel chroma bug", workaround_bugs, FF_BUG_QPEL_CHROMA, 0),
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
40 AVOPTION_CODEC_FLAG("bug_std_qpel", "workaround std qpel bug", workaround_bugs, FF_BUG_STD_QPEL, 0),
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
41 AVOPTION_CODEC_FLAG("bug_qpel_chroma2", "workaround qpel chroma2 bug", workaround_bugs, FF_BUG_QPEL_CHROMA2, 0),
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
42 AVOPTION_CODEC_FLAG("bug_direct_blocksize", "workaround direct blocksize bug", workaround_bugs, FF_BUG_DIRECT_BLOCKSIZE, 0),
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
43 AVOPTION_END()
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
44 };
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
45
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
46
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
47 static int parse_bool(const AVOption *c, char *s, int *var)
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
48 {
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
49 int b = 1; /* by default -on- when present */
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
50 if (s) {
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
51 if (!strcasecmp(s, "off") || !strcasecmp(s, "false")
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
52 || !strcmp(s, "0"))
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
53 b = 0;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
54 else if (!strcasecmp(s, "on") || !strcasecmp(s, "true")
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
55 || !strcmp(s, "1"))
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
56 b = 1;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
57 else
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
58 return -1;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
59 }
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
60
1124
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
61 if (c->type == FF_OPT_TYPE_FLAG) {
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
62 if (b)
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
63 *var |= (int)c->min;
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
64 else
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
65 *var &= ~(int)c->min;
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
66 } else
64c7c76ed17c * 'externaly' visible option list begins avoptions_ prefix
kabi
parents: 1114
diff changeset
67 *var = b;
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
68 return 0;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
69 }
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
70
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
71 static int parse_double(const AVOption *c, char *s, double *var)
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
72 {
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
73 double d;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
74 if (!s)
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
75 return -1;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
76 d = atof(s);
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
77 if (c->min != c->max) {
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
78 if (d < c->min || d > c->max) {
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
79 fprintf(stderr, "Option: %s double value: %f out of range <%f, %f>\n",
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
80 c->name, d, c->min, c->max);
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
81 return -1;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
82 }
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
83 }
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
84 *var = d;
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
85 return 0;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
86 }
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
87
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
88 static int parse_int(const AVOption* c, char* s, int* var)
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
89 {
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
90 int i;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
91 if (!s)
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
92 return -1;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
93 i = atoi(s);
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
94 if (c->min != c->max) {
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
95 if (i < (int)c->min || i > (int)c->max) {
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
96 fprintf(stderr, "Option: %s integer value: %d out of range <%d, %d>\n",
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
97 c->name, i, (int)c->min, (int)c->max);
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
98 return -1;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
99 }
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
100 }
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
101 *var = i;
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
102 return 0;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
103 }
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
104
1114
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
105 static int parse_string(const AVOption *c, char *s, void* strct, char **var)
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
106 {
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
107 if (!s)
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
108 return -1;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
109
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
110 if (c->type == FF_OPT_TYPE_RCOVERRIDE) {
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
111 int sf, ef, qs;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
112 float qf;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
113 if (sscanf(s, "%d,%d,%d,%f", &sf, &ef, &qs, &qf) == 4 && sf < ef) {
1114
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
114 AVCodecContext *avctx = (AVCodecContext *) strct;
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
115 RcOverride *o;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
116 avctx->rc_override = av_realloc(avctx->rc_override,
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
117 sizeof(RcOverride) * (avctx->rc_override_count + 1));
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
118 o = avctx->rc_override + avctx->rc_override_count++;
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
119 o->start_frame = sf;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
120 o->end_frame = ef;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
121 o->qscale = qs;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
122 o->quality_factor = qf;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
123
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
124 //printf("parsed Rc: %d,%d,%d,%f (%d)\n", sf,ef,qs,qf, avctx->rc_override_count);
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
125 } else {
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
126 printf("incorrect/unparsable Rc: \"%s\"\n", s);
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
127 }
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
128 } else
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
129 *var = av_strdup(s);
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
130 return 0;
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
131 }
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
132
1114
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
133 int avoption_parse(void* strct, const AVOption* list, const char *opts)
962
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
134 {
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
135 int r = 0;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
136 char* dopts = av_strdup(opts);
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
137 if (dopts) {
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
138 char *str = dopts;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
139
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
140 while (str && *str && r == 0) {
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
141 const AVOption *stack[FF_OPT_MAX_DEPTH];
1114
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
142 const AVOption *c = list;
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
143 int depth = 0;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
144 char* e = strchr(str, ':');
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
145 char* p;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
146 if (e)
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
147 *e++ = 0;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
148
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
149 p = strchr(str, '=');
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
150 if (p)
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
151 *p++ = 0;
962
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
152
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
153 // going through option structures
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
154 for (;;) {
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
155 if (!c->name) {
1114
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
156 if (c->help) {
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
157 stack[depth++] = c;
1114
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
158 c = (const AVOption*) c->help;
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
159 assert(depth > FF_OPT_MAX_DEPTH);
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
160 } else {
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
161 if (depth == 0)
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
162 break; // finished
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
163 c = stack[--depth];
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
164 c++;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
165 }
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
166 } else {
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
167 if (!strcmp(c->name, str)) {
1114
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
168 void* ptr = (char*)strct + c->offset;
962
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
169
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
170 switch (c->type & FF_OPT_TYPE_MASK) {
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
171 case FF_OPT_TYPE_BOOL:
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
172 r = parse_bool(c, p, (int*)ptr);
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
173 break;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
174 case FF_OPT_TYPE_DOUBLE:
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
175 r = parse_double(c, p, (double*)ptr);
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
176 break;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
177 case FF_OPT_TYPE_INT:
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
178 r = parse_int(c, p, (int*)ptr);
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
179 break;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
180 case FF_OPT_TYPE_STRING:
1114
e4762efc3617 * more generic avoption_parse
kabi
parents: 1106
diff changeset
181 r = parse_string(c, p, strct, (char**)ptr);
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
182 break;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
183 default:
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
184 assert(0 == 1);
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
185 }
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
186 }
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
187 c++;
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
188 }
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
189 }
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
190 str = e;
1019
ef905ded19fe * code for parsing options
kabi
parents: 962
diff changeset
191 }
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
192 av_free(dopts);
962
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
193 }
1058
3c3da6edc9a1 * still unfinished code for Options
kabi
parents: 1019
diff changeset
194 return r;
962
c5aef83c6a3f * first shot for generaly usable option parser for codecs
kabi
parents:
diff changeset
195 }