Changes between Version 7 and Version 8 of 3rd_Party_Media


Ignore:
Timestamp:
Mar 16, 2008 11:39:31 AM (16 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 3rd_Party_Media

    v7 v8  
    3737 * After SDP negotiation -- once SDP has been negotiated, we can start our media streaming. 
    3838 * Anytime thereafter when the invite session requires us to update our offer or answer. 
     39 * During call disconnection -- to release media. 
    3940 
    4041These will be discussed in more detail in the following sections. 
     
    202203 
    203204 
     205=== Call Disconnection === 
     206 
     207Call disconnection occurs when the invite session calls ''on_state_changed()'' of [http://www.pjsip.org/pjsip/docs/html/structpjsip__inv__callback.htm pjsip_inv_callback] with invite session state equal to ''PJSIP_INV_STATE_DISCONNECTED''. Application should release the media resources allocated for the call on this event. 
     208 
    204209---- 
    205210 
     
    213218Each integration approach have their pros and cons which will be discussed below. 
    214219 
     220---- 
    215221 
    216222=== Completely Replace PJMEDIA with Third Party Media Stack === 
     
    231237    - On other build system, you may link with PJMEDIA to get the SDP components linked with application, but do not use anything else. 
    232238    - Alternatively you may create a new library which consists of the following files from PJMEDIA directory: errno.c, sdp.c, sdp_cmp.c, and sdp_neg.c 
     239 1. Register PJMEDIA's specific error code to PJLIB error code space, using the code snippet below. This normally is done when we call ''pjmedia_endpt_create()'', but we can't call this function since we are not using PJMEDIA of course! 
     240  {{{ 
     241#!c 
     242   #include <pjmedia/errno.h> 
     243 
     244   pj_register_strerror(PJMEDIA_ERRNO_START, PJ_ERRNO_SPACE_SIZE, &pjmedia_strerror); 
     245  }}} 
    233246 1. You need to build the SDP manually for the invite session (either when creating the call or when the invite session needs updated offer or answer). You cannot use {{{pjmedia_endpt_create_sdp()}}} function since this function is part of PJMEDIA. 
    234247 1. To create a media session, you need to manually inspect both local and remote SDP (see ''on_media_update()'' pseudo-code above) and create your media session based on the information in both SDP's. 
    235248 
     249---- 
    236250 
    237251=== Reusing PJMEDIA's Session Info === 
     
    251265 1. Application needs to link with PJMEDIA library to get the SDP, the SDP generation/conversion and codec information parts of PJMEDIA. 
    252266 1. Implement a codec factory for each codec that the third party media stack supports, to register the codec information into PJMEDIA. Note that only the codec factory needs to be implemented, since we will never create PJMEDIA's stream so no codec will ever gets instantiated. 
    253  1. The operations in ''pjmedia_codec_factory_op'' that need to be implemented are: 
     267 1. The operations in [http://www.pjsip.org/pjmedia/docs/html/structpjmedia__codec__factory__op.htm pjmedia_codec_factory_op] that need to be implemented are: 
    254268  - test_alloc() 
    255269  - default_attr() 
    256270  - enum_info() 
    257271 1. You can use the sample codec implementations as a template to create your codec factories. ''Hints: you may use one codec factory to register multiple types of codecs''. 
    258  1. Create a ''pjmedia_endpt'' instance, and registers each of the codec factories into the codec manager (application can query the codec manager instance with [http://www.pjsip.org/pjmedia/docs/html/group__PJMED__ENDPT.htm#ge058aeedcfad28aa6293308c65429760 pjmedia_endpt_get_codec_mgr()] function). 
     272 1. Create a ''pjmedia_endpt'' instance with [http://www.pjsip.org/pjmedia/docs/html/group__PJMED__ENDPT.htm#ga91a95b7350ba141670683a991b4af97 pjmedia_endpt_create()], and registers each of the codec factories into the codec manager (application can query the codec manager instance with [http://www.pjsip.org/pjmedia/docs/html/group__PJMED__ENDPT.htm#ge058aeedcfad28aa6293308c65429760 pjmedia_endpt_get_codec_mgr()] function). 
    259273 1. The code to create a call or to handle media update event is similar to the generic pseudo-code explained earlier, except that application will replace call to [http://www.pjsip.org/pjmedia/docs/html/group__PJMED__SES.htm#g6bb6bcc4721ca9f357b5e3bb750378c6 pjmedia_session_create()] with the corresponding function provided by the third party media stack to start the media. 
    260274 
     275---- 
    261276 
    262277=== Integrating Third Party Media Stack into PJMEDIA === 
     
    275290 1. everything else related to media 
    276291 
     292