Changeset 4f620050a14477a01374b2a54f537fee935f5c82

Show
Ignore:
Timestamp:
05/03/07 22:34:30 (2 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1173130470 +0000
git-parent:

[4380e365008bdb1733b9ea36920b53dd13bfe7ec]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1173130470 +0000
Message:

--sout-udp-rtcp option to force RTCP usage.
(Currently RTCP only Sender Reports are implemented.)

RTCP is auto-enabled for RTP/TS but this could be used by the RTP stream
output plugin to enable RTCP too (in that case, RTP encapsulation is done
in the stream output plugin, so the access output cannot know if it should
do RTCP or not).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access_output/udp.c

    r80de300 r4f62005  
    103103                       "without trying to make the biggest possible packets " \ 
    104104                       "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") 
    105108#define AUTO_MCAST_TEXT N_("Automatic multicast streaming") 
    106109#define AUTO_MCAST_LONGTEXT N_("Allocates an outbound multicast address " \ 
     
    120123                                 VLC_TRUE ); 
    121124    add_suppressed_integer( SOUT_CFG_PREFIX "late" ); 
    122     add_bool( SOUT_CFG_PREFIX "raw",  0, NULL, RAW_TEXT, RAW_LONGTEXT, 
     125    add_bool( SOUT_CFG_PREFIX "raw",  VLC_FALSE, NULL, RAW_TEXT, RAW_LONGTEXT, 
    123126                                 VLC_TRUE ); 
    124     add_bool( SOUT_CFG_PREFIX "auto-mcast", 0, NULL, AUTO_MCAST_TEXT, 
     127    add_bool( SOUT_CFG_PREFIX "rtcp",  VLC_FALSE, NULL, RTCP_TEXT, RTCP_LONGTEXT, 
     128              VLC_TRUE ); 
     129    add_bool( SOUT_CFG_PREFIX "auto-mcast", VLC_FALSE, NULL, AUTO_MCAST_TEXT, 
    125130              AUTO_MCAST_LONGTEXT, VLC_TRUE ); 
    126     add_bool( SOUT_CFG_PREFIX "udplite", 0, NULL, UDPLITE_TEXT, UDPLITE_LONGTEXT, VLC_TRUE ); 
     131    add_bool( SOUT_CFG_PREFIX "udplite", VLC_FALSE, NULL, UDPLITE_TEXT, UDPLITE_LONGTEXT, VLC_TRUE ); 
    127132    add_integer( SOUT_CFG_PREFIX "cscov", 12, NULL, CSCOV_TEXT, CSCOV_LONGTEXT, VLC_TRUE ); 
    128133 
     
    142147    "group", 
    143148    "raw", 
     149    "rtcp", 
    144150    "lite", 
    145151    "cscov", 
     
    191197    int                 i_mtu; 
    192198 
    193     vlc_bool_t          b_rtpts; // 1 if add rtp/ts header 
     199    vlc_bool_t          b_rtpts; // true for RTP/MP2 encapsulation 
    194200    vlc_bool_t          b_mtu_warning; 
    195201    uint16_t            i_sequence_number; 
     
    224230 
    225231    vlc_value_t         val; 
     232    vlc_bool_t          b_rtcp = VLC_FALSE; 
    226233 
    227234    config_ChainParse( p_access, SOUT_CFG_PREFIX, 
     
    248255    { 
    249256        if (strcmp (p_access->psz_access, "rtp") == 0) 
    250             p_sys->b_rtpts = VLC_TRUE; 
     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"); 
    251262    } 
    252263 
     
    367378    p_sys->i_ssrc            = rand()&0xffffffff; 
    368379 
    369     if (p_sys->b_rtpts && OpenRTCP (p_access, proto)) 
     380    if (b_rtcp && OpenRTCP (p_access, proto)) 
    370381    { 
    371382        msg_Err (p_access, "cannot initialize RTCP sender"); 
     
    820831static void CloseRTCP (sout_access_thread_t *obj) 
    821832{ 
     833    if (obj->rtcp_handle == -1) 
     834        return; 
     835 
    822836    uint8_t *ptr = obj->rtcp_data; 
    823837    /* Bye */ 
     
    830844     * we can afford not to check bandwidth constraints here. */ 
    831845    send (obj->rtcp_handle, obj->rtcp_data, 8, 0); 
    832  
    833     if (obj->rtcp_handle != -1) 
    834         net_Close (obj->rtcp_handle); 
     846    net_Close (obj->rtcp_handle); 
    835847} 
    836848