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
3f95f0dd
Commit
3f95f0dd
authored
Oct 17, 2012
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtpdec: Move the URLContext used for RTCP RR out from the context, to a parameter
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
a0b7e289
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
13 deletions
+9
-13
rtpdec.c
libavformat/rtpdec.c
+4
-6
rtpdec.h
libavformat/rtpdec.h
+3
-5
rtsp.c
libavformat/rtsp.c
+2
-2
No files found.
libavformat/rtpdec.c
View file @
3f95f0dd
...
...
@@ -226,7 +226,7 @@ static int rtp_valid_packet_in_sequence(RTPStatistics *s, uint16_t seq)
return
1
;
}
int
ff_rtp_check_and_send_back_rr
(
RTPDemuxContext
*
s
,
int
count
)
int
ff_rtp_check_and_send_back_rr
(
RTPDemuxContext
*
s
,
URLContext
*
fd
,
int
count
)
{
AVIOContext
*
pb
;
uint8_t
*
buf
;
...
...
@@ -242,7 +242,7 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
uint32_t
fraction
;
uint64_t
ntp_time
=
s
->
last_rtcp_ntp_time
;
// TODO: Get local ntp time?
if
(
!
s
->
rtp_ctx
||
(
count
<
1
))
if
(
!
fd
||
(
count
<
1
))
return
-
1
;
/* TODO: I think this is way too often; RFC 1889 has algorithm for this */
...
...
@@ -316,7 +316,7 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
if
((
len
>
0
)
&&
buf
)
{
int
av_unused
result
;
av_dlog
(
s
->
ic
,
"sending %d bytes of RR
\n
"
,
len
);
result
=
ffurl_write
(
s
->
rtp_ctx
,
buf
,
len
);
result
=
ffurl_write
(
fd
,
buf
,
len
);
av_dlog
(
s
->
ic
,
"result from ffurl_write: %d
\n
"
,
result
);
av_free
(
buf
);
}
...
...
@@ -367,8 +367,7 @@ void ff_rtp_send_punch_packets(URLContext *rtp_handle)
* rtp demux (otherwise AV_CODEC_ID_MPEG2TS packets are returned)
*/
RTPDemuxContext
*
ff_rtp_parse_open
(
AVFormatContext
*
s1
,
AVStream
*
st
,
URLContext
*
rtpc
,
int
payload_type
,
int
queue_size
)
int
payload_type
,
int
queue_size
)
{
RTPDemuxContext
*
s
;
...
...
@@ -413,7 +412,6 @@ RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st,
}
}
// needed to send back RTCP RR in RTSP sessions
s
->
rtp_ctx
=
rtpc
;
gethostname
(
s
->
hostname
,
sizeof
(
s
->
hostname
));
return
s
;
}
...
...
libavformat/rtpdec.h
View file @
3f95f0dd
...
...
@@ -40,8 +40,7 @@ typedef struct RTPDynamicProtocolHandler RTPDynamicProtocolHandler;
typedef
struct
RTPDemuxContext
RTPDemuxContext
;
RTPDemuxContext
*
ff_rtp_parse_open
(
AVFormatContext
*
s1
,
AVStream
*
st
,
URLContext
*
rtpc
,
int
payload_type
,
int
queue_size
);
int
payload_type
,
int
queue_size
);
void
ff_rtp_parse_set_dynamic_protocol
(
RTPDemuxContext
*
s
,
PayloadContext
*
ctx
,
RTPDynamicProtocolHandler
*
handler
);
int
ff_rtp_parse_packet
(
RTPDemuxContext
*
s
,
AVPacket
*
pkt
,
...
...
@@ -69,10 +68,10 @@ void ff_rtp_send_punch_packets(URLContext* rtp_handle);
/**
* some rtp servers assume client is dead if they don't hear from them...
* so we send a Receiver Report to the provided
ByteIO c
ontext
* so we send a Receiver Report to the provided
URLC
ontext
* (we don't have access to the rtcp handle from here)
*/
int
ff_rtp_check_and_send_back_rr
(
RTPDemuxContext
*
s
,
int
count
);
int
ff_rtp_check_and_send_back_rr
(
RTPDemuxContext
*
s
,
URLContext
*
fd
,
int
count
);
// these statistics are used for rtcp receiver reports...
typedef
struct
RTPStatistics
{
...
...
@@ -158,7 +157,6 @@ struct RTPDemuxContext {
int
read_buf_index
;
int
read_buf_size
;
/* used to send back RTCP RR */
URLContext
*
rtp_ctx
;
char
hostname
[
256
];
/** Statistics for this stream (used by RTCP receiver reports) */
...
...
libavformat/rtsp.c
View file @
3f95f0dd
...
...
@@ -643,7 +643,7 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
rtsp_st
->
dynamic_protocol_context
,
rtsp_st
->
dynamic_handler
);
else
if
(
CONFIG_RTPDEC
)
rtsp_st
->
transport_priv
=
ff_rtp_parse_open
(
s
,
st
,
rtsp_st
->
rtp_handle
,
rtsp_st
->
transport_priv
=
ff_rtp_parse_open
(
s
,
st
,
rtsp_st
->
sdp_payload_type
,
reordering_queue_size
);
...
...
@@ -1860,7 +1860,7 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt)
case
RTSP_LOWER_TRANSPORT_UDP_MULTICAST
:
len
=
udp_read_packet
(
s
,
&
rtsp_st
,
rt
->
recvbuf
,
RECVBUF_SIZE
,
wait_end
);
if
(
len
>
0
&&
rtsp_st
->
transport_priv
&&
rt
->
transport
==
RTSP_TRANSPORT_RTP
)
ff_rtp_check_and_send_back_rr
(
rtsp_st
->
transport_priv
,
len
);
ff_rtp_check_and_send_back_rr
(
rtsp_st
->
transport_priv
,
rtsp_st
->
rtp_handle
,
len
);
break
;
}
if
(
len
==
AVERROR
(
EAGAIN
)
&&
first_queue_st
&&
...
...
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