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
d3f236b3
Commit
d3f236b3
authored
May 30, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avilter/avf_showwaves: switch to activate in showwaves filter
parent
ff2a638c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
avf_showwaves.c
libavfilter/avf_showwaves.c
+27
-3
No files found.
libavfilter/avf_showwaves.c
View file @
d3f236b3
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include "libavutil/opt.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/parseutils.h"
#include "avfilter.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "formats.h"
#include "audio.h"
#include "audio.h"
#include "video.h"
#include "video.h"
...
@@ -706,7 +707,8 @@ static int showwaves_filter_frame(AVFilterLink *inlink, AVFrame *insamples)
...
@@ -706,7 +707,8 @@ static int showwaves_filter_frame(AVFilterLink *inlink, AVFrame *insamples)
showwaves
->
sample_count_mod
=
0
;
showwaves
->
sample_count_mod
=
0
;
showwaves
->
buf_idx
++
;
showwaves
->
buf_idx
++
;
}
}
if
(
showwaves
->
buf_idx
==
showwaves
->
w
)
if
(
showwaves
->
buf_idx
==
showwaves
->
w
||
(
ff_outlink_get_status
(
inlink
)
&&
i
==
nb_samples
-
1
))
if
((
ret
=
push_frame
(
outlink
))
<
0
)
if
((
ret
=
push_frame
(
outlink
))
<
0
)
break
;
break
;
outpicref
=
showwaves
->
outpicref
;
outpicref
=
showwaves
->
outpicref
;
...
@@ -717,11 +719,33 @@ end:
...
@@ -717,11 +719,33 @@ end:
return
ret
;
return
ret
;
}
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
ShowWavesContext
*
showwaves
=
ctx
->
priv
;
AVFrame
*
in
;
const
int
nb_samples
=
showwaves
->
n
*
outlink
->
w
;
int
ret
;
FF_FILTER_FORWARD_STATUS_BACK
(
outlink
,
inlink
);
ret
=
ff_inlink_consume_samples
(
inlink
,
nb_samples
,
nb_samples
,
&
in
);
if
(
ret
<
0
)
return
ret
;
if
(
ret
>
0
)
return
showwaves_filter_frame
(
inlink
,
in
);
FF_FILTER_FORWARD_STATUS
(
inlink
,
outlink
);
FF_FILTER_FORWARD_WANTED
(
outlink
,
inlink
);
return
FFERROR_NOT_READY
;
}
static
const
AVFilterPad
showwaves_inputs
[]
=
{
static
const
AVFilterPad
showwaves_inputs
[]
=
{
{
{
.
name
=
"default"
,
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
filter_frame
=
showwaves_filter_frame
,
},
},
{
NULL
}
{
NULL
}
};
};
...
@@ -731,7 +755,6 @@ static const AVFilterPad showwaves_outputs[] = {
...
@@ -731,7 +755,6 @@ static const AVFilterPad showwaves_outputs[] = {
.
name
=
"default"
,
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
config_props
=
config_output
,
.
config_props
=
config_output
,
.
request_frame
=
request_frame
,
},
},
{
NULL
}
{
NULL
}
};
};
...
@@ -744,6 +767,7 @@ AVFilter ff_avf_showwaves = {
...
@@ -744,6 +767,7 @@ AVFilter ff_avf_showwaves = {
.
query_formats
=
query_formats
,
.
query_formats
=
query_formats
,
.
priv_size
=
sizeof
(
ShowWavesContext
),
.
priv_size
=
sizeof
(
ShowWavesContext
),
.
inputs
=
showwaves_inputs
,
.
inputs
=
showwaves_inputs
,
.
activate
=
activate
,
.
outputs
=
showwaves_outputs
,
.
outputs
=
showwaves_outputs
,
.
priv_class
=
&
showwaves_class
,
.
priv_class
=
&
showwaves_class
,
};
};
...
...
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