Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
e2a501e9
Commit
e2a501e9
authored
Sep 24, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor out RTSP control URL writing so it can be re-used
parent
839d6e8b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
21 deletions
+24
-21
modules/stream_out/rtsp.c
modules/stream_out/rtsp.c
+24
-21
No files found.
modules/stream_out/rtsp.c
View file @
e2a501e9
...
...
@@ -339,9 +339,28 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
sout_stream_t
*
p_stream
=
rtsp
->
owner
;
char
psz_sesbuf
[
17
];
const
char
*
psz_session
=
NULL
,
*
psz
;
char
control
[
sizeof
(
"rtsp://[]:12345"
)
+
NI_MAXNUMERICHOST
+
strlen
(
rtsp
->
psz_path
)];
if
(
answer
==
NULL
||
query
==
NULL
||
cl
==
NULL
)
return
VLC_SUCCESS
;
else
{
/* Build self-referential control URL */
char
ip
[
NI_MAXNUMERICHOST
],
*
ptr
;
httpd_ServerIP
(
cl
,
ip
);
ptr
=
strchr
(
ip
,
'%'
);
if
(
ptr
!=
NULL
)
*
ptr
=
'\0'
;
if
(
strchr
(
ip
,
':'
)
!=
NULL
)
sprintf
(
control
,
"rtsp://[%s]:%u%s"
,
ip
,
rtsp
->
port
,
rtsp
->
psz_path
);
else
sprintf
(
control
,
"rtsp://%s:%u%s"
,
ip
,
rtsp
->
port
,
rtsp
->
psz_path
);
}
/* */
answer
->
i_proto
=
HTTPD_PROTO_RTSP
;
...
...
@@ -367,30 +386,14 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
break
;
}
char
ip
[
NI_MAXNUMERICHOST
],
*
ptr
;
char
control
[
sizeof
(
"rtsp://[]:12345"
)
+
sizeof
(
ip
)
+
strlen
(
rtsp
->
psz_path
)];
/* Build self-referential URL */
httpd_ServerIP
(
cl
,
ip
);
ptr
=
strchr
(
ip
,
'%'
);
if
(
ptr
!=
NULL
)
*
ptr
=
'\0'
;
if
(
strchr
(
ip
,
':'
)
!=
NULL
)
sprintf
(
control
,
"rtsp://[%s]:%u%s"
,
ip
,
rtsp
->
port
,
rtsp
->
psz_path
);
else
sprintf
(
control
,
"rtsp://%s:%u%s"
,
ip
,
rtsp
->
port
,
rtsp
->
psz_path
);
ptr
=
SDPGenerate
(
rtsp
->
owner
,
control
);
answer
->
i_status
=
200
;
httpd_MsgAdd
(
answer
,
"Content-Type"
,
"%s"
,
"application/sdp"
);
httpd_MsgAdd
(
answer
,
"Content-Base"
,
"%s"
,
control
);
answer
->
p_body
=
(
uint8_t
*
)
ptr
;
answer
->
i_body
=
strlen
(
ptr
);
answer
->
p_body
=
(
uint8_t
*
)
SDPGenerate
(
rtsp
->
owner
,
control
);
if
(
answer
->
p_body
!=
NULL
)
answer
->
i_body
=
strlen
(
(
char
*
)
answer
->
p_body
);
else
answer
->
i_status
=
500
;
break
;
}
...
...
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