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
d3811079
Commit
d3811079
authored
Nov 30, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RTP out: convert s16l to s16b on the fly
parent
90e78daa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
1 deletion
+39
-1
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+5
-1
modules/stream_out/rtp.h
modules/stream_out/rtp.h
+1
-0
modules/stream_out/rtpfmt.c
modules/stream_out/rtpfmt.c
+33
-0
No files found.
modules/stream_out/rtp.c
View file @
d3811079
...
...
@@ -1066,6 +1066,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
rtp_set_ptime
(
id
,
20
,
1
);
break
;
case
VLC_CODEC_S16B
:
case
VLC_CODEC_S16L
:
if
(
p_fmt
->
audio
.
i_channels
==
1
&&
p_fmt
->
audio
.
i_rate
==
44100
)
{
id
->
i_payload_type
=
11
;
...
...
@@ -1076,7 +1077,10 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
id
->
i_payload_type
=
10
;
}
id
->
psz_enc
=
"L16"
;
id
->
pf_packetize
=
rtp_packetize_split
;
if
(
p_fmt
->
i_codec
==
VLC_CODEC_S16B
)
id
->
pf_packetize
=
rtp_packetize_split
;
else
id
->
pf_packetize
=
rtp_packetize_swab
;
rtp_set_ptime
(
id
,
20
,
2
);
break
;
case
VLC_CODEC_U8
:
...
...
modules/stream_out/rtp.h
View file @
d3811079
...
...
@@ -51,6 +51,7 @@ int rtp_packetize_mpa (sout_stream_id_t *, block_t *);
int
rtp_packetize_mpv
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_ac3
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_split
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_swab
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_mp4a
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_mp4a_latm
(
sout_stream_id_t
*
,
block_t
*
);
int
rtp_packetize_h263
(
sout_stream_id_t
*
,
block_t
*
);
...
...
modules/stream_out/rtpfmt.c
View file @
d3811079
...
...
@@ -240,6 +240,39 @@ int rtp_packetize_split( sout_stream_id_t *id, block_t *in )
return
VLC_SUCCESS
;
}
/* split and convert from little endian to network byte order */
int
rtp_packetize_swab
(
sout_stream_id_t
*
id
,
block_t
*
in
)
{
int
i_max
=
rtp_mtu
(
id
);
/* payload max in one packet */
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
;
for
(
i
=
0
;
i
<
i_count
;
i
++
)
{
int
i_payload
=
__MIN
(
i_max
,
i_data
);
block_t
*
out
=
block_Alloc
(
12
+
i_payload
);
/* rtp common header */
rtp_packetize_common
(
id
,
out
,
(
i
==
i_count
-
1
),
(
in
->
i_pts
>
0
?
in
->
i_pts
:
in
->
i_dts
)
);
swab
(
p_data
,
out
->
p_buffer
+
12
,
i_payload
);
out
->
i_buffer
=
12
+
i_payload
;
out
->
i_dts
=
in
->
i_dts
+
i
*
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
;
}
/* rfc3016 */
int
rtp_packetize_mp4a_latm
(
sout_stream_id_t
*
id
,
block_t
*
in
)
{
...
...
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