]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/source.h
sink, source: Add a latency offset which is inherited from the port
[pulseaudio] / src / pulsecore / source.h
index 30c2037b2d60f0eb8f65da6ea5d31931a8b8d235..da024e654f6f0fc3db5da6291799a2e97cded4ba 100644 (file)
@@ -113,6 +113,9 @@ struct pa_source {
     pa_device_port *active_port;
     pa_atomic_t mixer_dirty;
 
+    /* The latency offset is inherited from the currently active port */
+    pa_usec_t latency_offset;
+
     unsigned priority;
 
     /* Called when the main loop requests a state change. Called from
@@ -209,6 +212,9 @@ struct pa_source {
 
         pa_usec_t fixed_latency; /* for sources with PA_SOURCE_DYNAMIC_LATENCY this is 0 */
 
+        /* This latency offset is a direct copy from s->latency_offset */
+        pa_usec_t latency_offset;
+
         /* Delayed volume change events are queued here. The events
          * are stored in expiration order. The one expiring next is in
          * the head of the list. */
@@ -254,6 +260,7 @@ typedef enum pa_source_message {
     PA_SOURCE_MESSAGE_SET_MAX_REWIND,
     PA_SOURCE_MESSAGE_SET_PORT,
     PA_SOURCE_MESSAGE_UPDATE_VOLUME_AND_MUTE,
+    PA_SOURCE_MESSAGE_SET_LATENCY_OFFSET,
     PA_SOURCE_MESSAGE_MAX
 } pa_source_message_t;
 
@@ -335,6 +342,8 @@ void pa_source_update_flags(pa_source *s, pa_source_flags_t mask, pa_source_flag
 
 /*** May be called by everyone, from main context */
 
+void pa_source_set_latency_offset(pa_source *s, pa_usec_t offset);
+
 /* The returned value is supposed to be in the time domain of the sound card! */
 pa_usec_t pa_source_get_latency(pa_source *s);
 pa_usec_t pa_source_get_requested_latency(pa_source *s);