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
8159c4c4
Commit
8159c4c4
authored
Jan 22, 2010
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtp sout: use the URL helper everywhere
parent
e30cb4fb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
modules/stream_out/rtsp.c
modules/stream_out/rtsp.c
+19
-16
No files found.
modules/stream_out/rtsp.c
View file @
8159c4c4
...
@@ -52,7 +52,6 @@ struct rtsp_stream_t
...
@@ -52,7 +52,6 @@ struct rtsp_stream_t
httpd_host_t
*
host
;
httpd_host_t
*
host
;
httpd_url_t
*
url
;
httpd_url_t
*
url
;
char
*
psz_path
;
char
*
psz_path
;
const
char
*
track_sep
;
unsigned
track_id
;
unsigned
track_id
;
unsigned
port
;
unsigned
port
;
...
@@ -93,10 +92,6 @@ rtsp_stream_t *RtspSetup( sout_stream_t *p_stream, const vlc_url_t *url )
...
@@ -93,10 +92,6 @@ rtsp_stream_t *RtspSetup( sout_stream_t *p_stream, const vlc_url_t *url )
if
(
rtsp
->
psz_path
==
NULL
)
if
(
rtsp
->
psz_path
==
NULL
)
goto
error
;
goto
error
;
assert
(
strlen
(
rtsp
->
psz_path
)
>
0
);
rtsp
->
track_sep
=
rtsp
->
psz_path
[
strlen
(
rtsp
->
psz_path
)
-
1
]
==
'/'
?
""
:
"/"
;
msg_Dbg
(
p_stream
,
"RTSP stream: host %s port %d at %s"
,
msg_Dbg
(
p_stream
,
"RTSP stream: host %s port %d at %s"
,
url
->
psz_host
,
rtsp
->
port
,
rtsp
->
psz_path
);
url
->
psz_host
,
rtsp
->
port
,
rtsp
->
psz_path
);
...
@@ -181,12 +176,11 @@ struct rtsp_strack_t
...
@@ -181,12 +176,11 @@ struct rtsp_strack_t
char
*
RtspAppendTrackPath
(
rtsp_stream_id_t
*
id
,
const
char
*
base
)
char
*
RtspAppendTrackPath
(
rtsp_stream_id_t
*
id
,
const
char
*
base
)
{
{
assert
(
(
strlen
(
base
)
>
0
&&
base
[
strlen
(
base
)
-
1
]
==
'/'
)
const
char
*
sep
=
strlen
(
base
)
>
0
&&
base
[
strlen
(
base
)
-
1
]
==
'/'
?
^
(
id
->
stream
->
track_sep
[
0
]
==
'/'
)
);
""
:
"/"
;
char
*
url
;
char
*
url
;
if
(
asprintf
(
&
url
,
"%s%strackID=%u"
,
base
,
id
->
stream
->
track_sep
,
id
->
track_id
)
==
-
1
)
if
(
asprintf
(
&
url
,
"%s%strackID=%u"
,
base
,
sep
,
id
->
track_id
)
==
-
1
)
url
=
NULL
;
url
=
NULL
;
return
url
;
return
url
;
}
}
...
@@ -198,7 +192,7 @@ rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
...
@@ -198,7 +192,7 @@ rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
const
char
*
dst
,
int
ttl
,
const
char
*
dst
,
int
ttl
,
unsigned
loport
,
unsigned
hiport
)
unsigned
loport
,
unsigned
hiport
)
{
{
char
urlbuf
[
sizeof
(
"/trackID=123"
)
+
strlen
(
rtsp
->
psz_path
)]
;
char
*
urlbuf
;
rtsp_stream_id_t
*
id
=
malloc
(
sizeof
(
*
id
)
);
rtsp_stream_id_t
*
id
=
malloc
(
sizeof
(
*
id
)
);
httpd_url_t
*
url
;
httpd_url_t
*
url
;
...
@@ -218,10 +212,16 @@ rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
...
@@ -218,10 +212,16 @@ rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
id
->
hiport
=
hiport
;
id
->
hiport
=
hiport
;
}
}
snprintf
(
urlbuf
,
sizeof
(
urlbuf
),
"%s%strackID=%u"
,
rtsp
->
psz_path
,
urlbuf
=
RtspAppendTrackPath
(
id
,
rtsp
->
psz_path
);
rtsp
->
track_sep
,
id
->
track_id
);
if
(
urlbuf
==
NULL
)
{
free
(
id
);
return
NULL
;
}
msg_Dbg
(
rtsp
->
owner
,
"RTSP: adding %s"
,
urlbuf
);
msg_Dbg
(
rtsp
->
owner
,
"RTSP: adding %s"
,
urlbuf
);
url
=
id
->
url
=
httpd_UrlNewUnique
(
rtsp
->
host
,
urlbuf
,
NULL
,
NULL
,
NULL
);
url
=
id
->
url
=
httpd_UrlNewUnique
(
rtsp
->
host
,
urlbuf
,
NULL
,
NULL
,
NULL
);
free
(
urlbuf
);
if
(
url
==
NULL
)
if
(
url
==
NULL
)
{
{
...
@@ -652,6 +652,8 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
...
@@ -652,6 +652,8 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
ses
=
RtspClientGet
(
rtsp
,
psz_session
);
ses
=
RtspClientGet
(
rtsp
,
psz_session
);
if
(
ses
!=
NULL
)
if
(
ses
!=
NULL
)
{
{
/* The "trackID" part must match what is done in
* RtspAppendTrackPath() */
/* FIXME: we really need to limit the number of tracks... */
/* FIXME: we really need to limit the number of tracks... */
char
info
[
ses
->
trackc
*
(
strlen
(
control
)
char
info
[
ses
->
trackc
*
(
strlen
(
control
)
+
sizeof
(
"url=/trackID=123;seq=65535;"
+
sizeof
(
"url=/trackID=123;seq=65535;"
...
@@ -673,11 +675,12 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
...
@@ -673,11 +675,12 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
}
}
else
else
seq
=
rtp_get_seq
(
tr
->
id
->
sout_id
);
seq
=
rtp_get_seq
(
tr
->
id
->
sout_id
);
char
*
url
=
RtspAppendTrackPath
(
tr
->
id
,
control
);
infolen
+=
sprintf
(
info
+
infolen
,
infolen
+=
sprintf
(
info
+
infolen
,
"url=%s%strackID=%u;seq=%u;rtptime=%u, "
,
"url=%s;seq=%u;rtptime=%u, "
,
control
,
rtsp
->
track_sep
,
url
!=
NULL
?
url
:
""
,
seq
,
tr
->
id
->
track_id
,
seq
,
rtp_compute_ts
(
tr
->
id
->
sout_id
,
ts
)
);
rtp_compute_ts
(
tr
->
id
->
sout_id
,
ts
)
);
free
(
url
);
}
}
}
}
if
(
infolen
>
0
)
if
(
infolen
>
0
)
...
...
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