Ignore:
Timestamp:
Feb 5, 2009 10:59:14 AM (15 years ago)
Author:
nanang
Message:
  • Added new API for sound & sound port to create/open sound device with extended setting, to allow opening sound device with non-PCM format and other settings.
  • Updated symbian_ua/ua.cpp to be able to reopen sound device when audio stream session is using non-PCM data/passthrough codec.
  • Updated stream.c to allow it works with non-PCM data.
  • Added PCMU/A frames processing into non-PCM play/record callbacks in symbian_audio_aps.cpp.
  • Added passthrough codec init/deinitialization in pjsua-lib.
  • Added a new pjmedia_frame_ext helper function, pjmedia_frame_ext_pop_subframes, to pop-out/remove some subframes.
  • Other minor updates/fixes.
File:
1 edited

Legend:

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

    r2394 r2438  
    9292    unsigned    play_latency;       /**< Playback latency, in samples.      */ 
    9393} pjmedia_snd_stream_info; 
     94 
     95 
     96/**  
     97 * Stream setting for opening sound device with non-PCM data. 
     98 */ 
     99typedef struct pjmedia_snd_setting 
     100{ 
     101    pjmedia_fourcc      format;   /**< Format (FourCC ID).          */  
     102    pj_uint32_t         bitrate;  /**< Bitrate (bps).               */ 
     103    pj_uint32_t         mode;     /**< Mode, e.g: iLBC format has 
     104                                       20ms or 30ms frame size.     */ 
     105    pj_bool_t           plc;      /**< PLC enabled/disabled.        */ 
     106    pj_bool_t           vad;      /**< VAD enabled/disabled.        */ 
     107    pj_bool_t           cng;      /**< CNG enabled/disabled.        */ 
     108    pj_bool_t           loudspk;  /**< Audio routed to loudspeaker. */ 
     109} pjmedia_snd_setting; 
    94110 
    95111 
     
    274290 
    275291/** 
     292 * Create sound stream for capturing audio and/or audio playback, from the  
     293 * same device. This also allows opening sound stream with extended settings,  
     294 * e.g: stream format, see #pjmedia_snd_setting. 
     295 * 
     296 * @param dir               Sound stream direction. 
     297 * @param rec_id            Device index for recorder/capture stream, or 
     298 *                          -1 to use the first capable device. 
     299 * @param play_id           Device index for playback stream, or -1 to use  
     300 *                          the first capable device. 
     301 * @param clock_rate        Sound device's clock rate to set. 
     302 * @param channel_count     Set number of channels, 1 for mono, or 2 for 
     303 *                          stereo. The channel count determines the format 
     304 *                          of the frame. 
     305 * @param samples_per_frame Number of samples per frame. 
     306 * @param bits_per_sample   Set the number of bits per sample. The normal  
     307 *                          value for this parameter is 16 bits per sample. 
     308 * @param rec_cb            Callback to handle captured audio samples. 
     309 * @param play_cb           Callback to be called when the sound player needs 
     310 *                          more audio samples to play. 
     311 * @param user_data         User data to be associated with the stream. 
     312 * @param setting           Sound device extended setting. 
     313 * @param p_snd_strm        Pointer to receive the stream instance. 
     314 * 
     315 * @return                  PJ_SUCCESS on success. 
     316 */ 
     317PJ_DECL(pj_status_t) pjmedia_snd_open2( pjmedia_dir dir, 
     318                                        int rec_id, 
     319                                        int play_id, 
     320                                        unsigned clock_rate, 
     321                                        unsigned channel_count, 
     322                                        unsigned samples_per_frame, 
     323                                        unsigned bits_per_sample, 
     324                                        pjmedia_snd_rec_cb rec_cb, 
     325                                        pjmedia_snd_play_cb play_cb, 
     326                                        void *user_data, 
     327                                        const pjmedia_snd_setting *setting, 
     328                                        pjmedia_snd_stream **p_snd_strm); 
     329 
     330 
     331/** 
    276332 * Get information about live stream. 
    277333 * 
Note: See TracChangeset for help on using the changeset viewer.