Changeset 1806


Ignore:
Timestamp:
Feb 20, 2008 8:56:15 AM (11 years ago)
Author:
bennylp
Message:

Ticket #489: New PJSUA callbacks to notify application when media stream is created and destroyed

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r1748 r1806  
    603603    void (*on_call_media_state)(pjsua_call_id call_id); 
    604604 
     605  
     606    /**  
     607     * Notify application when media session is created and before it is 
     608     * registered to the conference bridge. Application may return different 
     609     * media port if it has added media processing port to the stream. This 
     610     * media port then will be added to the conference bridge instead. 
     611     * 
     612     * @param call_id       Call identification. 
     613     * @param sess          Media session for the call. 
     614     * @param stream_idx    Stream index in the media session. 
     615     * @param p_port        On input, it specifies the media port of the 
     616     *                      stream. Application may modify this pointer to 
     617     *                      point to different media port to be registered 
     618     *                      to the conference bridge. 
     619     * 
     620     * \par Python: 
     621     * Not applicable.  
     622     */ 
     623    void (*on_stream_created)(pjsua_call_id call_id,  
     624                              pjmedia_session *sess, 
     625                              unsigned stream_idx,  
     626                              pjmedia_port **p_port); 
     627 
     628    /**  
     629     * Notify application when media session has been unregistered from the 
     630     * conference bridge and about to be destroyed. 
     631     * 
     632     * @param call_id       Call identification. 
     633     * @param sess          Media session for the call. 
     634     * @param stream_idx    Stream index in the media session. 
     635     * 
     636     * \par Python: 
     637     * Not applicable.  
     638     */ 
     639    void (*on_stream_destroyed)(pjsua_call_id call_id, 
     640                                pjmedia_session *sess,  
     641                                unsigned stream_idx); 
     642 
    605643    /** 
    606644     * Notify application upon incoming DTMF digits. 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r1796 r1806  
    887887 
    888888    if (call->session) { 
     889        if (pjsua_var.ua_cfg.cb.on_stream_destroyed) { 
     890            pjsua_var.ua_cfg.cb.on_stream_destroyed(call_id, call->session, 0); 
     891        } 
     892 
    889893        pjmedia_session_destroy(call->session); 
    890894        call->session = NULL; 
     
    10581062        pjmedia_session_get_port(call->session, 0, &media_port); 
    10591063 
     1064        /* Notify application about stream creation. 
     1065         * Note: application may modify media_port to point to different 
     1066         * media port 
     1067         */ 
     1068        if (pjsua_var.ua_cfg.cb.on_stream_created) { 
     1069            pjsua_var.ua_cfg.cb.on_stream_created(call_id, call->session, 
     1070                                                  0, &media_port); 
     1071        } 
    10601072 
    10611073        /* 
Note: See TracChangeset for help on using the changeset viewer.