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
97aa5546
Commit
97aa5546
authored
Dec 23, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/volume: implement process_command() callback, with the volume command
Address trac ticket #2868.
parent
7619a87c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
2 deletions
+32
-2
filters.texi
doc/filters.texi
+14
-1
af_volume.c
libavfilter/af_volume.c
+17
-0
version.h
libavfilter/version.h
+1
-1
No files found.
doc/filters.texi
View file @
97aa5546
...
...
@@ -1828,7 +1828,8 @@ Set when the volume expression is evaluated.
It accepts the following values:
@table @samp
@item once
only evaluate expression once during the filter initialization
only evaluate expression once during the filter initialization, or
when the @samp{volume} command is sent
@item frame
evaluate expression for each incoming frame
...
...
@@ -1870,6 +1871,18 @@ Note that when @option{eval} is set to @samp{once} only the
@var{sample_rate} and @var{tb} variables are available, all other
variables will evaluate to NAN.
@subsection Commands
This filter supports the following commands:
@table @option
@item volume
Modify the volume expression.
The command accepts the same syntax of the corresponding option.
If the specified expression is not valid, it is kept at its current
value.
@end table
@subsection Examples
@itemize
...
...
libavfilter/af_volume.c
View file @
97aa5546
...
...
@@ -296,6 +296,22 @@ static int config_output(AVFilterLink *outlink)
return
set_volume
(
ctx
);
}
static
int
process_command
(
AVFilterContext
*
ctx
,
const
char
*
cmd
,
const
char
*
args
,
char
*
res
,
int
res_len
,
int
flags
)
{
VolumeContext
*
vol
=
ctx
->
priv
;
int
ret
=
AVERROR
(
ENOSYS
);
if
(
!
strcmp
(
cmd
,
"volume"
))
{
if
((
ret
=
set_expr
(
&
vol
->
volume_pexpr
,
args
,
ctx
))
<
0
)
return
ret
;
if
(
vol
->
eval_mode
==
EVAL_MODE_ONCE
)
set_volume
(
ctx
);
}
return
ret
;
}
#define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
#define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)*av_q2d(tb))
...
...
@@ -403,4 +419,5 @@ AVFilter ff_af_volume = {
.
inputs
=
avfilter_af_volume_inputs
,
.
outputs
=
avfilter_af_volume_outputs
,
.
flags
=
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
,
.
process_command
=
process_command
,
};
libavfilter/version.h
View file @
97aa5546
...
...
@@ -31,7 +31,7 @@
#define LIBAVFILTER_VERSION_MAJOR 4
#define LIBAVFILTER_VERSION_MINOR 0
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_MICRO 10
2
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
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