Ignore:
Timestamp:
Feb 21, 2009 2:21:59 PM (12 years ago)
Author:
bennylp
Message:

Updated libraries and applications to use the new Audio Device API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia/sound_port.h

    r2438 r2468  
    2525 * @brief Media port connection abstraction to sound device. 
    2626 */ 
    27 #include <pjmedia/sound.h> 
     27#include <pjmedia-audiodev/audiodev.h> 
    2828#include <pjmedia/port.h> 
    2929 
     
    163163 
    164164/** 
    165  * Create unidirectional or bidirectional sound port. This also allows 
    166  * creating sound port with extended settings, e.g: audio format, see  
    167  * #pjmedia_snd_setting. 
    168  * 
    169  * @param pool              Pool to allocate sound port structure. 
    170  * @param dir               Sound device direction. 
    171  * @param rec_id            Device index for recorder/capture stream, or 
    172  *                          -1 to use the first capable device. 
    173  * @param play_id           Device index for playback stream, or -1 to use  
    174  *                          the first capable device. 
    175  * @param clock_rate        Sound device's clock rate to set. 
    176  * @param channel_count     Set number of channels, 1 for mono, or 2 for 
    177  *                          stereo. The channel count determines the format 
    178  *                          of the frame. 
    179  * @param samples_per_frame Number of samples per frame. 
    180  * @param bits_per_sample   Set the number of bits per sample. The normal  
    181  *                          value for this parameter is 16 bits per sample. 
    182  * @param setting           Sound device extended settings, see  
    183  *                          #pjmedia_snd_setting. 
     165 * Create sound device port according to the specified parameters. 
     166 * 
     167 * @param pool              Pool to allocate sound port structure. 
     168 * @param prm               Sound device settings. 
    184169 * @param p_port            Pointer to receive the sound device port instance. 
    185170 * 
     
    188173 */ 
    189174PJ_DECL(pj_status_t) pjmedia_snd_port_create2(pj_pool_t *pool, 
    190                                               pjmedia_dir dir, 
    191                                               int rec_id, 
    192                                               int play_id, 
    193                                               unsigned clock_rate, 
    194                                               unsigned channel_count, 
    195                                               unsigned samples_per_frame, 
    196                                               unsigned bits_per_sample, 
    197                                               const pjmedia_snd_setting *setting, 
     175                                              const pjmedia_aud_param *prm, 
    198176                                              pjmedia_snd_port **p_port); 
    199177 
     
    217195 * @return                  The sound stream instance. 
    218196 */ 
    219 PJ_DECL(pjmedia_snd_stream*) pjmedia_snd_port_get_snd_stream( 
     197PJ_DECL(pjmedia_aud_stream*) pjmedia_snd_port_get_snd_stream( 
    220198                                                pjmedia_snd_port *snd_port); 
    221199 
    222200 
    223201/** 
    224  * Configure the echo cancellation tail length. By default, echo canceller 
    225  * is enabled in the sound device with the default tail length. After the 
    226  * sound port is created, application can query the current echo canceller 
    227  * tail length by calling #pjmedia_snd_port_get_ec_tail. 
    228  * 
    229  * Note that you should only change the EC settings when the sound port 
    230  * is not connected to any downstream ports, otherwise race condition may 
    231  * occur. 
     202 * Change the echo cancellation settings. The echo cancellation settings  
     203 * should have been specified when this sound port was created, by setting 
     204 * the appropriate fields in the pjmedia_aud_param, because not all sound 
     205 * device implementation supports changing the EC setting once the device 
     206 * has been opened. 
     207 * 
     208 * The behavior of this function depends on whether device or software AEC 
     209 * is being used. If the device supports AEC, this function will forward 
     210 * the change request to the device and it will be up to the device whether 
     211 * to support the request. If software AEC is being used (the software EC 
     212 * will be used if the device does not support AEC), this function will 
     213 * change the software EC settings. 
    232214 * 
    233215 * @param snd_port          The sound device port. 
     
    237219 *                          be disabled. 
    238220 * @param options           The options to be passed to #pjmedia_echo_create(). 
     221 *                          This is only used if software EC is being used. 
    239222 * 
    240223 * @return                  PJ_SUCCESS on success. 
Note: See TracChangeset for help on using the changeset viewer.