295
295
/** Return the context this stream is attached to */
296
296
pa_context* pa_stream_get_context(pa_stream *p);
298
/** Return the device (sink input or source output) index this stream is connected to */
298
/** Return the sink input resp. source output index this stream is
299
* identified in the server with. This is useful for usage with the
300
* introspection functions, such as pa_context_get_sink_input_info()
301
* resp. pa_context_get_source_output_info(). */
299
302
uint32_t pa_stream_get_index(pa_stream *s);
304
/** Return the index of the sink or source this stream is connected to
305
* in the server. This is useful for usage with the introspection
306
* functions, such as pa_context_get_sink_info_by_index()
307
* resp. pa_context_get_source_info_by_index(). Please note that
308
* streams may be moved between sinks/sources and thus it is
309
* recommended to use pa_stream_set_moved_callback() to be notified
310
* about this. This function will return with PA_ERR_NOTSUPPORTED when the
311
* server is older than 0.9.8. \since 0.9.8 */
312
uint32_t pa_stream_get_device_index(pa_stream *s);
314
/** Return the name of the sink or source this stream is connected to
315
* in the server. This is useful for usage with the introspection
316
* functions, such as pa_context_get_sink_info_by_name()
317
* resp. pa_context_get_source_info_by_name(). Please note that
318
* streams may be moved between sinks/sources and thus it is
319
* recommended to use pa_stream_set_moved_callback() to be notified
320
* about this. This function will return with PA_ERR_NOTSUPPORTED when the
321
* server is older than 0.9.8. \since 0.9.8 */
322
const char *pa_stream_get_device_name(pa_stream *s);
324
/** Return 1 if the sink or source this stream is connected to has
325
* been suspended. This will return 0 if not, and negative on
326
* error. This function will return with PA_ERR_NOTSUPPORTED when the
327
* server is older than 0.9.8. \since 0.9.8 */
328
int pa_stream_is_suspended(pa_stream *s);
301
330
/** Connect the stream to a sink */
302
331
int pa_stream_connect_playback(
303
332
pa_stream *s /**< The stream to connect to a sink */,
346
375
* calling pa_stream_peek(). \since 0.8 */
347
376
int pa_stream_drop(pa_stream *p);
349
/** Return the nember of bytes that may be written using pa_stream_write(), in bytes */
378
/** Return the number of bytes that may be written using pa_stream_write() */
350
379
size_t pa_stream_writable_size(pa_stream *p);
352
/** Return the number of bytes that may be read using pa_stream_read(), in bytes \since 0.8 */
381
/** Return the number of bytes that may be read using pa_stream_read() \since 0.8 */
353
382
size_t pa_stream_readable_size(pa_stream *p);
355
384
/** Drain a playback stream. Use this for notification when the buffer is empty */
378
407
/** Set the callback function that is called when a buffer underflow happens. (Only for playback streams) \since 0.8 */
379
408
void pa_stream_set_underflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
381
/** 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 */
410
/** Set the callback function that is called whenever a latency
411
* information update happens. Useful on PA_STREAM_AUTO_TIMING_UPDATE
412
* streams only. (Only for playback streams) \since 0.8.2 */
382
413
void pa_stream_set_latency_update_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
415
/** Set the callback function that is called whenever the stream is
416
* moved to a different sink/source. Use pa_stream_get_device_name()or
417
* pa_stream_get_device_index() to query the new sink/source. This
418
* notification is only generated when the server is at least
419
* 0.9.8. \since 0.9.8 */
420
void pa_stream_set_moved_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
422
/** Set the callback function that is called whenever the sink/source
423
* this stream is connected to is suspended or resumed. Use
424
* pa_stream_is_suspended() to query the new suspend status. Please
425
* note that the suspend status might also change when the stream is
426
* moved between devices. Thus if you call this function you very
427
* likely want to call pa_stream_set_moved_callback, too. This
428
* notification is only generated when the server is at least
429
* 0.9.8. \since 0.9.8 */
430
void pa_stream_set_suspended_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
384
432
/** Pause (or resume) playback of this stream temporarily. Available on both playback and recording streams. \since 0.3 */
385
433
pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata);
447
495
* PulseAudio 0.9. \since 0.9.0 */
448
496
const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s);
498
/** Change the buffer metrics of the stream during playback. The
499
* server might have chosen different buffer metrics then
500
* requested. The selected metrics may be queried with
501
* pa_stream_get_buffer_attr() as soon as the callback is called. Only
502
* valid after the stream has been connected successfully and if the
503
* server is at least PulseAudio 0.9.8. \since 0.9.8 */
504
pa_operation *pa_stream_set_buffer_attr(pa_stream *s, const pa_buffer_attr *attr, pa_stream_success_cb_t cb, void *userdata);
506
/* Change the stream sampling rate during playback. You need to pass
507
* PA_STREAM_VARIABLE_RATE in the flags parameter of
508
* pa_stream_connect() if you plan to use this function. Only valid
509
* after the stream has been connected successfully and if the server
510
* is at least PulseAudio 0.9.8. \since 0.9.8 */
511
pa_operation *pa_stream_update_sample_rate(pa_stream *s, uint32_t rate, pa_stream_success_cb_t cb, void *userdata);