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
40ce6381
Commit
40ce6381
authored
Dec 08, 2013
by
Andrey Utkin
Committed by
Jean-Baptiste Kempf
Dec 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable VP8 RTP packetization
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
a8b1850a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
modules/stream_out/rtpfmt.c
modules/stream_out/rtpfmt.c
+51
-0
No files found.
modules/stream_out/rtpfmt.c
View file @
40ce6381
...
...
@@ -53,6 +53,7 @@ static int rtp_packetize_g726_24 (sout_stream_id_t *, block_t *);
static
int
rtp_packetize_g726_32
(
sout_stream_id_t
*
,
block_t
*
);
static
int
rtp_packetize_g726_40
(
sout_stream_id_t
*
,
block_t
*
);
static
int
rtp_packetize_xiph
(
sout_stream_id_t
*
,
block_t
*
);
static
int
rtp_packetize_vp8
(
sout_stream_id_t
*
,
block_t
*
);
#define XIPH_IDENT (0)
...
...
@@ -516,6 +517,10 @@ int rtp_get_fmt( vlc_object_t *obj, es_format_t *p_fmt, const char *mux,
if
(
p_fmt
->
audio
.
i_channels
==
2
)
rtp_fmt
->
fmtp
=
strdup
(
"sprop-stereo=1"
);
break
;
case
VLC_CODEC_VP8
:
rtp_fmt
->
ptname
=
"VP8"
;
rtp_fmt
->
pf_packetize
=
rtp_packetize_vp8
;
break
;
default:
msg_Err
(
obj
,
"cannot add this stream (unsupported "
...
...
@@ -1375,3 +1380,49 @@ static int rtp_packetize_g726_40( sout_stream_id_t *id, block_t *in )
{
return
rtp_packetize_g726
(
id
,
in
,
8
);
}
#define RTP_VP8_HEADER_SIZE 1
#define RTP_VP8_PAYLOAD_START (12 + RTP_VP8_HEADER_SIZE)
static
int
rtp_packetize_vp8
(
sout_stream_id_t
*
id
,
block_t
*
in
)
{
int
i_max
=
rtp_mtu
(
id
)
-
RTP_VP8_HEADER_SIZE
;
int
i_count
=
(
in
->
i_buffer
+
i_max
-
1
)
/
i_max
;
uint8_t
*
p_data
=
in
->
p_buffer
;
int
i_data
=
in
->
i_buffer
;
if
(
i_max
<=
0
)
return
VLC_EGENERIC
;
for
(
int
i
=
0
;
i
<
i_count
;
i
++
)
{
int
i_payload
=
__MIN
(
i_max
,
i_data
);
block_t
*
out
=
block_Alloc
(
RTP_VP8_PAYLOAD_START
+
i_payload
);
if
(
out
==
NULL
)
return
VLC_ENOMEM
;
/* VP8 payload header */
/* All frames are marked as reference ones */
if
(
i
==
0
)
out
->
p_buffer
[
12
]
=
0x10
;
// partition start
else
out
->
p_buffer
[
12
]
=
0
;
/* rtp common header */
rtp_packetize_common
(
id
,
out
,
(
i
==
i_count
-
1
),
(
in
->
i_pts
>
VLC_TS_INVALID
?
in
->
i_pts
:
in
->
i_dts
)
);
memcpy
(
&
out
->
p_buffer
[
RTP_VP8_PAYLOAD_START
],
p_data
,
i_payload
);
out
->
i_buffer
=
RTP_VP8_PAYLOAD_START
+
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
;
}
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