• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Testing default values
2num=0
3toggle=1
4string=default
5escape=\=,
6flags=1
7rational=1/1
8video_rate=25/1
9width=200 height=300
10pix_fmt=0bgr
11sample_fmt=s16
12duration=1000
13color=255 192 203 255
14channel_layout=311=311
15binary=62 69 6e 0
16binary_size=4
17num64=1
18flt=0.333333
19dbl=0.333333
20TestContext AVOptions:
21  -num               <int>        E.......... set num (from 0 to 100) (default 0)
22  -toggle            <int>        E.......... set toggle (from 0 to 1) (default 1)
23  -rational          <rational>   E.......... set rational (from 0 to 10) (default 1/1)
24  -string            <string>     E.......... set string (default "default")
25  -escape            <string>     E.......... set escape str (default "\=,")
26  -flags             <flags>      E.......... set flags (default cool)
27     cool                         E.......... set cool flag
28     lame                         E.......... set lame flag
29     mu                           E.......... set mu flag
30  -size              <image_size> E.......... set size (default "200x300")
31  -pix_fmt           <pix_fmt>    E.......... set pixfmt (default 0bgr)
32  -sample_fmt        <sample_fmt> E.......... set samplefmt (default s16)
33  -video_rate        <video_rate> E.......... set videorate (default "25")
34  -duration          <duration>   E.......... set duration (default 0.001)
35  -color             <color>      E.......... set color (default "pink")
36  -cl                <channel_layout> E.......... set channel layout (default 0x137)
37  -bin               <binary>     E.......... set binary value
38  -bin1              <binary>     E.......... set binary value
39  -bin2              <binary>     E.......... set binary value
40  -num64             <int64>      E.......... set num 64bit (from 0 to 100) (default 1)
41  -flt               <float>      E.......... set float (from 0 to 100) (default 0.333333)
42  -dbl               <double>     E.......... set double (from 0 to 100) (default 0.333333)
43  -bool1             <boolean>    E.......... set boolean value (default auto)
44  -bool2             <boolean>    E.......... set boolean value (default true)
45  -bool3             <boolean>    E.......... set boolean value (default false)
46  -dict1             <dictionary> E.......... set dictionary value
47  -dict2             <dictionary> E.......... set dictionary value (default "happy=':-)'")
48
49Testing av_opt_is_set_to_default()
50name:       num default:1 error:
51name:    toggle default:0 error:
52name:  rational default:0 error:
53name:    string default:0 error:
54name:    escape default:0 error:
55name:     flags default:0 error:
56name:      cool default:1 error:Option not found
57name:      lame default:1 error:Option not found
58name:        mu default:1 error:Option not found
59name:      size default:0 error:
60name:   pix_fmt default:0 error:
61name:sample_fmt default:0 error:
62name:video_rate default:0 error:
63name:  duration default:0 error:
64name:     color default:0 error:
65name:        cl default:0 error:
66name:       bin default:0 error:
67name:      bin1 default:1 error:
68name:      bin2 default:1 error:
69name:     num64 default:0 error:
70name:       flt default:0 error:
71name:       dbl default:0 error:
72name:     bool1 default:0 error:
73name:     bool2 default:0 error:
74name:     bool3 default:1 error:
75name:     dict1 default:1 error:
76name:     dict2 default:0 error:
77name:       num default:1 error:
78name:    toggle default:1 error:
79name:  rational default:1 error:
80name:    string default:1 error:
81name:    escape default:1 error:
82name:     flags default:1 error:
83name:      cool default:1 error:Option not found
84name:      lame default:1 error:Option not found
85name:        mu default:1 error:Option not found
86name:      size default:1 error:
87name:   pix_fmt default:1 error:
88name:sample_fmt default:1 error:
89name:video_rate default:1 error:
90name:  duration default:1 error:
91name:     color default:1 error:
92name:        cl default:1 error:
93name:       bin default:1 error:
94name:      bin1 default:1 error:
95name:      bin2 default:1 error:
96name:     num64 default:1 error:
97name:       flt default:1 error:
98name:       dbl default:1 error:
99name:     bool1 default:1 error:
100name:     bool2 default:1 error:
101name:     bool3 default:1 error:
102name:     dict1 default:1 error:
103name:     dict2 default:1 error:
104
105Testing av_opt_get/av_opt_set()
106name: num         get: 0                set: OK               get: 0                OK
107name: toggle      get: 1                set: OK               get: 1                OK
108name: rational    get: 1/1              set: OK               get: 1/1              OK
109name: string      get: default          set: OK               get: default          OK
110name: escape      get: \=,              set: OK               get: \=,              OK
111name: flags       get: 0x00000001       set: OK               get: 0x00000001       OK
112name: size        get: 200x300          set: OK               get: 200x300          OK
113name: pix_fmt     get: 0bgr             set: OK               get: 0bgr             OK
114name: sample_fmt  get: s16              set: OK               get: s16              OK
115name: video_rate  get: 25/1             set: OK               get: 25/1             OK
116name: duration    get: 0.001            set: OK               get: 0.001            OK
117name: color       get: 0xffc0cbff       set: OK               get: 0xffc0cbff       OK
118name: cl          get: 0x137            set: OK               get: 0x137            OK
119name: bin         get: 62696E00         set: OK               get: 62696E00         OK
120name: bin1        get:                  set: OK               get:                  OK
121name: bin2        get:                  set: OK               get:                  OK
122name: num64       get: 1                set: OK               get: 1                OK
123name: flt         get: 0.333333         set: OK               get: 0.333333         OK
124name: dbl         get: 0.333333         set: OK               get: 0.333333         OK
125name: bool1       get: auto             set: OK               get: auto             OK
126name: bool2       get: true             set: OK               get: true             OK
127name: bool3       get: false            set: OK               get: false            OK
128name: dict1       get:                  set: OK               get:                  OK
129name: dict2       get: happy=\:-)       set: OK               get: happy=\:-)       OK
130
131Test av_opt_serialize()
132num=0,toggle=1,rational=1/1,string=default,escape=\\\=\,,flags=0x00000001,size=200x300,pix_fmt=0bgr,sample_fmt=s16,video_rate=25/1,duration=0.001,color=0xffc0cbff,cl=0x137,bin=62696E00,bin1=,bin2=,num64=1,flt=0.333333,dbl=0.333333,bool1=auto,bool2=true,bool3=false,dict1=,dict2=happy\=\\:-)
133Setting entry with key 'num' to value '0'
134Setting entry with key 'toggle' to value '1'
135Setting entry with key 'rational' to value '1/1'
136Setting entry with key 'string' to value 'default'
137Setting entry with key 'escape' to value '\=,'
138Setting entry with key 'flags' to value '0x00000001'
139Setting entry with key 'size' to value '200x300'
140Setting entry with key 'pix_fmt' to value '0bgr'
141Setting entry with key 'sample_fmt' to value 's16'
142Setting entry with key 'video_rate' to value '25/1'
143Setting entry with key 'duration' to value '0.001'
144Setting entry with key 'color' to value '0xffc0cbff'
145Setting entry with key 'cl' to value '0x137'
146Setting entry with key 'bin' to value '62696E00'
147Setting entry with key 'bin1' to value ''
148Setting entry with key 'bin2' to value ''
149Setting entry with key 'num64' to value '1'
150Setting entry with key 'flt' to value '0.333333'
151Setting entry with key 'dbl' to value '0.333333'
152Setting entry with key 'bool1' to value 'auto'
153Setting entry with key 'bool2' to value 'true'
154Setting entry with key 'bool3' to value 'false'
155Setting entry with key 'dict1' to value ''
156Setting entry with key 'dict2' to value 'happy=\:-)'
157num=0,toggle=1,rational=1/1,string=default,escape=\\\=\,,flags=0x00000001,size=200x300,pix_fmt=0bgr,sample_fmt=s16,video_rate=25/1,duration=0.001,color=0xffc0cbff,cl=0x137,bin=62696E00,bin1=,bin2=,num64=1,flt=0.333333,dbl=0.333333,bool1=auto,bool2=true,bool3=false,dict1=,dict2=happy\=\\:-)
158
159Testing av_set_options_string()
160Setting options string ''
161OK    ''
162Setting options string ':'
163Missing key or no key/value separator found after key ':'
164Error ':'
165Setting options string '='
166Missing key or no key/value separator found after key ''
167Error '='
168Setting options string 'foo=:'
169Setting entry with key 'foo' to value ''
170Key 'foo' not found.
171Error 'foo=:'
172Setting options string ':=foo'
173Setting entry with key ':' to value 'foo'
174Key ':' not found.
175Error ':=foo'
176Setting options string '=foo'
177Missing key or no key/value separator found after key ''
178Error '=foo'
179Setting options string 'foo='
180Setting entry with key 'foo' to value ''
181Key 'foo' not found.
182Error 'foo='
183Setting options string 'foo'
184Missing key or no key/value separator found after key 'foo'
185Error 'foo'
186Setting options string 'foo=val'
187Setting entry with key 'foo' to value 'val'
188Key 'foo' not found.
189Error 'foo=val'
190Setting options string 'foo==val'
191Setting entry with key 'foo' to value '=val'
192Key 'foo' not found.
193Error 'foo==val'
194Setting options string 'toggle=:'
195Setting entry with key 'toggle' to value ''
196Undefined constant or missing '(' in ''
197Unable to parse option value ""
198Error 'toggle=:'
199Setting options string 'string=:'
200Setting entry with key 'string' to value ''
201OK    'string=:'
202Setting options string 'toggle=1 : foo'
203Setting entry with key 'toggle' to value '1'
204Missing key or no key/value separator found after key 'foo'
205Error 'toggle=1 : foo'
206Setting options string 'toggle=100'
207Setting entry with key 'toggle' to value '100'
208Value 100.000000 for parameter 'toggle' out of range [0 - 1]
209Error 'toggle=100'
210Setting options string 'toggle==1'
211Setting entry with key 'toggle' to value '=1'
212Undefined constant or missing '(' in '=1'
213Unable to parse option value "=1"
214Error 'toggle==1'
215Setting options string 'flags=+mu-lame : num=42: toggle=0'
216Setting entry with key 'flags' to value '+mu-lame'
217Setting entry with key 'num' to value '42'
218Setting entry with key 'toggle' to value '0'
219OK    'flags=+mu-lame : num=42: toggle=0'
220Setting options string 'num=42 : string=blahblah'
221Setting entry with key 'num' to value '42'
222Setting entry with key 'string' to value 'blahblah'
223OK    'num=42 : string=blahblah'
224Setting options string 'rational=0 : rational=1/2 : rational=1/-1'
225Setting entry with key 'rational' to value '0'
226Setting entry with key 'rational' to value '1/2'
227Setting entry with key 'rational' to value '1/-1'
228Value -1.000000 for parameter 'rational' out of range [0 - 10]
229Value -1.000000 for parameter 'rational' out of range [0 - 10]
230Error 'rational=0 : rational=1/2 : rational=1/-1'
231Setting options string 'rational=-1/0'
232Error 'rational=-1/0'
233Setting options string 'size=1024x768'
234Setting entry with key 'size' to value '1024x768'
235OK    'size=1024x768'
236Setting options string 'size=pal'
237Setting entry with key 'size' to value 'pal'
238OK    'size=pal'
239Setting options string 'size=bogus'
240Setting entry with key 'size' to value 'bogus'
241Unable to parse option value "bogus" as image size
242Error 'size=bogus'
243Setting options string 'pix_fmt=yuv420p'
244Setting entry with key 'pix_fmt' to value 'yuv420p'
245OK    'pix_fmt=yuv420p'
246Setting options string 'pix_fmt=2'
247Setting entry with key 'pix_fmt' to value '2'
248OK    'pix_fmt=2'
249Setting options string 'pix_fmt=bogus'
250Setting entry with key 'pix_fmt' to value 'bogus'
251Unable to parse option value "bogus" as pixel format
252Error 'pix_fmt=bogus'
253Setting options string 'sample_fmt=s16'
254Setting entry with key 'sample_fmt' to value 's16'
255OK    'sample_fmt=s16'
256Setting options string 'sample_fmt=2'
257Setting entry with key 'sample_fmt' to value '2'
258OK    'sample_fmt=2'
259Setting options string 'sample_fmt=bogus'
260Setting entry with key 'sample_fmt' to value 'bogus'
261Unable to parse option value "bogus" as sample format
262Error 'sample_fmt=bogus'
263Setting options string 'video_rate=pal'
264Setting entry with key 'video_rate' to value 'pal'
265OK    'video_rate=pal'
266Setting options string 'video_rate=25'
267Setting entry with key 'video_rate' to value '25'
268OK    'video_rate=25'
269Setting options string 'video_rate=30000/1001'
270Setting entry with key 'video_rate' to value '30000/1001'
271OK    'video_rate=30000/1001'
272Setting options string 'video_rate=30/1.001'
273Setting entry with key 'video_rate' to value '30/1.001'
274OK    'video_rate=30/1.001'
275Setting options string 'video_rate=bogus'
276Setting entry with key 'video_rate' to value 'bogus'
277Undefined constant or missing '(' in 'bogus'
278Unable to parse option value "bogus" as video rate
279Error 'video_rate=bogus'
280Setting options string 'duration=bogus'
281Setting entry with key 'duration' to value 'bogus'
282Unable to parse option value "bogus" as duration
283Error 'duration=bogus'
284Setting options string 'duration=123.45'
285Setting entry with key 'duration' to value '123.45'
286OK    'duration=123.45'
287Setting options string 'duration=1\:23\:45.67'
288Setting entry with key 'duration' to value '1:23:45.67'
289OK    'duration=1\:23\:45.67'
290Setting options string 'color=blue'
291Setting entry with key 'color' to value 'blue'
292OK    'color=blue'
293Setting options string 'color=0x223300'
294Setting entry with key 'color' to value '0x223300'
295OK    'color=0x223300'
296Setting options string 'color=0x42FF07AA'
297Setting entry with key 'color' to value '0x42FF07AA'
298OK    'color=0x42FF07AA'
299Setting options string 'cl=stereo+downmix'
300Setting entry with key 'cl' to value 'stereo+downmix'
301OK    'cl=stereo+downmix'
302Setting options string 'cl=foo'
303Setting entry with key 'cl' to value 'foo'
304Unable to parse option value "foo" as channel layout
305Error 'cl=foo'
306Setting options string 'bin=boguss'
307Setting entry with key 'bin' to value 'boguss'
308Error 'bin=boguss'
309Setting options string 'bin=111'
310Setting entry with key 'bin' to value '111'
311Error 'bin=111'
312Setting options string 'bin=ffff'
313Setting entry with key 'bin' to value 'ffff'
314OK    'bin=ffff'
315Setting options string 'num64=bogus'
316Setting entry with key 'num64' to value 'bogus'
317Undefined constant or missing '(' in 'bogus'
318Unable to parse option value "bogus"
319Error 'num64=bogus'
320Setting options string 'num64=44'
321Setting entry with key 'num64' to value '44'
322OK    'num64=44'
323Setting options string 'num64=44.4'
324Setting entry with key 'num64' to value '44.4'
325OK    'num64=44.4'
326Setting options string 'num64=-1'
327Setting entry with key 'num64' to value '-1'
328Value -1.000000 for parameter 'num64' out of range [0 - 100]
329Error 'num64=-1'
330Setting options string 'num64=101'
331Setting entry with key 'num64' to value '101'
332Value 101.000000 for parameter 'num64' out of range [0 - 100]
333Error 'num64=101'
334Setting options string 'flt=bogus'
335Setting entry with key 'flt' to value 'bogus'
336Undefined constant or missing '(' in 'bogus'
337Unable to parse option value "bogus"
338Error 'flt=bogus'
339Setting options string 'flt=2'
340Setting entry with key 'flt' to value '2'
341OK    'flt=2'
342Setting options string 'flt=2.2'
343Setting entry with key 'flt' to value '2.2'
344OK    'flt=2.2'
345Setting options string 'flt=-1'
346Setting entry with key 'flt' to value '-1'
347Value -1.000000 for parameter 'flt' out of range [0 - 100]
348Error 'flt=-1'
349Setting options string 'flt=101'
350Setting entry with key 'flt' to value '101'
351Value 101.000000 for parameter 'flt' out of range [0 - 100]
352Error 'flt=101'
353Setting options string 'dbl=bogus'
354Setting entry with key 'dbl' to value 'bogus'
355Undefined constant or missing '(' in 'bogus'
356Unable to parse option value "bogus"
357Error 'dbl=bogus'
358Setting options string 'dbl=2'
359Setting entry with key 'dbl' to value '2'
360OK    'dbl=2'
361Setting options string 'dbl=2.2'
362Setting entry with key 'dbl' to value '2.2'
363OK    'dbl=2.2'
364Setting options string 'dbl=-1'
365Setting entry with key 'dbl' to value '-1'
366Value -1.000000 for parameter 'dbl' out of range [0 - 100]
367Error 'dbl=-1'
368Setting options string 'dbl=101'
369Setting entry with key 'dbl' to value '101'
370Value 101.000000 for parameter 'dbl' out of range [0 - 100]
371Error 'dbl=101'
372Setting options string 'bool1=true'
373Setting entry with key 'bool1' to value 'true'
374OK    'bool1=true'
375Setting options string 'bool2=auto'
376Setting entry with key 'bool2' to value 'auto'
377OK    'bool2=auto'
378Setting options string 'dict1='happy=\:-):sad=\:-(''
379Setting entry with key 'dict1' to value 'happy=\:-):sad=\:-('
380OK    'dict1='happy=\:-):sad=\:-(''
381
382Testing av_opt_set_from_string()
383Setting options string ''
384OK    ''
385Setting options string '5'
386Setting 'num' to value '5'
387OK    '5'
388Setting options string '5:hello'
389Setting 'num' to value '5'
390Setting 'string' to value 'hello'
391OK    '5:hello'
392Setting options string '5:hello:size=pal'
393Setting 'num' to value '5'
394Setting 'string' to value 'hello'
395Setting 'size' to value 'pal'
396OK    '5:hello:size=pal'
397Setting options string '5:size=pal:hello'
398Setting 'num' to value '5'
399Setting 'size' to value 'pal'
400No option name near 'hello'
401Error '5:size=pal:hello'
402Setting options string ':'
403Setting 'num' to value ''
404Undefined constant or missing '(' in ''
405Unable to parse option value ""
406Error ':'
407Setting options string '='
408Setting '' to value ''
409Option '' not found
410Error '='
411Setting options string ' 5 : hello : size = pal '
412Setting 'num' to value '5'
413Setting 'string' to value 'hello'
414Setting 'size' to value 'pal'
415OK    ' 5 : hello : size = pal '
416Setting options string 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here=42'
417Setting 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here' to value '42'
418Option 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here' not found
419Error 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here=42'
420