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
3ef18d45
Commit
3ef18d45
authored
Dec 14, 2010
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtsp: clean up multicast parameters
parent
87423359
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
37 deletions
+30
-37
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+10
-15
modules/stream_out/rtp.h
modules/stream_out/rtp.h
+1
-2
modules/stream_out/rtsp.c
modules/stream_out/rtsp.c
+18
-19
modules/stream_out/vod.c
modules/stream_out/vod.c
+1
-1
No files found.
modules/stream_out/rtp.c
View file @
3ef18d45
...
...
@@ -316,7 +316,6 @@ struct sout_stream_sys_t
uint16_t
i_port_video
;
uint8_t
proto
;
bool
rtcp_mux
;
int
i_ttl
:
9
;
bool
b_latm
;
/* VoD */
...
...
@@ -502,14 +501,11 @@ static int Open( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
p_sys
->
i_ttl
=
var_GetInteger
(
p_stream
,
SOUT_CFG_PREFIX
"ttl"
);
if
(
p_sys
->
i_ttl
=
=
-
1
)
int
i_ttl
=
var_GetInteger
(
p_stream
,
SOUT_CFG_PREFIX
"ttl"
);
if
(
i_ttl
!
=
-
1
)
{
/* Normally, we should let the default hop limit up to the core,
* but we have to know it to write our RTSP headers properly,
* which is why we ask the core. FIXME: broken when neither
* sout-rtp-ttl nor ttl are set. */
p_sys
->
i_ttl
=
var_InheritInteger
(
p_stream
,
"ttl"
);
var_Create
(
p_stream
,
"ttl"
,
VLC_VAR_INTEGER
);
var_SetInteger
(
p_stream
,
"ttl"
,
i_ttl
);
}
p_sys
->
b_latm
=
var_GetBool
(
p_stream
,
SOUT_CFG_PREFIX
"mp4a-latm"
);
...
...
@@ -1020,6 +1016,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
id
->
i_seq_sent_next
=
id
->
i_sequence
;
int
mcast_fd
=
-
1
;
if
(
p_sys
->
psz_destination
!=
NULL
)
{
/* Choose the port */
...
...
@@ -1094,9 +1091,8 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
default:
{
int
ttl
=
(
p_sys
->
i_ttl
>=
0
)
?
p_sys
->
i_ttl
:
-
1
;
int
fd
=
net_ConnectDgram
(
p_stream
,
p_sys
->
psz_destination
,
i_port
,
ttl
,
p_sys
->
proto
);
i_port
,
-
1
,
p_sys
->
proto
);
if
(
fd
==
-
1
)
{
msg_Err
(
p_stream
,
"cannot create RTP socket"
);
...
...
@@ -1107,6 +1103,8 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
setsockopt
(
fd
,
SOL_SOCKET
,
SO_RCVBUF
,
&
(
int
){
0
},
sizeof
(
int
));
rtp_add_sink
(
id
,
fd
,
p_sys
->
rtcp_mux
,
NULL
);
/* FIXME: test if this is multicast */
mcast_fd
=
fd
;
}
}
}
...
...
@@ -1143,11 +1141,8 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
p_sys
->
i_pts_offset
);
if
(
p_sys
->
rtsp
!=
NULL
)
id
->
rtsp_id
=
RtspAddId
(
p_sys
->
rtsp
,
id
,
GetDWBE
(
id
->
ssrc
),
id
->
rtp_fmt
.
clock_rate
,
p_sys
->
psz_destination
,
p_sys
->
i_ttl
,
id
->
i_port
,
id
->
i_port
+
1
);
id
->
rtsp_id
=
RtspAddId
(
p_sys
->
rtsp
,
id
,
GetDWBE
(
id
->
ssrc
),
id
->
rtp_fmt
.
clock_rate
,
mcast_fd
);
id
->
p_fifo
=
block_FifoNew
();
if
(
unlikely
(
id
->
p_fifo
==
NULL
)
)
...
...
modules/stream_out/rtp.h
View file @
3ef18d45
...
...
@@ -31,8 +31,7 @@ void RtspUnsetup( rtsp_stream_t *rtsp );
rtsp_stream_id_t
*
RtspAddId
(
rtsp_stream_t
*
rtsp
,
sout_stream_id_t
*
sid
,
uint32_t
ssrc
,
unsigned
clock_rate
,
const
char
*
dst
,
int
ttl
,
unsigned
loport
,
unsigned
hiport
);
int
mcast_fd
);
void
RtspDelId
(
rtsp_stream_t
*
rtsp
,
rtsp_stream_id_t
*
);
char
*
RtspAppendTrackPath
(
rtsp_stream_id_t
*
id
,
const
char
*
base
);
...
...
modules/stream_out/rtsp.c
View file @
3ef18d45
...
...
@@ -170,13 +170,11 @@ struct rtsp_stream_id_t
{
rtsp_stream_t
*
stream
;
sout_stream_id_t
*
sout_id
;
unsigned
clock_rate
;
/* needed to compute rtptime in RTP-Info */
httpd_url_t
*
url
;
const
char
*
dst
;
int
ttl
;
unsigned
track_id
;
uint32_t
ssrc
;
uint16_t
loport
,
hiport
;
unsigned
clock_rate
;
/* needed to compute rtptime in RTP-Info */
int
mcast_fd
;
};
...
...
@@ -226,9 +224,7 @@ char *RtspAppendTrackPath( rtsp_stream_id_t *id, const char *base )
rtsp_stream_id_t
*
RtspAddId
(
rtsp_stream_t
*
rtsp
,
sout_stream_id_t
*
sid
,
uint32_t
ssrc
,
unsigned
clock_rate
,
/* Multicast stuff - TODO: cleanup */
const
char
*
dst
,
int
ttl
,
unsigned
loport
,
unsigned
hiport
)
int
mcast_fd
)
{
if
(
rtsp
->
track_id
>
999
)
{
...
...
@@ -248,13 +244,7 @@ rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
id
->
track_id
=
rtsp
->
track_id
;
id
->
ssrc
=
ssrc
;
id
->
clock_rate
=
clock_rate
;
id
->
dst
=
dst
;
if
(
id
->
dst
!=
NULL
)
{
id
->
ttl
=
ttl
;
id
->
loport
=
loport
;
id
->
hiport
=
hiport
;
}
id
->
mcast_fd
=
mcast_fd
;
urlbuf
=
RtspAppendTrackPath
(
id
,
rtsp
->
psz_path
);
if
(
urlbuf
==
NULL
)
...
...
@@ -684,7 +674,7 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
tpt
=
transport_next
(
tpt
)
)
{
bool
b_multicast
=
true
,
b_unsupp
=
false
;
unsigned
loport
=
5004
,
hiport
=
5005
;
/* from RFC3551 */
unsigned
loport
=
5004
,
hiport
;
/* from RFC3551 */
/* Check transport protocol. */
/* Currently, we only support RTP/AVP over UDP */
...
...
@@ -752,10 +742,19 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
if
(
b_multicast
)
{
const
char
*
dst
=
id
->
dst
;
if
(
dst
==
NULL
)
char
dst
[
NI_MAXNUMERICHOST
];
int
dport
,
ttl
;
if
(
id
->
mcast_fd
==
-
1
)
continue
;
net_GetPeerAddress
(
id
->
mcast_fd
,
dst
,
&
dport
);
ttl
=
var_InheritInteger
(
owner
,
"ttl"
);
if
(
ttl
<=
0
)
/* FIXME: the TTL is left to the OS default, we can
* only guess that it's 1. */
ttl
=
1
;
if
(
psz_session
==
NULL
)
{
/* Create a dummy session ID */
...
...
@@ -768,8 +767,8 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
httpd_MsgAdd
(
answer
,
"Transport"
,
"RTP/AVP/UDP;destination=%s;port=%u-%u;"
"ttl=%d;mode=play"
,
dst
,
id
->
loport
,
id
->
hiport
,
(
id
->
ttl
>
0
)
?
id
->
ttl
:
1
);
dst
,
dport
,
dport
+
1
,
ttl
);
/* FIXME: this doesn't work with RTP + RTCP mux */
}
else
{
...
...
modules/stream_out/vod.c
View file @
3ef18d45
...
...
@@ -301,7 +301,7 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
{
media_es_t
*
p_es
=
p_media
->
es
[
i
];
p_es
->
rtsp_id
=
RtspAddId
(
p_media
->
rtsp
,
NULL
,
0
,
p_es
->
rtp_fmt
.
clock_rate
,
NULL
,
0
,
0
,
0
);
p_es
->
rtp_fmt
.
clock_rate
,
-
1
);
if
(
p_es
->
rtsp_id
==
NULL
)
goto
error
;
}
...
...
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