Changeset 9979fb83d459e83fa82e04dba5ab25b2b14939f9
- Timestamp:
- 14/02/07 20:59:54
(2 years ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1171483194 +0000
- git-parent:
[761669f1e221b98c5580feb7c9b30d627780985d]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1171483194 +0000
- Message:
Single service DCCP/RTP/AVP input
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r0c8b91b |
r9979fb8 |
|
| 30 | 30 | |
|---|
| 31 | 31 | Input/Demuxers: |
|---|
| 32 | | * UDP-Lite (requires OS support) for raw and RTP encapsulation |
|---|
| | 32 | * UDP-Lite protocol (requires OS support) for RTP/AVP |
|---|
| | 33 | * DCCP protocol (requires OS support) for RTP/AVP |
|---|
| 33 | 34 | |
|---|
| 34 | 35 | Decoders: |
|---|
| … | … | |
| 45 | 46 | |
|---|
| 46 | 47 | Stream output: |
|---|
| 47 | | * UDP-Lite (requires OS support) for raw and RTP/TS encapsulation |
|---|
| | 48 | * UDP-Lite (requires OS support) for RTP/TS encapsulation |
|---|
| 48 | 49 | |
|---|
| 49 | 50 | Interfaces: |
|---|
| rd9906f4 |
r9979fb8 |
|
| 71 | 71 | int net_Socket (vlc_object_t *obj, int family, int socktype, int proto); |
|---|
| 72 | 72 | |
|---|
| | 73 | #define net_Connect(a, b, c, d, e) __net_Connect(VLC_OBJECT(a), b, c, d, e) |
|---|
| 73 | 74 | VLC_EXPORT( int, __net_Connect, (vlc_object_t *p_this, const char *psz_host, int i_port, int socktype, int protocol) ); |
|---|
| 74 | 75 | |
|---|
| reb14a72 |
r9979fb8 |
|
| 38 | 38 | #include <vlc_network.h> |
|---|
| 39 | 39 | |
|---|
| | 40 | /* Big pile of stuff missing form glibc 2.5 */ |
|---|
| 40 | 41 | #if defined (HAVE_NETINET_UDPLITE_H) |
|---|
| 41 | 42 | # include <netinet/udplite.h> |
|---|
| … | … | |
| 43 | 44 | # define UDPLITE_SEND_CSCOV 10 |
|---|
| 44 | 45 | # define UDPLITE_RECV_CSCOV 11 |
|---|
| | 46 | #endif |
|---|
| | 47 | |
|---|
| | 48 | #ifndef SOCK_DCCP /* provisional API */ |
|---|
| | 49 | # ifdef __linux__ |
|---|
| | 50 | # define SOCK_DCCP 6 |
|---|
| | 51 | # endif |
|---|
| | 52 | #endif |
|---|
| | 53 | |
|---|
| | 54 | #ifndef IPPROTO_DCCP |
|---|
| | 55 | # define IPPROTO_DCCP 33 /* IANA */ |
|---|
| 45 | 56 | #endif |
|---|
| 46 | 57 | |
|---|
| … | … | |
| 97 | 108 | add_shortcut( "udplite" ); |
|---|
| 98 | 109 | add_shortcut( "rtptcp" ); |
|---|
| | 110 | add_shortcut( "dccp" ); |
|---|
| 99 | 111 | |
|---|
| 100 | 112 | set_callbacks( Open, Close ); |
|---|
| … | … | |
| 141 | 153 | int i_bind_port, i_server_port = 0; |
|---|
| 142 | 154 | int fam = AF_UNSPEC, proto = IPPROTO_UDP; |
|---|
| 143 | | vlc_bool_t b_framed = VLC_FALSE; |
|---|
| 144 | 155 | |
|---|
| 145 | 156 | if (strlen (p_access->psz_access) >= 3) |
|---|
| … | … | |
| 157 | 168 | if (strcmp (p_access->psz_access + 3, "lite") == 0) |
|---|
| 158 | 169 | proto = IPPROTO_UDPLITE; |
|---|
| | 170 | else |
|---|
| 159 | 171 | if (strcmp (p_access->psz_access + 3, "tcp") == 0) |
|---|
| 160 | | { |
|---|
| 161 | 172 | proto = IPPROTO_TCP; |
|---|
| 162 | | b_framed = VLC_TRUE; |
|---|
| 163 | | } |
|---|
| | 173 | else |
|---|
| | 174 | if (strcmp (p_access->psz_access, "dccp") == 0) |
|---|
| | 175 | proto = IPPROTO_DCCP; |
|---|
| 164 | 176 | } |
|---|
| 165 | 177 | |
|---|
| … | … | |
| 214 | 226 | MALLOC_ERR( p_access->p_sys, access_sys_t ); p_sys = p_access->p_sys; |
|---|
| 215 | 227 | |
|---|
| 216 | | p_sys->fd = b_framed |
|---|
| 217 | | ? net_ConnectTCP( p_access, psz_server_addr, i_server_port ) |
|---|
| 218 | | : net_OpenDgram( p_access, psz_bind_addr, i_bind_port, |
|---|
| 219 | | psz_server_addr, i_server_port, fam, proto ); |
|---|
| | 228 | switch (proto) |
|---|
| | 229 | { |
|---|
| | 230 | case IPPROTO_UDP: |
|---|
| | 231 | case IPPROTO_UDPLITE: |
|---|
| | 232 | p_sys->fd = net_OpenDgram( p_access, psz_bind_addr, i_bind_port, |
|---|
| | 233 | psz_server_addr, i_server_port, fam, |
|---|
| | 234 | proto ); |
|---|
| | 235 | break; |
|---|
| | 236 | |
|---|
| | 237 | case IPPROTO_TCP: |
|---|
| | 238 | p_sys = net_ConnectTCP( p_access, psz_server_addr, i_server_port ); |
|---|
| | 239 | p_sys->b_framed_rtp = VLC_TRUE; |
|---|
| | 240 | break; |
|---|
| | 241 | |
|---|
| | 242 | case IPPROTO_DCCP: |
|---|
| | 243 | #ifdef SOCK_DCCP |
|---|
| | 244 | p_sys->fd = net_Connect( p_access, psz_server_addr, i_server_port, |
|---|
| | 245 | SOCK_DCCP, IPPROTO_DCCP ); |
|---|
| | 246 | #else |
|---|
| | 247 | p_sys->fd = -1; |
|---|
| | 248 | msg_Err( p_access, "DCCP support not compiled-in!" ); |
|---|
| | 249 | #endif |
|---|
| | 250 | break; |
|---|
| | 251 | } |
|---|
| 220 | 252 | free (psz_name); |
|---|
| 221 | 253 | if( p_sys->fd == -1 ) |
|---|
| … | … | |
| 235 | 267 | #endif |
|---|
| 236 | 268 | |
|---|
| 237 | | p_sys->b_framed_rtp = b_framed; |
|---|
| 238 | | if (b_framed) |
|---|
| | 269 | if (p_sys->b_framed_rtp) |
|---|
| 239 | 270 | { |
|---|
| 240 | 271 | /* We don't do autodetection and prebuffering in case of framing */ |
|---|