Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
6d004778
Commit
6d004778
authored
Jun 04, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RTP: support for pulse code modulation
parent
8235fe32
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
2 deletions
+38
-2
modules/demux/rtp.c
modules/demux/rtp.c
+38
-2
No files found.
modules/demux/rtp.c
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
;
...
...
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