Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
4de16278
Commit
4de16278
authored
May 14, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a small vlc_fourcc_GetCodecAudio helper.
parent
57981acd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
0 deletions
+82
-0
include/vlc_fourcc.h
include/vlc_fourcc.h
+9
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/misc/fourcc.c
src/misc/fourcc.c
+72
-0
No files found.
include/vlc_fourcc.h
View file @
4de16278
...
...
@@ -333,6 +333,15 @@ VLC_EXPORT( vlc_fourcc_t, vlc_fourcc_GetCodec, ( int i_cat, vlc_fourcc_t i_fourc
*/
VLC_EXPORT
(
vlc_fourcc_t
,
vlc_fourcc_GetCodecFromString
,
(
int
i_cat
,
const
char
*
)
);
/**
* It convert the gives fourcc to an audio codec when possible.
*
* The fourcc converted are aflt, araw/pcm , twos, sowt. When an incompatible i_bits
* is detected, 0 is returned.
* The other fourcc goes through vlc_fourcc_GetCodec and i_bits is not checked.
*/
VLC_EXPORT
(
vlc_fourcc_t
,
vlc_fourcc_GetCodecAudio
,
(
vlc_fourcc_t
i_fourcc
,
int
i_bits
)
);
/**
* It returns the description of the given fourcc or NULL if not found.
*
...
...
src/libvlccore.sym
View file @
4de16278
...
...
@@ -453,6 +453,7 @@ vlc_event_send
__vlc_execve
vlc_fastmem_register
vlc_fourcc_GetCodec
vlc_fourcc_GetCodecAudio
vlc_fourcc_GetCodecFromString
vlc_fourcc_GetDescription
vlc_freeaddrinfo
...
...
src/misc/fourcc.c
View file @
4de16278
...
...
@@ -1195,6 +1195,78 @@ vlc_fourcc_t vlc_fourcc_GetCodecFromString( int i_cat, const char *psz_fourcc )
psz_fourcc
[
2
],
psz_fourcc
[
3
]
)
);
}
vlc_fourcc_t
vlc_fourcc_GetCodecAudio
(
vlc_fourcc_t
i_fourcc
,
int
i_bits
)
{
const
int
i_bytes
=
(
i_bits
+
7
)
/
8
;
if
(
i_fourcc
==
VLC_FOURCC
(
'a'
,
'f'
,
'l'
,
't'
)
)
{
switch
(
i_bytes
)
{
case
4
:
return
VLC_CODEC_FL32
;
case
8
:
return
VLC_CODEC_FL64
;
default:
return
0
;
}
}
else
if
(
i_fourcc
==
VLC_FOURCC
(
'a'
,
'r'
,
'a'
,
'w'
)
||
i_fourcc
==
VLC_FOURCC
(
'p'
,
'c'
,
'm'
,
' '
)
)
{
switch
(
i_bytes
)
{
case
1
:
return
VLC_CODEC_U8
;
case
2
:
return
VLC_CODEC_S16L
;
case
3
:
return
VLC_CODEC_S24L
;
break
;
case
4
:
return
VLC_CODEC_S32L
;
default:
return
0
;
}
}
else
if
(
i_fourcc
==
VLC_FOURCC
(
't'
,
'w'
,
'o'
,
's'
)
)
{
switch
(
i_bytes
)
{
case
1
:
return
VLC_CODEC_S8
;
case
2
:
return
VLC_CODEC_S16B
;
case
3
:
return
VLC_CODEC_S24B
;
case
4
:
return
VLC_CODEC_S32B
;
default:
return
0
;
}
}
else
if
(
i_fourcc
==
VLC_FOURCC
(
's'
,
'o'
,
'w'
,
't'
)
)
{
switch
(
i_bytes
)
{
case
1
:
return
VLC_CODEC_S8
;
case
2
:
return
VLC_CODEC_S16L
;
case
3
:
return
VLC_CODEC_S24L
;
case
4
:
return
VLC_CODEC_S32L
;
default:
return
0
;
}
}
else
{
return
vlc_fourcc_GetCodec
(
AUDIO_ES
,
i_fourcc
);
}
}
/* */
const
char
*
vlc_fourcc_GetDescription
(
int
i_cat
,
vlc_fourcc_t
i_fourcc
)
{
...
...
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