Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
b5a8bebd
Commit
b5a8bebd
authored
Sep 12, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
As yet untested T.140 RTP packetization
parent
86a25b2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+52
-0
No files found.
modules/stream_out/rtp.c
View file @
b5a8bebd
...
@@ -741,6 +741,7 @@ static int rtp_packetize_mp4a_latm ( sout_stream_t *, sout_stream_id_t *, block_
...
@@ -741,6 +741,7 @@ static int rtp_packetize_mp4a_latm ( sout_stream_t *, sout_stream_id_t *, block_
static
int
rtp_packetize_h263
(
sout_stream_t
*
,
sout_stream_id_t
*
,
block_t
*
);
static
int
rtp_packetize_h263
(
sout_stream_t
*
,
sout_stream_id_t
*
,
block_t
*
);
static
int
rtp_packetize_h264
(
sout_stream_t
*
,
sout_stream_id_t
*
,
block_t
*
);
static
int
rtp_packetize_h264
(
sout_stream_t
*
,
sout_stream_id_t
*
,
block_t
*
);
static
int
rtp_packetize_amr
(
sout_stream_t
*
,
sout_stream_id_t
*
,
block_t
*
);
static
int
rtp_packetize_amr
(
sout_stream_t
*
,
sout_stream_id_t
*
,
block_t
*
);
static
int
rtp_packetize_t140
(
sout_stream_t
*
,
sout_stream_id_t
*
,
block_t
*
);
static
void
sprintf_hexa
(
char
*
s
,
uint8_t
*
p_data
,
int
i_data
)
static
void
sprintf_hexa
(
char
*
s
,
uint8_t
*
p_data
,
int
i_data
)
{
{
...
@@ -1066,6 +1067,11 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
...
@@ -1066,6 +1067,11 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
id
->
i_clock_rate
=
p_fmt
->
audio
.
i_rate
;
id
->
i_clock_rate
=
p_fmt
->
audio
.
i_rate
;
id
->
pf_packetize
=
rtp_packetize_amr
;
id
->
pf_packetize
=
rtp_packetize_amr
;
break
;
break
;
case
VLC_FOURCC
(
't'
,
'1'
,
'4'
,
'0'
):
id
->
psz_rtpmap
=
strdup
(
"t140/1000"
);
id
->
i_clock_rate
=
1000
;
id
->
pf_packetize
=
rtp_packetize_t140
;
break
;
default:
default:
msg_Err
(
p_stream
,
"cannot add this stream (unsupported "
msg_Err
(
p_stream
,
"cannot add this stream (unsupported "
...
@@ -1991,6 +1997,52 @@ static int rtp_packetize_amr( sout_stream_t *p_stream, sout_stream_id_t *id,
...
@@ -1991,6 +1997,52 @@ static int rtp_packetize_amr( sout_stream_t *p_stream, sout_stream_id_t *id,
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
static
int
rtp_packetize_t140
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
,
block_t
*
in
)
{
const
size_t
i_max
=
id
->
i_mtu
-
12
;
const
uint8_t
*
p_data
=
in
->
p_buffer
;
size_t
i_data
=
in
->
i_buffer
;
for
(
unsigned
i_packet
=
0
;
i_data
>
0
;
i_packet
++
)
{
size_t
i_payload
=
i_data
;
/* Make sure we stop on an UTF-8 character boundary
* (assuming the input is valid UTF-8) */
if
(
i_data
>
i_max
)
{
i_payload
=
i_max
;
while
(
(
p_data
[
i_payload
]
&
0xC0
)
==
0x80
)
{
if
(
i_payload
==
0
)
return
VLC_SUCCESS
;
/* fishy input! */
i_payload
--
;
}
}
block_t
*
out
=
block_New
(
p_stream
,
12
+
i_payload
);
if
(
out
==
NULL
)
return
VLC_SUCCESS
;
rtp_packetize_common
(
id
,
out
,
0
,
in
->
i_pts
+
i_packet
);
memcpy
(
out
->
p_buffer
+
12
,
p_data
,
i_payload
);
out
->
i_buffer
=
12
+
i_payload
;
out
->
i_dts
=
out
->
i_pts
;
out
->
i_length
=
0
;
rtp_packetize_send
(
id
,
out
);
p_data
+=
i_payload
;
i_data
-=
i_payload
;
}
return
VLC_SUCCESS
;
}
/*****************************************************************************
/*****************************************************************************
* Non-RTP mux
* Non-RTP mux
*****************************************************************************/
*****************************************************************************/
...
...
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