Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
e5368cda
Commit
e5368cda
authored
Jun 01, 2024
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/asubprocess: get rid of config_input
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
1ba2d089
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
37 deletions
+15
-37
af_asubprocess.c
libavfilter/af_asubprocess.c
+15
-37
No files found.
libavfilter/af_asubprocess.c
View file @
e5368cda
...
...
@@ -46,6 +46,7 @@ typedef struct SP
}
SP
;
enum
{
STATE_START
=
0
,
STATE_EXPECT_RIFF
,
STATE_EXPECT_CHUNK
,
STATE_SKIP_CHUNK
,
...
...
@@ -54,7 +55,7 @@ enum {
STATE_ERROR
};
typedef
struct
A
ndioWMark
Context
{
typedef
struct
A
SubProcess
Context
{
const
AVClass
*
class
;
const
char
*
command
;
...
...
@@ -433,33 +434,6 @@ static int write_wav_header(AVFilterContext *ctx, ASubProcessContext *s, int nb_
return
ret
;
}
static
int
config_input
(
AVFilterLink
*
inlink
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
ASubProcessContext
*
s
=
ctx
->
priv
;
int
ret
;
ret
=
sp_new
(
ctx
);
if
(
ret
!=
0
)
return
ret
;
ret
=
write_wav_header
(
ctx
,
s
,
inlink
->
ch_layout
.
nb_channels
,
inlink
->
sample_rate
);
if
(
ret
!=
0
)
return
ret
;
#if 0
if (s->rbs)
rubberband_delete(s->rbs);
s->rbs = rubberband_new(inlink->sample_rate, inlink->ch_layout.nb_channels, opts, 1. / s->tempo, s->pitch);
if (!s->rbs)
return AVERROR(ENOMEM);
s->first_pts = AV_NOPTS_VALUE;
#endif
s
->
state
=
STATE_EXPECT_RIFF
;
return
0
;
}
static
void
read_samples
(
ASubProcessContext
*
s
,
int32_t
*
data
,
int
count
)
{
int
sample_size
=
s
->
out_bit_depth
/
8
;
...
...
@@ -588,6 +562,18 @@ static int activate(AVFilterContext *ctx)
int64_t
pts
;
int
status
,
ret
;
if
(
s
->
state
==
STATE_START
)
{
ret
=
sp_new
(
ctx
);
if
(
ret
!=
0
)
return
ret
;
s
->
state
=
STATE_EXPECT_RIFF
;
ret
=
write_wav_header
(
ctx
,
s
,
inlink
->
ch_layout
.
nb_channels
,
inlink
->
sample_rate
);
if
(
ret
!=
0
)
return
ret
;
}
FF_FILTER_FORWARD_STATUS_BACK
(
outlink
,
inlink
);
ret
=
try_read_frame
(
ctx
);
...
...
@@ -635,14 +621,6 @@ static int activate(AVFilterContext *ctx)
return
FFERROR_NOT_READY
;
}
static
const
AVFilterPad
asubprocess_inputs
[]
=
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
config_props
=
config_input
,
},
};
const
AVFilter
ff_af_asubprocess
=
{
.
name
=
"asubprocess"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Filter audio stream with subprocess."
),
...
...
@@ -651,7 +629,7 @@ const AVFilter ff_af_asubprocess = {
.
init
=
init
,
.
uninit
=
uninit
,
.
activate
=
activate
,
FILTER_INPUTS
(
asubprocess_inputs
),
FILTER_INPUTS
(
ff_audio_default_filterpad
),
FILTER_OUTPUTS
(
ff_audio_default_filterpad
),
FILTER_SINGLE_SAMPLEFMT
(
AV_SAMPLE_FMT_S32
),
};
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