Changes between Version 7 and Version 8 of 3rd_Party_Media
- Timestamp:
- Mar 16, 2008 11:39:31 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
3rd_Party_Media
v7 v8 37 37 * After SDP negotiation -- once SDP has been negotiated, we can start our media streaming. 38 38 * Anytime thereafter when the invite session requires us to update our offer or answer. 39 * During call disconnection -- to release media. 39 40 40 41 These will be discussed in more detail in the following sections. … … 202 203 203 204 205 === Call Disconnection === 206 207 Call 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 204 209 ---- 205 210 … … 213 218 Each integration approach have their pros and cons which will be discussed below. 214 219 220 ---- 215 221 216 222 === Completely Replace PJMEDIA with Third Party Media Stack === … … 231 237 - On other build system, you may link with PJMEDIA to get the SDP components linked with application, but do not use anything else. 232 238 - 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 }}} 233 246 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. 234 247 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. 235 248 249 ---- 236 250 237 251 === Reusing PJMEDIA's Session Info === … … 251 265 1. Application needs to link with PJMEDIA library to get the SDP, the SDP generation/conversion and codec information parts of PJMEDIA. 252 266 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: 254 268 - test_alloc() 255 269 - default_attr() 256 270 - enum_info() 257 271 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). 259 273 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. 260 274 275 ---- 261 276 262 277 === Integrating Third Party Media Stack into PJMEDIA === … … 275 290 1. everything else related to media 276 291 292