]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/sink.h
sink, source: Assign to reference_volume from only one place
[pulseaudio] / src / pulsecore / sink.h
index 54056a7a62f053b3104cf61115bf7b6974b83f95..3c796f060e2113203642e553adad4d44bf5c442f 100644 (file)
@@ -48,7 +48,7 @@ typedef struct pa_sink_volume_change pa_sink_volume_change;
 #include <pulsecore/thread-mq.h>
 #include <pulsecore/sink-input.h>
 
-#define PA_MAX_INPUTS_PER_SINK 32
+#define PA_MAX_INPUTS_PER_SINK 256
 
 /* Returns true if sink is linked: registered and accessible from client side. */
 static inline bool PA_SINK_IS_LINKED(pa_sink_state_t x) {
@@ -230,7 +230,7 @@ struct pa_sink {
 
     /* Called whenever the sampling frequency shall be changed. Called from
      * main thread. */
-    bool (*update_rate)(pa_sink *s, uint32_t rate);
+    int (*update_rate)(pa_sink *s, uint32_t rate);
 
     /* Contains copies of the above data so that the real-time worker
      * thread can work without access locking */
@@ -311,8 +311,6 @@ typedef enum pa_sink_message {
     PA_SINK_MESSAGE_SET_STATE,
     PA_SINK_MESSAGE_START_MOVE,
     PA_SINK_MESSAGE_FINISH_MOVE,
-    PA_SINK_MESSAGE_ATTACH,
-    PA_SINK_MESSAGE_DETACH,
     PA_SINK_MESSAGE_SET_LATENCY_RANGE,
     PA_SINK_MESSAGE_GET_LATENCY_RANGE,
     PA_SINK_MESSAGE_SET_FIXED_LATENCY,
@@ -395,23 +393,20 @@ void pa_sink_set_max_request(pa_sink *s, size_t max_request);
 void pa_sink_set_latency_range(pa_sink *s, pa_usec_t min_latency, pa_usec_t max_latency);
 void pa_sink_set_fixed_latency(pa_sink *s, pa_usec_t latency);
 
-void pa_sink_detach(pa_sink *s);
-void pa_sink_attach(pa_sink *s);
-
 void pa_sink_set_soft_volume(pa_sink *s, const pa_cvolume *volume);
 void pa_sink_volume_changed(pa_sink *s, const pa_cvolume *new_volume);
 void pa_sink_mute_changed(pa_sink *s, bool new_muted);
 
 void pa_sink_update_flags(pa_sink *s, pa_sink_flags_t mask, pa_sink_flags_t value);
 
-bool pa_device_init_description(pa_proplist *p);
+bool pa_device_init_description(pa_proplist *p, pa_card *card);
 bool pa_device_init_icon(pa_proplist *p, bool is_sink);
 bool pa_device_init_intended_roles(pa_proplist *p);
 unsigned pa_device_init_priority(pa_proplist *p);
 
 /**** May be called by everyone, from main context */
 
-bool pa_sink_update_rate(pa_sink *s, uint32_t rate, bool passthrough);
+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);
 
 /* The returned value is supposed to be in the time domain of the sound card! */
@@ -461,7 +456,13 @@ pa_queue *pa_sink_move_all_start(pa_sink *s, pa_queue *q);
 void pa_sink_move_all_finish(pa_sink *s, pa_queue *q, bool save);
 void pa_sink_move_all_fail(pa_queue *q);
 
+/* Returns a copy of the sink formats. TODO: Get rid of this function (or at
+ * least get rid of the copying). There's no good reason to copy the formats
+ * every time someone wants to know what formats the sink supports. The formats
+ * idxset could be stored directly in the pa_sink struct.
+ * https://bugs.freedesktop.org/show_bug.cgi?id=71924 */
 pa_idxset* pa_sink_get_formats(pa_sink *s);
+
 bool pa_sink_set_formats(pa_sink *s, pa_idxset *formats);
 bool pa_sink_check_format(pa_sink *s, pa_format_info *f);
 pa_idxset* pa_sink_check_formats(pa_sink *s, pa_idxset *in_formats);
@@ -502,6 +503,13 @@ void pa_sink_invalidate_requested_latency(pa_sink *s, bool dynamic);
 
 pa_usec_t pa_sink_get_latency_within_thread(pa_sink *s);
 
+/* Called from the main thread, from sink-input.c only. The normal way to set
+ * the sink reference volume is to call pa_sink_set_volume(), but the flat
+ * volume logic in sink-input.c needs also a function that doesn't do all the
+ * extra stuff that pa_sink_set_volume() does. This function simply sets
+ * s->reference_volume and fires change notifications. */
+void pa_sink_set_reference_volume_direct(pa_sink *s, const pa_cvolume *volume);
+
 /* 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. */