Ignore:
Timestamp:
Mar 17, 2011 4:34:43 AM (11 years ago)
Author:
bennylp
Message:

Modifications in PJSUA-LIB to support multiple media streams (multiple audio and/or video) and dynamic creation of media transports. This closed #1185 and closed #1201.

1185: Dynamic creation of media transports
============================================
Done:

  • media transports are created on demand now

Todo:

  • media transport creation is still blocking

1201: Video support in PJSUA-LIB
===================================
Done:

  • call now supports N media (N audio and M video)
  • number of audio/video streams is configurable per acc
  • extra audio stream info in pjsua_call_info to support multiple audio streams

in one call

  • video subsys and ffmpeg initialization in PJSUA-LIB
  • ability to offer and create video SDP answer
  • "dq" for more than 1 audio streams
  • introducing pjsua_state and pjsua_get_state()

API change:

  • on_stream_created() and on_stream_destroyed() callbacks: changed session to

stream

Todo:

  • many others features are disabled, just search for DISABLED_FOR_TICKET_1185

macro (these have also been added to ticket #1193 (Issues & Todos)). Notable
missing features are:

  • creation of duplicate SDP m= lines for optional SRTP
  • mm.. that's it?
  • whole lot of testings

pjsua:
===============

  • Added --extra-audio and --video options. Specify these more than once and

each time an extra audio/video streams will be added. :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjsip-apps/src/pjsua/pjsua_app.c

    r3372 r3457  
    268268 
    269269    puts  (""); 
    270     puts  ("Media Options:"); 
     270    puts  ("Audio Options:"); 
    271271    puts  ("  --add-codec=name    Manually add codec (default is to enable all)"); 
    272272    puts  ("  --dis-codec=name    Disable codec (can be specified multiple times)"); 
     
    302302    puts  ("  --no-tones          Disable audible tones"); 
    303303    puts  ("  --jb-max-size       Specify jitter buffer maximum size, in frames (default=-1)"); 
     304    puts  ("  --extra-audio       Add one more audio stream"); 
     305 
     306    puts  (""); 
     307    puts  ("Video Options:"); 
     308    puts  ("  --video             Enable video"); 
    304309 
    305310    puts  (""); 
     
    541546           OPT_AUTO_UPDATE_NAT,OPT_USE_COMPACT_FORM,OPT_DIS_CODEC, 
    542547           OPT_NO_FORCE_LR, 
    543            OPT_TIMER, OPT_TIMER_SE, OPT_TIMER_MIN_SE 
     548           OPT_TIMER, OPT_TIMER_SE, OPT_TIMER_MIN_SE, 
     549           OPT_VIDEO, OPT_EXTRA_AUDIO 
    544550    }; 
    545551    struct pj_getopt_option long_options[] = { 
     
    660666        { "timer-min-se", 1, 0, OPT_TIMER_MIN_SE}, 
    661667        { "outb-rid",   1, 0, OPT_OUTB_RID}, 
     668        { "video",      0, 0, OPT_VIDEO}, 
     669        { "extra-audio",0, 0, OPT_EXTRA_AUDIO}, 
    662670        { NULL, 0, 0, 0} 
    663671    }; 
     
    14161424            cfg->udp_cfg.qos_params.flags = PJ_QOS_PARAM_HAS_DSCP; 
    14171425            cfg->udp_cfg.qos_params.dscp_val = 0x18; 
     1426            break; 
     1427        case OPT_VIDEO: 
     1428            ++cur_acc->max_video_cnt; 
     1429            break; 
     1430        case OPT_EXTRA_AUDIO: 
     1431            ++cur_acc->max_audio_cnt; 
    14181432            break; 
    14191433        default: 
     
    16611675    if (acc_cfg->mwi_enabled) 
    16621676        pj_strcat2(result, "--mwi\n"); 
     1677 
     1678    /* Video & extra audio */ 
     1679    for (i=0; i<acc_cfg->max_video_cnt; ++i) { 
     1680        pj_strcat2(result, "--video\n"); 
     1681    } 
     1682    for (i=1; i<acc_cfg->max_audio_cnt; ++i) { 
     1683        pj_strcat2(result, "--extra-audio\n"); 
     1684    } 
    16631685} 
    16641686 
     
    38923914                acc_cfg.cred_info[0].data = pj_str(passwd); 
    38933915 
     3916                acc_cfg.rtp_cfg = app_config.rtp_cfg; 
     3917 
    38943918                status = pjsua_acc_add(&acc_cfg, PJ_TRUE, NULL); 
    38953919                if (status != PJ_SUCCESS) { 
     
    49294953    /* Add accounts */ 
    49304954    for (i=0; i<app_config.acc_cnt; ++i) { 
     4955        app_config.acc_cfg[i].rtp_cfg = app_config.rtp_cfg; 
    49314956        status = pjsua_acc_add(&app_config.acc_cfg[i], PJ_TRUE, NULL); 
    49324957        if (status != PJ_SUCCESS) 
     
    49604985    if (app_config.ipv6) 
    49614986        status = create_ipv6_media_transports(); 
     4987  #if DISABLED_FOR_TICKET_1185 
    49624988    else 
    49634989        status = pjsua_media_transports_create(&app_config.rtp_cfg); 
     4990  #endif 
    49644991#endif 
    49654992    if (status != PJ_SUCCESS) 
     
    52965323    } 
    52975324 
     5325#if DISABLED_FOR_TICKET_1185 
    52985326    return pjsua_media_transports_attach(tp, i, PJ_TRUE); 
    5299 } 
    5300  
     5327#else 
     5328    return PJ_ENOTSUP; 
     5329#endif 
     5330} 
     5331 
Note: See TracChangeset for help on using the changeset viewer.