Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

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