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
e35fb5ad
Commit
e35fb5ad
authored
Dec 26, 2013
by
Clément Bœsch
Committed by
Clément Bœsch
Aug 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/showwaves: add split_channels option
parent
ba29746f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
filters.texi
doc/filters.texi
+3
-0
avf_showwaves.c
libavfilter/avf_showwaves.c
+10
-4
version.h
libavfilter/version.h
+1
-1
No files found.
doc/filters.texi
View file @
e35fb5ad
...
...
@@ -10830,6 +10830,9 @@ is not explicitly specified.
Set the (approximate) output frame rate. This is done by setting the
option @var{n}. Default value is "25".
@item split_channels
Set if channels should be drawn separately or overlap. Default value is 0.
@end table
@subsection Examples
...
...
libavfilter/avf_showwaves.c
View file @
e35fb5ad
...
...
@@ -51,6 +51,7 @@ typedef struct {
int
n
;
int
sample_count_mod
;
enum
ShowWavesMode
mode
;
int
split_channels
;
void
(
*
draw_sample
)(
uint8_t
*
buf
,
int
height
,
int
linesize
,
int16_t
sample
,
int16_t
*
prev_y
,
int
intensity
);
}
ShowWavesContext
;
...
...
@@ -69,6 +70,7 @@ static const AVOption showwaves_options[] = {
{
"n"
,
"set how many samples to show in the same point"
,
OFFSET
(
n
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
FLAGS
},
{
"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
},
{
"split_channels"
,
"draw channels separately"
,
OFFSET
(
split_channels
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1
,
FLAGS
},
{
NULL
}
};
...
...
@@ -241,7 +243,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
int
nb_channels
=
inlink
->
channels
;
int
i
,
j
,
ret
=
0
;
const
int
n
=
showwaves
->
n
;
const
int
x
=
255
/
(
nb_channels
*
n
);
/* multiplication factor, pre-computed to avoid in-loop divisions */
const
int
x
=
255
/
((
showwaves
->
split_channels
?
1
:
nb_channels
)
*
n
);
/* multiplication factor, pre-computed to avoid in-loop divisions */
const
int
ch_height
=
showwaves
->
split_channels
?
outlink
->
h
/
nb_channels
:
outlink
->
h
;
/* draw data in the buffer */
for
(
i
=
0
;
i
<
nb_samples
;
i
++
)
{
...
...
@@ -260,10 +263,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
for
(
j
=
0
;
j
<
outlink
->
h
;
j
++
)
memset
(
outpicref
->
data
[
0
]
+
j
*
linesize
,
0
,
outlink
->
w
);
}
for
(
j
=
0
;
j
<
nb_channels
;
j
++
)
showwaves
->
draw_sample
(
outpicref
->
data
[
0
]
+
showwaves
->
buf_idx
,
outlink
->
h
,
linesize
,
*
p
++
,
for
(
j
=
0
;
j
<
nb_channels
;
j
++
)
{
uint8_t
*
buf
=
outpicref
->
data
[
0
]
+
showwaves
->
buf_idx
;
if
(
showwaves
->
split_channels
)
buf
+=
j
*
ch_height
*
linesize
;
showwaves
->
draw_sample
(
buf
,
ch_height
,
linesize
,
*
p
++
,
&
showwaves
->
buf_idy
[
j
],
x
);
}
showwaves
->
sample_count_mod
++
;
if
(
showwaves
->
sample_count_mod
==
n
)
{
...
...
libavfilter/version.h
View file @
e35fb5ad
...
...
@@ -31,7 +31,7 @@
#define LIBAVFILTER_VERSION_MAJOR 5
#define LIBAVFILTER_VERSION_MINOR 0
#define LIBAVFILTER_VERSION_MICRO 10
0
#define LIBAVFILTER_VERSION_MICRO 10
1
#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