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
4db2dc94
Commit
4db2dc94
authored
Aug 23, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup RTP / RTSP boundary a little
parent
39d3b160
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
30 deletions
+42
-30
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+2
-19
modules/stream_out/rtp.h
modules/stream_out/rtp.h
+3
-6
modules/stream_out/rtsp.c
modules/stream_out/rtsp.c
+37
-5
No files found.
modules/stream_out/rtp.c
View file @
4db2dc94
...
...
@@ -514,8 +514,7 @@ static void Close( vlc_object_t * p_this )
}
}
while
(
p_sys
->
i_rtsp
>
0
)
RtspClientDel
(
p_stream
,
p_sys
->
rtsp
[
0
]
);
RtspUnsetup
(
p_stream
);
vlc_mutex_destroy
(
&
p_sys
->
lock_sdp
);
...
...
@@ -1112,23 +1111,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
msg_Dbg
(
p_stream
,
"maximum RTP packet size: %d bytes"
,
id
->
i_mtu
);
if
(
p_sys
->
p_rtsp_url
)
{
char
psz_urlc
[
strlen
(
p_sys
->
psz_rtsp_control
)
+
1
+
10
];
sprintf
(
psz_urlc
,
"%s/trackID=%d"
,
p_sys
->
psz_rtsp_path
,
p_sys
->
i_es
);
msg_Dbg
(
p_stream
,
"rtsp: adding %s
\n
"
,
psz_urlc
);
id
->
p_rtsp_url
=
httpd_UrlNewUnique
(
p_sys
->
p_rtsp_host
,
psz_urlc
,
NULL
,
NULL
,
NULL
);
if
(
id
->
p_rtsp_url
)
{
httpd_UrlCatch
(
id
->
p_rtsp_url
,
HTTPD_MSG_DESCRIBE
,
RtspCallbackId
,
(
void
*
)
id
);
httpd_UrlCatch
(
id
->
p_rtsp_url
,
HTTPD_MSG_SETUP
,
RtspCallbackId
,
(
void
*
)
id
);
httpd_UrlCatch
(
id
->
p_rtsp_url
,
HTTPD_MSG_PLAY
,
RtspCallbackId
,
(
void
*
)
id
);
httpd_UrlCatch
(
id
->
p_rtsp_url
,
HTTPD_MSG_PAUSE
,
RtspCallbackId
,
(
void
*
)
id
);
httpd_UrlCatch
(
id
->
p_rtsp_url
,
HTTPD_MSG_TEARDOWN
,
RtspCallbackId
,
(
void
*
)
id
);
}
}
RtspSetupId
(
p_stream
,
id
);
/* Update p_sys context */
vlc_mutex_lock
(
&
p_sys
->
lock_es
);
...
...
modules/stream_out/rtp.h
View file @
4db2dc94
...
...
@@ -24,12 +24,9 @@
typedef
struct
rtsp_client_t
rtsp_client_t
;
int
RtspSetup
(
sout_stream_t
*
p_stream
,
vlc_url_t
*
);
int
RtspCallbackId
(
httpd_callback_sys_t
*
,
httpd_client_t
*
,
httpd_message_t
*
,
httpd_message_t
*
);
void
RtspClientDel
(
sout_stream_t
*
,
rtsp_client_t
*
);
int
RtspSetup
(
sout_stream_t
*
p_stream
,
const
vlc_url_t
*
url
);
int
RtspSetupId
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
);
void
RtspUnsetup
(
sout_stream_t
*
p_stream
);
char
*
SDPGenerate
(
const
sout_stream_t
*
p_stream
,
const
char
*
psz_destination
,
vlc_bool_t
b_rtsp
);
...
...
modules/stream_out/rtsp.c
View file @
4db2dc94
...
...
@@ -52,10 +52,12 @@ struct rtsp_client_t
static
int
RtspCallback
(
httpd_callback_sys_t
*
p_args
,
httpd_client_t
*
cl
,
httpd_message_t
*
answer
,
httpd_message_t
*
query
);
static
int
RtspCallbackId
(
httpd_callback_sys_t
*
p_args
,
httpd_client_t
*
cl
,
httpd_message_t
*
answer
,
httpd_message_t
*
query
);
static
void
RtspClientDel
(
sout_stream_t
*
p_stream
,
rtsp_client_t
*
rtsp
);
int
RtspSetup
(
sout_stream_t
*
p_stream
,
vlc_url_t
*
url
)
int
RtspSetup
(
sout_stream_t
*
p_stream
,
const
vlc_url_t
*
url
)
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
...
...
@@ -73,7 +75,7 @@ int RtspSetup( sout_stream_t *p_stream, vlc_url_t *url )
url
->
psz_host
,
url
->
i_port
>
0
?
url
->
i_port
:
554
,
p_sys
->
psz_rtsp_path
);
p_sys
->
p_rtsp_url
=
httpd_UrlNewUnique
(
p_sys
->
p_rtsp_host
,
p_sys
->
psz_rtsp_path
,
NULL
,
NULL
,
NULL
);
if
(
p_sys
->
p_rtsp_url
==
0
)
if
(
p_sys
->
p_rtsp_url
==
NULL
)
{
return
VLC_EGENERIC
;
}
...
...
@@ -87,6 +89,36 @@ int RtspSetup( sout_stream_t *p_stream, vlc_url_t *url )
}
int
RtspSetupId
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
)
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
char
psz_urlc
[
strlen
(
p_sys
->
psz_rtsp_control
)
+
1
+
10
];
sprintf
(
psz_urlc
,
"%s/trackID=%d"
,
p_sys
->
psz_rtsp_path
,
p_sys
->
i_es
);
msg_Dbg
(
p_stream
,
"rtsp: adding %s
\n
"
,
psz_urlc
);
id
->
p_rtsp_url
=
httpd_UrlNewUnique
(
p_sys
->
p_rtsp_host
,
psz_urlc
,
NULL
,
NULL
,
NULL
);
if
(
id
->
p_rtsp_url
)
{
httpd_UrlCatch
(
id
->
p_rtsp_url
,
HTTPD_MSG_DESCRIBE
,
RtspCallbackId
,
(
void
*
)
id
);
httpd_UrlCatch
(
id
->
p_rtsp_url
,
HTTPD_MSG_SETUP
,
RtspCallbackId
,
(
void
*
)
id
);
httpd_UrlCatch
(
id
->
p_rtsp_url
,
HTTPD_MSG_PLAY
,
RtspCallbackId
,
(
void
*
)
id
);
httpd_UrlCatch
(
id
->
p_rtsp_url
,
HTTPD_MSG_PAUSE
,
RtspCallbackId
,
(
void
*
)
id
);
httpd_UrlCatch
(
id
->
p_rtsp_url
,
HTTPD_MSG_TEARDOWN
,
RtspCallbackId
,
(
void
*
)
id
);
}
return
VLC_SUCCESS
;
}
void
RtspUnsetup
(
sout_stream_t
*
p_stream
)
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
while
(
p_sys
->
i_rtsp
>
0
)
RtspClientDel
(
p_stream
,
p_sys
->
rtsp
[
0
]
);
}
static
rtsp_client_t
*
RtspClientNew
(
sout_stream_t
*
p_stream
,
const
char
*
psz_session
)
{
rtsp_client_t
*
rtsp
=
malloc
(
sizeof
(
rtsp_client_t
));
...
...
@@ -122,7 +154,7 @@ static rtsp_client_t *RtspClientGet( sout_stream_t *p_stream, const char *psz_se
}
/*static*/
void
RtspClientDel
(
sout_stream_t
*
p_stream
,
rtsp_client_t
*
rtsp
)
static
void
RtspClientDel
(
sout_stream_t
*
p_stream
,
rtsp_client_t
*
rtsp
)
{
int
i
;
TAB_REMOVE
(
p_stream
->
p_sys
->
i_rtsp
,
p_stream
->
p_sys
->
rtsp
,
rtsp
);
...
...
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