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
85fb7b34
Commit
85fb7b34
authored
Jul 24, 2002
by
Fabrice Bellard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added rtp port range support
Originally committed as revision 792 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
51885599
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
rtsp.c
libav/rtsp.c
+25
-6
rtsp.h
libav/rtsp.h
+2
-0
No files found.
libav/rtsp.c
View file @
85fb7b34
...
...
@@ -47,6 +47,10 @@ int rtsp_abort_req = 0;
changing this variable */
int
rtsp_default_protocols
=
(
1
<<
RTSP_PROTOCOL_RTP_TCP
)
|
(
1
<<
RTSP_PROTOCOL_RTP_UDP
)
|
(
1
<<
RTSP_PROTOCOL_RTP_UDP_MULTICAST
);
/* if non zero, then set a range for RTP ports */
int
rtsp_rtp_port_min
=
0
;
int
rtsp_rtp_port_max
=
0
;
FFRTSPCallback
*
ff_rtsp_callback
=
NULL
;
static
int
rtsp_probe
(
AVProbeData
*
p
)
...
...
@@ -486,8 +490,8 @@ static int rtsp_read_header(AVFormatContext *s,
/* XXX: we assume the same server is used for the control of each
RTSP stream */
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
AVInputFormat
*
fmt
;
char
transport
[
2048
];
AVInputFormat
*
fmt
;
st
=
s
->
streams
[
i
];
rtsp_st
=
st
->
priv_data
;
...
...
@@ -497,12 +501,27 @@ static int rtsp_read_header(AVFormatContext *s,
/* RTP/UDP */
if
(
protocol_mask
&
(
1
<<
RTSP_PROTOCOL_RTP_UDP
))
{
fmt
=
&
rtp_demux
;
if
(
av_open_input_file
(
&
rtsp_st
->
ic
,
"rtp://"
,
fmt
,
0
,
NULL
)
<
0
)
{
char
buf
[
256
];
int
j
;
/* first try in specified port range */
if
(
rtsp_rtp_port_min
!=
0
)
{
for
(
j
=
rtsp_rtp_port_min
;
j
<=
rtsp_rtp_port_max
;
j
++
)
{
snprintf
(
buf
,
sizeof
(
buf
),
"rtp://?localport=%d"
,
j
);
if
(
!
av_open_input_file
(
&
rtsp_st
->
ic
,
buf
,
&
rtp_demux
,
0
,
NULL
))
goto
rtp_opened
;
}
}
/* then try on any port */
if
(
av_open_input_file
(
&
rtsp_st
->
ic
,
"rtp://"
,
&
rtp_demux
,
0
,
NULL
)
<
0
)
{
err
=
AVERROR_INVALIDDATA
;
goto
fail
;
}
rtp_opened:
port
=
rtp_get_local_port
(
url_fileno
(
&
rtsp_st
->
ic
->
pb
));
if
(
transport
[
0
]
!=
'\0'
)
pstrcat
(
transport
,
sizeof
(
transport
),
","
);
...
...
libav/rtsp.h
View file @
85fb7b34
...
...
@@ -79,6 +79,8 @@ void rtsp_parse_line(RTSPHeader *reply, const char *buf);
extern
int
rtsp_abort_req
;
extern
int
rtsp_default_protocols
;
extern
int
rtsp_rtp_port_min
;
extern
int
rtsp_rtp_port_max
;
extern
FFRTSPCallback
*
ff_rtsp_callback
;
#endif
/* RTSP_H */
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