]> code.delx.au - pulseaudio/commitdiff
minor cleanups
authorLennart Poettering <lennart@poettering.net>
Fri, 27 Aug 2004 16:24:22 +0000 (16:24 +0000)
committerLennart Poettering <lennart@poettering.net>
Fri, 27 Aug 2004 16:24:22 +0000 (16:24 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@155 fefdeb5f-60dc-0310-8127-8f9354f1896f

configure.ac
doc/todo
polyp/polyplib-def.h
polyp/polyplib-introspect.c
polyp/polyplib-introspect.h
polyp/polyplib-stream.c
polyp/protocol-native.c
polyp/tagstruct.c

index 7e0b3c213d32ddc1c820ada1a4426dffc9443832..7aa6c5d4893be2912142db84be152099ae41cce5 100644 (file)
@@ -20,7 +20,7 @@
 # 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])
index a317b4f33d1cd098b0b38dd7e77eca29ec2abfac..c225dd53e10d47e34fecaa77175e2434636bacb2 100644 (file)
--- a/doc/todo
+++ b/doc/todo
@@ -8,7 +8,13 @@
 - 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
index 02f5e526f15bc2939af3876077a170bc4ac29284..6c3cd825ce730bdf39803f81195a5a06e556a1d5 100644 (file)
@@ -129,10 +129,16 @@ enum pa_subscription_event_type {
 /** 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. */  
 };
index 63422383f681e920a284be039b92a3acab5c7792..e650fb9fe3f70707e0291572dc59dde075345630 100644 (file)
@@ -400,7 +400,8 @@ static void context_get_sink_input_info_callback(struct pa_pdispatch *pd, uint32
                 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;
             }
index 0c30518431b4b9189d71fb46345ccb4ff5ddbdb1..fc7aa1233747e2c4d67a2ebba09c215fe095f96b 100644 (file)
@@ -93,15 +93,17 @@ struct pa_client_info {
 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);
index f45e1e7c06354880ab87e5b0fccc1b1719d71cbf..220e4a14404ec86cf76c75e05737a8137e943cad 100644 (file)
@@ -168,8 +168,6 @@ void pa_command_request(struct pa_pdispatch *pd, uint32_t command, uint32_t tag,
     
     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);
 
index 7b7dfef630e76ff40701d9418154dd2f5839e43b..213568a0570c249bae065bec407465a0cde8608b 100644 (file)
@@ -1022,6 +1022,7 @@ static void sink_input_fill_tagstruct(struct pa_tagstruct *t, struct pa_sink_inp
     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) {
@@ -1363,6 +1364,7 @@ static void command_flush_or_trigger_playback_stream(struct pa_pdispatch *pd, ui
 
     pa_sink_notify(s->sink_input->sink);
     pa_pstream_send_simple_ack(c->pstream, tag);
+    request_bytes(s);
 }
 
 /*** pstream callbacks ***/
index 9578a9eb64db57f5d8d2cc958ac0795c6b23b2e4..742f6b9cbc9bfa2c6b54641674d90869c65e14a1 100644 (file)
@@ -95,7 +95,7 @@ void pa_tagstruct_puts(struct pa_tagstruct*t, const char *s) {
     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;
 }