46 #define REASONABLE_SIZE 1024
48 #define OFFSET(x) offsetof(TileContext, x)
49 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
53 {.str =
"6x5"}, 0, 0,
FLAGS },
54 {
"margin",
"set outer border margin in pixels",
OFFSET(margin),
56 {
"padding",
"set inner border thickness in pixels",
OFFSET(padding),
58 {
"nb_frames",
"set maximum number of frame to render",
OFFSET(nb_frames),
68 static const char *shorthand[] = {
"layout",
"nb_frames",
"margin",
"padding",
NULL };
71 tile->
class = &tile_class;
87 tile->
w, tile->
h, tile->
w * tile->
h);
105 const unsigned total_margin_w = (tile->
w - 1) * tile->
padding + 2*tile->
margin;
106 const unsigned total_margin_h = (tile->
h - 1) * tile->
padding + 2*tile->
margin;
108 if (inlink->
w > (INT_MAX - total_margin_w) / tile->
w) {
113 if (inlink->
h > (INT_MAX - total_margin_h) / tile->
h) {
118 outlink->
w = tile->
w * inlink->
w + total_margin_w;
119 outlink->
h = tile->
h * inlink->
h + total_margin_h;
134 const unsigned tx = tile->
current % tile->
w;
135 const unsigned ty = tile->
current / tile->
w;
150 x0, y0, inlink->
w, inlink->
h);
180 outlink->
w, outlink->
h);
192 0, 0, outlink->
w, outlink->
h);
199 x0, y0, 0, 0, inlink->
w, inlink->
h);
256 .priv_class = &tile_class,