sink, source, device-port: renames to distinguish latency offsets

Renamed all variables pertaining to latency offsets of sinks and sources,
calling them "port_latency_offset" or similar instead. All of these variables
refer to latency offsets inherited from ports, rather than being unique to
the sinks or sources themselves.

This change is to pave the way for additional functionality for setting
latency offsets on sources and sinks independenly from the value they inherit
from their port. In order to implement them we first need this rename so that
the two latency offsets can be stored individually and summed when reporting
the total latency of the source or sink.

The renames made are:

pa_sink_set_latency_offset() -> pa_sink_set_port_latency_offset()
pa_source_set_latency_offset() -> pa_source_set_port_latency_offset()
sink->latency_offset -> sink->port_latency_offset
sink->thread_info.latency_offset -> sink->thread_info.port_latency_offset
source->latency_offset -> source->port_latency_offset
source->thread_info.latency_offset -> source->thread_info.port_latency_offset
PA_SINK_MESSAGE_SET_LATENCY_OFFSET -> PA_SINK_MESSAGE_SET_PORT_LATENCY_OFFSET
PA_SOURCE_MESSAGE_SET_LATENCY_OFFSET -> PA_SOURCE_MESSAGE_SET_PORT_LATENCY_OFFSET
This commit is contained in:
Chris Billington 2016-01-23 12:31:34 +11:00 committed by Arun Raghavan
parent 99c3bc69d5
commit 694662d936
5 changed files with 40 additions and 40 deletions

View file

@ -118,7 +118,7 @@ struct pa_sink {
pa_atomic_t mixer_dirty;
/* The latency offset is inherited from the currently active port */
int64_t latency_offset;
int64_t port_latency_offset;
unsigned priority;
@ -287,8 +287,8 @@ struct pa_sink {
* in changing it */
pa_usec_t fixed_latency; /* for sinks with PA_SINK_DYNAMIC_LATENCY this is 0 */
/* This latency offset is a direct copy from s->latency_offset */
int64_t latency_offset;
/* This latency offset is a direct copy from s->port_latency_offset */
int64_t port_latency_offset;
/* Delayed volume change events are queued here. The events
* are stored in expiration order. The one expiring next is in
@ -337,7 +337,7 @@ typedef enum pa_sink_message {
PA_SINK_MESSAGE_SET_MAX_REQUEST,
PA_SINK_MESSAGE_SET_PORT,
PA_SINK_MESSAGE_UPDATE_VOLUME_AND_MUTE,
PA_SINK_MESSAGE_SET_LATENCY_OFFSET,
PA_SINK_MESSAGE_SET_PORT_LATENCY_OFFSET,
PA_SINK_MESSAGE_MAX
} pa_sink_message_t;
@ -423,7 +423,7 @@ unsigned pa_device_init_priority(pa_proplist *p);
/**** May be called by everyone, from main context */
int pa_sink_update_rate(pa_sink *s, uint32_t rate, bool passthrough);
void pa_sink_set_latency_offset(pa_sink *s, int64_t offset);
void pa_sink_set_port_latency_offset(pa_sink *s, int64_t offset);
/* The returned value is supposed to be in the time domain of the sound card! */
pa_usec_t pa_sink_get_latency(pa_sink *s);