Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
1fc92d51
Commit
1fc92d51
authored
Nov 07, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: rationalize filters pipelines function names (cosmetic)
parent
d96db36f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
33 deletions
+32
-33
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+6
-6
src/audio_output/filters.c
src/audio_output/filters.c
+19
-22
src/audio_output/input.c
src/audio_output/input.c
+3
-2
src/audio_output/output.c
src/audio_output/output.c
+4
-3
No files found.
src/audio_output/aout_internal.h
View file @
1fc92d51
...
...
@@ -113,12 +113,12 @@ block_t *aout_InputPlay( audio_output_t *p_aout, aout_input_t *p_input,
block_t
*
p_buffer
,
int
i_input_rate
,
date_t
*
);
/* From filters.c : */
int
aout_Filters
CreatePipeline
(
vlc_object_t
*
,
filter_t
**
,
unsigned
*
,
unsigned
,
const
audio_sample_format_t
*
,
const
audio_sample_format_t
*
);
#define aout_Filters
CreatePipelin
e(o, pv, pc, max, inf, outf) \
aout_Filters
CreatePipelin
e(VLC_OBJECT(o), pv, pc, max, inf, outf)
void
aout_Filters
DestroyPipeline
(
filter_t
*
const
*
,
unsigned
);
void
aout_FiltersPlay
(
filter_t
*
const
*
,
unsigned
,
block_t
**
);
int
aout_Filters
PipelineCreate
(
vlc_object_t
*
,
filter_t
**
,
unsigned
*
,
unsigned
,
const
audio_sample_format_t
*
,
const
audio_sample_format_t
*
);
#define aout_Filters
PipelineCreat
e(o, pv, pc, max, inf, outf) \
aout_Filters
PipelineCreat
e(VLC_OBJECT(o), pv, pc, max, inf, outf)
void
aout_Filters
PipelineDestroy
(
filter_t
*
const
*
,
unsigned
);
block_t
*
aout_FiltersPipelinePlay
(
filter_t
*
const
*
,
unsigned
,
block_t
*
);
int
aout_FiltersNew
(
audio_output_t
*
,
const
audio_sample_format_t
*
,
const
audio_sample_format_t
*
,
const
aout_request_vout_t
*
);
...
...
src/audio_output/filters.c
View file @
1fc92d51
...
...
@@ -125,7 +125,6 @@ static int SplitConversion( const audio_sample_format_t *restrict infmt,
return
0
;
}
#undef aout_FiltersCreatePipeline
/**
* Allocates audio format conversion filters
* @param obj parent VLC object for new filters
...
...
@@ -136,10 +135,10 @@ static int SplitConversion( const audio_sample_format_t *restrict infmt,
* @param outfmt output audio format
* @return 0 on success, -1 on failure
*/
int
aout_FiltersCreatePipeline
(
vlc_object_t
*
obj
,
filter_t
**
filters
,
unsigned
*
nb_filters
,
unsigned
max_filters
,
const
audio_sample_format_t
*
restrict
infmt
,
const
audio_sample_format_t
*
restrict
outfmt
)
int
(
aout_FiltersPipelineCreate
)(
vlc_object_t
*
obj
,
filter_t
**
filters
,
unsigned
*
nb_filters
,
unsigned
max_filters
,
const
audio_sample_format_t
*
restrict
infmt
,
const
audio_sample_format_t
*
restrict
outfmt
)
{
audio_sample_format_t
curfmt
=
*
outfmt
;
unsigned
i
=
0
;
...
...
@@ -194,14 +193,14 @@ int aout_FiltersCreatePipeline( vlc_object_t *obj, filter_t **filters,
return
0
;
rollback:
aout_Filters
DestroyPipeline
(
filters
,
i
);
aout_Filters
PipelineDestroy
(
filters
,
i
);
return
-
1
;
}
/**
* Destroys a chain of audio filters.
*/
void
aout_Filters
DestroyPipeline
(
filter_t
*
const
*
filters
,
unsigned
n
)
void
aout_Filters
PipelineDestroy
(
filter_t
*
const
*
filters
,
unsigned
n
)
{
for
(
unsigned
i
=
0
;
i
<
n
;
i
++
)
{
...
...
@@ -221,21 +220,19 @@ static inline bool ChangeFiltersString (vlc_object_t *aout, const char *var,
/**
* Filters an audio buffer through a chain of filters.
*/
void
aout_FiltersPlay
(
filter_t
*
const
*
pp_filters
,
unsigned
i_nb_filters
,
block_t
**
pp_block
)
block_t
*
aout_FiltersPipelinePlay
(
filter_t
*
const
*
filters
,
unsigned
count
,
block_t
*
block
)
{
block_t
*
p_block
=
*
pp_block
;
/* TODO: use filter chain */
for
(
unsigned
i
=
0
;
(
i
<
i_nb_filters
)
&&
(
p_block
!=
NULL
);
i
++
)
for
(
unsigned
i
=
0
;
(
i
<
count
)
&&
(
block
!=
NULL
);
i
++
)
{
filter_t
*
p_filter
=
pp_
filters
[
i
];
filter_t
*
filter
=
filters
[
i
];
/* Please note that p_block->i_nb_samples & i_buffer
* shall be set by the filter plug-in. */
p_block
=
p_filter
->
pf_audio_filter
(
p_filter
,
p_block
);
block
=
filter
->
pf_audio_filter
(
filter
,
block
);
}
*
pp_block
=
p_
block
;
return
block
;
}
/** Callback for visualization selection */
...
...
@@ -454,7 +451,7 @@ int aout_FiltersNew (audio_output_t *aout,
}
/* convert to the filter input format if necessary */
if
(
aout_Filters
CreatePipeline
(
VLC_OBJECT
(
aout
)
,
owner
->
filters
,
if
(
aout_Filters
PipelineCreate
(
aout
,
owner
->
filters
,
&
owner
->
nb_filters
,
AOUT_MAX_FILTERS
-
1
,
&
input_format
,
&
filter
->
fmt_in
.
audio
))
...
...
@@ -477,8 +474,8 @@ int aout_FiltersNew (audio_output_t *aout,
/* convert to the output format (minus resampling) if necessary */
output_format
.
i_rate
=
input_format
.
i_rate
;
if
(
aout_Filters
CreatePipeline
(
VLC_OBJECT
(
aout
),
owner
->
filters
,
&
owner
->
nb_filters
,
AOUT_MAX_FILTERS
,
if
(
aout_Filters
PipelineCreate
(
aout
,
owner
->
filters
,
&
owner
->
nb_
filters
,
AOUT_MAX_FILTERS
,
&
input_format
,
&
output_format
))
{
msg_Err
(
aout
,
"cannot setup filtering pipeline"
);
...
...
@@ -509,7 +506,7 @@ int aout_FiltersNew (audio_output_t *aout,
return
0
;
error:
aout_Filters
DestroyPipeline
(
owner
->
filters
,
owner
->
nb_filters
);
aout_Filters
PipelineDestroy
(
owner
->
filters
,
owner
->
nb_filters
);
var_DelCallback
(
aout
,
"equalizer"
,
EqualizerCallback
,
NULL
);
var_DelCallback
(
aout
,
"visual"
,
VisualizationCallback
,
NULL
);
return
-
1
;
...
...
@@ -523,13 +520,13 @@ void aout_FiltersDelete (audio_output_t *aout)
aout_owner_t
*
owner
=
aout_owner
(
aout
);
if
(
owner
->
resampler
!=
NULL
)
aout_Filters
DestroyPipeline
(
&
owner
->
resampler
,
1
);
aout_Filters
DestroyPipeline
(
owner
->
filters
,
owner
->
nb_filters
);
aout_Filters
PipelineDestroy
(
&
owner
->
resampler
,
1
);
aout_Filters
PipelineDestroy
(
owner
->
filters
,
owner
->
nb_filters
);
var_DelCallback
(
aout
,
"equalizer"
,
EqualizerCallback
,
NULL
);
var_DelCallback
(
aout
,
"visual"
,
VisualizationCallback
,
NULL
);
/* XXX We need to update recycle_vout before calling
* aout_Filters
DestroyPipeline
().
* aout_Filters
PipelineDestroy
().
* FIXME There may be a race condition if audio-visual is updated between
* aout_FiltersDestroy() and the next aout_FiltersNew().
*/
...
...
src/audio_output/input.c
View file @
1fc92d51
...
...
@@ -161,7 +161,8 @@ block_t *aout_InputPlay(audio_output_t *p_aout, aout_input_t *p_input,
}
/* Run pre-filters. */
aout_FiltersPlay
(
owner
->
filters
,
owner
->
nb_filters
,
&
p_buffer
);
p_buffer
=
aout_FiltersPipelinePlay
(
owner
->
filters
,
owner
->
nb_filters
,
p_buffer
);
if
(
!
p_buffer
)
return
NULL
;
...
...
@@ -234,7 +235,7 @@ block_t *aout_InputPlay(audio_output_t *p_aout, aout_input_t *p_input,
/* Actually run the resampler now. */
if
(
owner
->
resampler
!=
NULL
)
aout_FiltersPlay
(
&
owner
->
resampler
,
1
,
&
p_buffer
);
p_buffer
=
aout_FiltersPipelinePlay
(
&
owner
->
resampler
,
1
,
p_buffer
);
if
(
!
p_buffer
)
return
NULL
;
...
...
src/audio_output/output.c
View file @
1fc92d51
...
...
@@ -405,7 +405,7 @@ int aout_OutputNew (audio_output_t *aout, const audio_sample_format_t *fmtp)
/* Create converters. */
owner
->
nb_converters
=
0
;
if
(
aout_Filters
CreatePipelin
e
(
aout
,
owner
->
converters
,
if
(
aout_Filters
PipelineCreat
e
(
aout
,
owner
->
converters
,
&
owner
->
nb_converters
,
sizeof
(
owner
->
converters
)
/
sizeof
(
owner
->
converters
[
0
]),
&
owner
->
mixer_format
,
&
fmt
)
<
0
)
...
...
@@ -431,7 +431,7 @@ void aout_OutputDelete (audio_output_t *aout)
var_DelCallback
(
aout
,
"stereo-mode"
,
aout_ChannelsRestart
,
NULL
);
if
(
aout
->
stop
!=
NULL
)
aout
->
stop
(
aout
);
aout_Filters
DestroyPipeline
(
owner
->
converters
,
owner
->
nb_converters
);
aout_Filters
PipelineDestroy
(
owner
->
converters
,
owner
->
nb_converters
);
}
/**
...
...
@@ -446,7 +446,8 @@ void aout_OutputPlay (audio_output_t *aout, block_t *block)
aout_assert_locked
(
aout
);
aout_FiltersPlay
(
owner
->
converters
,
owner
->
nb_converters
,
&
block
);
block
=
aout_FiltersPipelinePlay
(
owner
->
converters
,
owner
->
nb_converters
,
block
);
if
(
block
==
NULL
)
return
;
if
(
block
->
i_buffer
==
0
)
...
...
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