Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
3c2e4c2a
Commit
3c2e4c2a
authored
Apr 11, 2013
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/showwaves: switch to an AVOptions-based system.
parent
38788f2d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
26 deletions
+11
-26
filters.texi
doc/filters.texi
+5
-3
avf_showwaves.c
libavfilter/avf_showwaves.c
+6
-22
avfilter.c
libavfilter/avfilter.c
+0
-1
No files found.
doc/filters.texi
View file @
3c2e4c2a
...
...
@@ -7140,8 +7140,12 @@ ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
Convert input audio to a video output, representing the samples waves.
The filter accepts the following named parameters:
The filter accepts the following options:
@table @option
@item size, s
Specify the video size for the output. Default value is "600x240".
@item mode
Set display mode.
...
...
@@ -7166,8 +7170,6 @@ is not explicitly specified.
Set the (approximate) output frame rate. This is done by setting the
option @var{n}. Default value is "25".
@item size, s
Specify the video size for the output. Default value is "600x240".
@end table
@subsection Examples
...
...
libavfilter/avf_showwaves.c
View file @
3c2e4c2a
...
...
@@ -54,35 +54,19 @@ typedef struct {
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
showwaves_options
[]
=
{
{
"rate"
,
"set video rate"
,
OFFSET
(
rate
),
AV_OPT_TYPE_VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"r"
,
"set video rate"
,
OFFSET
(
rate
),
AV_OPT_TYPE_VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"size"
,
"set video size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
"600x240"
},
0
,
0
,
FLAGS
},
{
"s"
,
"set video size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
"600x240"
},
0
,
0
,
FLAGS
},
{
"mode"
,
"select display mode"
,
OFFSET
(
mode
),
AV_OPT_TYPE_INT
,
{.
i64
=
MODE_POINT
},
0
,
MODE_NB
-
1
,
FLAGS
,
"mode"
},
{
"point"
,
"draw a point for each sample"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_POINT
},
.
flags
=
FLAGS
,
.
unit
=
"mode"
},
{
"line"
,
"draw a line for each sample"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_LINE
},
.
flags
=
FLAGS
,
.
unit
=
"mode"
},
{
"n"
,
"set how many samples to show in the same point"
,
OFFSET
(
n
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
FLAGS
},
{
"mode"
,
"select display mode"
,
OFFSET
(
mode
),
AV_OPT_TYPE_INT
,
{.
i64
=
MODE_POINT
},
0
,
MODE_NB
-
1
,
FLAGS
,
"mode"
},
{
"point"
,
"draw a point for each sample"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_POINT
},
.
flags
=
FLAGS
,
.
unit
=
"mode"
},
{
"line"
,
"draw a line for each sample"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_LINE
},
.
flags
=
FLAGS
,
.
unit
=
"mode"
},
{
"rate"
,
"set video rate"
,
OFFSET
(
rate
),
AV_OPT_TYPE_VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"r"
,
"set video rate"
,
OFFSET
(
rate
),
AV_OPT_TYPE_VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
NULL
},
};
AVFILTER_DEFINE_CLASS
(
showwaves
);
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
ShowWavesContext
*
showwaves
=
ctx
->
priv
;
int
err
;
showwaves
->
class
=
&
showwaves_class
;
av_opt_set_defaults
(
showwaves
);
showwaves
->
buf_idx
=
0
;
if
((
err
=
av_set_options_string
(
showwaves
,
args
,
"="
,
":"
))
<
0
)
return
err
;
return
0
;
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
ShowWavesContext
*
showwaves
=
ctx
->
priv
;
...
...
@@ -133,6 +117,7 @@ static int config_output(AVFilterLink *outlink)
if
(
!
showwaves
->
n
)
showwaves
->
n
=
FFMAX
(
1
,
((
double
)
inlink
->
sample_rate
/
(
showwaves
->
w
*
av_q2d
(
showwaves
->
rate
)))
+
0
.
5
);
showwaves
->
buf_idx
=
0
;
outlink
->
w
=
showwaves
->
w
;
outlink
->
h
=
showwaves
->
h
;
outlink
->
sample_aspect_ratio
=
(
AVRational
){
1
,
1
};
...
...
@@ -261,7 +246,6 @@ static const AVFilterPad showwaves_outputs[] = {
AVFilter
avfilter_avf_showwaves
=
{
.
name
=
"showwaves"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Convert input audio to a video output."
),
.
init
=
init
,
.
uninit
=
uninit
,
.
query_formats
=
query_formats
,
.
priv_size
=
sizeof
(
ShowWavesContext
),
...
...
libavfilter/avfilter.c
View file @
3c2e4c2a
...
...
@@ -694,7 +694,6 @@ static const char *const filters_left_to_update[] = {
"sendcmd"
,
"setdar"
,
"setsar"
,
"showwaves"
,
"smptebars"
,
};
...
...
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