Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
455
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
6d004778
Commit
6d004778
authored
16 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
RTP: support for pulse code modulation
parent
8235fe32
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/demux/rtp.c
+38
-2
38 additions, 2 deletions
modules/demux/rtp.c
with
38 additions
and
2 deletions
modules/demux/rtp.c
+
38
−
2
View file @
6d004778
...
...
@@ -339,7 +339,7 @@ static void stream_decode (demux_t *demux, void *data, block_t *block)
*/
/* PT=0
* PCMU:
* PCMU:
G.711 µ-law (RFC3551)
*/
static
void
*
pcmu_init
(
demux_t
*
demux
)
{
...
...
@@ -352,7 +352,7 @@ static void *pcmu_init (demux_t *demux)
}
/* PT=8
* PCMA:
* PCMA:
G.711 A-law (RFC3551)
*/
static
void
*
pcma_init
(
demux_t
*
demux
)
{
...
...
@@ -364,6 +364,29 @@ static void *pcma_init (demux_t *demux)
return
codec_init
(
demux
,
&
fmt
);
}
/* PT=10,11
* L16: 16-bits (network byte order) PCM
*/
static
void
*
l16s_init
(
demux_t
*
demux
)
{
es_format_t
fmt
;
es_format_Init
(
&
fmt
,
AUDIO_ES
,
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'b'
));
fmt
.
audio
.
i_rate
=
44100
;
fmt
.
audio
.
i_channels
=
2
;
return
codec_init
(
demux
,
&
fmt
);
}
static
void
*
l16m_init
(
demux_t
*
demux
)
{
es_format_t
fmt
;
es_format_Init
(
&
fmt
,
AUDIO_ES
,
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'b'
));
fmt
.
audio
.
i_rate
=
44100
;
fmt
.
audio
.
i_channels
=
1
;
return
codec_init
(
demux
,
&
fmt
);
}
/* PT=14
* MPA: MPEG Audio (RFC2250, §3.4)
*/
...
...
@@ -449,6 +472,7 @@ static int Demux (demux_t *demux)
if
(
block
)
{
/* Not using SDP, we need to guess the payload format used */
/* see http://www.iana.org/assignments/rtp-parameters */
if
(
p_sys
->
autodetect
&&
block
->
i_buffer
>=
2
)
{
rtp_pt_t
pt
=
{
...
...
@@ -473,6 +497,18 @@ static int Demux (demux_t *demux)
pt
.
frequency
=
8000
;
break
;
case
10
:
msg_Dbg
(
demux
,
"detected stereo PCM"
);
pt
.
init
=
l16s_init
;
pt
.
frequency
=
44100
;
break
;
case
11
:
msg_Dbg
(
demux
,
"detected mono PCM"
);
pt
.
init
=
l16m_init
;
pt
.
frequency
=
44100
;
break
;
case
14
:
msg_Dbg
(
demux
,
"detected MPEG Audio"
);
pt
.
init
=
mpa_init
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment