summaryrefslogtreecommitdiffstats
path: root/polyp/polyplib-stream.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-09-26 17:02:26 +0000
committerLennart Poettering <lennart@poettering.net>2004-09-26 17:02:26 +0000
commit5bac3c3ce515cb588f3928431db4fe1c396d53e7 (patch)
tree7ec714219121bee11db5f7f497879e805ea30926 /polyp/polyplib-stream.h
parent405fac5ea7070fa7b50a77952fa8042f87f588a8 (diff)
bum version number
add new macro PA_API_VERSION for preprocessor level conditional compiling add new native APIs: - counter - cork & flush for record streams - add flags parameters to pa_stream_connect_xx() - new prebuf command - time api, and total latency calculator - return sample spec ability to cork source output streams dump server status on SIGHUP to syslog show sink input/source outputs status in cli-text.c don't flush esound output buffer when client disconnects move version api to polyplib-version.h git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@240 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/polyplib-stream.h')
-rw-r--r--polyp/polyplib-stream.h40
1 files changed, 34 insertions, 6 deletions
diff --git a/polyp/polyplib-stream.h b/polyp/polyplib-stream.h
index 257f2b99..e095d7fa 100644
--- a/polyp/polyplib-stream.h
+++ b/polyp/polyplib-stream.h
@@ -57,10 +57,10 @@ struct pa_context* pa_stream_get_context(struct pa_stream *p);
uint32_t pa_stream_get_index(struct pa_stream *s);
/** Connect the stream to a sink */
-void pa_stream_connect_playback(struct pa_stream *s, const char *dev, const struct pa_buffer_attr *attr, pa_volume_t volume);
+void pa_stream_connect_playback(struct pa_stream *s, const char *dev, const struct pa_buffer_attr *attr, enum pa_stream_flags flags, pa_volume_t volume);
/** Connect the stream to a source */
-void pa_stream_connect_record(struct pa_stream *s, const char *dev, const struct pa_buffer_attr *attr);
+void pa_stream_connect_record(struct pa_stream *s, const char *dev, const struct pa_buffer_attr *attr, enum pa_stream_flags flags);
/** Disconnect a stream from a source/sink */
void pa_stream_disconnect(struct pa_stream *s);
@@ -107,28 +107,56 @@ struct pa_operation* pa_stream_get_latency(struct pa_stream *p, void (*cb)(struc
/** Set the callback function that is called whenever the state of the stream changes */
void pa_stream_set_state_callback(struct pa_stream *s, void (*cb)(struct pa_stream *s, void *userdata), void *userdata);
-/** Set the callback function that is called when new data may be written to the stream */
+/** Set the callback function that is called when new data may be
+ * written to the stream. */
void pa_stream_set_write_callback(struct pa_stream *p, void (*cb)(struct pa_stream *p, size_t length, void *userdata), void *userdata);
/** Set the callback function that is called when new data is available from the stream */
void pa_stream_set_read_callback(struct pa_stream *p, void (*cb)(struct pa_stream *p, const void*data, size_t length, void *userdata), void *userdata);
-/** Pause (or resume) playback of this stream temporarily. \since 0.3 */
+/** Pause (or resume) playback of this stream temporarily. Available on both playback and recording streams. \since 0.3 */
struct pa_operation* pa_stream_cork(struct pa_stream *s, int b, void (*cb) (struct pa_stream*s, int success, void *userdata), void *userdata);
/** Flush the playback buffer of this stream. Most of the time you're
* better off using the parameter delta of pa_stream_write() instead of this
- * function. \since 0.3 */
+ * function. Available on both playback and recording streams. \since 0.3 */
struct pa_operation* pa_stream_flush(struct pa_stream *s, void (*cb)(struct pa_stream *s, int success, void *userdata), void *userdata);
+/** Reenable prebuffering. Available for playback streams only. \since 0.6 */
+struct pa_operation* pa_stream_prebuf(struct pa_stream *s, void (*cb)(struct pa_stream *s, int success, void *userdata), void *userdata);
+
/** Request immediate start of playback on this stream. This disables
- * prebuffering as specified in the pa_buffer_attr structure. \since
+ * prebuffering as specified in the pa_buffer_attr structure. Available for playback streams only. \since
* 0.3 */
struct pa_operation* pa_stream_trigger(struct pa_stream *s, void (*cb)(struct pa_stream *s, int success, void *userdata), void *userdata);
/** Rename the stream. \since 0.5 */
struct pa_operation* pa_stream_set_name(struct pa_stream *s, const char *name, void(*cb)(struct pa_stream*c, int success, void *userdata), void *userdata);
+/** Return the total number of bytes written to/read from the
+ * stream. This counter is not reset on pa_stream_flush(), you may do
+ * this yourself using pa_stream_reset_counter(). \since 0.6 */
+uint64_t pa_stream_get_counter(struct pa_stream *s);
+
+/** Reset the total byte count to 0. \since 0.6 */
+void pa_stream_reset_counter(struct pa_stream *s);
+
+/** Return the current playback/recording time. This is based on the
+ * counter accessible with pa_stream_get_counter(). This function
+ * requires a pa_latency_info structure as argument, which should be
+ * acquired using pa_stream_get_latency(). \since 0.6 */
+pa_usec_t pa_stream_get_time(struct pa_stream *s, const struct pa_latency_info *i);
+
+/** Return the total stream latency. Thus function requires a
+ * pa_latency_info structure as argument, which should be aquired
+ * using pa_stream_get_latency(). In case the stream is a monitoring
+ * stream the result can be negative, i.e. the captured samples are
+ * not yet played. In this case *negative is set to 1. \since 0.6 */
+pa_usec_t pa_stream_get_total_latency(struct pa_stream *s, const struct pa_latency_info *i, int *negative);
+
+/** Return a pointer to the streams sample specification. \since 0.6 */
+const struct pa_sample_spec* pa_stream_get_sample_spec(struct pa_stream *s);
+
PA_C_DECL_END
#endif