Changeset 9979fb83d459e83fa82e04dba5ab25b2b14939f9

Show
Ignore:
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
  • NEWS

    r0c8b91b r9979fb8  
    3030 
    3131Input/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 
    3334 
    3435Decoders: 
     
    4546 
    4647Stream output: 
    47  * UDP-Lite (requires OS support) for raw and RTP/TS encapsulation 
     48 * UDP-Lite (requires OS support) for RTP/TS encapsulation 
    4849 
    4950Interfaces: 
  • include/vlc_network.h

    rd9906f4 r9979fb8  
    7171int net_Socket (vlc_object_t *obj, int family, int socktype, int proto); 
    7272 
     73#define net_Connect(a, b, c, d, e) __net_Connect(VLC_OBJECT(a), b, c, d, e) 
    7374VLC_EXPORT( int, __net_Connect, (vlc_object_t *p_this, const char *psz_host, int i_port, int socktype, int protocol) ); 
    7475 
  • modules/access/udp.c

    reb14a72 r9979fb8  
    3838#include <vlc_network.h> 
    3939 
     40/* Big pile of stuff missing form glibc 2.5 */ 
    4041#if defined (HAVE_NETINET_UDPLITE_H) 
    4142# include <netinet/udplite.h> 
     
    4344# define UDPLITE_SEND_CSCOV     10 
    4445# 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 */ 
    4556#endif 
    4657 
     
    97108    add_shortcut( "udplite" ); 
    98109    add_shortcut( "rtptcp" ); 
     110    add_shortcut( "dccp" ); 
    99111 
    100112    set_callbacks( Open, Close ); 
     
    141153    int  i_bind_port, i_server_port = 0; 
    142154    int fam = AF_UNSPEC, proto = IPPROTO_UDP; 
    143     vlc_bool_t b_framed = VLC_FALSE; 
    144155 
    145156    if (strlen (p_access->psz_access) >= 3) 
     
    157168        if (strcmp (p_access->psz_access + 3, "lite") == 0) 
    158169            proto = IPPROTO_UDPLITE; 
     170        else 
    159171        if (strcmp (p_access->psz_access + 3, "tcp") == 0) 
    160         { 
    161172            proto = IPPROTO_TCP; 
    162             b_framed = VLC_TRUE; 
    163         } 
     173        else 
     174        if (strcmp (p_access->psz_access, "dccp") == 0) 
     175            proto = IPPROTO_DCCP; 
    164176    } 
    165177 
     
    214226    MALLOC_ERR( p_access->p_sys, access_sys_t ); p_sys = p_access->p_sys; 
    215227 
    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    } 
    220252    free (psz_name); 
    221253    if( p_sys->fd == -1 ) 
     
    235267#endif 
    236268 
    237     p_sys->b_framed_rtp = b_framed; 
    238     if (b_framed) 
     269    if (p_sys->b_framed_rtp) 
    239270    { 
    240271        /* We don't do autodetection and prebuffering in case of framing */