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
f5122a54
Commit
f5122a54
authored
Jul 28, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Remove dead multicast code
- Fix RTSP error codes
parent
0196d42e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
45 deletions
+11
-45
modules/misc/rtsp.c
modules/misc/rtsp.c
+11
-45
No files found.
modules/misc/rtsp.c
View file @
f5122a54
...
@@ -114,7 +114,6 @@ struct vod_media_t
...
@@ -114,7 +114,6 @@ struct vod_media_t
char
*
psz_rtsp_control
;
char
*
psz_rtsp_control
;
char
*
psz_rtsp_path
;
char
*
psz_rtsp_path
;
char
*
psz_destination
;
int
i_port
;
int
i_port
;
int
i_port_audio
;
int
i_port_audio
;
int
i_port_video
;
int
i_port_video
;
...
@@ -172,7 +171,7 @@ static int RtspCallback( httpd_callback_sys_t *, httpd_client_t *,
...
@@ -172,7 +171,7 @@ static int RtspCallback( httpd_callback_sys_t *, httpd_client_t *,
static
int
RtspCallbackES
(
httpd_callback_sys_t
*
,
httpd_client_t
*
,
static
int
RtspCallbackES
(
httpd_callback_sys_t
*
,
httpd_client_t
*
,
httpd_message_t
*
,
httpd_message_t
*
);
httpd_message_t
*
,
httpd_message_t
*
);
static
char
*
SDPGenerate
(
vod_media_t
*
,
char
*
);
static
char
*
SDPGenerate
(
const
vod_media_t
*
);
static
void
sprintf_hexa
(
char
*
s
,
uint8_t
*
p_data
,
int
i_data
)
static
void
sprintf_hexa
(
char
*
s
,
uint8_t
*
p_data
,
int
i_data
)
{
{
...
@@ -613,7 +612,6 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
...
@@ -613,7 +612,6 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
{
{
vod_media_t
*
p_media
=
(
vod_media_t
*
)
p_args
;
vod_media_t
*
p_media
=
(
vod_media_t
*
)
p_args
;
vod_t
*
p_vod
=
p_media
->
p_vod
;
vod_t
*
p_vod
=
p_media
->
p_vod
;
char
*
psz_destination
=
p_media
->
psz_destination
;
char
*
psz_session
=
NULL
;
char
*
psz_session
=
NULL
;
rtsp_client_t
*
p_rtsp
;
rtsp_client_t
*
p_rtsp
;
...
@@ -630,8 +628,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
...
@@ -630,8 +628,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
case
HTTPD_MSG_DESCRIBE
:
case
HTTPD_MSG_DESCRIBE
:
{
{
char
*
psz_sdp
=
char
*
psz_sdp
=
SDPGenerate
(
p_media
,
psz_destination
?
SDPGenerate
(
p_media
);
psz_destination
:
"0.0.0.0"
);
answer
->
i_status
=
200
;
answer
->
i_status
=
200
;
answer
->
psz_status
=
strdup
(
"OK"
);
answer
->
psz_status
=
strdup
(
"OK"
);
...
@@ -776,27 +773,8 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
...
@@ -776,27 +773,8 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
psz_transport
=
httpd_MsgGet
(
query
,
"Transport"
);
psz_transport
=
httpd_MsgGet
(
query
,
"Transport"
);
fprintf
(
stderr
,
"HTTPD_MSG_SETUP: transport=%s
\n
"
,
psz_transport
);
fprintf
(
stderr
,
"HTTPD_MSG_SETUP: transport=%s
\n
"
,
psz_transport
);
if
(
strstr
(
psz_transport
,
"multicast"
)
&&
p_media
->
psz_destination
)
if
(
strstr
(
psz_transport
,
"unicast"
)
&&
{
strstr
(
psz_transport
,
"client_port="
)
)
fprintf
(
stderr
,
"HTTPD_MSG_SETUP: multicast
\n
"
);
answer
->
i_status
=
200
;
answer
->
psz_status
=
strdup
(
"OK"
);
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
psz_session
=
httpd_MsgGet
(
query
,
"Session"
);
if
(
!
psz_session
||
!*
psz_session
)
{
asprintf
(
&
psz_session
,
"%d"
,
rand
()
);
}
httpd_MsgAdd
(
answer
,
"Transport"
,
"RTP/AVP/UDP;destination=%s;port=%d-%d;ttl=%d"
,
p_media
->
psz_destination
,
p_media
->
i_port
,
p_media
->
i_port
+
1
,
p_media
->
i_ttl
);
}
else
if
(
strstr
(
psz_transport
,
"unicast"
)
&&
strstr
(
psz_transport
,
"client_port="
)
)
{
{
rtsp_client_t
*
p_rtsp
;
rtsp_client_t
*
p_rtsp
;
rtsp_client_es_t
*
p_rtsp_es
;
rtsp_client_es_t
*
p_rtsp_es
;
...
@@ -806,7 +784,7 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
...
@@ -806,7 +784,7 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
if
(
!
ip
)
if
(
!
ip
)
{
{
answer
->
i_status
=
4
00
;
answer
->
i_status
=
5
00
;
answer
->
psz_status
=
strdup
(
"Internal server error"
);
answer
->
psz_status
=
strdup
(
"Internal server error"
);
answer
->
i_body
=
0
;
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
answer
->
p_body
=
NULL
;
...
@@ -828,7 +806,7 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
...
@@ -828,7 +806,7 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
if
(
!
p_rtsp
)
if
(
!
p_rtsp
)
{
{
/* FIXME right error code */
/* FIXME right error code */
answer
->
i_status
=
4
00
;
answer
->
i_status
=
4
54
;
answer
->
psz_status
=
strdup
(
"Unknown session id"
);
answer
->
psz_status
=
strdup
(
"Unknown session id"
);
answer
->
i_body
=
0
;
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
answer
->
p_body
=
NULL
;
...
@@ -853,8 +831,8 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
...
@@ -853,8 +831,8 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
}
}
else
/* TODO strstr( psz_transport, "interleaved" ) ) */
else
/* TODO strstr( psz_transport, "interleaved" ) ) */
{
{
answer
->
i_status
=
4
00
;
answer
->
i_status
=
4
61
;
answer
->
psz_status
=
strdup
(
"
Bad Reques
t"
);
answer
->
psz_status
=
strdup
(
"
Unsupported Transpor
t"
);
answer
->
i_body
=
0
;
answer
->
i_body
=
0
;
answer
->
p_body
=
NULL
;
answer
->
p_body
=
NULL
;
}
}
...
@@ -962,7 +940,7 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
...
@@ -962,7 +940,7 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
* SDPGenerate: TODO
* SDPGenerate: TODO
* FIXME: need to be moved to a common place ?
* FIXME: need to be moved to a common place ?
*****************************************************************************/
*****************************************************************************/
static
char
*
SDPGenerate
(
vod_media_t
*
p_media
,
char
*
psz_destination
)
static
char
*
SDPGenerate
(
const
vod_media_t
*
p_media
)
{
{
int
i
,
i_size
;
int
i
,
i_size
;
char
*
p
,
*
psz_sdp
;
char
*
p
,
*
psz_sdp
;
...
@@ -976,8 +954,7 @@ static char *SDPGenerate( vod_media_t *p_media, char *psz_destination )
...
@@ -976,8 +954,7 @@ static char *SDPGenerate( vod_media_t *p_media, char *psz_destination )
strlen
(
"e=*
\r\n
"
)
+
strlen
(
p_media
->
psz_session_email
)
+
strlen
(
"e=*
\r\n
"
)
+
strlen
(
p_media
->
psz_session_email
)
+
strlen
(
"t=0 0
\r\n
"
)
+
/* FIXME */
strlen
(
"t=0 0
\r\n
"
)
+
/* FIXME */
strlen
(
"a=tool:"
PACKAGE_STRING
"
\r\n
"
)
+
strlen
(
"a=tool:"
PACKAGE_STRING
"
\r\n
"
)
+
strlen
(
"c=IN IP4 */*
\r\n
"
)
+
20
+
10
+
strlen
(
"c=IN IPn */*
\r\n
"
)
+
20
+
10
+
NI_MAXNUMERICHOST
+
strlen
(
psz_destination
?
psz_destination
:
"0.0.0.0"
)
+
strlen
(
"a=range:npt=0-1000000000.000
\r\n
"
);
strlen
(
"a=range:npt=0-1000000000.000
\r\n
"
);
for
(
i
=
0
;
i
<
p_media
->
i_es
;
i
++
)
for
(
i
=
0
;
i
<
p_media
->
i_es
;
i
++
)
...
@@ -1016,18 +993,7 @@ static char *SDPGenerate( vod_media_t *p_media, char *psz_destination )
...
@@ -1016,18 +993,7 @@ static char *SDPGenerate( vod_media_t *p_media, char *psz_destination )
p
+=
sprintf
(
p
,
"t=0 0
\r\n
"
);
/* FIXME */
p
+=
sprintf
(
p
,
"t=0 0
\r\n
"
);
/* FIXME */
p
+=
sprintf
(
p
,
"a=tool:"
PACKAGE_STRING
"
\r\n
"
);
p
+=
sprintf
(
p
,
"a=tool:"
PACKAGE_STRING
"
\r\n
"
);
p
+=
sprintf
(
p
,
"c=IN IP4 %s"
,
psz_destination
?
psz_destination
:
"0.0.0.0"
);
p
+=
sprintf
(
p
,
"c=IN IP4 0.0.0.0
\r\n
"
);
if
(
(
psz_destination
!=
NULL
)
&&
net_AddressIsMulticast
(
p_media
->
p_vod
,
psz_destination
)
)
{
/* Add the ttl if it is a multicast address */
p
+=
sprintf
(
p
,
"/%d
\r\n
"
,
p_media
->
i_ttl
);
}
else
{
p
+=
sprintf
(
p
,
"
\r\n
"
);
}
if
(
p_media
->
i_length
>
0
)
if
(
p_media
->
i_length
>
0
)
p
+=
sprintf
(
p
,
"a=range:npt=0-%.3f
\r\n
"
,
p
+=
sprintf
(
p
,
"a=range:npt=0-%.3f
\r\n
"
,
...
...
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