~ubuntu-branches/ubuntu/oneiric/pulseaudio/oneiric

« back to all changes in this revision

Viewing changes to src/pulse/stream.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2007-12-04 00:56:08 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20071204005608-y1xqvcu45g1yxtlu
Tags: 0.9.8-1ubuntu1
"Hail our new PulseAudio overlords (part two)."

* Merge from Debian unstable.
* Ubuntu-specific changes:
  - debian/control:
    + Don't build-depend on libjack0.100.0-dev or build jack module
      packages,
    + Update pulseaudio's Recommends and Suggests to accomodate
      existing promoted main packages,
    + Explicitly mention pasuspender in pulseaudio-utils's long
      description,
    + Add Vcs-Bzr URI,
    + Adhere to DebianMaintainerField;
  - debian/rules: Use multiuser for update-rc.d;
  - debian/patches/series: Retain the exclusion of
    0001-Set-ESD-socket-to-tmp-.esd-socket-to-match-up-with.patch.
* Dropped Ubuntu-specific change (absorbed into Debian source):
  debian/patches/0002-Double-esound-maximum-sample-size.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef foostreamhfoo
2
2
#define foostreamhfoo
3
3
 
4
 
/* $Id: stream.h 1999 2007-10-30 14:17:41Z lennart $ */
 
4
/* $Id: stream.h 2067 2007-11-21 01:30:40Z lennart $ */
5
5
 
6
6
/***
7
7
  This file is part of PulseAudio.
295
295
/** Return the context this stream is attached to */
296
296
pa_context* pa_stream_get_context(pa_stream *p);
297
297
 
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);
300
303
 
 
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);
 
313
 
 
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);
 
323
 
 
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);
 
329
 
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);
348
377
 
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);
351
380
 
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);
354
383
 
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);
380
409
 
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);
383
414
 
 
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);
 
421
 
 
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);
 
431
 
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);
386
434
 
447
495
 * PulseAudio 0.9. \since 0.9.0 */
448
496
const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s);
449
497
 
 
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);
 
505
 
 
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);
 
512
 
450
513
PA_C_DECL_END
451
514
 
452
515
#endif