Ignore:
Timestamp:
Jun 20, 2008 9:39:02 PM (16 years ago)
Author:
bennylp
Message:

Updated doxygen documentations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/transport.h

    r2032 r2037  
    3030 
    3131/** 
    32  * @defgroup PJMEDIA_TRANSPORT Media Transports 
    33  * @ingroup PJMEDIA 
     32 * @defgroup PJMEDIA_TRANSPORT Media Transport 
    3433 * @brief Transports. 
    35  * Transport related components. 
    36  */ 
    37  
    38 /** 
    39  * @defgroup PJMEDIA_TRANSPORT_H Media Network Transport Interface 
    40  * @ingroup PJMEDIA_TRANSPORT 
    41  * @brief PJMEDIA object for sending/receiving media packets over the network 
    4234 * @{ 
    4335 * The media transport (#pjmedia_transport) is the object to send and 
    4436 * receive media packets over the network. The media transport interface 
    4537 * allows the library to be extended to support different types of  
    46  * transports to send and receive packets. Currently only the standard 
    47  * UDP transport implementation is provided (see \ref PJMEDIA_TRANSPORT_UDP), 
    48  * but application designer may extend the library to support other types 
    49  * of custom transports such as RTP/RTCP over TCP, RTP/RTCP over HTTP, etc. 
     38 * transports to send and receive packets. 
    5039 * 
    5140 * The media transport is declared as #pjmedia_transport "class", which 
     
    6352 
    6453 
    65  * \section PJMEDIA_TRANSPORT_H_USING Using the Media Transport 
     54 * \section PJMEDIA_TRANSPORT_H_USING Basic Media Transport Usage 
    6655 * 
    6756 * The media transport's life-cycle normally follows the following stages. 
     
    142131 * 
    143132 * 
    144  * \section PJMEDIA_TRANSPORT_H_EXT Media Transport Extended API 
     133 * \section offer_answer Interaction with SDP Offer/Answer 
    145134  
    146    Apart from the basic interface above, the media transport provides some 
    147    more APIs: 
    148  
    149     - pjmedia_transport_media_create() 
    150    \n 
    151       This API is provided to allow the media transport to add more information 
    152       in the SDP offer, before the offer is sent to remote. Additionally, for  
    153       answerer side, this callback allows the media transport to reject the  
    154       offer before this offer is processed by the SDP negotiator.  
    155  
    156     - pjmedia_transport_media_start() 
    157     \n 
    158       This API should be called after offer and answer are negotiated, and  
    159       both SDPs are available, and before the media is started. For answerer 
    160       side, this callback will be called before the answer is sent to remote, 
    161       to allow media transport to put additional info in the SDP. For  
    162       offerer side, this callback will be called after SDP answer is  
    163       received. In this callback, the media transport has the final chance  
    164       to negotiate/validate the offer and answer before media is really  
    165       started (and answer is sent, for answerer side).  
    166  
    167     - pjmedia_transport_media_stop() 
    168     \n 
    169       This API should be called when the media is stopped, to allow the media 
    170       transport to release its resources.  
    171  
    172     - pjmedia_transport_simulate_lost() 
    173     \n 
    174       This API can be used to instruct media transport to simulate packet lost 
    175       on a particular direction. 
     135   For basic UDP transport, the \ref PJMEDIA_TRANSPORT_H_USING above is 
     136   sufficient to use the media transport. However, more complex media 
     137   transports such as \ref PJMEDIA_TRANSPORT_SRTP and \ref 
     138   PJMEDIA_TRANSPORT_ICE requires closer interactions with SDP offer and 
     139   answer negotiation. 
     140 
     141   The media transports can interact with the SDP offer/answer via 
     142   these APIs: 
     143     - #pjmedia_transport_media_create(), to initialize the media transport 
     144       for new media session, 
     145     - #pjmedia_transport_encode_sdp(), to encode SDP offer or answer, 
     146     - #pjmedia_transport_media_start(), to activate the settings that 
     147       have been negotiated by SDP offer answer, and 
     148     - #pjmedia_transport_media_stop(), to deinitialize the media transport 
     149       and reset the transport to its idle state. 
     150    
     151   The usage of these API in the context of SDP offer answer will be  
     152   described below. 
     153 
     154   \subsection media_create Initializing Transport for New Session 
     155 
     156   Application must call #pjmedia_transport_media_create() before using 
     157   the transport for a new session. 
     158 
     159   \subsection creat_oa Creating SDP Offer and Answer 
     160 
     161   The #pjmedia_transport_encode_sdp() is used to put additional information 
     162   from the transport to the local SDP, before the SDP is sent and negotiated 
     163   with remote SDP. 
     164 
     165   When creating an offer, call #pjmedia_transport_encode_sdp() with 
     166   local SDP (and NULL as \a rem_sdp). The media transport will add the 
     167   relevant attributes in the local SDP. Application then gives the local 
     168   SDP to the invite session to be sent to remote agent. 
     169 
     170   When creating an answer, also call #pjmedia_transport_encode_sdp(), 
     171   but this time specify both local and remote SDP to the function. The  
     172   media transport will once again modify the local SDP and add relevant 
     173   attributes to the local SDP, if the appropriate attributes related to 
     174   the transport functionality are present in remote offer. The remote 
     175   SDP does not contain the relevant attributes, then the specific transport 
     176   functionality will not be activated for the session. 
     177 
     178   The #pjmedia_transport_encode_sdp() should also be called when application 
     179   sends subsequent SDP offer or answer. The media transport will encode 
     180   the appropriate attributes based on the state of the session. 
     181 
     182   \subsection media_start Offer/Answer Completion 
     183 
     184   Once both local and remote SDP have been negotiated by the  
     185   \ref PJMEDIA_SDP_NEG (normally this is part of PJSIP invite session), 
     186   application should give both local and remote SDP to  
     187   #pjmedia_transport_media_start() so that the settings are activated 
     188   for the session. This function should be called for both initial and 
     189   subsequent SDP negotiation. 
     190 
     191   \subsection media_stop Stopping Transport 
     192 
     193   Once session is stop application must call #pjmedia_transport_media_stop() 
     194   to deactivate the transport feature. Application may reuse the transport 
     195   for subsequent media session by repeating the #pjmedia_transport_media_create(), 
     196   #pjmedia_transport_encode_sdp(), #pjmedia_transport_media_start(), and 
     197   #pjmedia_transport_media_stop() above. 
    176198 
    177199 * \section PJMEDIA_TRANSPORT_H_IMPL Implementing Media Transport 
     
    199221 * example, to send RTP/RTCP packets). 
    200222 * 
    201  * For an example of media transport implementation, please refer to  
    202  * <tt>transport_udp.h</tt> and <tt>transport_udp.c</tt> in PJMEDIA source 
    203  * distribution. 
    204  */ 
     223 */ 
     224 
     225 
     226#include <pjmedia/sdp.h> 
    205227 
    206228PJ_BEGIN_DECL 
    207  
    208 #include <pjmedia/sdp.h> 
    209229 
    210230 
     
    347367    /** 
    348368     * This function is called by application to start the transport 
    349      * based on SDP negotiation result. 
     369     * based on local and remote SDP. 
    350370     * 
    351371     * Application should call #pjmedia_transport_media_start() instead of  
     
    414434 
    415435/** 
    416  * This structure declares stream transport. A stream transport is called 
     436 * This structure declares media transport. A media transport is called 
    417437 * by the stream to transmit a packet, and will notify stream when 
    418438 * incoming packet is arrived. 
     
    638658 
    639659/** 
    640  * Prepare the media transport for a new media session, and optionally 
    641  * encode the relevant information in the \a sdp_local. Application must 
     660 * Prepare the media transport for a new media session, Application must 
    642661 * call this function before starting a new media session using this 
    643662 * transport. 
     
    649668 * @param sdp_pool      Pool object to allocate memory related to SDP 
    650669 *                      messaging components. 
    651  * @param option        Option flags, from #pjmedia_tranport_media_option 
    652  * @param rem_sdp       Remote SDP if it's available. 
     670 * @param options       Option flags, from #pjmedia_tranport_media_option 
     671 * @param rem_sdp       Remote SDP if local SDP is an answer, otherwise 
     672 *                      specify NULL if SDP is an offer. 
    653673 * @param media_index   Media index in SDP. 
    654674 * 
     
    668688/** 
    669689 * Put transport specific information into the SDP. This function can be 
    670  * called to create SDP offer or answer, depending whether \a rem_sdp 
    671  * parameter is present. 
     690 * called to put transport specific information in the initial or 
     691 * subsequent SDP offer or answer. 
    672692 * 
    673693 * This is just a simple wrapper which calls <tt>encode_sdp()</tt> member  
     
    679699 * @param sdp           The local SDP to be filled in information from the 
    680700 *                      media transport. 
    681  * @param rem_sdp       Remote SDP if it's available. 
     701 * @param rem_sdp       Remote SDP if local SDP is an answer, otherwise 
     702 *                      specify NULL if SDP is an offer. 
    682703 * @param media_index   Media index in SDP. 
    683704 * 
     
    695716 
    696717/** 
    697  * Start the transport with regards to SDP negotiation result.  
    698  * This API should be called after offer and answer are negotiated, and  
    699  * both SDPs are available, and before the media is started. For answerer 
    700  * side, this callback will be called before the answer is sent to remote, 
    701  * to allow media transport to put additional info in the SDP. For  
    702  * offerer side, this callback will be called after SDP answer is  
    703  * received. In this callback, the media transport has the final chance  
    704  * to negotiate/validate the offer and answer before media is really  
    705  * started (and answer is sent, for answerer side).  
     718 * Start the transport session with the settings in both local and remote  
     719 * SDP. The actual work that is done by this function depends on the  
     720 * underlying transport type. For SRTP, this will activate the encryption 
     721 * and decryption based on the keys found the SDPs. For ICE, this will 
     722 * start ICE negotiation according to the information found in the SDPs. 
    706723 * 
    707724 * This is just a simple wrapper which calls <tt>media_start()</tt> member  
     
    710727 * @param tp            The media transport. 
    711728 * @param tmp_pool      The memory pool for allocating temporary objects. 
    712  * @param option        The media transport option. 
    713729 * @param sdp_local     Local SDP. 
    714730 * @param sdp_remote    Remote SDP. 
    715  * @param media_index   Media index to start. 
     731 * @param media_index   Media index in the SDP. 
    716732 * 
    717733 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     
    729745 
    730746/** 
    731  * Stop the transport.  
    732  * This API should be called when the media is stopped, to allow the media 
    733  * transport to release its resources.  
     747 * This API should be called when the session is stopped, to allow the media 
     748 * transport to release its resources used for the session. 
    734749 * 
    735750 * This is just a simple wrapper which calls <tt>media_stop()</tt> member  
Note: See TracChangeset for help on using the changeset viewer.