Changeset 3429:8b04b92caa30 in roaraudio for libroarpulse
- Timestamp:
- 02/12/10 00:05:18 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroarpulse/stream.c
r3428 r3429 57 57 struct { 58 58 struct _roar_pa_stream_cb change_state; 59 struct _roar_pa_stream_cb write; 60 struct _roar_pa_stream_cb read; 61 struct _roar_pa_stream_cb overflow; 62 struct _roar_pa_stream_cb underflow; 63 struct _roar_pa_stream_cb latency; 59 64 } cb; 60 65 }; … … 254 259 /** Set the callback function that is called when new data may be 255 260 * written to the stream. */ 256 void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata); 261 void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata) { 262 if ( p == NULL ) 263 return; 264 265 p->cb.write.cb.rcb = cb; 266 p->cb.write.userdata = userdata; 267 } 257 268 258 269 /** Set the callback function that is called when new data is available from the stream. 259 270 * Return the number of bytes read. \since 0.8 */ 260 void pa_stream_set_read_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata); 271 void pa_stream_set_read_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata) { 272 if ( p == NULL ) 273 return; 274 275 p->cb.read.cb.rcb = cb; 276 p->cb.read.userdata = userdata; 277 } 261 278 262 279 /** Set the callback function that is called when a buffer overflow happens. (Only for playback streams) \since 0.8 */ 263 void pa_stream_set_overflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata); 280 void pa_stream_set_overflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata) { 281 if ( p == NULL ) 282 return; 283 284 p->cb.overflow.cb.ncb = cb; 285 p->cb.overflow.userdata = userdata; 286 } 264 287 265 288 /** Set the callback function that is called when a buffer underflow happens. (Only for playback streams) \since 0.8 */ 266 void pa_stream_set_underflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata); 289 void pa_stream_set_underflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata) { 290 if ( p == NULL ) 291 return; 292 293 p->cb.underflow.cb.ncb = cb; 294 p->cb.underflow.userdata = userdata; 295 } 267 296 268 297 /** Set the callback function that is called whenever a latency information update happens. Useful on PA_STREAM_AUTO_TIMING_UPDATE streams only. (Only for playback streams) \since 0.8.2 */ 269 void pa_stream_set_latency_update_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata); 298 void pa_stream_set_latency_update_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata) { 299 if ( p == NULL ) 300 return; 301 302 p->cb.latency.cb.ncb = cb; 303 p->cb.latency.userdata = userdata; 304 } 270 305 271 306 /** Pause (or resume) playback of this stream temporarily. Available on both playback and recording streams. \since 0.3 */
Note: See TracChangeset
for help on using the changeset viewer.