Ignore:
Timestamp:
Oct 24, 2017 7:31:39 AM (7 years ago)
Author:
ming
Message:

Fixed #2052: Add option for pjsua callback on_stream_created to destroy application's supplied media port

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp

    r5672 r5676  
    10711071} 
    10721072 
    1073 void Endpoint::on_stream_created(pjsua_call_id call_id, 
    1074                                  pjmedia_stream *strm, 
    1075                                  unsigned stream_idx, 
    1076                                  pjmedia_port **p_port) 
     1073void Endpoint::on_stream_created2(pjsua_call_id call_id, 
     1074                                  pjsua_on_stream_created_param *param) 
    10771075{ 
    10781076    Call *call = Call::lookup(call_id); 
     
    10821080     
    10831081    OnStreamCreatedParam prm; 
    1084     prm.stream = strm; 
    1085     prm.streamIdx = stream_idx; 
    1086     prm.pPort = (void *)*p_port; 
     1082    prm.stream = param->stream; 
     1083    prm.streamIdx = param->stream_idx; 
     1084    prm.destroyPort = param->destroy_port; 
     1085    prm.pPort = (MediaPort)param->port; 
    10871086     
    10881087    call->onStreamCreated(prm); 
    10891088     
    1090     if (prm.pPort != (void *)*p_port) 
    1091         *p_port = (pjmedia_port *)prm.pPort; 
     1089    param->destroy_port = prm.destroyPort; 
     1090    param->port = (pjmedia_port *)prm.pPort; 
    10921091} 
    10931092 
     
    15581557    ua_cfg.cb.on_call_media_state       = &Endpoint::on_call_media_state; 
    15591558    ua_cfg.cb.on_call_sdp_created       = &Endpoint::on_call_sdp_created; 
    1560     ua_cfg.cb.on_stream_created         = &Endpoint::on_stream_created; 
     1559    ua_cfg.cb.on_stream_created2        = &Endpoint::on_stream_created2; 
    15611560    ua_cfg.cb.on_stream_destroyed       = &Endpoint::on_stream_destroyed; 
    15621561    ua_cfg.cb.on_dtmf_digit             = &Endpoint::on_dtmf_digit; 
Note: See TracChangeset for help on using the changeset viewer.