Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
4c48570a
Commit
4c48570a
authored
Sep 08, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RTCP SR is back
parent
31067bdd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
10 deletions
+21
-10
modules/stream_out/rtcp.c
modules/stream_out/rtcp.c
+6
-5
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+14
-3
modules/stream_out/rtp.h
modules/stream_out/rtp.h
+1
-2
No files found.
modules/stream_out/rtcp.c
View file @
4c48570a
...
...
@@ -59,20 +59,21 @@ struct rtcp_sender_t
};
rtcp_sender_t
*
OpenRTCP
(
vlc_object_t
*
obj
,
int
rtp_fd
,
int
proto
,
uint16_t
dport
)
rtcp_sender_t
*
OpenRTCP
(
vlc_object_t
*
obj
,
int
rtp_fd
,
int
proto
)
{
rtcp_sender_t
*
rtcp
;
uint8_t
*
ptr
;
char
src
[
NI_MAXNUMERICHOST
],
dst
[
NI_MAXNUMERICHOST
];
int
sport
;
int
sport
,
dport
;
int
fd
;
if
(
net_GetSockAddress
(
rtp_fd
,
src
,
&
sport
)
||
net_GetPeerAddress
(
rtp_fd
,
dst
,
NULL
))
||
net_GetPeerAddress
(
rtp_fd
,
dst
,
&
dport
))
return
NULL
;
sport
++
;
dport
++
;
fd
=
net_OpenDgram
(
obj
,
src
,
sport
,
dst
,
dport
,
AF_UNSPEC
,
proto
);
if
(
fd
==
-
1
)
return
NULL
;
...
...
@@ -127,7 +128,7 @@ rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd,
SetWBE
(
lenptr
,
ptr
-
sdes
);
rtcp
->
length
=
ptr
-
rtcp
->
payload
;
return
VLC_SUCCESS
;
return
rtcp
;
}
...
...
modules/stream_out/rtp.c
View file @
4c48570a
...
...
@@ -224,7 +224,7 @@ typedef int (*pf_rtp_packetizer_t)( sout_stream_t *, sout_stream_id_t *,
typedef
struct
rtp_sink_t
{
int
rtp_fd
;
int
rtcp_fd
;
rtcp_sender_t
*
rtcp
;
}
rtp_sink_t
;
struct
sout_stream_id_t
...
...
@@ -1314,7 +1314,10 @@ static void ThreadSend( vlc_object_t *p_this )
vlc_mutex_lock
(
&
id
->
lock_sink
);
for
(
int
i
=
0
;
i
<
id
->
sinkc
;
i
++
)
{
send
(
id
->
sinkv
[
i
].
rtp_fd
,
out
->
p_buffer
,
out
->
i_buffer
,
0
);
SendRTCP
(
id
->
sinkv
[
i
].
rtcp
,
out
);
}
vlc_mutex_unlock
(
&
id
->
lock_sink
);
block_Release
(
out
);
...
...
@@ -1328,7 +1331,10 @@ static inline void rtp_packetize_send( sout_stream_id_t *id, block_t *out )
int
rtp_add_sink
(
sout_stream_id_t
*
id
,
int
fd
)
{
rtp_sink_t
sink
=
{
fd
,
-
1
};
rtp_sink_t
sink
=
{
fd
,
NULL
};
sink
.
rtcp
=
OpenRTCP
(
VLC_OBJECT
(
id
->
p_stream
),
fd
,
IPPROTO_UDP
);
if
(
sink
.
rtcp
==
NULL
)
msg_Err
(
id
,
"RTCP failed!"
);
vlc_mutex_lock
(
&
id
->
lock_sink
);
INSERT_ELEM
(
id
->
sinkv
,
id
->
sinkc
,
id
->
sinkc
,
sink
);
...
...
@@ -1338,18 +1344,23 @@ int rtp_add_sink( sout_stream_id_t *id, int fd )
void
rtp_del_sink
(
sout_stream_id_t
*
id
,
int
fd
)
{
rtp_sink_t
sink
=
{
fd
,
NULL
};
/* NOTE: must be safe to use if fd is not included */
vlc_mutex_lock
(
&
id
->
lock_sink
);
for
(
int
i
=
0
;
i
<
id
->
sinkc
;
i
++
)
{
if
(
id
->
sinkv
[
i
].
rtp_fd
==
fd
)
{
sink
=
id
->
sinkv
[
i
];
REMOVE_ELEM
(
id
->
sinkv
,
id
->
sinkc
,
i
);
break
;
}
}
vlc_mutex_unlock
(
&
id
->
lock_sink
);
net_Close
(
fd
);
CloseRTCP
(
sink
.
rtcp
);
net_Close
(
sink
.
rtp_fd
);
}
/****************************************************************************
...
...
modules/stream_out/rtp.h
View file @
4c48570a
...
...
@@ -41,7 +41,6 @@ void rtp_del_sink( sout_stream_id_t *id, int fd );
/* RTCP */
typedef
struct
rtcp_sender_t
rtcp_sender_t
;
rtcp_sender_t
*
OpenRTCP
(
vlc_object_t
*
obj
,
int
rtp_fd
,
int
proto
,
uint16_t
dport
);
rtcp_sender_t
*
OpenRTCP
(
vlc_object_t
*
obj
,
int
rtp_fd
,
int
proto
);
void
CloseRTCP
(
rtcp_sender_t
*
rtcp
);
void
SendRTCP
(
rtcp_sender_t
*
restrict
rtcp
,
const
block_t
*
rtp
);
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