Changeset 321 for pjproject/trunk/pjmedia/include/pjmedia/sound.h
- Timestamp:
- Mar 16, 2006 6:52:55 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/sound.h
r320 r321 37 37 38 38 /** 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_info39 typedef struct pjmedia_snd_stream pjmedia_snd_stream; 40 41 /** 42 * Device information structure returned by #pjmedia_snd_get_dev_info. 43 */ 44 typedef struct pjmedia_snd_dev_info 45 45 { 46 46 char name[64]; /**< Device name. */ … … 48 48 unsigned output_count; /**< Max number of output channels. */ 49 49 unsigned default_samples_per_sec;/**< Default sampling rate. */ 50 } pj _snd_dev_info;50 } pjmedia_snd_dev_info; 51 51 52 52 /** … … 63 63 * @return Non-zero to stop the stream. 64 64 */ 65 typedef pj_status_t (*pj _snd_play_cb)(/* in */ void *user_data,65 typedef pj_status_t (*pjmedia_snd_play_cb)(/* in */ void *user_data, 66 66 /* in */ pj_uint32_t timestamp, 67 67 /* out */ void *output, … … 79 79 * @return Non-zero to stop the stream. 80 80 */ 81 typedef pj_status_t (*pj _snd_rec_cb)(/* in */ void *user_data,81 typedef pj_status_t (*pjmedia_snd_rec_cb)(/* in */ void *user_data, 82 82 /* in */ pj_uint32_t timestamp, 83 83 /* in */ const void *input, … … 91 91 * @return Zero on success. 92 92 */ 93 PJ_DECL(pj_status_t) pj _snd_init(pj_pool_factory *factory);93 PJ_DECL(pj_status_t) pjmedia_snd_init(pj_pool_factory *factory); 94 94 95 95 … … 99 99 * @return Number of devices. 100 100 */ 101 PJ_DECL(int) pj _snd_get_dev_count(void);101 PJ_DECL(int) pjmedia_snd_get_dev_count(void); 102 102 103 103 … … 106 106 * 107 107 * @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 */ 110 PJ_DECL(const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info(unsigned index); 111 111 112 112 … … 114 114 * Create a new audio stream for audio capture purpose. 115 115 * 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 */ 131 PJ_DECL(pj_status_t) pjmedia_snd_open_recorder( int index, 125 132 unsigned clock_rate, 126 133 unsigned channel_count, 127 134 unsigned samples_per_frame, 128 135 unsigned bits_per_sample, 129 pj _snd_rec_cb rec_cb,136 pjmedia_snd_rec_cb rec_cb, 130 137 void *user_data, 131 pj _snd_stream **p_snd_strm);138 pjmedia_snd_stream **p_snd_strm); 132 139 133 140 /** 134 141 * Create a new audio stream for playing audio samples. 135 142 * 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 */ 159 PJ_DECL(pj_status_t) pjmedia_snd_open_player( int index, 145 160 unsigned clock_rate, 146 161 unsigned channel_count, 147 162 unsigned samples_per_frame, 148 163 unsigned bits_per_sample, 149 pj _snd_play_cb play_cb,164 pjmedia_snd_play_cb play_cb, 150 165 void *user_data, 151 pj _snd_stream **p_snd_strm );166 pjmedia_snd_stream **p_snd_strm ); 152 167 153 168 /** … … 158 173 * @return Zero on success. 159 174 */ 160 PJ_DECL(pj_status_t) pj _snd_stream_start(pj_snd_stream *stream);175 PJ_DECL(pj_status_t) pjmedia_snd_stream_start(pjmedia_snd_stream *stream); 161 176 162 177 /** … … 167 182 * @return Zero on success. 168 183 */ 169 PJ_DECL(pj_status_t) pj _snd_stream_stop(pj_snd_stream *stream);184 PJ_DECL(pj_status_t) pjmedia_snd_stream_stop(pjmedia_snd_stream *stream); 170 185 171 186 /** … … 176 191 * @return Zero on success. 177 192 */ 178 PJ_DECL(pj_status_t) pj _snd_stream_close(pj_snd_stream *stream);193 PJ_DECL(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream); 179 194 180 195 /** … … 183 198 * @return Zero on success. 184 199 */ 185 PJ_DECL(pj_status_t) pj _snd_deinit(void);200 PJ_DECL(pj_status_t) pjmedia_snd_deinit(void); 186 201 187 202
Note: See TracChangeset
for help on using the changeset viewer.