Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2cfc8b17
Commit
2cfc8b17
authored
Nov 17, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_tile: add init_padding option
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
e01d2c00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
filters.texi
doc/filters.texi
+5
-0
vf_tile.c
libavfilter/vf_tile.c
+11
-1
No files found.
doc/filters.texi
View file @
2cfc8b17
...
@@ -14637,6 +14637,11 @@ is "black".
...
@@ -14637,6 +14637,11 @@ is "black".
@item overlap
@item overlap
Set the number of frames to overlap when tiling several successive frames together.
Set the number of frames to overlap when tiling several successive frames together.
The value must be between @code{0} and @var{nb_frames - 1}.
The value must be between @code{0} and @var{nb_frames - 1}.
@item init_padding
Set the number of frames to initially be empty before displaying first output frame.
This controls how soon will one get first output frame.
The value must be between @code{0} and @var{nb_frames - 1}.
@end table
@end table
@subsection Examples
@subsection Examples
...
...
libavfilter/vf_tile.c
View file @
2cfc8b17
...
@@ -38,6 +38,7 @@ typedef struct TileContext {
...
@@ -38,6 +38,7 @@ typedef struct TileContext {
unsigned
margin
;
unsigned
margin
;
unsigned
padding
;
unsigned
padding
;
unsigned
overlap
;
unsigned
overlap
;
unsigned
init_padding
;
unsigned
current
;
unsigned
current
;
unsigned
nb_frames
;
unsigned
nb_frames
;
FFDrawContext
draw
;
FFDrawContext
draw
;
...
@@ -62,6 +63,8 @@ static const AVOption tile_options[] = {
...
@@ -62,6 +63,8 @@ static const AVOption tile_options[] = {
{
"color"
,
"set the color of the unused area"
,
OFFSET
(
rgba_color
),
AV_OPT_TYPE_COLOR
,
{.
str
=
"black"
},
.
flags
=
FLAGS
},
{
"color"
,
"set the color of the unused area"
,
OFFSET
(
rgba_color
),
AV_OPT_TYPE_COLOR
,
{.
str
=
"black"
},
.
flags
=
FLAGS
},
{
"overlap"
,
"set how many frames to overlap for each render"
,
OFFSET
(
overlap
),
{
"overlap"
,
"set how many frames to overlap for each render"
,
OFFSET
(
overlap
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
FLAGS
},
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
FLAGS
},
{
"init_padding"
,
" set how many frames to initially pad"
,
OFFSET
(
init_padding
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
FLAGS
},
{
NULL
}
{
NULL
}
};
};
...
@@ -99,6 +102,12 @@ static av_cold int init(AVFilterContext *ctx)
...
@@ -99,6 +102,12 @@ static av_cold int init(AVFilterContext *ctx)
tile
->
overlap
=
tile
->
nb_frames
-
1
;
tile
->
overlap
=
tile
->
nb_frames
-
1
;
}
}
if
(
tile
->
init_padding
>=
tile
->
nb_frames
)
{
av_log
(
ctx
,
AV_LOG_WARNING
,
"init_padding must be less than %d
\n
"
,
tile
->
nb_frames
);
}
else
{
tile
->
current
=
tile
->
init_padding
;
}
return
0
;
return
0
;
}
}
...
@@ -201,11 +210,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
...
@@ -201,11 +210,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
tile
->
out_ref
->
height
=
outlink
->
h
;
tile
->
out_ref
->
height
=
outlink
->
h
;
/* fill surface once for margin/padding */
/* fill surface once for margin/padding */
if
(
tile
->
margin
||
tile
->
padding
)
if
(
tile
->
margin
||
tile
->
padding
||
tile
->
init_padding
)
ff_fill_rectangle
(
&
tile
->
draw
,
&
tile
->
blank
,
ff_fill_rectangle
(
&
tile
->
draw
,
&
tile
->
blank
,
tile
->
out_ref
->
data
,
tile
->
out_ref
->
data
,
tile
->
out_ref
->
linesize
,
tile
->
out_ref
->
linesize
,
0
,
0
,
outlink
->
w
,
outlink
->
h
);
0
,
0
,
outlink
->
w
,
outlink
->
h
);
tile
->
init_padding
=
0
;
}
}
if
(
tile
->
prev_out_ref
)
{
if
(
tile
->
prev_out_ref
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment