Changeset 979f5cc201141379f1153ad721b1a6ec4032e20f

Show
Ignore:
Timestamp:
09/15/07 22:10:50 (1 year ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1189887050 +0000
git-parent:

[d212179528ff468f9aed583eef8552203b32093f]

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

Announce API simplification

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_sout.h

    r974be97 r979f5cc  
    209209 
    210210/**************************************************************************** 
    211  * Announce handler mess 
     211 * Announce handler 
    212212 ****************************************************************************/ 
    213213VLC_EXPORT(session_descriptor_t*,sout_AnnounceRegisterSDP, (sout_instance_t *, const char *, const char *, const char *, announce_method_t* ) ); 
    214214VLC_EXPORT( int,                sout_AnnounceUnRegister, (sout_instance_t *,session_descriptor_t* ) ); 
    215215 
    216 VLC_EXPORT(void,                 sout_AnnounceSessionDestroy, (session_descriptor_t *) ); 
    217216VLC_EXPORT(announce_method_t*,   sout_SAPMethod, (void) ); 
    218217VLC_EXPORT(void,                 sout_MethodRelease, (announce_method_t *) ); 
  • modules/stream_out/rtp.c

    rbc650c5 r979f5cc  
    11971197    sout_stream_sys_t *p_sys = p_stream->p_sys; 
    11981198    sout_instance_t   *p_sout = p_stream->p_sout; 
    1199     announce_method_t *p_method = sout_SAPMethod(); 
    12001199 
    12011200    /* Remove the previous session */ 
     
    12031202    { 
    12041203        sout_AnnounceUnRegister( p_sout, p_sys->p_session); 
    1205         sout_AnnounceSessionDestroy( p_sys->p_session ); 
    12061204        p_sys->p_session = NULL; 
    12071205    } 
     
    12091207    if( ( p_sys->i_es > 0 || p_sys->p_mux ) && p_sys->psz_sdp && *p_sys->psz_sdp ) 
    12101208    { 
     1209        announce_method_t *p_method = sout_SAPMethod(); 
    12111210        p_sys->p_session = sout_AnnounceRegisterSDP( p_sout, SOUT_CFG_PREFIX, 
    12121211                                                     p_sys->psz_sdp, 
    12131212                                                     p_sys->psz_destination, 
    12141213                                                     p_method ); 
    1215     } 
    1216  
    1217     sout_MethodRelease( p_method ); 
     1214        sout_MethodRelease( p_method ); 
     1215    } 
     1216 
    12181217    return VLC_SUCCESS; 
    12191218} 
  • modules/stream_out/standard.c

    r5a922f6 r979f5cc  
    409409 
    410410    if( p_sys->p_session != NULL ) 
    411     { 
    412411        sout_AnnounceUnRegister( p_stream->p_sout, p_sys->p_session ); 
    413         sout_AnnounceSessionDestroy( p_sys->p_session ); 
    414     } 
    415412 
    416413    sout_MuxDelete( p_sys->p_mux ); 
  • src/libvlc.sym

    r974be97 r979f5cc  
    266266sout_AccessOutWrite 
    267267sout_AnnounceRegisterSDP 
    268 sout_AnnounceSessionDestroy 
    269268sout_AnnounceUnRegister 
    270269sout_MuxAddStream 
  • src/stream_output/announce.c

    rd212179 r979f5cc  
    4848 
    4949/** 
    50  * Create and initialize a session descriptor 
    51  * 
    52  * \return a new session descriptor 
    53  */ 
    54 static session_descriptor_t * sout_AnnounceSessionCreate (vlc_object_t *obj, 
    55                                                    const char *cfgpref) 
    56 { 
    57     return calloc (1, sizeof (session_descriptor_t)); 
    58 } 
    59  
    60 /** 
    6150 *  Register a new session with the announce handler, using a pregenerated SDP 
    6251 * 
    6352 * \param p_sout a sout instance structure 
    6453 * \param psz_sdp the SDP to register 
    65  * \param psz_uri session address (needed for SAP address auto detection) 
     54 * \param psz_dst session address (needed for SAP address auto detection) 
    6655 * \param p_method an announce method descriptor 
    6756 * \return the new session descriptor structure 
     
    6958session_descriptor_t * 
    7059sout_AnnounceRegisterSDP( sout_instance_t *p_sout, const char *cfgpref, 
    71                           const char *psz_sdp, const char *psz_uri
     60                          const char *psz_sdp, const char *psz_dst
    7261                          announce_method_t *p_method ) 
    7362{ 
     
    8978    } 
    9079 
    91     p_session = sout_AnnounceSessionCreate(VLC_OBJECT (p_sout), cfgpref); 
     80    p_session = malloc( sizeof( *p_session ) ); 
     81    memset( p_session, 0, sizeof( *p_session ) ); 
    9282    p_session->psz_sdp = strdup( psz_sdp ); 
    9383 
    9484    /* GRUIK. We should not convert back-and-forth from string to numbers */ 
    9585    struct addrinfo *res; 
    96     if (vlc_getaddrinfo (VLC_OBJECT (p_sout), psz_uri, 0, NULL, &res) == 0) 
     86    if (vlc_getaddrinfo (VLC_OBJECT (p_sout), psz_dst, 0, NULL, &res) == 0) 
    9787    { 
    9888        if (res->ai_addrlen <= sizeof (p_session->addr)) 
     
    129119    } 
    130120    i_ret  = announce_UnRegister( p_announce, p_session ); 
     121    if( i_ret == 0 ) 
     122        free( p_session ); 
    131123 
    132124    vlc_object_release( p_announce ); 
    133125 
    134126    return i_ret; 
    135 } 
    136  
    137 /** 
    138  * Destroy a session descriptor and free all 
    139  * 
    140  * \param p_session the session to destroy 
    141  * \return Nothing 
    142  */ 
    143 void sout_AnnounceSessionDestroy( session_descriptor_t *p_session ) 
    144 { 
    145     free( p_session ); 
    146127} 
    147128