Changeset 974be97baa8cabe04c64f9fb0f363ec5e95573d3

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

[5a922f698001f938fc3347a96244e1f0a01e03f6]

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

Unexport some unused APIs

Files:

Legend:

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

    rbc650c5 r974be97  
    211211 * Announce handler mess 
    212212 ****************************************************************************/ 
    213 VLC_EXPORT( int,                sout_AnnounceRegister, (sout_instance_t *,session_descriptor_t*, announce_method_t* ) ); 
    214213VLC_EXPORT(session_descriptor_t*,sout_AnnounceRegisterSDP, (sout_instance_t *, const char *, const char *, const char *, announce_method_t* ) ); 
    215214VLC_EXPORT( int,                sout_AnnounceUnRegister, (sout_instance_t *,session_descriptor_t* ) ); 
    216215 
    217 VLC_EXPORT(session_descriptor_t*,sout_AnnounceSessionCreate, (vlc_object_t *obj, const char *cfgpref) ); 
    218 VLC_EXPORT(int,                  sout_SessionSetMedia, (vlc_object_t *obj, session_descriptor_t *, const char *, const char *, int, const char *, int) ); 
    219216VLC_EXPORT(void,                 sout_AnnounceSessionDestroy, (session_descriptor_t *) ); 
    220217VLC_EXPORT(announce_method_t*,   sout_SAPMethod, (void) ); 
  • src/libvlc.sym

    rbc650c5 r974be97  
    11sout_MethodRelease 
    22sout_SAPMethod 
    3 sout_SessionSetMedia 
    43vlc_b64_encode_binary 
    54vlc_strnlen 
     
    266265sout_AccessOutSeek 
    267266sout_AccessOutWrite 
    268 sout_AnnounceRegister 
    269267sout_AnnounceRegisterSDP 
    270 sout_AnnounceSessionCreate 
    271268sout_AnnounceSessionDestroy 
    272269sout_AnnounceUnRegister 
  • src/stream_output/announce.c

    rcc3bd15 r974be97  
    3131#include <assert.h> 
    3232 
     33/* Private functions for the announce handler */ 
     34static announce_handler_t*  announce_HandlerCreate( vlc_object_t *); 
     35static int announce_Register( announce_handler_t *p_announce, 
     36                              session_descriptor_t *p_session, 
     37                              announce_method_t *p_method ); 
     38static int announce_UnRegister( announce_handler_t *p_announce, 
     39                                session_descriptor_t *p_session ); 
    3340 
    3441struct announce_method_t 
     
    4148 
    4249/** 
    43  *  Register a new session with the announce handler 
    44  * 
    45  * \param p_sout a sout instance structure 
    46  * \param p_session a session descriptor 
    47  * \param p_method an announce method descriptor 
    48  * \return VLC_SUCCESS or an error 
    49  */ 
    50 int sout_AnnounceRegister( sout_instance_t *p_sout, 
    51                        session_descriptor_t *p_session, 
    52                        announce_method_t *p_method ) 
    53 { 
    54     int i_ret; 
    55     announce_handler_t *p_announce = (announce_handler_t*) 
    56                               vlc_object_find( p_sout, 
    57                                               VLC_OBJECT_ANNOUNCE, 
    58                                               FIND_ANYWHERE ); 
    59  
    60     if( !p_announce ) 
    61     { 
    62         msg_Dbg( p_sout, "No announce handler found, creating one" ); 
    63         p_announce = announce_HandlerCreate( p_sout ); 
    64         if( !p_announce ) 
    65         { 
    66             msg_Err( p_sout, "Creation failed" ); 
    67             return VLC_ENOMEM; 
    68         } 
    69         vlc_object_yield( p_announce ); 
    70         msg_Dbg( p_sout, "creation done" ); 
    71     } 
    72  
    73     i_ret = announce_Register( p_announce, p_session, p_method ); 
    74     vlc_object_release( p_announce ); 
    75  
    76     return i_ret; 
    77 } 
    78  
    79 /** 
    80  *  Register a new session with the announce handler, using a pregenerated SDP 
    81  * 
    82  * \param p_sout a sout instance structure 
    83  * \param psz_sdp the SDP to register 
    84  * \param psz_uri session address (needed for SAP address auto detection) 
    85  * \param p_method an announce method descriptor 
    86  * \return the new session descriptor structure 
    87  */ 
    88 session_descriptor_t * 
    89 sout_AnnounceRegisterSDP( sout_instance_t *p_sout, const char *cfgpref, 
    90                           const char *psz_sdp, const char *psz_uri, 
    91                           announce_method_t *p_method ) 
    92 { 
    93     session_descriptor_t *p_session; 
    94     announce_handler_t *p_announce = (announce_handler_t*) 
    95                                      vlc_object_find( p_sout, 
    96                                               VLC_OBJECT_ANNOUNCE, 
    97                                               FIND_ANYWHERE ); 
    98     if( !p_announce ) 
    99     { 
    100         msg_Dbg( p_sout, "no announce handler found, creating one" ); 
    101         p_announce = announce_HandlerCreate( p_sout ); 
    102         if( !p_announce ) 
    103         { 
    104             msg_Err( p_sout, "Creation failed" ); 
    105             return NULL; 
    106         } 
    107         vlc_object_yield( p_announce ); 
    108     } 
    109  
    110     p_session = sout_AnnounceSessionCreate(VLC_OBJECT (p_sout), cfgpref); 
    111     p_session->psz_sdp = strdup( psz_sdp ); 
    112  
    113     /* GRUIK. We should not convert back-and-forth from string to numbers */ 
    114     struct addrinfo *res; 
    115     if (vlc_getaddrinfo (VLC_OBJECT (p_sout), psz_uri, 0, NULL, &res) == 0) 
    116     { 
    117         if (res->ai_addrlen <= sizeof (p_session->addr)) 
    118             memcpy (&p_session->addr, res->ai_addr, 
    119                     p_session->addrlen = res->ai_addrlen); 
    120         vlc_freeaddrinfo (res); 
    121     } 
    122  
    123     announce_Register( p_announce, p_session, p_method ); 
    124  
    125     vlc_object_release( p_announce ); 
    126     return p_session; 
    127 } 
    128  
    129 /** 
    130  *  UnRegister an existing session 
    131  * 
    132  * \param p_sout a sout instance structure 
    133  * \param p_session the session descriptor 
    134  * \return VLC_SUCCESS or an error 
    135  */ 
    136 int sout_AnnounceUnRegister( sout_instance_t *p_sout, 
    137                              session_descriptor_t *p_session ) 
    138 { 
    139     int i_ret; 
    140     announce_handler_t *p_announce = (announce_handler_t*) 
    141                               vlc_object_find( p_sout, 
    142                                               VLC_OBJECT_ANNOUNCE, 
    143                                               FIND_ANYWHERE ); 
    144     if( !p_announce ) 
    145     { 
    146         msg_Dbg( p_sout, "unable to remove announce: no announce handler" ); 
    147         return VLC_ENOOBJ; 
    148     } 
    149     i_ret  = announce_UnRegister( p_announce, p_session ); 
    150  
    151     vlc_object_release( p_announce ); 
    152  
    153     return i_ret; 
    154 } 
    155  
    156 /** 
    15750 * Create and initialize a session descriptor 
    15851 * 
    15952 * \return a new session descriptor 
    16053 */ 
    161 session_descriptor_t * sout_AnnounceSessionCreate (vlc_object_t *obj, 
     54static session_descriptor_t * sout_AnnounceSessionCreate (vlc_object_t *obj, 
    16255                                                   const char *cfgpref) 
    16356{ 
     
    19083} 
    19184 
    192 int sout_SessionSetMedia (vlc_object_t *obj, session_descriptor_t *p_session, 
    193                           const char *fmt, const char *src, int sport, 
    194                           const char *dst, int dport) 
    195 
    196     if ((p_session->sdpformat = strdup (fmt)) == NULL) 
    197         return VLC_ENOMEM; 
     85/** 
     86 *  Register a new session with the announce handler, using a pregenerated SDP 
     87 * 
     88 * \param p_sout a sout instance structure 
     89 * \param psz_sdp the SDP to register 
     90 * \param psz_uri session address (needed for SAP address auto detection) 
     91 * \param p_method an announce method descriptor 
     92 * \return the new session descriptor structure 
     93 */ 
     94session_descriptor_t * 
     95sout_AnnounceRegisterSDP( sout_instance_t *p_sout, const char *cfgpref, 
     96                          const char *psz_sdp, const char *psz_uri, 
     97                          announce_method_t *p_method ) 
     98
     99    session_descriptor_t *p_session; 
     100    announce_handler_t *p_announce = (announce_handler_t*) 
     101                                     vlc_object_find( p_sout, 
     102                                              VLC_OBJECT_ANNOUNCE, 
     103                                              FIND_ANYWHERE ); 
     104    if( !p_announce ) 
     105    { 
     106        msg_Dbg( p_sout, "no announce handler found, creating one" ); 
     107        p_announce = announce_HandlerCreate( VLC_OBJECT( p_sout ) ); 
     108        if( !p_announce ) 
     109        { 
     110            msg_Err( p_sout, "Creation failed" ); 
     111            return NULL; 
     112        } 
     113        vlc_object_yield( p_announce ); 
     114    } 
     115 
     116    p_session = sout_AnnounceSessionCreate(VLC_OBJECT (p_sout), cfgpref); 
     117    p_session->psz_sdp = strdup( psz_sdp ); 
    198118 
    199119    /* GRUIK. We should not convert back-and-forth from string to numbers */ 
    200120    struct addrinfo *res; 
    201     if (vlc_getaddrinfo (obj, dst, dport, NULL, &res) == 0) 
    202     { 
    203         if (res->ai_addrlen > sizeof (p_session->addr)) 
    204             goto oflow; 
    205  
    206         memcpy (&p_session->addr, res->ai_addr, 
    207                 p_session->addrlen = res->ai_addrlen); 
     121    if (vlc_getaddrinfo (VLC_OBJECT (p_sout), psz_uri, 0, NULL, &res) == 0) 
     122    { 
     123        if (res->ai_addrlen <= sizeof (p_session->addr)) 
     124            memcpy (&p_session->addr, res->ai_addr, 
     125                    p_session->addrlen = res->ai_addrlen); 
    208126        vlc_freeaddrinfo (res); 
    209127    } 
    210     if (vlc_getaddrinfo (obj, src, sport, NULL, &res) == 0) 
    211     { 
    212         if (res->ai_addrlen > sizeof (p_session->orig)) 
    213             goto oflow; 
    214         memcpy (&p_session->orig, res->ai_addr, 
    215                p_session->origlen = res->ai_addrlen); 
    216         vlc_freeaddrinfo (res); 
    217     } 
    218     return 0; 
    219  
    220 oflow: 
    221     vlc_freeaddrinfo (res); 
    222     return VLC_ENOMEM; 
     128 
     129    announce_Register( p_announce, p_session, p_method ); 
     130 
     131    vlc_object_release( p_announce ); 
     132    return p_session; 
     133
     134 
     135/** 
     136 *  UnRegister an existing session 
     137 * 
     138 * \param p_sout a sout instance structure 
     139 * \param p_session the session descriptor 
     140 * \return VLC_SUCCESS or an error 
     141 */ 
     142int sout_AnnounceUnRegister( sout_instance_t *p_sout, 
     143                             session_descriptor_t *p_session ) 
     144
     145    int i_ret; 
     146    announce_handler_t *p_announce = (announce_handler_t*) 
     147                              vlc_object_find( p_sout, 
     148                                              VLC_OBJECT_ANNOUNCE, 
     149                                              FIND_ANYWHERE ); 
     150    if( !p_announce ) 
     151    { 
     152        msg_Dbg( p_sout, "unable to remove announce: no announce handler" ); 
     153        return VLC_ENOOBJ; 
     154    } 
     155    i_ret  = announce_UnRegister( p_announce, p_session ); 
     156 
     157    vlc_object_release( p_announce ); 
     158 
     159    return i_ret; 
    223160} 
    224161 
     
    268205 * \return the new announce handler or NULL on error 
    269206 */ 
    270 announce_handler_t *__announce_HandlerCreate( vlc_object_t *p_this ) 
     207static announce_handler_t *announce_HandlerCreate( vlc_object_t *p_this ) 
    271208{ 
    272209    announce_handler_t *p_announce; 
     
    309246 
    310247/* Register an announce */ 
    311 int announce_Register( announce_handler_t *p_announce, 
    312                        session_descriptor_t *p_session, 
    313                        announce_method_t *p_method ) 
     248static int announce_Register( announce_handler_t *p_announce, 
     249                              session_descriptor_t *p_session, 
     250                              announce_method_t *p_method ) 
    314251{ 
    315252    if (p_method == NULL) 
     
    345282 
    346283/* Unregister an announce */ 
    347 int announce_UnRegister( announce_handler_t *p_announce, 
    348                   session_descriptor_t *p_session ) 
     284static int announce_UnRegister( announce_handler_t *p_announce, 
     285                                session_descriptor_t *p_session ) 
    349286{ 
    350287    msg_Dbg( p_announce, "unregistering announce" ); 
  • src/stream_output/stream_output.h

    rfe63f4c r974be97  
    102102}; 
    103103 
    104 #define announce_HandlerCreate(a) __announce_HandlerCreate(VLC_OBJECT(a)) 
    105 announce_handler_t*  __announce_HandlerCreate( vlc_object_t *); 
    106  
    107 /* Private functions for the announce handler */ 
    108104int announce_HandlerDestroy( announce_handler_t * ); 
    109 int announce_Register( announce_handler_t *p_announce, 
    110                        session_descriptor_t *p_session, 
    111                        announce_method_t *p_method ); 
    112 int announce_UnRegister( announce_handler_t *p_announce, 
    113                          session_descriptor_t *p_session ); 
    114105 
    115106sap_handler_t *announce_SAPHandlerCreate( announce_handler_t *p_announce );