Changeset 5956


Ignore:
Timestamp:
Mar 21, 2019 8:46:13 AM (7 months ago)
Author:
nanang
Message:

Misc (re #2147): Add info and checks about Extra Audio Device supporting mono channel only.

Location:
pjproject/trunk/pjsip
Files:
4 edited

Legend:

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

    r5939 r5956  
    74917491 * application can install Null Sound Device (i.e: using 
    74927492 * pjsua_set_null_snd_dev()), which will act as a master port, and instantiate 
    7493  * the sound device as extra sound device. But note that extra sound device 
    7494  * will not have auto-close upon idle feature. 
     7493 * the sound device as extra sound device. 
     7494 * 
     7495 * Note that extra sound device will not have auto-close upon idle feature. 
     7496 * Also note that currently extra sound device only supports mono channel. 
    74957497 */ 
    74967498typedef struct pjsua_ext_snd_dev pjsua_ext_snd_dev; 
     
    75007502 * Create an extra sound device and register it to conference bridge. 
    75017503 * 
    7502  * @param snd_param     Sound device port param. 
     7504 * @param snd_param     Sound device port param. Currently this only supports 
     7505 *                      mono channel, so channel count must be set to 1. 
    75037506 * @param p_snd         The extra sound device instance. 
    75047507 * 
  • pjproject/trunk/pjsip/include/pjsua2/media.hpp

    r5923 r5956  
    14011401/** 
    14021402 * Extra audio device. This class allows application to have multiple 
    1403  * sound device instances active concurrently. Application may also use 
    1404  * this class to improve media clock. Normally media clock is driven by 
    1405  * sound device in master port, but unfortunately some sound devices may 
    1406  * produce jittery clock. To improve media clock, application can install 
    1407  * Null Sound Device (i.e: using AudDevManager::setNullDev()), which will 
    1408  * act as a master port, and install the sound device as extra sound device. 
     1403 * sound device instances active concurrently. 
     1404  
     1405 * Application may also use this class to improve media clock. Normally 
     1406 * media clock is driven by sound device in master port, but unfortunately 
     1407 * some sound devices may produce jittery clock. To improve media clock, 
     1408 * application can install Null Sound Device (i.e: using 
     1409 * AudDevManager::setNullDev()), which will act as a master port, and 
     1410 * install the sound device as extra sound device. 
     1411 * 
    14091412 * Note that extra sound device will not have auto-close upon idle feature. 
     1413 * Also note that the extra sound device only supports mono channel. 
    14101414 */ 
    14111415class ExtraAudioDevice : public AudioMedia 
     
    14261430 
    14271431    /** 
    1428      * Open the audio device using format (e.g.: clock rate, channel count, 
    1429      * samples per frame) matched to the conference bridge's format. 
     1432     * Open the audio device using format (e.g.: clock rate, bit per sample, 
     1433     * samples per frame) matched to the conference bridge's format, except 
     1434     * the channel count, which will be set to one (mono channel). 
    14301435     */ 
    14311436    void open(); 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_aud.c

    r5923 r5956  
    23882388 
    23892389    PJ_ASSERT_RETURN(param && p_snd, PJ_EINVAL); 
     2390    PJ_ASSERT_RETURN(param->base.channel_count == 1, PJMEDIA_ENCCHANNEL); 
    23902391 
    23912392    pool = pjsua_pool_create("extsnd%p", 512, 512); 
  • pjproject/trunk/pjsip/src/pjsua2/media.cpp

    r5955 r5956  
    10951095    param.base.rec_id = recDev; 
    10961096    param.base.clock_rate = master_info.clock_rate; 
    1097     param.base.channel_count = master_info.channel_count; 
    1098     param.base.samples_per_frame = master_info.samples_per_frame; 
     1097    param.base.channel_count = 1; 
     1098    param.base.samples_per_frame = master_info.samples_per_frame / 
     1099                                   master_info.channel_count; 
    10991100    param.base.bits_per_sample = master_info.bits_per_sample; 
    11001101 
Note: See TracChangeset for help on using the changeset viewer.