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
8b9537f7
Commit
8b9537f7
authored
Aug 23, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More boundary cleanup
parent
4db2dc94
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
34 deletions
+41
-34
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+19
-25
modules/stream_out/rtp.h
modules/stream_out/rtp.h
+5
-4
modules/stream_out/rtsp.c
modules/stream_out/rtsp.c
+17
-5
No files found.
modules/stream_out/rtp.c
View file @
8b9537f7
...
@@ -524,12 +524,6 @@ static void Close( vlc_object_t * p_this )
...
@@ -524,12 +524,6 @@ static void Close( vlc_object_t * p_this )
if
(
p_sys
->
p_httpd_host
)
if
(
p_sys
->
p_httpd_host
)
httpd_HostDelete
(
p_sys
->
p_httpd_host
);
httpd_HostDelete
(
p_sys
->
p_httpd_host
);
if
(
p_sys
->
p_rtsp_url
)
httpd_UrlDelete
(
p_sys
->
p_rtsp_url
);
if
(
p_sys
->
p_rtsp_host
)
httpd_HostDelete
(
p_sys
->
p_rtsp_host
);
if
(
p_sys
->
psz_session_name
)
if
(
p_sys
->
psz_session_name
)
free
(
p_sys
->
psz_session_name
);
free
(
p_sys
->
psz_session_name
);
...
@@ -882,9 +876,10 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
...
@@ -882,9 +876,10 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
id
->
psz_destination
=
p_sys
->
psz_destination
?
strdup
(
p_sys
->
psz_destination
)
:
NULL
;
id
->
psz_destination
=
p_sys
->
psz_destination
?
strdup
(
p_sys
->
psz_destination
)
:
NULL
;
id
->
i_port
=
i_port
;
id
->
i_port
=
i_port
;
id
->
p_rtsp_url
=
NULL
;
id
->
p_rtsp_url
=
NULL
;
vlc_mutex_init
(
p_stream
,
&
id
->
lock_rtsp
);
id
->
i_rtsp_access
=
0
;
vlc_mutex_init
(
p_stream
,
&
id
->
lock_sink
);
id
->
rtsp_access
=
NULL
;
id
->
i_sink
=
0
;
id
->
sink
=
NULL
;
switch
(
p_fmt
->
i_codec
)
switch
(
p_fmt
->
i_codec
)
{
{
...
@@ -1111,7 +1106,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
...
@@ -1111,7 +1106,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
);
msg_Dbg
(
p_stream
,
"maximum RTP packet size: %d bytes"
,
id
->
i_mtu
);
if
(
p_sys
->
p_rtsp_url
)
if
(
p_sys
->
p_rtsp_url
)
Rtsp
Setup
Id
(
p_stream
,
id
);
Rtsp
Add
Id
(
p_stream
,
id
);
/* Update p_sys context */
/* Update p_sys context */
vlc_mutex_lock
(
&
p_sys
->
lock_es
);
vlc_mutex_lock
(
&
p_sys
->
lock_es
);
...
@@ -1172,11 +1167,10 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
...
@@ -1172,11 +1167,10 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
sout_MuxDeleteStream
(
p_sys
->
p_mux
,
id
->
p_input
);
sout_MuxDeleteStream
(
p_sys
->
p_mux
,
id
->
p_input
);
}
}
if
(
id
->
p_rtsp_url
)
if
(
id
->
p_rtsp_url
)
{
RtspDelId
(
p_stream
,
id
);
httpd_UrlDelete
(
id
->
p_rtsp_url
);
}
vlc_mutex_destroy
(
&
id
->
lock_sink
);
vlc_mutex_destroy
(
&
id
->
lock_rtsp
);
free
(
id
->
sink
);
if
(
id
->
rtsp_access
)
free
(
id
->
rtsp_access
);
/* Update SDP (sap/file) */
/* Update SDP (sap/file) */
if
(
p_sys
->
b_export_sap
&&
!
p_sys
->
p_mux
)
SapSetup
(
p_stream
);
if
(
p_sys
->
b_export_sap
&&
!
p_sys
->
p_mux
)
SapSetup
(
p_stream
);
...
@@ -1427,12 +1421,12 @@ static void rtp_packetize_common( sout_stream_id_t *id, block_t *out,
...
@@ -1427,12 +1421,12 @@ static void rtp_packetize_common( sout_stream_id_t *id, block_t *out,
static
void
rtp_packetize_send
(
sout_stream_id_t
*
id
,
block_t
*
out
)
static
void
rtp_packetize_send
(
sout_stream_id_t
*
id
,
block_t
*
out
)
{
{
int
i
;
int
i
;
vlc_mutex_lock
(
&
id
->
lock_
rtsp
);
vlc_mutex_lock
(
&
id
->
lock_
sink
);
for
(
i
=
0
;
i
<
id
->
i_
rtsp_access
;
i
++
)
for
(
i
=
0
;
i
<
id
->
i_
sink
;
i
++
)
{
{
sout_AccessOutWrite
(
id
->
rtsp_access
[
i
],
block_Duplicate
(
out
)
);
sout_AccessOutWrite
(
id
->
sink
[
i
],
block_Duplicate
(
out
)
);
}
}
vlc_mutex_unlock
(
&
id
->
lock_
rtsp
);
vlc_mutex_unlock
(
&
id
->
lock_
sink
);
if
(
id
->
p_access
)
if
(
id
->
p_access
)
{
{
...
@@ -1446,16 +1440,16 @@ static void rtp_packetize_send( sout_stream_id_t *id, block_t *out )
...
@@ -1446,16 +1440,16 @@ static void rtp_packetize_send( sout_stream_id_t *id, block_t *out )
int
rtp_add_sink
(
sout_stream_id_t
*
id
,
sout_access_out_t
*
access
)
int
rtp_add_sink
(
sout_stream_id_t
*
id
,
sout_access_out_t
*
access
)
{
{
vlc_mutex_lock
(
&
id
->
lock_
rtsp
);
vlc_mutex_lock
(
&
id
->
lock_
sink
);
TAB_APPEND
(
id
->
i_
rtsp_access
,
id
->
rtsp_access
,
access
);
TAB_APPEND
(
id
->
i_
sink
,
id
->
sink
,
access
);
vlc_mutex_unlock
(
&
id
->
lock_
rtsp
);
vlc_mutex_unlock
(
&
id
->
lock_
sink
);
}
}
void
rtp_del_sink
(
sout_stream_id_t
*
id
,
sout_access_out_t
*
access
)
void
rtp_del_sink
(
sout_stream_id_t
*
id
,
sout_access_out_t
*
access
)
{
{
vlc_mutex_lock
(
&
id
->
lock_
rtsp
);
vlc_mutex_lock
(
&
id
->
lock_
sink
);
TAB_REMOVE
(
id
->
i_
rtsp_access
,
id
->
rtsp_access
,
access
);
TAB_REMOVE
(
id
->
i_
sink
,
id
->
sink
,
access
);
vlc_mutex_unlock
(
&
id
->
lock_
rtsp
);
vlc_mutex_unlock
(
&
id
->
lock_
sink
);
}
}
static
int
rtp_packetize_mpa
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
,
static
int
rtp_packetize_mpa
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
,
...
...
modules/stream_out/rtp.h
View file @
8b9537f7
...
@@ -25,8 +25,9 @@
...
@@ -25,8 +25,9 @@
typedef
struct
rtsp_client_t
rtsp_client_t
;
typedef
struct
rtsp_client_t
rtsp_client_t
;
int
RtspSetup
(
sout_stream_t
*
p_stream
,
const
vlc_url_t
*
url
);
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
);
void
RtspUnsetup
(
sout_stream_t
*
p_stream
);
int
RtspAddId
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
);
void
RtspDelId
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
);
char
*
SDPGenerate
(
const
sout_stream_t
*
p_stream
,
char
*
SDPGenerate
(
const
sout_stream_t
*
p_stream
,
const
char
*
psz_destination
,
vlc_bool_t
b_rtsp
);
const
char
*
psz_destination
,
vlc_bool_t
b_rtsp
);
...
@@ -62,9 +63,9 @@ struct sout_stream_id_t
...
@@ -62,9 +63,9 @@ struct sout_stream_id_t
/* for sending the packets */
/* for sending the packets */
sout_access_out_t
*
p_access
;
sout_access_out_t
*
p_access
;
vlc_mutex_t
lock_
rtsp
;
vlc_mutex_t
lock_
sink
;
int
i_
rtsp_access
;
int
i_
sink
;
sout_access_out_t
**
rtsp_access
;
sout_access_out_t
**
sink
;
/* */
/* */
sout_input_t
*
p_input
;
sout_input_t
*
p_input
;
...
...
modules/stream_out/rtsp.c
View file @
8b9537f7
...
@@ -89,7 +89,21 @@ int RtspSetup( sout_stream_t *p_stream, const vlc_url_t *url )
...
@@ -89,7 +89,21 @@ 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
)
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
while
(
p_sys
->
i_rtsp
>
0
)
RtspClientDel
(
p_stream
,
p_sys
->
rtsp
[
0
]
);
if
(
p_sys
->
p_rtsp_url
)
httpd_UrlDelete
(
p_sys
->
p_rtsp_url
);
if
(
p_sys
->
p_rtsp_host
)
httpd_HostDelete
(
p_sys
->
p_rtsp_host
);
}
int
RtspAddId
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
)
{
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
char
psz_urlc
[
strlen
(
p_sys
->
psz_rtsp_control
)
+
1
+
10
];
char
psz_urlc
[
strlen
(
p_sys
->
psz_rtsp_control
)
+
1
+
10
];
...
@@ -111,11 +125,9 @@ int RtspSetupId( sout_stream_t *p_stream, sout_stream_id_t *id )
...
@@ -111,11 +125,9 @@ int RtspSetupId( sout_stream_t *p_stream, sout_stream_id_t *id )
}
}
void
Rtsp
Unsetup
(
sout_stream_t
*
p_stream
)
void
Rtsp
DelId
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
)
{
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
httpd_UrlDelete
(
id
->
p_rtsp_url
);
while
(
p_sys
->
i_rtsp
>
0
)
RtspClientDel
(
p_stream
,
p_sys
->
rtsp
[
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