Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
e71c332d
Commit
e71c332d
authored
Jan 30, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed: refactor into one module and one submodule
instead of three submodule and no main module!
parent
736cc6b8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
63 deletions
+45
-63
modules/audio_filter/converter/fixed.c
modules/audio_filter/converter/fixed.c
+45
-63
No files found.
modules/audio_filter/converter/fixed.c
View file @
e71c332d
...
@@ -36,57 +36,50 @@
...
@@ -36,57 +36,50 @@
#include <vlc_aout.h>
#include <vlc_aout.h>
#include <vlc_filter.h>
#include <vlc_filter.h>
/*****************************************************************************
static
int
CreateTo
(
vlc_object_t
*
);
* Local prototypes
static
int
CreateFrom
(
vlc_object_t
*
);
*****************************************************************************/
static
int
Create_F32ToS16
(
vlc_object_t
*
);
static
block_t
*
Do_F32ToS16
(
filter_t
*
,
block_t
*
);
static
int
Create_S16ToF32
(
vlc_object_t
*
);
static
block_t
*
Do_S16ToF32
(
filter_t
*
,
block_t
*
);
static
int
Create_U8ToF32
(
vlc_object_t
*
);
static
block_t
*
Do_U8ToF32
(
filter_t
*
,
block_t
*
);
/*****************************************************************************
/*****************************************************************************
* Module descriptor
* Module descriptor
*****************************************************************************/
*****************************************************************************/
vlc_module_begin
()
vlc_module_begin
()
set_description
(
N_
(
"Fixed point audio format conversions"
)
)
set_description
(
N_
(
"Fixed point audio format conversions"
)
)
add_submodule
()
set_callbacks
(
CreateTo
,
NULL
)
set_callbacks
(
Create_F32ToS16
,
NULL
)
set_capability
(
"audio filter"
,
10
)
add_submodule
()
set_callbacks
(
Create_S16ToF32
,
NULL
)
set_capability
(
"audio filter"
,
15
)
set_capability
(
"audio filter"
,
15
)
add_submodule
()
add_submodule
()
set_callbacks
(
Create
_U8ToF32
,
NULL
)
set_callbacks
(
Create
From
,
NULL
)
set_capability
(
"audio filter"
,
1
)
set_capability
(
"audio filter"
,
1
0
)
vlc_module_end
()
vlc_module_end
()
/***
**************************************************************************
/***
Conversion from FI32 to audio output ***/
* F32 to S16
static
block_t
*
Do_F32ToS16
(
filter_t
*
,
block_t
*
);
*****************************************************************************/
static
int
Create
_F32ToS16
(
vlc_object_t
*
p_this
)
static
int
Create
From
(
vlc_object_t
*
p_this
)
{
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
if
(
p_filter
->
fmt_in
.
audio
.
i_format
!=
VLC_CODEC_FI32
if
(
p_filter
->
fmt_in
.
audio
.
i_format
!=
VLC_CODEC_FI32
||
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_S16N
)
||
!
AOUT_FMTS_SIMILAR
(
&
p_filter
->
fmt_in
.
audio
,
{
&
p_filter
->
fmt_out
.
audio
)
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
if
(
!
AOUT_FMTS_SIMILAR
(
&
p_filter
->
fmt_in
.
audio
,
&
p_filter
->
fmt_out
.
audio
)
)
/* In fixed-point builds, audio outputs pretty much all use S16N. */
/* Feel free to add some other format if every needed. */
switch
(
p_filter
->
fmt_out
.
audio
.
i_format
)
{
{
case
VLC_CODEC_S16N
:
p_filter
->
pf_audio_filter
=
Do_F32ToS16
;
break
;
default:
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
p_filter
->
pf_audio_filter
=
Do_F32ToS16
;
return
VLC_SUCCESS
;;
return
VLC_SUCCESS
;;
}
}
/*****************************************************************************
* F32 to S16
*****************************************************************************/
/*****************************************************************************
/*****************************************************************************
* support routines borrowed from mpg321 (file: mad.c), which is distributed
* support routines borrowed from mpg321 (file: mad.c), which is distributed
* under GPL license
* under GPL license
...
@@ -144,30 +137,39 @@ static block_t *Do_F32ToS16( filter_t * p_filter, block_t * p_in_buf )
...
@@ -144,30 +137,39 @@ static block_t *Do_F32ToS16( filter_t * p_filter, block_t * p_in_buf )
return
p_in_buf
;
return
p_in_buf
;
}
}
/*** Conversions from decoders to FI32 */
static
block_t
*
Do_S16ToF32
(
filter_t
*
,
block_t
*
);
static
block_t
*
Do_U8ToF32
(
filter_t
*
,
block_t
*
);
/*****************************************************************************
static
int
CreateTo
(
vlc_object_t
*
p_this
)
* S16 to F32
*****************************************************************************/
static
int
Create_S16ToF32
(
vlc_object_t
*
p_this
)
{
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
if
(
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_FI32
if
(
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_FI32
||
p_filter
->
fmt_in
.
audio
.
i_format
!=
VLC_CODEC_S16N
)
||
!
AOUT_FMTS_SIMILAR
(
&
p_filter
->
fmt_in
.
audio
,
{
&
p_filter
->
fmt_out
.
audio
)
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
if
(
!
AOUT_FMTS_SIMILAR
(
&
p_filter
->
fmt_in
.
audio
,
&
p_filter
->
fmt_out
.
audio
)
)
switch
(
p_filter
->
fmt_in
.
audio
.
i_format
)
{
{
case
VLC_CODEC_S16N
:
p_filter
->
pf_audio_filter
=
Do_S16ToF32
;
break
;
case
VLC_CODEC_U8
:
p_filter
->
pf_audio_filter
=
Do_U8ToF32
;
break
;
default:
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
p_filter
->
pf_audio_filter
=
Do_S16ToF32
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
/*****************************************************************************
* S16 to F32
*****************************************************************************/
static
block_t
*
Do_S16ToF32
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
)
static
block_t
*
Do_S16ToF32
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
)
{
{
block_t
*
p_out_buf
;
block_t
*
p_out_buf
;
...
@@ -197,26 +199,6 @@ out:
...
@@ -197,26 +199,6 @@ out:
/*****************************************************************************
/*****************************************************************************
* U8 to F32
* U8 to F32
*****************************************************************************/
*****************************************************************************/
static
int
Create_U8ToF32
(
vlc_object_t
*
p_this
)
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
if
(
p_filter
->
fmt_in
.
audio
.
i_format
!=
VLC_CODEC_U8
||
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_FI32
)
{
return
VLC_EGENERIC
;
}
if
(
!
AOUT_FMTS_SIMILAR
(
&
p_filter
->
fmt_in
.
audio
,
&
p_filter
->
fmt_out
.
audio
)
)
{
return
VLC_EGENERIC
;
}
p_filter
->
pf_audio_filter
=
Do_U8ToF32
;
return
VLC_SUCCESS
;
}
static
block_t
*
Do_U8ToF32
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
)
static
block_t
*
Do_U8ToF32
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
)
{
{
block_t
*
p_out_buf
;
block_t
*
p_out_buf
;
...
...
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