]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/remap.h
remap: Add helper function to setup channel arrangement information
[pulseaudio] / src / pulsecore / remap.h
index 6411a46f3b55fc9054449849e0a9ea2018980c10..3bd14036a02245d4fedaad3ea9dbcb81e583931d 100644 (file)
@@ -30,8 +30,8 @@ typedef struct pa_remap pa_remap_t;
 typedef void (*pa_do_remap_func_t) (pa_remap_t *m, void *d, const void *s, unsigned n);
 
 struct pa_remap {
-    pa_sample_format_t *format;
-    pa_sample_spec *i_ss, *o_ss;
+    pa_sample_format_t format;
+    pa_sample_spec i_ss, o_ss;
     float map_table_f[PA_CHANNELS_MAX][PA_CHANNELS_MAX];
     int32_t map_table_i[PA_CHANNELS_MAX][PA_CHANNELS_MAX];
     pa_do_remap_func_t do_remap;
@@ -45,4 +45,14 @@ typedef void (*pa_init_remap_func_t) (pa_remap_t *m);
 pa_init_remap_func_t pa_get_init_remap_func(void);
 void pa_set_init_remap_func(pa_init_remap_func_t func);
 
+/* Check if remapping can be performed by just copying some or all input
+ * channels' data to output channels. Returns true and a table of input
+ * channel indices, or false otherwise.
+ *
+ * The table contains an entry for each output channels. Each table entry given
+ * either the input channel index to be copied, or -1 indicating that the
+ * output channel is not used and hence zero.
+ */
+bool pa_setup_remap_arrange(const pa_remap_t *m, int8_t arrange[PA_CHANNELS_MAX]);
+
 #endif /* fooremapfoo */