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
3fa37fdc
Commit
3fa37fdc
authored
Mar 22, 2006
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for X-Playnow RTSP option
parent
24f39790
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
28 deletions
+78
-28
modules/misc/rtsp.c
modules/misc/rtsp.c
+17
-6
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+26
-10
src/network/httpd.c
src/network/httpd.c
+35
-12
No files found.
modules/misc/rtsp.c
View file @
3fa37fdc
...
...
@@ -651,8 +651,10 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
char
*
psz_transport
=
NULL
;
char
*
psz_playnow
=
NULL
;
/* support option: x-playNow */
char
*
psz_session
=
NULL
;
char
*
psz_cseq
=
NULL
;
rtsp_client_t
*
p_rtsp
;
int
i_port
=
0
;
int
i_cseq
=
0
;
if
(
answer
==
NULL
||
query
==
NULL
)
return
VLC_SUCCESS
;
...
...
@@ -756,7 +758,8 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
answer
->
p_body
=
NULL
;
}
if
(
!
psz_playnow
||
!*
psz_playnow
)
/* Intentional fall-through on x-playNow option in RTSP request */
if
(
!
psz_playnow
)
break
;
}
...
...
@@ -891,8 +894,9 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
httpd_MsgAdd
(
answer
,
"Server"
,
"VLC Server"
);
httpd_MsgAdd
(
answer
,
"Content-Length"
,
"%d"
,
answer
->
i_body
);
httpd_MsgAdd
(
answer
,
"Cseq"
,
"%d"
,
atoi
(
httpd_MsgGet
(
query
,
"Cseq"
)
)
);
psz_cseq
=
httpd_MsgGet
(
query
,
"Cseq"
);
psz_cseq
?
i_cseq
=
atoi
(
psz_cseq
)
:
0
;
httpd_MsgAdd
(
answer
,
"Cseq"
,
"%d"
,
i_cseq
);
httpd_MsgAdd
(
answer
,
"Cache-Control"
,
"%s"
,
"no-cache"
);
if
(
psz_session
)
...
...
@@ -914,6 +918,8 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
char
*
psz_playnow
=
NULL
;
/* support option: x-playNow */
char
*
psz_session
=
NULL
;
char
*
psz_position
=
NULL
;
char
*
psz_cseq
=
NULL
;
int
i_cseq
=
0
;
int
i
;
if
(
answer
==
NULL
||
query
==
NULL
)
return
VLC_SUCCESS
;
...
...
@@ -1021,7 +1027,8 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
answer
->
p_body
=
NULL
;
}
if
(
!
psz_playnow
||
!*
psz_playnow
)
/* Intentional fall-through on x-playNow option in RTSP request */
if
(
!
psz_playnow
)
break
;
case
HTTPD_MSG_PLAY
:
...
...
@@ -1116,8 +1123,12 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
httpd_MsgAdd
(
answer
,
"Server"
,
"VLC Server"
);
httpd_MsgAdd
(
answer
,
"Content-Length"
,
"%d"
,
answer
->
i_body
);
httpd_MsgAdd
(
answer
,
"Cseq"
,
"%d"
,
atoi
(
httpd_MsgGet
(
query
,
"Cseq"
)
)
);
psz_cseq
=
httpd_MsgGet
(
query
,
"Cseq"
);
if
(
psz_cseq
)
i_cseq
=
atoi
(
psz_cseq
);
else
i_cseq
=
0
;
httpd_MsgAdd
(
answer
,
"Cseq"
,
"%d"
,
i_cseq
);
httpd_MsgAdd
(
answer
,
"Cache-Control"
,
"%s"
,
"no-cache"
);
if
(
psz_session
)
...
...
modules/stream_out/rtp.c
View file @
3fa37fdc
...
...
@@ -770,7 +770,6 @@ static char *SDPGenerate( const sout_stream_t *p_stream,
const
char
*
psz_destination
,
vlc_bool_t
b_rtsp
)
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_instance_t
*
p_sout
=
p_stream
->
p_sout
;
int
i_size
;
char
*
psz_sdp
,
*
p
,
ipv
;
int
i
;
...
...
@@ -1497,6 +1496,9 @@ static rtsp_client_t *RtspClientNew( sout_stream_t *p_stream, char *psz_session
static
rtsp_client_t
*
RtspClientGet
(
sout_stream_t
*
p_stream
,
char
*
psz_session
)
{
int
i
;
if
(
psz_session
)
return
NULL
;
for
(
i
=
0
;
i
<
p_stream
->
p_sys
->
i_rtsp
;
i
++
)
{
if
(
!
strcmp
(
p_stream
->
p_sys
->
rtsp
[
i
]
->
psz_session
,
psz_session
)
)
...
...
@@ -1559,8 +1561,10 @@ static int RtspCallback( httpd_callback_sys_t *p_args,
{
sout_stream_t
*
p_stream
=
(
sout_stream_t
*
)
p_args
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
char
*
psz_destination
=
p_sys
->
psz_destination
;
char
*
psz_session
=
NULL
;
char
*
psz_destination
=
p_sys
->
psz_destination
;
char
*
psz_session
=
NULL
;
char
*
psz_cseq
=
NULL
;
int
i_cseq
=
0
;
if
(
answer
==
NULL
||
query
==
NULL
)
{
...
...
@@ -1673,7 +1677,12 @@ static int RtspCallback( httpd_callback_sys_t *p_args,
}
httpd_MsgAdd
(
answer
,
"Server"
,
PACKAGE_STRING
);
httpd_MsgAdd
(
answer
,
"Content-Length"
,
"%d"
,
answer
->
i_body
);
httpd_MsgAdd
(
answer
,
"Cseq"
,
"%d"
,
atoi
(
httpd_MsgGet
(
query
,
"Cseq"
)
)
);
psz_cseq
=
httpd_MsgGet
(
query
,
"Cseq"
);
if
(
psz_cseq
)
i_cseq
=
atoi
(
psz_cseq
);
else
i_cseq
=
0
;
httpd_MsgAdd
(
answer
,
"Cseq"
,
"%d"
,
i_cseq
);
httpd_MsgAdd
(
answer
,
"Cache-Control"
,
"%s"
,
"no-cache"
);
if
(
psz_session
)
...
...
@@ -1683,15 +1692,17 @@ static int RtspCallback( httpd_callback_sys_t *p_args,
return
VLC_SUCCESS
;
}
static
int
RtspCallbackId
(
httpd_callback_sys_t
*
p_args
,
static
int
RtspCallbackId
(
httpd_callback_sys_t
*
p_args
,
httpd_client_t
*
cl
,
httpd_message_t
*
answer
,
httpd_message_t
*
query
)
{
sout_stream_id_t
*
id
=
(
sout_stream_id_t
*
)
p_args
;
sout_stream_t
*
p_stream
=
id
->
p_stream
;
sout_instance_t
*
p_sout
=
p_stream
->
p_sout
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
char
*
psz_session
=
NULL
;
char
*
psz_session
=
NULL
;
char
*
psz_cseq
=
NULL
;
int
i_cseq
=
0
;
if
(
answer
==
NULL
||
query
==
NULL
)
{
...
...
@@ -1719,7 +1730,7 @@ static int RtspCallbackId( httpd_callback_sys_t *p_args,
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
psz_session
=
httpd_MsgGet
(
query
,
"Session"
);
if
(
*
psz_session
==
0
)
if
(
!
psz_session
)
{
psz_session
=
malloc
(
100
);
sprintf
(
psz_session
,
"%d"
,
rand
()
);
...
...
@@ -1750,7 +1761,7 @@ static int RtspCallbackId( httpd_callback_sys_t *p_args,
//fprintf( stderr, "HTTPD_MSG_SETUP: unicast ip=%s port=%d\n", ip, i_port );
psz_session
=
httpd_MsgGet
(
query
,
"Session"
);
if
(
*
psz_session
==
0
)
if
(
!
psz_session
)
{
psz_session
=
malloc
(
100
);
sprintf
(
psz_session
,
"%d"
,
rand
()
);
...
...
@@ -1819,7 +1830,12 @@ static int RtspCallbackId( httpd_callback_sys_t *p_args,
}
httpd_MsgAdd
(
answer
,
"Server"
,
"VLC Server"
);
httpd_MsgAdd
(
answer
,
"Content-Length"
,
"%d"
,
answer
->
i_body
);
httpd_MsgAdd
(
answer
,
"Cseq"
,
"%d"
,
atoi
(
httpd_MsgGet
(
query
,
"Cseq"
)
)
);
psz_cseq
=
httpd_MsgGet
(
query
,
"Cseq"
);
if
(
psz_cseq
)
i_cseq
=
atoi
(
psz_cseq
);
else
i_cseq
=
0
;
httpd_MsgAdd
(
answer
,
"Cseq"
,
"%d"
,
i_cseq
);
httpd_MsgAdd
(
answer
,
"Cache-Control"
,
"%s"
,
"no-cache"
);
if
(
psz_session
)
...
...
src/network/httpd.c
View file @
3fa37fdc
...
...
@@ -367,6 +367,7 @@ static int httpd_FileCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl,
httpd_file_t
*
file
=
(
httpd_file_t
*
)
p_sys
;
uint8_t
*
psz_args
=
query
->
psz_args
;
uint8_t
**
pp_body
,
*
p_body
;
char
*
psz_connection
=
NULL
;
int
*
pi_body
,
i_body
;
if
(
answer
==
NULL
||
query
==
NULL
)
...
...
@@ -410,10 +411,10 @@ static int httpd_FileCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl,
}
/* We respect client request */
if
(
strcmp
(
httpd_MsgGet
(
&
cl
->
query
,
"Connection"
),
""
)
)
psz_connection
=
httpd_MsgGet
(
&
cl
->
query
,
"Connection"
);
if
(
psz_connection
!=
NULL
)
{
httpd_MsgAdd
(
answer
,
"Connection"
,
httpd_MsgGet
(
&
cl
->
query
,
"Connection"
)
);
httpd_MsgAdd
(
answer
,
"Connection"
,
psz_connection
);
}
httpd_MsgAdd
(
answer
,
"Content-Length"
,
"%d"
,
answer
->
i_body
);
...
...
@@ -1342,7 +1343,7 @@ char *httpd_MsgGet( httpd_message_t *msg, char *name )
return
msg
->
value
[
i
];
}
}
return
""
;
return
NULL
;
}
void
httpd_MsgAdd
(
httpd_message_t
*
msg
,
char
*
name
,
char
*
psz_value
,
...
)
...
...
@@ -2052,6 +2053,7 @@ static void httpd_HostThread( httpd_host_t *host )
}
else
if
(
i_msg
==
HTTPD_MSG_OPTIONS
)
{
char
*
psz_cseq
=
NULL
;
int
i_cseq
;
/* unimplemented */
...
...
@@ -2064,7 +2066,11 @@ static void httpd_HostThread( httpd_host_t *host )
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
i_cseq
=
atoi
(
httpd_MsgGet
(
query
,
"Cseq"
)
);
psz_cseq
=
httpd_MsgGet
(
query
,
"Cseq"
);
if
(
psz_cseq
)
i_cseq
=
atoi
(
psz_cseq
);
else
i_cseq
=
0
;
httpd_MsgAdd
(
answer
,
"Cseq"
,
"%d"
,
i_cseq
);
httpd_MsgAdd
(
answer
,
"Server"
,
"VLC Server"
);
httpd_MsgAdd
(
answer
,
"Public"
,
"DESCRIBE, SETUP, "
...
...
@@ -2157,7 +2163,8 @@ static void httpd_HostThread( httpd_host_t *host )
char
*
id
;
asprintf
(
&
id
,
"%s:%s"
,
url
->
psz_user
,
url
->
psz_password
);
auth
=
malloc
(
strlen
(
b64
)
+
1
);
if
(
b64
)
auth
=
malloc
(
strlen
(
b64
)
+
1
);
else
auth
=
malloc
(
strlen
(
""
)
+
1
);
if
(
!
strncasecmp
(
b64
,
"BASIC"
,
5
)
)
{
...
...
@@ -2292,13 +2299,29 @@ static void httpd_HostThread( httpd_host_t *host )
{
if
(
cl
->
i_mode
==
HTTPD_CLIENT_FILE
||
cl
->
answer
.
i_body_offset
==
0
)
{
char
*
psz_connection
=
httpd_MsgGet
(
&
cl
->
answer
,
"Connection"
);
char
*
psz_query
=
httpd_MsgGet
(
&
cl
->
query
,
"Connection"
);
vlc_bool_t
b_connection
=
VLC_FALSE
;
vlc_bool_t
b_keepalive
=
VLC_FALSE
;
vlc_bool_t
b_query
=
VLC_FALSE
;
cl
->
url
=
NULL
;
if
(
(
cl
->
query
.
i_proto
==
HTTPD_PROTO_HTTP
&&
(
(
cl
->
answer
.
i_version
==
0
&&
!
strcasecmp
(
httpd_MsgGet
(
&
cl
->
answer
,
"Connection"
),
"Keep-Alive"
)
)
||
(
cl
->
answer
.
i_version
==
1
&&
strcasecmp
(
httpd_MsgGet
(
&
cl
->
answer
,
"Connection"
),
"Close"
)
)
)
)
||
(
cl
->
query
.
i_proto
==
HTTPD_PROTO_RTSP
&&
strcasecmp
(
httpd_MsgGet
(
&
cl
->
query
,
"Connection"
),
"Close"
)
&&
strcasecmp
(
httpd_MsgGet
(
&
cl
->
answer
,
"Connection"
),
"Close"
)
)
)
if
(
psz_connection
)
{
b_connection
=
(
strcasecmp
(
psz_connection
,
"Close"
)
==
0
);
b_keepalive
=
(
strcasecmp
(
psz_connection
,
"Keep-Alive"
)
==
0
);
}
if
(
psz_query
)
{
b_query
=
(
strcasecmp
(
psz_query
,
"Close"
)
==
0
);
}
if
(
(
(
cl
->
query
.
i_proto
==
HTTPD_PROTO_HTTP
)
&&
(
(
cl
->
answer
.
i_version
==
0
&&
b_keepalive
)
||
(
cl
->
answer
.
i_version
==
1
&&
!
b_connection
)
)
)
||
(
(
cl
->
query
.
i_proto
==
HTTPD_PROTO_RTSP
)
&&
!
b_query
&&
!
b_connection
)
)
{
httpd_MsgClean
(
&
cl
->
query
);
httpd_MsgInit
(
&
cl
->
query
);
...
...
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