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
21b1f08e
Commit
21b1f08e
authored
Apr 29, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/avf_avectorscope: switch to activate
parent
77aacdb0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
avf_avectorscope.c
libavfilter/avf_avectorscope.c
+26
-6
No files found.
libavfilter/avf_avectorscope.c
View file @
21b1f08e
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,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"
...
@@ -69,6 +70,7 @@ typedef struct AudioVectorScopeContext {
...
@@ -69,6 +70,7 @@ typedef struct AudioVectorScopeContext {
int
mirror
;
int
mirror
;
unsigned
prev_x
,
prev_y
;
unsigned
prev_x
,
prev_y
;
AVRational
frame_rate
;
AVRational
frame_rate
;
int
nb_samples
;
}
AudioVectorScopeContext
;
}
AudioVectorScopeContext
;
#define OFFSET(x) offsetof(AudioVectorScopeContext, x)
#define OFFSET(x) offsetof(AudioVectorScopeContext, x)
...
@@ -208,12 +210,8 @@ static int config_input(AVFilterLink *inlink)
...
@@ -208,12 +210,8 @@ static int config_input(AVFilterLink *inlink)
{
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
AVFilterContext
*
ctx
=
inlink
->
dst
;
AudioVectorScopeContext
*
s
=
ctx
->
priv
;
AudioVectorScopeContext
*
s
=
ctx
->
priv
;
int
nb_samples
;
nb_samples
=
FFMAX
(
1024
,
((
double
)
inlink
->
sample_rate
/
av_q2d
(
s
->
frame_rate
))
+
0
.
5
);
s
->
nb_samples
=
FFMAX
(
1
,
((
double
)
inlink
->
sample_rate
/
av_q2d
(
s
->
frame_rate
))
+
0
.
5
);
inlink
->
partial_buf_size
=
inlink
->
min_samples
=
inlink
->
max_samples
=
nb_samples
;
return
0
;
return
0
;
}
}
...
@@ -365,6 +363,28 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
...
@@ -365,6 +363,28 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
return
ff_filter_frame
(
outlink
,
av_frame_clone
(
s
->
outpicref
));
return
ff_filter_frame
(
outlink
,
av_frame_clone
(
s
->
outpicref
));
}
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AudioVectorScopeContext
*
s
=
ctx
->
priv
;
AVFrame
*
in
;
int
ret
;
FF_FILTER_FORWARD_STATUS_BACK
(
outlink
,
inlink
);
ret
=
ff_inlink_consume_samples
(
inlink
,
s
->
nb_samples
,
s
->
nb_samples
,
&
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
void
uninit
(
AVFilterContext
*
ctx
)
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
{
AudioVectorScopeContext
*
s
=
ctx
->
priv
;
AudioVectorScopeContext
*
s
=
ctx
->
priv
;
...
@@ -377,7 +397,6 @@ static const AVFilterPad audiovectorscope_inputs[] = {
...
@@ -377,7 +397,6 @@ static const AVFilterPad audiovectorscope_inputs[] = {
.
name
=
"default"
,
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
config_props
=
config_input
,
.
config_props
=
config_input
,
.
filter_frame
=
filter_frame
,
},
},
{
NULL
}
{
NULL
}
};
};
...
@@ -397,6 +416,7 @@ AVFilter ff_avf_avectorscope = {
...
@@ -397,6 +416,7 @@ AVFilter ff_avf_avectorscope = {
.
uninit
=
uninit
,
.
uninit
=
uninit
,
.
query_formats
=
query_formats
,
.
query_formats
=
query_formats
,
.
priv_size
=
sizeof
(
AudioVectorScopeContext
),
.
priv_size
=
sizeof
(
AudioVectorScopeContext
),
.
activate
=
activate
,
.
inputs
=
audiovectorscope_inputs
,
.
inputs
=
audiovectorscope_inputs
,
.
outputs
=
audiovectorscope_outputs
,
.
outputs
=
audiovectorscope_outputs
,
.
priv_class
=
&
avectorscope_class
,
.
priv_class
=
&
avectorscope_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