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
ea18db64
Commit
ea18db64
authored
Jul 29, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Put correct IP4 owner address
- Support IP6 (refs #270)
parent
9416c4e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
28 deletions
+46
-28
modules/misc/rtsp.c
modules/misc/rtsp.c
+46
-28
No files found.
modules/misc/rtsp.c
View file @
ea18db64
...
...
@@ -625,12 +625,22 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
char
*
psz_sdp
=
SDPGenerate
(
p_media
,
cl
);
answer
->
i_status
=
200
;
answer
->
psz_status
=
strdup
(
"OK"
);
httpd_MsgAdd
(
answer
,
"Content-type"
,
"%s"
,
"application/sdp"
);
answer
->
p_body
=
(
uint8_t
*
)
psz_sdp
;
answer
->
i_body
=
strlen
(
psz_sdp
);
if
(
psz_sdp
!=
NULL
)
{
answer
->
i_status
=
200
;
answer
->
psz_status
=
strdup
(
"OK"
);
httpd_MsgAdd
(
answer
,
"Content-type"
,
"%s"
,
"application/sdp"
);
answer
->
p_body
=
(
uint8_t
*
)
psz_sdp
;
answer
->
i_body
=
strlen
(
psz_sdp
);
}
else
{
answer
->
i_status
=
500
;
answer
->
psz_status
=
strdup
(
"Internal server error"
);
answer
->
p_body
=
NULL
;
answer
->
i_body
=
0
;
}
break
;
}
...
...
@@ -937,44 +947,53 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
static
char
*
SDPGenerate
(
const
vod_media_t
*
p_media
,
httpd_client_t
*
cl
)
{
int
i
,
i_size
;
char
*
p
,
*
psz_sdp
,
*
ip
;
char
*
p
,
*
psz_sdp
,
ip
[
NI_MAXNUMERICHOST
],
ipv
;
if
(
httpd_ServerIP
(
cl
,
ip
)
==
NULL
)
return
NULL
;
p
=
strchr
(
ip
,
'%'
);
if
(
p
!=
NULL
)
*
p
=
'\0'
;
/* remove scope if present */
ipv
=
(
strchr
(
ip
,
':'
)
!=
NULL
)
?
'6'
:
'4'
;
/* Calculate size */
i_size
=
s
trlen
(
"v=0
\r\n
"
)
+
s
trlen
(
"o=- * * IN IP4 127.0.0.1
\r\n
"
)
+
10
+
10
+
s
trlen
(
"s=*
\r\n
"
)
+
strlen
(
p_media
->
psz_session_name
)
+
s
trlen
(
"i=*
\r\n
"
)
+
strlen
(
p_media
->
psz_session_description
)
+
s
trlen
(
"u=*
\r\n
"
)
+
strlen
(
p_media
->
psz_session_url
)
+
s
trlen
(
"e=*
\r\n
"
)
+
strlen
(
p_media
->
psz_session_email
)
+
s
trlen
(
"t=0 0
\r\n
"
)
+
/* FIXME */
s
trlen
(
"a=tool:"
PACKAGE_STRING
"
\r\n
"
)
+
s
trlen
(
"c=IN IPn */*
\r\n
"
)
+
20
+
10
+
NI_MAXNUMERICHOST
+
s
trlen
(
"a=range:npt=0-1000000000.000
\r\n
"
);
i_size
=
s
izeof
(
"v=0
\r\n
"
)
+
s
izeof
(
"o=- * * IN IP4
\r\n
"
)
+
10
+
NI_MAXNUMERICHOST
+
s
izeof
(
"s=*
\r\n
"
)
+
strlen
(
p_media
->
psz_session_name
)
+
s
izeof
(
"i=*
\r\n
"
)
+
strlen
(
p_media
->
psz_session_description
)
+
s
izeof
(
"u=*
\r\n
"
)
+
strlen
(
p_media
->
psz_session_url
)
+
s
izeof
(
"e=*
\r\n
"
)
+
strlen
(
p_media
->
psz_session_email
)
+
s
izeof
(
"t=0 0
\r\n
"
)
+
/* FIXME */
s
izeof
(
"a=tool:"
PACKAGE_STRING
"
\r\n
"
)
+
s
izeof
(
"c=IN IP4 0.0.0.0
\r\n
"
)
+
20
+
10
+
s
izeof
(
"a=range:npt=0-1000000000.000
\r\n
"
);
for
(
i
=
0
;
i
<
p_media
->
i_es
;
i
++
)
{
media_es_t
*
p_es
=
p_media
->
es
[
i
];
i_size
+=
s
trlen
(
"m=**d*o * RTP/AVP *
\r\n
"
)
+
10
+
10
;
i_size
+=
s
izeof
(
"m=**d*o * RTP/AVP *
\r\n
"
)
+
19
;
if
(
p_es
->
psz_rtpmap
)
{
i_size
+=
s
trlen
(
"a=rtpmap:* *
\r\n
"
)
+
strlen
(
p_es
->
psz_rtpmap
)
+
10
;
i_size
+=
s
izeof
(
"a=rtpmap:* *
\r\n
"
)
+
strlen
(
p_es
->
psz_rtpmap
)
+
9
;
}
if
(
p_es
->
psz_fmtp
)
{
i_size
+=
s
trlen
(
"a=fmtp:* *
\r\n
"
)
+
strlen
(
p_es
->
psz_fmtp
)
+
10
;
i_size
+=
s
izeof
(
"a=fmtp:* *
\r\n
"
)
+
strlen
(
p_es
->
psz_fmtp
)
+
9
;
}
i_size
+=
s
trlen
(
"a=control:*/trackid=*
\r\n
"
)
+
strlen
(
p_media
->
psz_rtsp_control
)
+
10
;
i_size
+=
s
izeof
(
"a=control:*/trackid=*
\r\n
"
)
+
strlen
(
p_media
->
psz_rtsp_control
)
+
9
;
}
p
=
psz_sdp
=
malloc
(
i_size
);
p
+=
sprintf
(
p
,
"v=0
\r\n
"
);
p
+=
sprintf
(
p
,
"o=- "
I64Fd
" %d IN IP
4 127.0.0.1
\r\n
"
,
p_media
->
i_sdp_id
,
p_media
->
i_sdp_version
);
p
+=
sprintf
(
p
,
"o=- "
I64Fd
" %d IN IP
%c %s
\r\n
"
,
p_media
->
i_sdp_id
,
p_media
->
i_sdp_version
,
ipv
,
ip
);
if
(
*
p_media
->
psz_session_name
)
p
+=
sprintf
(
p
,
"s=%s
\r\n
"
,
p_media
->
psz_session_name
);
if
(
*
p_media
->
psz_session_description
)
...
...
@@ -987,7 +1006,7 @@ static char *SDPGenerate( const vod_media_t *p_media, httpd_client_t *cl )
p
+=
sprintf
(
p
,
"t=0 0
\r\n
"
);
/* FIXME */
p
+=
sprintf
(
p
,
"a=tool:"
PACKAGE_STRING
"
\r\n
"
);
p
+=
sprintf
(
p
,
"c=IN IP
4 0.0.0.0
\r\n
"
);
p
+=
sprintf
(
p
,
"c=IN IP
%c %s
\r\n
"
,
ipv
,
ipv
==
'6'
?
"::"
:
"0.0.0.0
"
);
if
(
p_media
->
i_length
>
0
)
p
+=
sprintf
(
p
,
"a=range:npt=0-%.3f
\r\n
"
,
...
...
@@ -1027,6 +1046,5 @@ static char *SDPGenerate( const vod_media_t *p_media, httpd_client_t *cl )
p_media
->
psz_rtsp_control
,
i
);
}
fprintf
(
stderr
,
psz_sdp
);
return
psz_sdp
;
}
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