Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
3b2e8d1d
Commit
3b2e8d1d
authored
Apr 03, 2009
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtpenc: Allow including a SDES/CNAME block in RTCP SR packets
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
65e05327
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
rtpenc.c
libavformat/rtpenc.c
+17
-0
rtpenc.h
libavformat/rtpenc.h
+1
-0
No files found.
libavformat/rtpenc.c
View file @
3b2e8d1d
...
...
@@ -34,6 +34,7 @@ static const AVOption options[] = {
FF_RTP_FLAG_OPTS
(
RTPMuxContext
,
flags
),
{
"payload_type"
,
"Specify RTP payload type"
,
offsetof
(
RTPMuxContext
,
payload_type
),
AV_OPT_TYPE_INT
,
{.
i64
=
-
1
},
-
1
,
127
,
AV_OPT_FLAG_ENCODING_PARAM
},
{
"ssrc"
,
"Stream identifier"
,
offsetof
(
RTPMuxContext
,
ssrc
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
INT_MIN
,
INT_MAX
,
AV_OPT_FLAG_ENCODING_PARAM
},
{
"cname"
,
"CNAME to include in RTCP SR packets"
,
offsetof
(
RTPMuxContext
,
cname
),
AV_OPT_TYPE_STRING
,
{
.
str
=
NULL
},
0
,
0
,
AV_OPT_FLAG_ENCODING_PARAM
},
{
NULL
},
};
...
...
@@ -271,6 +272,22 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time)
avio_wb32
(
s1
->
pb
,
rtp_ts
);
avio_wb32
(
s1
->
pb
,
s
->
packet_count
);
avio_wb32
(
s1
->
pb
,
s
->
octet_count
);
if
(
s
->
cname
)
{
int
len
=
FFMIN
(
strlen
(
s
->
cname
),
255
);
avio_w8
(
s1
->
pb
,
(
RTP_VERSION
<<
6
)
+
1
);
avio_w8
(
s1
->
pb
,
RTCP_SDES
);
avio_wb16
(
s1
->
pb
,
(
7
+
len
+
3
)
/
4
);
/* length in words - 1 */
avio_wb32
(
s1
->
pb
,
s
->
ssrc
);
avio_w8
(
s1
->
pb
,
0x01
);
/* CNAME */
avio_w8
(
s1
->
pb
,
len
);
avio_write
(
s1
->
pb
,
s
->
cname
,
len
);
avio_w8
(
s1
->
pb
,
0
);
/* END */
for
(
len
=
(
7
+
len
)
%
4
;
len
%
4
;
len
++
)
avio_w8
(
s1
->
pb
,
0
);
}
avio_flush
(
s1
->
pb
);
}
...
...
libavformat/rtpenc.h
View file @
3b2e8d1d
...
...
@@ -30,6 +30,7 @@ struct RTPMuxContext {
AVStream
*
st
;
int
payload_type
;
uint32_t
ssrc
;
const
char
*
cname
;
uint16_t
seq
;
uint32_t
timestamp
;
uint32_t
base_timestamp
;
...
...
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