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
9a829a2b
Commit
9a829a2b
authored
Jul 18, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_blend: unbreak tblend
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
5c7f7086
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
39 deletions
+29
-39
vf_blend.c
libavfilter/vf_blend.c
+29
-39
No files found.
libavfilter/vf_blend.c
View file @
9a829a2b
...
...
@@ -423,35 +423,36 @@ static av_cold void uninit(AVFilterContext *ctx)
av_expr_free
(
b
->
params
[
i
].
e
);
}
#if CONFIG_BLEND_FILTER
static
int
config_output
(
AVFilterLink
*
outlink
)
{
AVFilterContext
*
ctx
=
outlink
->
src
;
AVFilterLink
*
toplink
=
ctx
->
inputs
[
TOP
];
AVFilterLink
*
bottomlink
=
ctx
->
inputs
[
BOTTOM
];
BlendContext
*
b
=
ctx
->
priv
;
const
AVPixFmtDescriptor
*
pix_desc
=
av_pix_fmt_desc_get
(
toplink
->
format
);
int
ret
,
plane
,
is_16bit
;
if
(
toplink
->
format
!=
bottomlink
->
format
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"inputs must be of same pixel format
\n
"
);
return
AVERROR
(
EINVAL
);
}
if
(
toplink
->
w
!=
bottomlink
->
w
||
toplink
->
h
!=
bottomlink
->
h
||
toplink
->
sample_aspect_ratio
.
num
!=
bottomlink
->
sample_aspect_ratio
.
num
||
toplink
->
sample_aspect_ratio
.
den
!=
bottomlink
->
sample_aspect_ratio
.
den
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"First input link %s parameters "
"(size %dx%d, SAR %d:%d) do not match the corresponding "
"second input link %s parameters (%dx%d, SAR %d:%d)
\n
"
,
ctx
->
input_pads
[
TOP
].
name
,
toplink
->
w
,
toplink
->
h
,
toplink
->
sample_aspect_ratio
.
num
,
toplink
->
sample_aspect_ratio
.
den
,
ctx
->
input_pads
[
BOTTOM
].
name
,
bottomlink
->
w
,
bottomlink
->
h
,
bottomlink
->
sample_aspect_ratio
.
num
,
bottomlink
->
sample_aspect_ratio
.
den
);
return
AVERROR
(
EINVAL
);
if
(
!
b
->
tblend
)
{
AVFilterLink
*
bottomlink
=
ctx
->
inputs
[
BOTTOM
];
if
(
toplink
->
format
!=
bottomlink
->
format
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"inputs must be of same pixel format
\n
"
);
return
AVERROR
(
EINVAL
);
}
if
(
toplink
->
w
!=
bottomlink
->
w
||
toplink
->
h
!=
bottomlink
->
h
||
toplink
->
sample_aspect_ratio
.
num
!=
bottomlink
->
sample_aspect_ratio
.
num
||
toplink
->
sample_aspect_ratio
.
den
!=
bottomlink
->
sample_aspect_ratio
.
den
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"First input link %s parameters "
"(size %dx%d, SAR %d:%d) do not match the corresponding "
"second input link %s parameters (%dx%d, SAR %d:%d)
\n
"
,
ctx
->
input_pads
[
TOP
].
name
,
toplink
->
w
,
toplink
->
h
,
toplink
->
sample_aspect_ratio
.
num
,
toplink
->
sample_aspect_ratio
.
den
,
ctx
->
input_pads
[
BOTTOM
].
name
,
bottomlink
->
w
,
bottomlink
->
h
,
bottomlink
->
sample_aspect_ratio
.
num
,
bottomlink
->
sample_aspect_ratio
.
den
);
return
AVERROR
(
EINVAL
);
}
}
outlink
->
w
=
toplink
->
w
;
...
...
@@ -466,8 +467,10 @@ static int config_output(AVFilterLink *outlink)
is_16bit
=
pix_desc
->
comp
[
0
].
depth_minus1
==
15
;
b
->
nb_planes
=
av_pix_fmt_count_planes
(
toplink
->
format
);
if
((
ret
=
ff_dualinput_init
(
ctx
,
&
b
->
dinput
))
<
0
)
return
ret
;
if
(
b
->
tblend
)
outlink
->
flags
|=
FF_LINK_FLAG_REQUEST_LOOP
;
else
if
((
ret
=
ff_dualinput_init
(
ctx
,
&
b
->
dinput
))
<
0
)
return
ret
;
for
(
plane
=
0
;
plane
<
FF_ARRAY_ELEMS
(
b
->
params
);
plane
++
)
{
FilterParams
*
param
=
&
b
->
params
[
plane
];
...
...
@@ -525,6 +528,8 @@ static int config_output(AVFilterLink *outlink)
return
0
;
}
#if CONFIG_BLEND_FILTER
static
int
request_frame
(
AVFilterLink
*
outlink
)
{
BlendContext
*
b
=
outlink
->
src
->
priv
;
...
...
@@ -577,21 +582,6 @@ AVFilter ff_vf_blend = {
#if CONFIG_TBLEND_FILTER
static
int
tblend_config_output
(
AVFilterLink
*
outlink
)
{
AVFilterContext
*
ctx
=
outlink
->
src
;
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
BlendContext
*
b
=
ctx
->
priv
;
const
AVPixFmtDescriptor
*
pix_desc
=
av_pix_fmt_desc_get
(
inlink
->
format
);
b
->
hsub
=
pix_desc
->
log2_chroma_w
;
b
->
vsub
=
pix_desc
->
log2_chroma_h
;
b
->
nb_planes
=
av_pix_fmt_count_planes
(
inlink
->
format
);
outlink
->
flags
|=
FF_LINK_FLAG_REQUEST_LOOP
;
return
0
;
}
static
int
tblend_filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
frame
)
{
BlendContext
*
b
=
inlink
->
dst
->
priv
;
...
...
@@ -627,7 +617,7 @@ static const AVFilterPad tblend_outputs[] = {
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
config_props
=
tblend_
config_output
,
.
config_props
=
config_output
,
},
{
NULL
}
};
...
...
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