FFmpeg  4.3
opt.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #include <limits.h>
20 #include <stdio.h>
21 
22 #include "libavutil/common.h"
24 #include "libavutil/error.h"
25 #include "libavutil/log.h"
26 #include "libavutil/mem.h"
27 #include "libavutil/rational.h"
28 #include "libavutil/opt.h"
29 #include "libavutil/pixdesc.h"
30 
31 typedef struct TestContext {
32  const AVClass *class;
33  int num;
34  int toggle;
35  char *string;
36  int flags;
39  int w, h;
42  int64_t duration;
44  int64_t channel_layout;
45  void *binary;
47  void *binary1;
49  void *binary2;
51  int64_t num64;
52  float flt;
53  double dbl;
54  char *escape;
55  int bool1;
56  int bool2;
57  int bool3;
60 } TestContext;
61 
62 #define OFFSET(x) offsetof(TestContext, x)
63 
64 #define TEST_FLAG_COOL 01
65 #define TEST_FLAG_LAME 02
66 #define TEST_FLAG_MU 04
67 
68 static const AVOption test_options[]= {
69  {"num", "set num", OFFSET(num), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100, 1 },
70  {"toggle", "set toggle", OFFSET(toggle), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, 1 },
71  {"rational", "set rational", OFFSET(rational), AV_OPT_TYPE_RATIONAL, { .dbl = 1 }, 0, 10, 1 },
72  {"string", "set string", OFFSET(string), AV_OPT_TYPE_STRING, { .str = "default" }, CHAR_MIN, CHAR_MAX, 1 },
73  {"escape", "set escape str", OFFSET(escape), AV_OPT_TYPE_STRING, { .str = "\\=," }, CHAR_MIN, CHAR_MAX, 1 },
74  {"flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, { .i64 = 1 }, 0, INT_MAX, 1, "flags" },
75  {"cool", "set cool flag", 0, AV_OPT_TYPE_CONST, { .i64 = TEST_FLAG_COOL }, INT_MIN, INT_MAX, 1, "flags" },
76  {"lame", "set lame flag", 0, AV_OPT_TYPE_CONST, { .i64 = TEST_FLAG_LAME }, INT_MIN, INT_MAX, 1, "flags" },
77  {"mu", "set mu flag", 0, AV_OPT_TYPE_CONST, { .i64 = TEST_FLAG_MU }, INT_MIN, INT_MAX, 1, "flags" },
78  {"size", "set size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, { .str="200x300" }, 0, 0, 1 },
79  {"pix_fmt", "set pixfmt", OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, { .i64 = AV_PIX_FMT_0BGR }, -1, INT_MAX, 1 },
80  {"sample_fmt", "set samplefmt", OFFSET(sample_fmt), AV_OPT_TYPE_SAMPLE_FMT, { .i64 = AV_SAMPLE_FMT_S16 }, -1, INT_MAX, 1 },
81  {"video_rate", "set videorate", OFFSET(video_rate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, 1 },
82  {"duration", "set duration", OFFSET(duration), AV_OPT_TYPE_DURATION, { .i64 = 1000 }, 0, INT64_MAX, 1 },
83  {"color", "set color", OFFSET(color), AV_OPT_TYPE_COLOR, { .str = "pink" }, 0, 0, 1 },
84  {"cl", "set channel layout", OFFSET(channel_layout), AV_OPT_TYPE_CHANNEL_LAYOUT, { .i64 = AV_CH_LAYOUT_HEXAGONAL }, 0, INT64_MAX, 1 },
85  {"bin", "set binary value", OFFSET(binary), AV_OPT_TYPE_BINARY, { .str="62696e00" }, 0, 0, 1 },
86  {"bin1", "set binary value", OFFSET(binary1), AV_OPT_TYPE_BINARY, { .str=NULL }, 0, 0, 1 },
87  {"bin2", "set binary value", OFFSET(binary2), AV_OPT_TYPE_BINARY, { .str="" }, 0, 0, 1 },
88  {"num64", "set num 64bit", OFFSET(num64), AV_OPT_TYPE_INT64, { .i64 = 1 }, 0, 100, 1 },
89  {"flt", "set float", OFFSET(flt), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 / 3 }, 0, 100, 1 },
90  {"dbl", "set double", OFFSET(dbl), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 / 3 }, 0, 100, 1 },
91  {"bool1", "set boolean value", OFFSET(bool1), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, 1 },
92  {"bool2", "set boolean value", OFFSET(bool2), AV_OPT_TYPE_BOOL, { .i64 = 1 }, -1, 1, 1 },
93  {"bool3", "set boolean value", OFFSET(bool3), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, 1 },
94  {"dict1", "set dictionary value", OFFSET(dict1), AV_OPT_TYPE_DICT, { .str = NULL}, 0, 0, 1 },
95  {"dict2", "set dictionary value", OFFSET(dict2), AV_OPT_TYPE_DICT, { .str = "happy=':-)'"}, 0, 0, 1 },
96  { NULL },
97 };
98 
99 static const char *test_get_name(void *ctx)
100 {
101  return "test";
102 }
103 
104 static const AVClass test_class = {
105  .class_name = "TestContext",
106  .item_name = test_get_name,
107  .option = test_options,
108 };
109 
110 static void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
111 {
112  vfprintf(stdout, fmt, vl);
113 }
114 
115 int main(void)
116 {
117  int i;
118 
121 
122  printf("Testing default values\n");
123  {
124  TestContext test_ctx = { 0 };
125  test_ctx.class = &test_class;
126  av_opt_set_defaults(&test_ctx);
127 
128  printf("num=%d\n", test_ctx.num);
129  printf("toggle=%d\n", test_ctx.toggle);
130  printf("string=%s\n", test_ctx.string);
131  printf("escape=%s\n", test_ctx.escape);
132  printf("flags=%d\n", test_ctx.flags);
133  printf("rational=%d/%d\n", test_ctx.rational.num, test_ctx.rational.den);
134  printf("video_rate=%d/%d\n", test_ctx.video_rate.num, test_ctx.video_rate.den);
135  printf("width=%d height=%d\n", test_ctx.w, test_ctx.h);
136  printf("pix_fmt=%s\n", av_get_pix_fmt_name(test_ctx.pix_fmt));
137  printf("sample_fmt=%s\n", av_get_sample_fmt_name(test_ctx.sample_fmt));
138  printf("duration=%"PRId64"\n", test_ctx.duration);
139  printf("color=%d %d %d %d\n", test_ctx.color[0], test_ctx.color[1], test_ctx.color[2], test_ctx.color[3]);
140  printf("channel_layout=%"PRId64"=%"PRId64"\n", test_ctx.channel_layout, (int64_t)AV_CH_LAYOUT_HEXAGONAL);
141  if (test_ctx.binary)
142  printf("binary=%x %x %x %x\n", ((uint8_t*)test_ctx.binary)[0], ((uint8_t*)test_ctx.binary)[1], ((uint8_t*)test_ctx.binary)[2], ((uint8_t*)test_ctx.binary)[3]);
143  printf("binary_size=%d\n", test_ctx.binary_size);
144  printf("num64=%"PRId64"\n", test_ctx.num64);
145  printf("flt=%.6f\n", test_ctx.flt);
146  printf("dbl=%.6f\n", test_ctx.dbl);
147 
148  av_opt_show2(&test_ctx, NULL, -1, 0);
149 
150  av_opt_free(&test_ctx);
151  }
152 
153  printf("\nTesting av_opt_is_set_to_default()\n");
154  {
155  int ret;
156  TestContext test_ctx = { 0 };
157  const AVOption *o = NULL;
158  test_ctx.class = &test_class;
159 
161 
162  while (o = av_opt_next(&test_ctx, o)) {
163  ret = av_opt_is_set_to_default_by_name(&test_ctx, o->name, 0);
164  printf("name:%10s default:%d error:%s\n", o->name, !!ret, ret < 0 ? av_err2str(ret) : "");
165  }
166  av_opt_set_defaults(&test_ctx);
167  while (o = av_opt_next(&test_ctx, o)) {
168  ret = av_opt_is_set_to_default_by_name(&test_ctx, o->name, 0);
169  printf("name:%10s default:%d error:%s\n", o->name, !!ret, ret < 0 ? av_err2str(ret) : "");
170  }
171  av_opt_free(&test_ctx);
172  }
173 
174  printf("\nTesting av_opt_get/av_opt_set()\n");
175  {
176  TestContext test_ctx = { 0 };
177  TestContext test2_ctx = { 0 };
178  const AVOption *o = NULL;
179  test_ctx.class = &test_class;
180  test2_ctx.class = &test_class;
181 
183 
184  av_opt_set_defaults(&test_ctx);
185 
186  while (o = av_opt_next(&test_ctx, o)) {
187  char *value1 = NULL;
188  char *value2 = NULL;
189  int ret1 = AVERROR_BUG;
190  int ret2 = AVERROR_BUG;
191  int ret3 = AVERROR_BUG;
192 
193  if (o->type == AV_OPT_TYPE_CONST)
194  continue;
195 
196  ret1 = av_opt_get(&test_ctx, o->name, 0, (uint8_t **)&value1);
197  if (ret1 >= 0) {
198  ret2 = av_opt_set(&test2_ctx, o->name, value1, 0);
199  if (ret2 >= 0)
200  ret3 = av_opt_get(&test2_ctx, o->name, 0, (uint8_t **)&value2);
201  }
202 
203  printf("name: %-11s get: %-16s set: %-16s get: %-16s %s\n", o->name,
204  ret1 >= 0 ? value1 : av_err2str(ret1),
205  ret2 >= 0 ? "OK" : av_err2str(ret2),
206  ret3 >= 0 ? value2 : av_err2str(ret3),
207  ret1 >= 0 && ret2 >= 0 && ret3 >= 0 && !strcmp(value1, value2) ? "OK" : "Mismatch");
208  av_free(value1);
209  av_free(value2);
210  }
211  av_opt_free(&test_ctx);
212  av_opt_free(&test2_ctx);
213  }
214 
215  printf("\nTest av_opt_serialize()\n");
216  {
217  TestContext test_ctx = { 0 };
218  char *buf;
219  test_ctx.class = &test_class;
220 
222 
223  av_opt_set_defaults(&test_ctx);
224  if (av_opt_serialize(&test_ctx, 0, 0, &buf, '=', ',') >= 0) {
225  printf("%s\n", buf);
226  av_opt_free(&test_ctx);
227  memset(&test_ctx, 0, sizeof(test_ctx));
228  test_ctx.class = &test_class;
229  av_set_options_string(&test_ctx, buf, "=", ",");
230  av_free(buf);
231  if (av_opt_serialize(&test_ctx, 0, 0, &buf, '=', ',') >= 0) {
232  printf("%s\n", buf);
233  av_free(buf);
234  }
235  }
236  av_opt_free(&test_ctx);
237  }
238 
239  printf("\nTesting av_set_options_string()\n");
240  {
241  TestContext test_ctx = { 0 };
242  static const char * const options[] = {
243  "",
244  ":",
245  "=",
246  "foo=:",
247  ":=foo",
248  "=foo",
249  "foo=",
250  "foo",
251  "foo=val",
252  "foo==val",
253  "toggle=:",
254  "string=:",
255  "toggle=1 : foo",
256  "toggle=100",
257  "toggle==1",
258  "flags=+mu-lame : num=42: toggle=0",
259  "num=42 : string=blahblah",
260  "rational=0 : rational=1/2 : rational=1/-1",
261  "rational=-1/0",
262  "size=1024x768",
263  "size=pal",
264  "size=bogus",
265  "pix_fmt=yuv420p",
266  "pix_fmt=2",
267  "pix_fmt=bogus",
268  "sample_fmt=s16",
269  "sample_fmt=2",
270  "sample_fmt=bogus",
271  "video_rate=pal",
272  "video_rate=25",
273  "video_rate=30000/1001",
274  "video_rate=30/1.001",
275  "video_rate=bogus",
276  "duration=bogus",
277  "duration=123.45",
278  "duration=1\\:23\\:45.67",
279  "color=blue",
280  "color=0x223300",
281  "color=0x42FF07AA",
282  "cl=stereo+downmix",
283  "cl=foo",
284  "bin=boguss",
285  "bin=111",
286  "bin=ffff",
287  "num64=bogus",
288  "num64=44",
289  "num64=44.4",
290  "num64=-1",
291  "num64=101",
292  "flt=bogus",
293  "flt=2",
294  "flt=2.2",
295  "flt=-1",
296  "flt=101",
297  "dbl=bogus",
298  "dbl=2",
299  "dbl=2.2",
300  "dbl=-1",
301  "dbl=101",
302  "bool1=true",
303  "bool2=auto",
304  "dict1='happy=\\:-):sad=\\:-('",
305  };
306 
307  test_ctx.class = &test_class;
308  av_opt_set_defaults(&test_ctx);
309 
311 
312  for (i=0; i < FF_ARRAY_ELEMS(options); i++) {
313  int silence_log = !strcmp(options[i], "rational=-1/0"); // inf formating differs between platforms
314  av_log(&test_ctx, AV_LOG_DEBUG, "Setting options string '%s'\n", options[i]);
315  if (silence_log)
317  if (av_set_options_string(&test_ctx, options[i], "=", ":") < 0)
318  printf("Error '%s'\n", options[i]);
319  else
320  printf("OK '%s'\n", options[i]);
322  }
323  av_opt_free(&test_ctx);
324  }
325 
326  printf("\nTesting av_opt_set_from_string()\n");
327  {
328  TestContext test_ctx = { 0 };
329  static const char * const options[] = {
330  "",
331  "5",
332  "5:hello",
333  "5:hello:size=pal",
334  "5:size=pal:hello",
335  ":",
336  "=",
337  " 5 : hello : size = pal ",
338  "a_very_long_option_name_that_will_need_to_be_ellipsized_around_here=42"
339  };
340  static const char * const shorthand[] = { "num", "string", NULL };
341 
342  test_ctx.class = &test_class;
343  av_opt_set_defaults(&test_ctx);
344 
346 
347  for (i=0; i < FF_ARRAY_ELEMS(options); i++) {
348  av_log(&test_ctx, AV_LOG_DEBUG, "Setting options string '%s'\n", options[i]);
349  if (av_opt_set_from_string(&test_ctx, options[i], shorthand, "=", ":") < 0)
350  printf("Error '%s'\n", options[i]);
351  else
352  printf("OK '%s'\n", options[i]);
353  }
354  av_opt_free(&test_ctx);
355  }
356 
357  return 0;
358 }
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
level
uint8_t level
Definition: svq3.c:209
opt.h
TestContext::video_rate
AVRational video_rate
Definition: opt.c:38
AV_OPT_TYPE_SAMPLE_FMT
@ AV_OPT_TYPE_SAMPLE_FMT
Definition: opt.h:235
av_opt_set_defaults
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
Definition: opt.c:1357
color
Definition: vf_paletteuse.c:588
AV_LOG_QUIET
#define AV_LOG_QUIET
Print no output.
Definition: log.h:158
TestContext::color
uint8_t color[4]
Definition: opt.c:43
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
Definition: opt.h:236
rational.h
pixdesc.h
TestContext::binary_size
int binary_size
Definition: opt.c:46
av_opt_is_set_to_default_by_name
int av_opt_is_set_to_default_by_name(void *obj, const char *name, int search_flags)
Check if given option is set to its default value.
Definition: opt.c:2048
AV_CH_LAYOUT_HEXAGONAL
#define AV_CH_LAYOUT_HEXAGONAL
Definition: channel_layout.h:101
AVOption
AVOption.
Definition: opt.h:246
test_get_name
static const char * test_get_name(void *ctx)
Definition: opt.c:99
main
int main(void)
Definition: opt.c:115
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Definition: opt.h:237
TEST_FLAG_LAME
#define TEST_FLAG_LAME
Definition: opt.c:65
TestContext::string
char * string
Definition: opt.c:35
AVDictionary
Definition: dict.c:30
AV_OPT_TYPE_RATIONAL
@ AV_OPT_TYPE_RATIONAL
Definition: opt.h:228
TestContext::toggle
int toggle
Definition: opt.c:34
TestContext::num64
int64_t num64
Definition: opt.c:51
av_set_options_string
int av_set_options_string(void *ctx, const char *opts, const char *key_val_sep, const char *pairs_sep)
Parse the key/value pairs list in opts.
Definition: opt.c:1478
TestContext::binary_size2
int binary_size2
Definition: opt.c:50
AV_OPT_TYPE_BINARY
@ AV_OPT_TYPE_BINARY
offset must point to a pointer immediately followed by an int for the length
Definition: opt.h:229
TestContext::duration
int64_t duration
Definition: opt.c:42
TestContext::flags
int flags
Definition: opt.c:36
av_opt_set
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
Definition: opt.c:465
AVRational::num
int num
Numerator.
Definition: rational.h:59
TestContext::dbl
double dbl
Definition: opt.c:53
TestContext::binary
void * binary
Definition: opt.c:45
TestContext::class
const AVClass * class
Definition: opt.c:32
duration
int64_t duration
Definition: movenc.c:63
TestContext::h
int h
Definition: opt.c:39
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:225
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:224
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:197
ctx
AVFormatContext * ctx
Definition: movenc.c:48
limits.h
pix_fmt
static enum AVPixelFormat pix_fmt
Definition: demuxing_decoding.c:40
av_get_sample_fmt_name
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
Definition: samplefmt.c:49
TestContext::bool1
int bool1
Definition: opt.c:55
TestContext::bool2
int bool2
Definition: opt.c:56
TestContext
Definition: opt.c:31
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
NULL
#define NULL
Definition: coverity.c:32
TEST_FLAG_COOL
#define TEST_FLAG_COOL
Definition: opt.c:64
TestContext::num
int num
Definition: opt.c:33
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AV_OPT_TYPE_COLOR
@ AV_OPT_TYPE_COLOR
Definition: opt.h:238
av_opt_set_from_string
int av_opt_set_from_string(void *ctx, const char *opts, const char *const *shorthand, const char *key_val_sep, const char *pairs_sep)
Parse the key-value pairs list in opts.
Definition: opt.c:1558
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
Definition: opt.h:233
AV_OPT_TYPE_DICT
@ AV_OPT_TYPE_DICT
Definition: opt.h:230
TestContext::pix_fmt
enum AVPixelFormat pix_fmt
Definition: opt.c:40
av_opt_free
void av_opt_free(void *obj)
Free all allocated objects in obj.
Definition: opt.c:1610
TestContext::flt
float flt
Definition: opt.c:52
TestContext::w
int w
Definition: opt.c:39
TestContext::binary2
void * binary2
Definition: opt.c:49
TestContext::rational
AVRational rational
Definition: opt.c:37
error.h
options
const OptionDef options[]
av_log_set_callback
void av_log_set_callback(void(*callback)(void *, int, const char *, va_list))
Set the logging callback.
Definition: log.c:455
av_err2str
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
Definition: error.h:119
OFFSET
#define OFFSET(x)
Definition: opt.c:62
TestContext::dict2
AVDictionary * dict2
Definition: opt.c:59
TEST_FLAG_MU
#define TEST_FLAG_MU
Definition: opt.c:66
printf
printf("static const uint8_t my_array[100] = {\n")
AVOption::name
const char * name
Definition: opt.h:247
AV_OPT_TYPE_CHANNEL_LAYOUT
@ AV_OPT_TYPE_CHANNEL_LAYOUT
Definition: opt.h:239
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:226
TestContext::escape
char * escape
Definition: opt.c:54
av_log_set_level
void av_log_set_level(int level)
Set the log level.
Definition: log.c:440
log.h
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
TestContext::binary_size1
int binary_size1
Definition: opt.c:48
common.h
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
uint8_t
uint8_t
Definition: audio_convert.c:194
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:61
av_opt_next
const AVOption * av_opt_next(const void *obj, const AVOption *last)
Iterate over all AVOptions belonging to obj.
Definition: opt.c:45
ret
ret
Definition: filter_design.txt:187
AV_PIX_FMT_0BGR
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition: pixfmt.h:239
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:72
w
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
Definition: fate.txt:150
AVOption::type
enum AVOptionType type
Definition: opt.h:260
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen_template.c:38
channel_layout.h
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
log_callback_help
static void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
Definition: opt.c:110
AV_OPT_TYPE_PIXEL_FMT
@ AV_OPT_TYPE_PIXEL_FMT
Definition: opt.h:234
av_opt_serialize
int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer, const char key_val_sep, const char pairs_sep)
Serialize object's options.
Definition: opt.c:2060
mem.h
test_class
static const AVClass test_class
Definition: opt.c:104
av_free
#define av_free(p)
Definition: tableprint_vlc.h:34
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:240
TestContext::binary1
void * binary1
Definition: opt.c:47
TestContext::dict1
AVDictionary * dict1
Definition: opt.c:58
TestContext::bool3
int bool3
Definition: opt.c:57
AV_OPT_TYPE_FLAGS
@ AV_OPT_TYPE_FLAGS
Definition: opt.h:222
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:564
AVERROR_BUG
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Definition: error.h:50
av_opt_get
int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
Definition: opt.c:779
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
TestContext::channel_layout
int64_t channel_layout
Definition: opt.c:44
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:227
av_opt_show2
int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags)
Show the obj options.
Definition: opt.c:1345
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:232
test_options
static const AVOption test_options[]
Definition: opt.c:68
TestContext::sample_fmt
enum AVSampleFormat sample_fmt
Definition: opt.c:41
av_get_pix_fmt_name
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
Definition: pixdesc.c:2465