***/
typedef struct pa_sink pa_sink;
-typedef struct pa_device_port pa_device_port;
typedef struct pa_sink_volume_change pa_sink_volume_change;
#include <inttypes.h>
#include <pulsecore/asyncmsgq.h>
#include <pulsecore/msgobject.h>
#include <pulsecore/rtpoll.h>
+#include <pulsecore/device-port.h>
#include <pulsecore/card.h>
#include <pulsecore/queue.h>
#include <pulsecore/thread-mq.h>
return x == PA_SINK_RUNNING || x == PA_SINK_IDLE || x == PA_SINK_SUSPENDED;
}
-struct pa_device_port {
- char *name;
- char *description;
-
- unsigned priority;
- pa_port_available_t available; /* PA_PORT_AVAILABLE_UNKNOWN, PA_PORT_AVAILABLE_NO or PA_PORT_AVAILABLE_YES */
-
- /* .. followed by some implementation specific data */
-};
-
-#define PA_DEVICE_PORT_DATA(d) ((void*) ((uint8_t*) d + PA_ALIGN(sizeof(pa_device_port))))
-
/* A generic definition for void callback functions */
typedef void(*pa_sink_cb_t)(pa_sink *s);
pa_hashmap *ports;
pa_device_port *active_port;
+ pa_atomic_t mixer_dirty;
+
+ /* The latency offset is inherited from the currently active port */
+ int64_t latency_offset;
unsigned priority;
* thread context. */
pa_sink_cb_t update_requested_latency; /* may be NULL */
- /* Called whenever the port shall be changed. Called from main
- * thread. */
+ /* Called whenever the port shall be changed. Called from IO
+ * thread if deferred volumes are enabled, and main thread otherwise. */
int (*set_port)(pa_sink *s, pa_device_port *port); /* may be NULL */
/* Called to get the list of formats supported by the sink, sorted
* 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;
+
/* 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. */
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_MAX
} pa_sink_message_t;
typedef struct pa_sink_new_data {
+ pa_suspend_cause_t suspend_cause;
+
char *name;
pa_proplist *proplist;
/**** May be called by everyone, from main context */
pa_bool_t pa_sink_update_rate(pa_sink *s, uint32_t rate, pa_bool_t passthrough);
+void pa_sink_set_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);
pa_bool_t pa_sink_update_proplist(pa_sink *s, pa_update_mode_t mode, pa_proplist *p);
int pa_sink_set_port(pa_sink *s, const char *name, pa_bool_t save);
+void pa_sink_set_mixer_dirty(pa_sink *s, pa_bool_t is_dirty);
unsigned pa_sink_linked_by(pa_sink *s); /* Number of connected streams */
unsigned pa_sink_used_by(pa_sink *s); /* Number of connected streams which are not corked */
pa_usec_t pa_sink_get_latency_within_thread(pa_sink *s);
-pa_device_port *pa_device_port_new(const char *name, const char *description, size_t extra);
-void pa_device_port_free(pa_device_port *p);
-
/* Verify that we called in IO context (aka 'thread context), or that
* the sink is not yet set up, i.e. the thread not set up yet. See
* pa_assert_io_context() in thread-mq.h for more information. */