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
c32cb1d1
Commit
c32cb1d1
authored
Sep 04, 2008
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtp: g726 packetization
parent
09cffd83
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
0 deletions
+78
-0
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+22
-0
modules/stream_out/rtp.h
modules/stream_out/rtp.h
+4
-0
modules/stream_out/rtpfmt.c
modules/stream_out/rtpfmt.c
+52
-0
No files found.
modules/stream_out/rtp.c
View file @
c32cb1d1
...
...
@@ -1064,6 +1064,28 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
id
->
psz_enc
=
"MPV"
;
id
->
pf_packetize
=
rtp_packetize_mpv
;
break
;
case
VLC_FOURCC
(
'G'
,
'7'
,
'2'
,
'6'
):
case
VLC_FOURCC
(
'g'
,
'7'
,
'2'
,
'6'
):
switch
(
p_fmt
->
i_bitrate
/
1000
)
{
case
16
:
id
->
psz_enc
=
"G726-16"
;
id
->
pf_packetize
=
rtp_packetize_g726_16
;
break
;
case
24
:
id
->
psz_enc
=
"G726-24"
;
id
->
pf_packetize
=
rtp_packetize_g726_24
;
break
;
case
32
:
id
->
psz_enc
=
"G726-32"
;
id
->
pf_packetize
=
rtp_packetize_g726_32
;
break
;
case
40
:
id
->
psz_enc
=
"G726-40"
;
id
->
pf_packetize
=
rtp_packetize_g726_40
;
break
;
}
break
;
case
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
):
id
->
psz_enc
=
"ac3"
;
id
->
pf_packetize
=
rtp_packetize_ac3
;
...
...
modules/stream_out/rtp.h
View file @
c32cb1d1
...
...
@@ -58,6 +58,10 @@ int rtp_packetize_h264 (sout_stream_id_t *, block_t *);
int
rtp_packetize_amr
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_spx
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_t140
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_g726_16
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_g726_24
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_g726_32
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_g726_40
(
sout_stream_id_t
*
,
block_t
*
);
/* RTCP */
typedef
struct
rtcp_sender_t
rtcp_sender_t
;
...
...
modules/stream_out/rtpfmt.c
View file @
c32cb1d1
...
...
@@ -668,3 +668,55 @@ int rtp_packetize_spx( sout_stream_id_t *id, block_t *in )
rtp_packetize_send
(
id
,
p_out
);
return
VLC_SUCCESS
;
}
static
int
rtp_packetize_g726
(
sout_stream_id_t
*
id
,
block_t
*
in
,
int
i_pad
)
{
int
i_max
=
(
rtp_mtu
(
id
)
-
12
+
i_pad
-
1
)
&
~
i_pad
;
int
i_count
=
(
in
->
i_buffer
+
i_max
-
1
)
/
i_max
;
uint8_t
*
p_data
=
in
->
p_buffer
;
int
i_data
=
in
->
i_buffer
;
int
i_packet
=
0
;
while
(
i_data
>
0
)
{
int
i_payload
=
__MIN
(
i_max
,
i_data
);
block_t
*
out
=
block_New
(
p_stream
,
12
+
i_payload
);
/* rtp common header */
rtp_packetize_common
(
id
,
out
,
0
,
(
in
->
i_pts
>
0
?
in
->
i_pts
:
in
->
i_dts
)
);
memcpy
(
&
out
->
p_buffer
[
12
],
p_data
,
i_payload
);
out
->
i_buffer
=
12
+
i_payload
;
out
->
i_dts
=
in
->
i_dts
+
i_packet
++
*
in
->
i_length
/
i_count
;
out
->
i_length
=
in
->
i_length
/
i_count
;
rtp_packetize_send
(
id
,
out
);
p_data
+=
i_payload
;
i_data
-=
i_payload
;
}
return
VLC_SUCCESS
;
}
int
rtp_packetize_g726_16
(
sout_stream_id_t
*
id
,
block_t
*
in
)
{
return
rtp_packetize_g726
(
id
,
in
,
16
);
}
int
rtp_packetize_g726_24
(
sout_stream_id_t
*
id
,
block_t
*
in
)
{
return
rtp_packetize_g726
(
id
,
in
,
24
);
}
int
rtp_packetize_g726_32
(
sout_stream_id_t
*
id
,
block_t
*
in
)
{
return
rtp_packetize_g726
(
id
,
in
,
32
);
}
int
rtp_packetize_g726_40
(
sout_stream_id_t
*
id
,
block_t
*
in
)
{
return
rtp_packetize_g726
(
id
,
in
,
40
);
}
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