Ignore:
Timestamp:
Mar 16, 2006 6:52:55 PM (18 years ago)
Author:
bennylp
Message:

Added sound port (sound_port.h/c), and changed sound and RTCP names from pj_* to pjmedia_*

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/sound.h

    r320 r321  
    3737 
    3838/** Opaque data type for audio stream. */ 
    39 typedef struct pj_snd_stream pj_snd_stream; 
    40  
    41 /** 
    42  * Device information structure returned by #pj_snd_get_dev_info. 
    43  */ 
    44 typedef struct pj_snd_dev_info 
     39typedef struct pjmedia_snd_stream pjmedia_snd_stream; 
     40 
     41/** 
     42 * Device information structure returned by #pjmedia_snd_get_dev_info. 
     43 */ 
     44typedef struct pjmedia_snd_dev_info 
    4545{ 
    4646    char        name[64];               /**< Device name.                   */ 
     
    4848    unsigned    output_count;           /**< Max number of output channels. */ 
    4949    unsigned    default_samples_per_sec;/**< Default sampling rate.         */ 
    50 } pj_snd_dev_info; 
     50} pjmedia_snd_dev_info; 
    5151 
    5252/**  
     
    6363 * @return              Non-zero to stop the stream. 
    6464 */ 
    65 typedef pj_status_t (*pj_snd_play_cb)(/* in */   void *user_data, 
     65typedef pj_status_t (*pjmedia_snd_play_cb)(/* in */   void *user_data, 
    6666                                      /* in */   pj_uint32_t timestamp, 
    6767                                      /* out */  void *output, 
     
    7979 * @return              Non-zero to stop the stream. 
    8080 */ 
    81 typedef pj_status_t (*pj_snd_rec_cb)(/* in */   void *user_data, 
     81typedef pj_status_t (*pjmedia_snd_rec_cb)(/* in */   void *user_data, 
    8282                                     /* in */   pj_uint32_t timestamp, 
    8383                                     /* in */   const void *input, 
     
    9191 * @return              Zero on success. 
    9292 */ 
    93 PJ_DECL(pj_status_t) pj_snd_init(pj_pool_factory *factory); 
     93PJ_DECL(pj_status_t) pjmedia_snd_init(pj_pool_factory *factory); 
    9494 
    9595 
     
    9999 * @return              Number of devices. 
    100100 */ 
    101 PJ_DECL(int) pj_snd_get_dev_count(void); 
     101PJ_DECL(int) pjmedia_snd_get_dev_count(void); 
    102102 
    103103 
     
    106106 * 
    107107 * @param index         The index of the device, which should be in the range 
    108  *                      from zero to #pj_snd_get_dev_count - 1. 
    109  */ 
    110 PJ_DECL(const pj_snd_dev_info*) pj_snd_get_dev_info(unsigned index); 
     108 *                      from zero to #pjmedia_snd_get_dev_count - 1. 
     109 */ 
     110PJ_DECL(const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info(unsigned index); 
    111111 
    112112 
     
    114114 * Create a new audio stream for audio capture purpose. 
    115115 * 
    116  * @param index         Device index, or -1 to let the library choose the first 
    117  *                      available device, or -2 to use NULL device. 
    118  * @param param         Stream parameters. 
    119  * @param rec_cb        Callback to handle captured audio samples. 
    120  * @param user_data     User data to be associated with the stream. 
    121  * 
    122  * @return              Audio stream, or NULL if failed. 
    123  */ 
    124 PJ_DECL(pj_status_t) pj_snd_open_recorder( int index, 
     116 * @param index             Device index, or -1 to let the library choose the  
     117 *                          first available device. 
     118 * @param clock_rate        Sound device's clock rate to set. 
     119 * @param channel_count     Set number of channels, 1 for mono, or 2 for 
     120 *                          stereo. The channel count determines the format 
     121 *                          of the frame. 
     122 * @param samples_per_frame Number of samples per frame. 
     123 * @param bits_per_sample   Set the number of bits per sample. The normal  
     124 *                          value for this parameter is 16 bits per sample. 
     125 * @param rec_cb            Callback to handle captured audio samples. 
     126 * @param user_data         User data to be associated with the stream. 
     127 * @param p_snd_strm        Pointer to receive the stream instance. 
     128 * 
     129 * @return                  PJ_SUCCESS on success. 
     130 */ 
     131PJ_DECL(pj_status_t) pjmedia_snd_open_recorder( int index, 
    125132                                           unsigned clock_rate, 
    126133                                           unsigned channel_count, 
    127134                                           unsigned samples_per_frame, 
    128135                                           unsigned bits_per_sample, 
    129                                            pj_snd_rec_cb rec_cb, 
     136                                           pjmedia_snd_rec_cb rec_cb, 
    130137                                           void *user_data, 
    131                                            pj_snd_stream **p_snd_strm); 
     138                                           pjmedia_snd_stream **p_snd_strm); 
    132139 
    133140/** 
    134141 * Create a new audio stream for playing audio samples. 
    135142 * 
    136  * @param index         Device index, or -1 to let the library choose the first 
    137  *                      available device, or -2 to use NULL device. 
    138  * @param param         Stream parameters. 
    139  * @param play_cb       Callback to supply audio samples. 
    140  * @param user_data     User data to be associated with the stream. 
    141  * 
    142  * @return              Audio stream, or NULL if failed. 
    143  */ 
    144 PJ_DECL(pj_status_t) pj_snd_open_player( int index, 
     143 * @param index             Device index, or -1 to let the library choose the  
     144 *                          first available device. 
     145 * @param clock_rate        Sound device's clock rate to set. 
     146 * @param channel_count     Set number of channels, 1 for mono, or 2 for 
     147 *                          stereo. The channel count determines the format 
     148 *                          of the frame. 
     149 * @param samples_per_frame Number of samples per frame. 
     150 * @param bits_per_sample   Set the number of bits per sample. The normal  
     151 *                          value for this parameter is 16 bits per sample. 
     152 * @param play_cb           Callback to be called when the sound player needs 
     153 *                          more audio samples to play. 
     154 * @param user_data         User data to be associated with the stream. 
     155 * @param p_snd_strm        Pointer to receive the stream instance. 
     156 * 
     157 * @return                  PJ_SUCCESS on success. 
     158 */ 
     159PJ_DECL(pj_status_t) pjmedia_snd_open_player( int index, 
    145160                                         unsigned clock_rate, 
    146161                                         unsigned channel_count, 
    147162                                         unsigned samples_per_frame, 
    148163                                         unsigned bits_per_sample, 
    149                                          pj_snd_play_cb play_cb, 
     164                                         pjmedia_snd_play_cb play_cb, 
    150165                                         void *user_data, 
    151                                          pj_snd_stream **p_snd_strm ); 
     166                                         pjmedia_snd_stream **p_snd_strm ); 
    152167 
    153168/** 
     
    158173 * @return              Zero on success. 
    159174 */ 
    160 PJ_DECL(pj_status_t) pj_snd_stream_start(pj_snd_stream *stream); 
     175PJ_DECL(pj_status_t) pjmedia_snd_stream_start(pjmedia_snd_stream *stream); 
    161176 
    162177/** 
     
    167182 * @return              Zero on success. 
    168183 */ 
    169 PJ_DECL(pj_status_t) pj_snd_stream_stop(pj_snd_stream *stream); 
     184PJ_DECL(pj_status_t) pjmedia_snd_stream_stop(pjmedia_snd_stream *stream); 
    170185 
    171186/** 
     
    176191 * @return              Zero on success. 
    177192 */ 
    178 PJ_DECL(pj_status_t) pj_snd_stream_close(pj_snd_stream *stream); 
     193PJ_DECL(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream); 
    179194 
    180195/** 
     
    183198 * @return              Zero on success. 
    184199 */ 
    185 PJ_DECL(pj_status_t) pj_snd_deinit(void); 
     200PJ_DECL(pj_status_t) pjmedia_snd_deinit(void); 
    186201 
    187202 
Note: See TracChangeset for help on using the changeset viewer.