Changes between Version 7 and Version 8 of 3rd_Party_Media

Mar 16, 2008 11:39:31 AM (16 years ago)



  • 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. 
    4041These will be discussed in more detail in the following sections. 
     205=== Call Disconnection === 
     207Call disconnection occurs when the invite session calls ''on_state_changed()'' of [ 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. 
    213218Each integration approach have their pros and cons which will be discussed below. 
    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  {{{ 
     242   #include <pjmedia/errno.h> 
     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. 
    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 [ 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 [ pjmedia_endpt_get_codec_mgr()] function). 
     272 1. Create a ''pjmedia_endpt'' instance with [ pjmedia_endpt_create()], and registers each of the codec factories into the codec manager (application can query the codec manager instance with [ 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 [ pjmedia_session_create()] with the corresponding function provided by the third party media stack to start the media. 
    262277=== Integrating Third Party Media Stack into PJMEDIA === 
    275290 1. everything else related to media