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
293489d8
Commit
293489d8
authored
May 27, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_superequalizer: switch to activate
parent
3da8d04c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
af_superequalizer.c
libavfilter/af_superequalizer.c
+25
-6
No files found.
libavfilter/af_superequalizer.c
View file @
293489d8
...
...
@@ -25,6 +25,7 @@
#include "audio.h"
#include "avfilter.h"
#include "filters.h"
#include "internal.h"
#define NBANDS 17
...
...
@@ -203,7 +204,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
dst
=
(
float
*
)
s
->
out
->
extended_data
[
ch
];
src
=
(
float
*
)
in
->
extended_data
[
ch
];
for
(
i
=
0
;
i
<
s
->
winlen
;
i
++
)
for
(
i
=
0
;
i
<
in
->
nb_samples
;
i
++
)
fsamples
[
i
]
=
src
[
i
];
for
(;
i
<
s
->
tabsize
;
i
++
)
fsamples
[
i
]
=
0
;
...
...
@@ -240,6 +241,28 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return
ff_filter_frame
(
outlink
,
out
);
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
SuperEqualizerContext
*
s
=
ctx
->
priv
;
AVFrame
*
in
=
NULL
;
int
ret
;
FF_FILTER_FORWARD_STATUS_BACK
(
outlink
,
inlink
);
ret
=
ff_inlink_consume_samples
(
inlink
,
s
->
winlen
,
s
->
winlen
,
&
in
);
if
(
ret
<
0
)
return
ret
;
if
(
ret
>
0
)
return
filter_frame
(
inlink
,
in
);
FF_FILTER_FORWARD_STATUS
(
inlink
,
outlink
);
FF_FILTER_FORWARD_WANTED
(
outlink
,
inlink
);
return
FFERROR_NOT_READY
;
}
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
{
SuperEqualizerContext
*
s
=
ctx
->
priv
;
...
...
@@ -277,10 +300,6 @@ static int config_input(AVFilterLink *inlink)
AVFilterContext
*
ctx
=
inlink
->
dst
;
SuperEqualizerContext
*
s
=
ctx
->
priv
;
inlink
->
partial_buf_size
=
inlink
->
min_samples
=
inlink
->
max_samples
=
s
->
winlen
;
s
->
out
=
ff_get_audio_buffer
(
inlink
,
s
->
tabsize
);
if
(
!
s
->
out
)
return
AVERROR
(
ENOMEM
);
...
...
@@ -314,7 +333,6 @@ static const AVFilterPad superequalizer_inputs[] = {
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
filter_frame
=
filter_frame
,
.
config_props
=
config_input
,
},
{
NULL
}
...
...
@@ -363,6 +381,7 @@ AVFilter ff_af_superequalizer = {
.
priv_class
=
&
superequalizer_class
,
.
query_formats
=
query_formats
,
.
init
=
init
,
.
activate
=
activate
,
.
uninit
=
uninit
,
.
inputs
=
superequalizer_inputs
,
.
outputs
=
superequalizer_outputs
,
...
...
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