Changeset 31456021a2949b237406f493fce2a5a015c19f57
- Timestamp:
- 10/02/07 14:38:42
(2 years ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1171114722 +0000
- git-parent:
[97577c7bc51823c4c2447011a0d1a678bce39e7c]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1171114722 +0000
- Message:
Force RTP for UDP-Lite, as we have no legacy issue (suggestion from Md)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r7605da8 |
r3145602 |
|
| 96 | 96 | add_shortcut( "rtp6" ); |
|---|
| 97 | 97 | add_shortcut( "udplite" ); |
|---|
| 98 | | add_shortcut( "rtplite" ); |
|---|
| 99 | 98 | |
|---|
| 100 | 99 | set_callbacks( Open, Close ); |
|---|
| … | … | |
| 137 | 136 | const char *psz_server_addr, *psz_bind_addr = ""; |
|---|
| 138 | 137 | int i_bind_port, i_server_port = 0; |
|---|
| 139 | | int fam = AF_UNSPEC, proto = IPPROTO_UDP, cscov = 8; |
|---|
| | 138 | int fam = AF_UNSPEC, proto = IPPROTO_UDP; |
|---|
| 140 | 139 | |
|---|
| 141 | 140 | if (strlen (p_access->psz_access) >= 3) |
|---|
| … | … | |
| 153 | 152 | if (strcmp (p_access->psz_access + 3, "lite") == 0) |
|---|
| 154 | 153 | proto = IPPROTO_UDPLITE; |
|---|
| 155 | | } |
|---|
| 156 | | if (strncmp (p_access->psz_access, "rtp", 3) == 0) |
|---|
| 157 | | /* Checksum coverage: RTP header is AT LEAST 12 bytes |
|---|
| 158 | | * in addition to UDP header (8 bytes) */ |
|---|
| 159 | | cscov += 12; |
|---|
| | 154 | } |
|---|
| 160 | 155 | |
|---|
| 161 | 156 | i_bind_port = var_CreateGetInteger( p_access, "server-port" ); |
|---|
| … | … | |
| 223 | 218 | #ifdef UDPLITE_RECV_CSCOV |
|---|
| 224 | 219 | if (proto == IPPROTO_UDPLITE) |
|---|
| 225 | | setsockopt (p_sys->fd, SOL_UDPLITE, UDPLITE_RECV_CSCOV, &cscov, sizeof (cscov)); |
|---|
| | 220 | /* UDP header: 8 bytes + RTP header: 12 bytes (or more) */ |
|---|
| | 221 | setsockopt (p_sys->fd, SOL_UDPLITE, UDPLITE_RECV_CSCOV, |
|---|
| | 222 | &(int){ 20 }, sizeof (int)); |
|---|
| 226 | 223 | #endif |
|---|
| 227 | 224 | |
|---|
| rce6dbc6 |
r3145602 |
|
| 118 | 118 | add_shortcut( "rtp" ); // Will work only with ts muxer |
|---|
| 119 | 119 | add_shortcut( "udplite" ); |
|---|
| 120 | | add_shortcut( "rtplite" ); |
|---|
| 121 | 120 | set_callbacks( Open, Close ); |
|---|
| 122 | 121 | vlc_module_end(); |
|---|
| … | … | |
| 206 | 205 | ppsz_core_options, p_access->p_cfg ); |
|---|
| 207 | 206 | |
|---|
| 208 | | if( !( p_sys = malloc( sizeof( sout_access_out_sys_t ) ) ) ) |
|---|
| | 207 | if( !( p_sys = calloc ( 1, sizeof( sout_access_out_sys_t ) ) ) ) |
|---|
| 209 | 208 | { |
|---|
| 210 | 209 | msg_Err( p_access, "not enough memory" ); |
|---|
| 211 | 210 | return VLC_EGENERIC; |
|---|
| 212 | 211 | } |
|---|
| 213 | | memset( p_sys, 0, sizeof(sout_access_out_sys_t) ); |
|---|
| 214 | 212 | p_access->p_sys = p_sys; |
|---|
| 215 | 213 | |
|---|
| 216 | 214 | if( p_access->psz_access != NULL ) |
|---|
| 217 | 215 | { |
|---|
| 218 | | if (strncmp (p_access->psz_access, "rtp", 3) == 0) |
|---|
| 219 | | { |
|---|
| 220 | | p_sys->b_rtpts = 1; |
|---|
| 221 | | cscov += RTP_HEADER_LENGTH; |
|---|
| 222 | | } |
|---|
| 223 | | if ((strlen (p_access->psz_access) >= 3) |
|---|
| 224 | | && (strcmp (p_access->psz_access + 3, "lite") == 0)) |
|---|
| | 216 | if (strcmp (p_access->psz_access, "rtp") == 0) |
|---|
| | 217 | p_sys->b_rtpts = VLC_TRUE; |
|---|
| | 218 | if (strcmp (p_access->psz_access, "udplite") == 0) |
|---|
| | 219 | { |
|---|
| | 220 | protoname = "UDP-Lite"; |
|---|
| 225 | 221 | proto = IPPROTO_UDPLITE; |
|---|
| 226 | | } |
|---|
| | 222 | p_sys->b_rtpts = VLC_TRUE; |
|---|
| | 223 | } |
|---|
| | 224 | } |
|---|
| | 225 | if (p_sys->b_rtpts) |
|---|
| | 226 | cscov += RTP_HEADER_LENGTH; |
|---|
| 227 | 227 | |
|---|
| 228 | 228 | psz_parser = strdup( p_access->psz_name ); |
|---|
| … | … | |
| 271 | 271 | if( i_handle == -1 ) |
|---|
| 272 | 272 | { |
|---|
| 273 | | msg_Err( p_access, "failed to create UDP socket" ); |
|---|
| | 273 | msg_Err( p_access, "failed to create %s socket", protoname ); |
|---|
| 274 | 274 | return VLC_EGENERIC; |
|---|
| 275 | 275 | } |
|---|
| … | … | |
| 311 | 311 | p_access->pf_seek = Seek; |
|---|
| 312 | 312 | |
|---|
| 313 | | msg_Dbg( p_access, "udp access output opened(%s:%d)", |
|---|
| 314 | | psz_dst_addr, i_dst_port ); |
|---|
| | 313 | msg_Dbg( p_access, "%s access output opened(%s:%d)", |
|---|
| | 314 | protoname, psz_dst_addr, i_dst_port ); |
|---|
| 315 | 315 | |
|---|
| 316 | 316 | free( psz_dst_addr ); |
|---|
| … | … | |
| 355 | 355 | p_access->p_sout->i_out_pace_nocontrol--; |
|---|
| 356 | 356 | |
|---|
| 357 | | msg_Dbg( p_access, "udp access output closed" ); |
|---|
| | 357 | msg_Dbg( p_access, "UDP access output closed" ); |
|---|
| 358 | 358 | free( p_sys ); |
|---|
| 359 | 359 | } |
|---|
| … | … | |
| 384 | 384 | if( p_sys->p_buffer->i_dts + p_sys->p_thread->i_caching < mdate() ) |
|---|
| 385 | 385 | { |
|---|
| 386 | | msg_Dbg( p_access, "late packet for udp input (" I64Fd ")", |
|---|
| | 386 | msg_Dbg( p_access, "late packet for UDP input (" I64Fd ")", |
|---|
| 387 | 387 | mdate() - p_sys->p_buffer->i_dts |
|---|
| 388 | 388 | - p_sys->p_thread->i_caching ); |
|---|