# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
AC_PREREQ(2.57)
-AC_INIT([polypaudio],[0.2],[mzcbylcnhqvb (at) 0pointer (dot) de])
+AC_INIT([polypaudio],[0.3],[mzcbylcnhqvb (at) 0pointer (dot) de])
AC_CONFIG_SRCDIR([polyp/main.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign -Wall])
- native library/protocol:
module load/unload
kill client/...
+ autoload management
- more complete pactl
+- daemon autostart
+- cleanup tagstruct (add s32, pa_volume_t, pa_usec_t)
+- xmlrpc
+- remove all gcc warnings
+- complete doxygen coverage
** later ***
- slp/rendezvous
/** Return one if an event type t matches an event mask bitfield */
#define pa_subscription_match_flags(m, t) (!!((m) & (1 << ((t) & PA_SUBSCRIPTION_EVENT_FACILITY_MASK))))
-/** A structure for latency info. See pa_stream_get_latency(). */
+/** A structure for latency info. See pa_stream_get_latency(). The
+ * total latency a sample that is written with pa_stream_write() takes
+ * to be played is buffer_usec+sink_usec. The buffer to which
+ * buffer_usec relates may be manipulated freely (with
+ * pa_stream_write()'s delta argument, pa_stream_flush() and friends),
+ * the playback buffer sink_usec relates to is a FIFO which cannot be
+ * flushed or manipulated in any way. */
struct pa_latency_info {
pa_usec_t buffer_usec; /**< Time in usecs the current buffer takes to play */
- pa_usec_t sink_usec; /**< Time in usecs a sample takes to be played on the sink. The total latency is buffer_usec+sink_usec. */
+ pa_usec_t sink_usec; /**< Time in usecs a sample takes to be played on the sink. */
int playing; /**< Non-zero when the stream is currently playing */
int queue_length; /**< Queue size in bytes. */
};
pa_tagstruct_getu32(t, &i.sink) < 0 ||
pa_tagstruct_get_sample_spec(t, &i.sample_spec) < 0 ||
pa_tagstruct_getu32(t, &i.volume) < 0 ||
- pa_tagstruct_getu32(t, &i.latency) < 0) {
+ pa_tagstruct_getu32(t, &i.buffer_usec) < 0 ||
+ pa_tagstruct_getu32(t, &i.sink_usec) < 0) {
pa_context_fail(o->context, PA_ERROR_PROTOCOL);
goto finish;
}
struct pa_operation* pa_context_get_client_info(struct pa_context *c, uint32_t index, void (*cb)(struct pa_context *c, const struct pa_client_info*i, int is_last, void *userdata), void *userdata);
struct pa_operation* pa_context_get_client_info_list(struct pa_context *c, void (*cb)(struct pa_context *c, const struct pa_client_info*i, int is_last, void *userdata), void *userdata);
+/** Stores information about sink inputs */
struct pa_sink_input_info {
- uint32_t index;
- const char *name;
- uint32_t owner_module;
- uint32_t client;
- uint32_t sink;
- struct pa_sample_spec sample_spec;
- pa_volume_t volume;
- pa_usec_t latency;
+ uint32_t index; /**< Name of this index */
+ const char *name; /**< Name of the sink input */
+ uint32_t owner_module; /**< Index of the module this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any module */
+ uint32_t client; /**< Index of the client this sink input belongs to, or PA_INVALID_INDEX when it does not belong to any client */
+ uint32_t sink; /**< Index of the connected sink */
+ struct pa_sample_spec sample_spec; /**< The sample specification of the sink input */
+ pa_volume_t volume; /**< The volume of this sink input */
+ pa_usec_t buffer_usec; /**< Latency due to buffering in sink input, see pa_latency_info for details */
+ pa_usec_t sink_usec; /**< Latency of the sink device, see pa_latency_info for details */
};
struct pa_operation* pa_context_get_sink_input_info(struct pa_context *c, uint32_t index, void (*cb)(struct pa_context *c, const struct pa_sink_input_info*i, int is_last, void *userdata), void *userdata);
s->requested_bytes += bytes;
- fprintf(stderr, "total req: %u (%u)\n", s->requested_bytes, bytes);
-
if (s->requested_bytes && s->write_callback)
s->write_callback(s, s->requested_bytes, s->write_userdata);
pa_tagstruct_put_sample_spec(t, &s->sample_spec);
pa_tagstruct_putu32(t, s->volume);
pa_tagstruct_putu32(t, pa_sink_input_get_latency(s));
+ pa_tagstruct_putu32(t, pa_sink_get_latency(s->sink));
}
static void source_output_fill_tagstruct(struct pa_tagstruct *t, struct pa_source_output *s) {
pa_sink_notify(s->sink_input->sink);
pa_pstream_send_simple_ack(c->pstream, tag);
+ request_bytes(s);
}
/*** pstream callbacks ***/
l = strlen(s)+2;
extend(t, l);
t->data[t->length] = TAG_STRING;
- strcpy(t->data+t->length+1, s);
+ strcpy((char*) (t->data+t->length+1), s);
t->length += l;
}