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
8b2e9636
Commit
8b2e9636
authored
Oct 09, 2014
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtsp: Support tls-encapsulated RTSP
parent
c27328e7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
rtsp.c
libavformat/rtsp.c
+18
-6
rtsp.h
libavformat/rtsp.h
+1
-0
No files found.
libavformat/rtsp.c
View file @
8b2e9636
...
@@ -1589,10 +1589,13 @@ void ff_rtsp_close_connections(AVFormatContext *s)
...
@@ -1589,10 +1589,13 @@ void ff_rtsp_close_connections(AVFormatContext *s)
int
ff_rtsp_connect
(
AVFormatContext
*
s
)
int
ff_rtsp_connect
(
AVFormatContext
*
s
)
{
{
RTSPState
*
rt
=
s
->
priv_data
;
RTSPState
*
rt
=
s
->
priv_data
;
char
host
[
1024
],
path
[
1024
],
tcpname
[
1024
],
cmd
[
2048
],
auth
[
128
];
char
proto
[
128
],
host
[
1024
],
path
[
1024
];
char
tcpname
[
1024
],
cmd
[
2048
],
auth
[
128
];
const
char
*
lower_rtsp_proto
=
"tcp"
;
int
port
,
err
,
tcp_fd
;
int
port
,
err
,
tcp_fd
;
RTSPMessageHeader
reply1
=
{
0
},
*
reply
=
&
reply1
;
RTSPMessageHeader
reply1
=
{
0
},
*
reply
=
&
reply1
;
int
lower_transport_mask
=
0
;
int
lower_transport_mask
=
0
;
int
default_port
=
RTSP_DEFAULT_PORT
;
char
real_challenge
[
64
]
=
""
;
char
real_challenge
[
64
]
=
""
;
struct
sockaddr_storage
peer
;
struct
sockaddr_storage
peer
;
socklen_t
peer_len
=
sizeof
(
peer
);
socklen_t
peer_len
=
sizeof
(
peer
);
...
@@ -1619,15 +1622,23 @@ int ff_rtsp_connect(AVFormatContext *s)
...
@@ -1619,15 +1622,23 @@ int ff_rtsp_connect(AVFormatContext *s)
rt
->
lower_transport_mask
&=
(
1
<<
RTSP_LOWER_TRANSPORT_NB
)
-
1
;
rt
->
lower_transport_mask
&=
(
1
<<
RTSP_LOWER_TRANSPORT_NB
)
-
1
;
redirect:
redirect:
lower_transport_mask
=
rt
->
lower_transport_mask
;
/* extract hostname and port */
/* extract hostname and port */
av_url_split
(
NULL
,
0
,
auth
,
sizeof
(
auth
),
av_url_split
(
proto
,
sizeof
(
proto
)
,
auth
,
sizeof
(
auth
),
host
,
sizeof
(
host
),
&
port
,
path
,
sizeof
(
path
),
s
->
filename
);
host
,
sizeof
(
host
),
&
port
,
path
,
sizeof
(
path
),
s
->
filename
);
if
(
!
strcmp
(
proto
,
"rtsps"
))
{
lower_rtsp_proto
=
"tls"
;
default_port
=
RTSPS_DEFAULT_PORT
;
rt
->
lower_transport_mask
=
1
<<
RTSP_LOWER_TRANSPORT_TCP
;
}
if
(
*
auth
)
{
if
(
*
auth
)
{
av_strlcpy
(
rt
->
auth
,
auth
,
sizeof
(
rt
->
auth
));
av_strlcpy
(
rt
->
auth
,
auth
,
sizeof
(
rt
->
auth
));
}
}
if
(
port
<
0
)
if
(
port
<
0
)
port
=
RTSP_DEFAULT_PORT
;
port
=
default_port
;
lower_transport_mask
=
rt
->
lower_transport_mask
;
if
(
!
lower_transport_mask
)
if
(
!
lower_transport_mask
)
lower_transport_mask
=
(
1
<<
RTSP_LOWER_TRANSPORT_NB
)
-
1
;
lower_transport_mask
=
(
1
<<
RTSP_LOWER_TRANSPORT_NB
)
-
1
;
...
@@ -1647,7 +1658,7 @@ redirect:
...
@@ -1647,7 +1658,7 @@ redirect:
/* Construct the URI used in request; this is similar to s->filename,
/* Construct the URI used in request; this is similar to s->filename,
* but with authentication credentials removed and RTSP specific options
* but with authentication credentials removed and RTSP specific options
* stripped out. */
* stripped out. */
ff_url_join
(
rt
->
control_uri
,
sizeof
(
rt
->
control_uri
),
"rtsp"
,
NULL
,
ff_url_join
(
rt
->
control_uri
,
sizeof
(
rt
->
control_uri
),
proto
,
NULL
,
host
,
port
,
"%s"
,
path
);
host
,
port
,
"%s"
,
path
);
if
(
rt
->
control_transport
==
RTSP_MODE_TUNNEL
)
{
if
(
rt
->
control_transport
==
RTSP_MODE_TUNNEL
)
{
...
@@ -1726,7 +1737,8 @@ redirect:
...
@@ -1726,7 +1737,8 @@ redirect:
}
}
}
else
{
}
else
{
/* open the tcp connection */
/* open the tcp connection */
ff_url_join
(
tcpname
,
sizeof
(
tcpname
),
"tcp"
,
NULL
,
host
,
port
,
NULL
);
ff_url_join
(
tcpname
,
sizeof
(
tcpname
),
lower_rtsp_proto
,
NULL
,
host
,
port
,
NULL
);
if
(
ffurl_open
(
&
rt
->
rtsp_hd
,
tcpname
,
AVIO_FLAG_READ_WRITE
,
if
(
ffurl_open
(
&
rt
->
rtsp_hd
,
tcpname
,
AVIO_FLAG_READ_WRITE
,
&
s
->
interrupt_callback
,
NULL
)
<
0
)
{
&
s
->
interrupt_callback
,
NULL
)
<
0
)
{
err
=
AVERROR
(
EIO
);
err
=
AVERROR
(
EIO
);
...
...
libavformat/rtsp.h
View file @
8b2e9636
...
@@ -70,6 +70,7 @@ enum RTSPControlTransport {
...
@@ -70,6 +70,7 @@ enum RTSPControlTransport {
};
};
#define RTSP_DEFAULT_PORT 554
#define RTSP_DEFAULT_PORT 554
#define RTSPS_DEFAULT_PORT 322
#define RTSP_MAX_TRANSPORTS 8
#define RTSP_MAX_TRANSPORTS 8
#define RTSP_TCP_MAX_PACKET_SIZE 1472
#define RTSP_TCP_MAX_PACKET_SIZE 1472
#define RTSP_DEFAULT_NB_AUDIO_CHANNELS 1
#define RTSP_DEFAULT_NB_AUDIO_CHANNELS 1
...
...
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