Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
e677a71b
Commit
e677a71b
authored
Feb 10, 2006
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use correct Transport answer
parent
15f7074e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
17 deletions
+61
-17
modules/misc/rtsp.c
modules/misc/rtsp.c
+61
-17
No files found.
modules/misc/rtsp.c
View file @
e677a71b
...
...
@@ -132,7 +132,7 @@ struct vod_media_t
int
i_es
;
media_es_t
**
es
;
char
*
psz_mux
;
int
b_raw
;
vlc_bool_t
b_raw
;
/* RTSP client */
int
i_rtsp
;
...
...
@@ -273,6 +273,7 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
p_media
->
es
=
0
;
p_media
->
psz_mux
=
0
;
p_media
->
rtsp
=
0
;
p_media
->
b_raw
=
VLC_FALSE
;
asprintf
(
&
p_media
->
psz_rtsp_path
,
"%s%s"
,
p_sys
->
psz_path
,
psz_name
);
p_media
->
p_rtsp_url
=
...
...
@@ -631,11 +632,13 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
if
(
answer
==
NULL
||
query
==
NULL
)
return
VLC_SUCCESS
;
msg_
Info
(
p_vod
,
"RtspCallback query: type=%d"
,
query
->
i_type
);
msg_
Dbg
(
p_vod
,
"RtspCallback query: type=%d"
,
query
->
i_type
);
answer
->
i_proto
=
HTTPD_PROTO_RTSP
;
answer
->
i_version
=
query
->
i_version
;
answer
->
i_type
=
HTTPD_MSG_ANSWER
;
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
switch
(
query
->
i_type
)
{
...
...
@@ -656,8 +659,9 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
if
(
strstr
(
psz_transport
,
"MP2T/H2221/UDP"
)
||
strstr
(
psz_transport
,
"RAW/RAW/UDP"
)
)
{
p_media
->
b_raw
=
1
;
p_media
->
b_raw
=
VLC_TRUE
;
}
if
(
httpd_ClientIP
(
cl
,
ip
)
==
NULL
)
{
answer
->
i_status
=
500
;
...
...
@@ -668,7 +672,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
}
msg_Dbg
(
p_vod
,
"HTTPD_MSG_SETUP: unicast ip=%s port=%d"
,
ip
,
i_port
);
ip
,
i_port
);
psz_session
=
httpd_MsgGet
(
query
,
"Session"
);
if
(
!
psz_session
||
!*
psz_session
)
...
...
@@ -695,8 +699,22 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
httpd_MsgAdd
(
answer
,
"Transport"
,
"RTP/AVP/UDP;client_port=%d-%d"
,
i_port
,
i_port
+
1
);
if
(
p_media
->
b_raw
)
{
if
(
strstr
(
psz_transport
,
"MP2T/H2221/UDP"
)
)
{
httpd_MsgAdd
(
answer
,
"Transport"
,
"MP2T/H2221/UDP;client_port=%d-%d"
,
i_port
,
i_port
+
1
);
}
else
if
(
strstr
(
psz_transport
,
"RAW/RAW/UDP"
)
)
{
httpd_MsgAdd
(
answer
,
"Transport"
,
"RAW/RAW/UDP;client_port=%d-%d"
,
i_port
,
i_port
+
1
);
}
}
else
httpd_MsgAdd
(
answer
,
"Transport"
,
"RTP/AVP/UDP;client_port=%d-%d"
,
i_port
,
i_port
+
1
);
}
else
/* TODO strstr( psz_transport, "interleaved" ) ) */
{
...
...
@@ -705,6 +723,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
}
if
(
!
psz_playnow
)
break
;
}
...
...
@@ -715,10 +734,13 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
int
i
,
i_port_audio
=
0
,
i_port_video
=
0
;
/* for now only multicast so easy */
answer
->
i_status
=
200
;
answer
->
psz_status
=
strdup
(
"OK"
);
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
if
(
!
psz_playnow
)
{
answer
->
i_status
=
200
;
answer
->
psz_status
=
strdup
(
"OK"
);
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
}
if
(
!
psz_session
)
psz_session
=
httpd_MsgGet
(
query
,
"Session"
);
...
...
@@ -864,11 +886,13 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
if
(
answer
==
NULL
||
query
==
NULL
)
return
VLC_SUCCESS
;
msg_
Info
(
p_vod
,
"RtspCallback query: type=%d"
,
query
->
i_type
);
msg_
Dbg
(
p_vod
,
"RtspCallback query: type=%d"
,
query
->
i_type
);
answer
->
i_proto
=
HTTPD_PROTO_RTSP
;
answer
->
i_version
=
query
->
i_version
;
answer
->
i_type
=
HTTPD_MSG_ANSWER
;
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
switch
(
query
->
i_type
)
{
...
...
@@ -930,8 +954,24 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
httpd_MsgAdd
(
answer
,
"Transport"
,
"RTP/AVP/UDP;client_port=%d-%d"
,
i_port
,
i_port
+
1
);
if
(
p_media
->
b_raw
)
{
if
(
strstr
(
psz_transport
,
"MP2T/H2221/UDP"
)
)
{
httpd_MsgAdd
(
answer
,
"Transport"
,
"MP2T/H2221/UDP;client_port=%d-%d"
,
i_port
,
i_port
+
1
);
}
else
if
(
strstr
(
psz_transport
,
"RAW/RAW/UDP"
)
)
{
httpd_MsgAdd
(
answer
,
"Transport"
,
"RAW/RAW/UDP;client_port=%d-%d"
,
i_port
,
i_port
+
1
);
}
}
else
{
httpd_MsgAdd
(
answer
,
"Transport"
,
"RTP/AVP/UDP;client_port=%d-%d"
,
i_port
,
i_port
+
1
);
}
}
else
/* TODO strstr( psz_transport, "interleaved" ) ) */
{
...
...
@@ -940,6 +980,7 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
}
if
(
!
psz_playnow
)
break
;
...
...
@@ -968,10 +1009,13 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
}
}
answer
->
i_status
=
200
;
answer
->
psz_status
=
strdup
(
"OK"
);
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
if
(
!
psz_playnow
)
{
answer
->
i_status
=
200
;
answer
->
psz_status
=
strdup
(
"OK"
);
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
}
break
;
case
HTTPD_MSG_TEARDOWN
:
...
...
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