Changeset ad1aedc in mainline
- Timestamp:
- 2012-08-20T09:48:02Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 20840922
- Parents:
- 86fe9d1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_audio_pcm.c
r86fe9d1 rad1aedc 59 59 * CLIENT SIDE 60 60 */ 61 62 /** 63 * Open audio session with device identified by location service string. 64 * 65 * @param name Location service string. 66 * @return Pointer to a new audio device session, NULL on failure. 67 */ 61 68 audio_pcm_sess_t *audio_pcm_open(const char *name) 62 69 { … … 69 76 } 70 77 78 /** 79 * Open audio session with device identified by location service id 80 * 81 * @param name Location service id. 82 * @return Pointer to a new audio device session, NULL on failure. 83 */ 71 84 audio_pcm_sess_t *audio_pcm_open_service(service_id_t id) 72 85 { … … 74 87 } 75 88 89 /** 90 * Close open audio device session. 91 * 92 * @param name Open audio device session. 93 * 94 * @note Calling this function on already closed or invalid session results 95 * in undefined behavior. 96 */ 76 97 void audio_pcm_close(audio_pcm_sess_t *sess) 77 98 { … … 80 101 } 81 102 103 /** 104 * Get a short description string. 105 * 106 * @param sess Audio device session. 107 * @param name Place to store newly allocated string. 108 * 109 * @return Error code. 110 * 111 * @note Caller is responsible for freeing newly allocated memory. 112 */ 82 113 int audio_pcm_get_info_str(audio_pcm_sess_t *sess, const char **name) 83 114 { … … 109 140 } 110 141 142 143 /** 144 * Query value of specified capability. 145 * 146 * @param sess Audio device session. 147 * @param cap Audio device capability. 148 * @param val Place to store queried value. 149 * 150 * @return Error code. 151 */ 111 152 int audio_pcm_query_cap(audio_pcm_sess_t *sess, audio_cap_t cap, unsigned *val) 112 153 { … … 124 165 } 125 166 167 /** 168 * Query current position in device buffer. 169 * 170 * @param sess Audio device session. 171 * @param pos Place to store the result. 172 * 173 * @return Error code. 174 * 175 * Works for both playback and capture. 176 */ 126 177 int audio_pcm_get_buffer_pos(audio_pcm_sess_t *sess, size_t *pos) 127 178 { … … 139 190 } 140 191 192 /** 193 * Test format parameters for device support. 194 * 195 * @param sess Audio device session. 196 * @param channels Number of channels 197 * @param rate Sampling rate. 198 * @format Sample format. 199 * 200 * @return Error code. 201 * 202 * Works for both playback and capture. This function modifies provided 203 * parameters to the nearest values supported by the device. 204 */ 141 205 int audio_pcm_test_format(audio_pcm_sess_t *sess, unsigned *channels, 142 206 unsigned *rate, pcm_sample_format_t *format) … … 168 232 } 169 233 234 /** 235 * Get device accessible playback/capture buffer. 236 * 237 * @param sess Audio device session. 238 * @param buffer Place to store pointer to the buffer. 239 * @param size Place to store buffer size (bytes). 240 * @param event_rec Event callback function. 241 * @param arg Event callback custom parameter. 242 * 243 * @return Error code. 244 */ 170 245 int audio_pcm_get_buffer(audio_pcm_sess_t *sess, void **buffer, size_t *size, 171 246 async_client_conn_t event_rec, void* arg) … … 200 275 } 201 276 277 /** 278 * Release device accessible playback/capture buffer. 279 * 280 * @param sess Audio device session. 281 * 282 * @return Error code. 283 */ 202 284 int audio_pcm_release_buffer(audio_pcm_sess_t *sess) 203 285 { … … 210 292 } 211 293 294 /** 295 * Start playback on buffer from position 0. 296 * 297 * @param sess Audio device session. 298 * @param frames Size of fragment (in frames). 299 * @param channels Number of channels. 300 * @param sample_rate Sampling rate (for one channel). 301 * @param format Sample format. 302 * 303 * @return Error code. 304 * 305 * Event will be generated after every fragment. Set fragment size to 306 * 0 to turn off event generation. 307 */ 212 308 int audio_pcm_start_playback(audio_pcm_sess_t *sess, unsigned frames, 213 309 unsigned channels, unsigned sample_rate, pcm_sample_format_t format) … … 226 322 } 227 323 324 /** 325 * Stop current playback. 326 * 327 * @param sess Audio device session. 328 * 329 * @return Error code. 330 */ 228 331 int audio_pcm_stop_playback(audio_pcm_sess_t *sess) 229 332 { … … 236 339 } 237 340 341 /** 342 * Start capture on buffer from position 0. 343 * 344 * @param sess Audio device session. 345 * @param frames Size of fragment (in frames). 346 * @param channels Number of channels. 347 * @param sample_rate Sampling rate (for one channel). 348 * @param format Sample format. 349 * 350 * @return Error code. 351 * 352 * Event will be generated after every fragment. Set fragment size to 353 * 0 to turn off event generation. 354 */ 238 355 int audio_pcm_start_capture(audio_pcm_sess_t *sess, unsigned frames, 239 356 unsigned channels, unsigned sample_rate, pcm_sample_format_t format) … … 251 368 } 252 369 370 /** 371 * Stop current playback. 372 * 373 * @param sess Audio device session. 374 * 375 * @return Error code. 376 */ 253 377 int audio_pcm_stop_capture(audio_pcm_sess_t *sess) 254 378 {
Note:
See TracChangeset
for help on using the changeset viewer.