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
4152413d
Commit
4152413d
authored
Mar 31, 2018
by
Martin Vignali
Committed by
Paul B Mahol
Apr 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/showvolume : move clear picture part to a func
and use it if fade == 0.
parent
a1b91b0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
avf_showvolume.c
libavfilter/avf_showvolume.c
+16
-10
No files found.
libavfilter/avf_showvolume.c
View file @
4152413d
...
...
@@ -245,13 +245,24 @@ static void drawtext(AVFrame *pic, int x, int y, const char *txt, int o)
}
}
static
void
clear_picture
(
ShowVolumeContext
*
s
,
AVFilterLink
*
outlink
)
{
int
i
,
j
;
const
uint32_t
bg
=
(
uint32_t
)(
s
->
bgopacity
*
255
)
<<
24
;
for
(
i
=
0
;
i
<
outlink
->
h
;
i
++
)
{
uint32_t
*
dst
=
(
uint32_t
*
)(
s
->
out
->
data
[
0
]
+
i
*
s
->
out
->
linesize
[
0
]);
for
(
j
=
0
;
j
<
outlink
->
w
;
j
++
)
AV_WN32A
(
dst
+
j
,
bg
);
}
}
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
insamples
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
ShowVolumeContext
*
s
=
ctx
->
priv
;
const
int
step
=
s
->
step
;
int
c
,
i
,
j
,
k
;
int
c
,
j
,
k
;
AVFrame
*
out
;
if
(
!
s
->
out
||
s
->
out
->
width
!=
outlink
->
w
||
...
...
@@ -262,18 +273,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
av_frame_free
(
&
insamples
);
return
AVERROR
(
ENOMEM
);
}
for
(
i
=
0
;
i
<
outlink
->
h
;
i
++
)
{
uint32_t
*
dst
=
(
uint32_t
*
)(
s
->
out
->
data
[
0
]
+
i
*
s
->
out
->
linesize
[
0
]);
const
uint32_t
bg
=
(
uint32_t
)(
s
->
bgopacity
*
255
)
<<
24
;
for
(
j
=
0
;
j
<
outlink
->
w
;
j
++
)
AV_WN32A
(
dst
+
j
,
bg
);
}
clear_picture
(
s
,
outlink
);
}
s
->
out
->
pts
=
insamples
->
pts
;
if
(
s
->
f
<
1
.
)
{
if
(
(
s
->
f
<
1
.)
&&
(
s
->
f
>
0
.)
)
{
for
(
j
=
0
;
j
<
outlink
->
h
;
j
++
)
{
uint8_t
*
dst
=
s
->
out
->
data
[
0
]
+
j
*
s
->
out
->
linesize
[
0
];
const
uint32_t
alpha
=
s
->
bgopacity
*
255
;
...
...
@@ -285,6 +289,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
dst
[
k
*
4
+
3
]
=
FFMAX
(
dst
[
k
*
4
+
3
]
*
s
->
f
,
alpha
);
}
}
}
else
if
(
s
->
f
==
0
.)
{
clear_picture
(
s
,
outlink
);
}
if
(
s
->
orientation
)
{
/* vertical */
...
...
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