Changeset 0b879fdfa25b12b2d4ca60e119cf4a1bdafe5c8b
- Timestamp:
- 06/03/07 16:53:43
(2 years ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1173196423 +0000
- git-parent:
[c1432d5dc66274596ec743c608e97e6034e897df]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1173196423 +0000
- Message:
Make --sout-udp-rtcp an integer carrying a port number rather than a boolean
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rdd78530 |
r0b879fd |
|
| 103 | 103 | "without trying to make the biggest possible packets " \ |
|---|
| 104 | 104 | "in order to improve streaming)." ) |
|---|
| 105 | | #define RTCP_TEXT N_("Force RTCP Sender Reports") |
|---|
| 106 | | #define RTCP_LONGTEXT N_("Sends RTCP Sender Report packets even if " \ |
|---|
| 107 | | "RTP encapsulation is not done") |
|---|
| | 105 | #define RTCP_TEXT N_("RTCP destination port number") |
|---|
| | 106 | #define RTCP_LONGTEXT N_("Sends RTCP packets to this port (0 = auto)") |
|---|
| 108 | 107 | #define AUTO_MCAST_TEXT N_("Automatic multicast streaming") |
|---|
| 109 | 108 | #define AUTO_MCAST_LONGTEXT N_("Allocates an outbound multicast address " \ |
|---|
| … | … | |
| 125 | 124 | add_bool( SOUT_CFG_PREFIX "raw", VLC_FALSE, NULL, RAW_TEXT, RAW_LONGTEXT, |
|---|
| 126 | 125 | VLC_TRUE ); |
|---|
| 127 | | add_bool( SOUT_CFG_PREFIX "rtcp", VLC_FALSE, NULL, RTCP_TEXT, RTCP_LONGTEXT, |
|---|
| 128 | | VLC_TRUE ); |
|---|
| | 126 | add_integer( SOUT_CFG_PREFIX "rtcp", 0, NULL, RTCP_TEXT, RTCP_LONGTEXT, |
|---|
| | 127 | VLC_TRUE ); |
|---|
| 129 | 128 | add_bool( SOUT_CFG_PREFIX "auto-mcast", VLC_FALSE, NULL, AUTO_MCAST_TEXT, |
|---|
| 130 | 129 | AUTO_MCAST_LONGTEXT, VLC_TRUE ); |
|---|
| … | … | |
| 211 | 210 | #define RTP_HEADER_LENGTH 12 |
|---|
| 212 | 211 | |
|---|
| 213 | | static int OpenRTCP (sout_access_out_t *obj, int proto); |
|---|
| | 212 | static int OpenRTCP (sout_access_out_t *obj, int proto, uint16_t dport); |
|---|
| 214 | 213 | static void SendRTCP (sout_access_thread_t *obj, uint32_t timestamp); |
|---|
| 215 | 214 | static void CloseRTCP (sout_access_thread_t *obj); |
|---|
| … | … | |
| 224 | 223 | |
|---|
| 225 | 224 | char *psz_dst_addr = NULL; |
|---|
| 226 | | int i_dst_port, proto = IPPROTO_UDP; |
|---|
| | 225 | int i_dst_port, i_rtcp_port = 0, proto = IPPROTO_UDP; |
|---|
| 227 | 226 | const char *protoname = "UDP"; |
|---|
| 228 | 227 | |
|---|
| … | … | |
| 230 | 229 | |
|---|
| 231 | 230 | vlc_value_t val; |
|---|
| 232 | | vlc_bool_t b_rtcp = VLC_FALSE; |
|---|
| 233 | 231 | |
|---|
| 234 | 232 | config_ChainParse( p_access, SOUT_CFG_PREFIX, |
|---|
| … | … | |
| 255 | 253 | { |
|---|
| 256 | 254 | if (strcmp (p_access->psz_access, "rtp") == 0) |
|---|
| 257 | | p_sys->b_rtpts = b_rtcp = VLC_TRUE; |
|---|
| 258 | | else |
|---|
| 259 | | /* This option is really only meant for the RTP streaming output |
|---|
| 260 | | * plugin. Doing RTCP for raw UDP will yield weird results. */ |
|---|
| 261 | | b_rtcp = var_GetBool (p_access, SOUT_CFG_PREFIX"rtcp"); |
|---|
| | 255 | p_sys->b_rtpts = VLC_TRUE; |
|---|
| 262 | 256 | } |
|---|
| 263 | 257 | |
|---|
| … | … | |
| 289 | 283 | } |
|---|
| 290 | 284 | } |
|---|
| | 285 | |
|---|
| | 286 | /* This option is really only meant for the RTP streaming output |
|---|
| | 287 | * plugin. Doing RTCP for raw UDP will yield weird results. */ |
|---|
| | 288 | i_rtcp_port = var_GetInteger (p_access, SOUT_CFG_PREFIX"rtcp"); |
|---|
| | 289 | /* If RTCP port is not specified, use the default, if we do RTP/MP2 encap, |
|---|
| | 290 | * or do not use RTCP at all otherwise. */ |
|---|
| | 291 | if ((i_rtcp_port == 0) && (p_sys->b_rtpts)) |
|---|
| | 292 | i_rtcp_port = i_dst_port + 1; |
|---|
| 291 | 293 | |
|---|
| 292 | 294 | p_sys->p_thread = |
|---|
| … | … | |
| 378 | 380 | p_sys->i_ssrc = rand()&0xffffffff; |
|---|
| 379 | 381 | |
|---|
| 380 | | if (b_rtcp && OpenRTCP (p_access, proto)) |
|---|
| | 382 | if (i_rtcp_port && OpenRTCP (p_access, proto, i_rtcp_port)) |
|---|
| 381 | 383 | { |
|---|
| 382 | 384 | msg_Err (p_access, "cannot initialize RTCP sender"); |
|---|
| … | … | |
| 765 | 767 | * - we do not implement any profile-specific extensions for the time being. |
|---|
| 766 | 768 | */ |
|---|
| 767 | | static int OpenRTCP (sout_access_out_t *obj, int proto) |
|---|
| | 769 | static int OpenRTCP (sout_access_out_t *obj, int proto, uint16_t dport) |
|---|
| 768 | 770 | { |
|---|
| 769 | 771 | sout_access_out_sys_t *p_sys = obj->p_sys; |
|---|
| … | … | |
| 772 | 774 | |
|---|
| 773 | 775 | char src[NI_MAXNUMERICHOST], dst[NI_MAXNUMERICHOST]; |
|---|
| 774 | | int sport, dport; |
|---|
| | 776 | int sport; |
|---|
| 775 | 777 | |
|---|
| 776 | 778 | fd = obj->p_sys->p_thread->i_handle; |
|---|
| 777 | 779 | if (net_GetSockAddress (fd, src, &sport) |
|---|
| 778 | | || net_GetPeerAddress (fd, dst, &dport)) |
|---|
| | 780 | || net_GetPeerAddress (fd, dst, NULL)) |
|---|
| 779 | 781 | return VLC_EGENERIC; |
|---|
| 780 | 782 | |
|---|
| 781 | 783 | sport++; |
|---|
| 782 | | dport++; |
|---|
| 783 | 784 | fd = net_OpenDgram (obj, src, sport, dst, dport, AF_UNSPEC, proto); |
|---|
| 784 | 785 | if (fd == -1) |
|---|