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
d8ae3c5a
Commit
d8ae3c5a
authored
Apr 15, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simple: fix comments and reorder functions
parent
165f575d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
45 deletions
+51
-45
modules/audio_filter/channel_mixer/simple.c
modules/audio_filter/channel_mixer/simple.c
+51
-45
No files found.
modules/audio_filter/channel_mixer/simple.c
View file @
d8ae3c5a
...
@@ -52,13 +52,62 @@ vlc_module_end ()
...
@@ -52,13 +52,62 @@ vlc_module_end ()
/*****************************************************************************
/*****************************************************************************
* Local prototypes
* Local prototypes
*****************************************************************************/
*****************************************************************************/
static
bool
IsSupported
(
const
audio_format_t
*
p_input
,
const
audio_format_t
*
p_output
);
struct
filter_sys_t
struct
filter_sys_t
{
{
void
(
*
pf_dowork
)(
filter_t
*
,
block_t
*
,
block_t
*
);
void
(
*
pf_dowork
)(
filter_t
*
,
block_t
*
,
block_t
*
);
};
};
/*****************************************************************************
* IsSupported: can we downmix?
*****************************************************************************/
static
bool
IsSupported
(
const
audio_format_t
*
p_input
,
const
audio_format_t
*
p_output
)
{
if
(
p_input
->
i_format
!=
VLC_CODEC_FL32
||
p_input
->
i_format
!=
p_output
->
i_format
||
p_input
->
i_rate
!=
p_output
->
i_rate
)
{
return
false
;
}
if
(
p_input
->
i_physical_channels
==
p_output
->
i_physical_channels
&&
p_input
->
i_original_channels
==
p_output
->
i_original_channels
)
{
return
false
;
}
/* Only conversion to Mono, Stereo, 4.0 and 5.1 */
if
(
p_output
->
i_physical_channels
!=
AOUT_CHAN_CENTER
&&
p_output
->
i_physical_channels
!=
AOUT_CHANS_2_0
&&
p_output
->
i_physical_channels
!=
AOUT_CHANS_4_0
&&
p_output
->
i_physical_channels
!=
AOUT_CHANS_5_1
)
{
return
false
;
}
/* Only from 7.x/5.x/4.0/3.x/2.0
* NB 5.X rear and middle are handled the same way
* We don't support 2.1 -> 2.0 (trivial can do it)
* TODO: We don't support any 8.1 input
* TODO: We don't support any 6.x input
* TODO: We don't support 4.0 rear and 4.0 middle
* */
if
(
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_7_0
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_5_0
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_5_0_MIDDLE
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_4_CENTER_REAR
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_3_0
&&
p_input
->
i_physical_channels
!=
AOUT_CHANS_2_0
)
{
return
false
;
}
/* Only downmixing */
if
(
aout_FormatNbChannels
(
p_input
)
<=
aout_FormatNbChannels
(
p_output
)
)
return
false
;
return
true
;
}
static
block_t
*
Filter
(
filter_t
*
,
block_t
*
);
static
block_t
*
Filter
(
filter_t
*
,
block_t
*
);
static
void
DoWork_7_x_to_2_0
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
,
block_t
*
p_out_buf
)
{
static
void
DoWork_7_x_to_2_0
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
,
block_t
*
p_out_buf
)
{
...
@@ -352,47 +401,4 @@ static block_t *Filter( filter_t *p_filter, block_t *p_block )
...
@@ -352,47 +401,4 @@ static block_t *Filter( filter_t *p_filter, block_t *p_block )
return
p_out
;
return
p_out
;
}
}
/*****************************************************************************
* Helpers:
*****************************************************************************/
static
bool
IsSupported
(
const
audio_format_t
*
p_input
,
const
audio_format_t
*
p_output
)
{
if
(
p_input
->
i_format
!=
VLC_CODEC_FL32
||
p_input
->
i_format
!=
p_output
->
i_format
||
p_input
->
i_rate
!=
p_output
->
i_rate
)
return
false
;
if
(
p_input
->
i_physical_channels
==
p_output
->
i_physical_channels
&&
p_input
->
i_original_channels
==
p_output
->
i_original_channels
)
{
return
false
;
}
/* Only conversion to Mono, Stereo and 4.0 right now */
if
(
p_output
->
i_physical_channels
!=
AOUT_CHAN_CENTER
&&
p_output
->
i_physical_channels
!=
AOUT_CHANS_2_0
&&
p_output
->
i_physical_channels
!=
AOUT_CHANS_4_0
&&
p_output
->
i_physical_channels
!=
AOUT_CHANS_5_1
)
{
return
false
;
}
/* Only from 7/7.1/5/5.1/3/3.1/2.0
* XXX 5.X rear and middle are handled the same way */
if
(
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_7_0
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_5_0
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_5_0_MIDDLE
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_3_0
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_4_CENTER_REAR
&&
p_input
->
i_physical_channels
!=
AOUT_CHANS_2_0
)
{
return
false
;
}
/* Only if we downmix */
if
(
aout_FormatNbChannels
(
p_input
)
<=
aout_FormatNbChannels
(
p_output
)
)
return
false
;
return
true
;
}
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