mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-server: fill volumes and state
This commit is contained in:
parent
3c2b58d192
commit
2bf5cfa2f7
4 changed files with 198 additions and 95 deletions
|
|
@ -97,6 +97,11 @@ struct sample_spec {
|
|||
uint32_t rate;
|
||||
uint8_t channels;
|
||||
};
|
||||
#define SAMPLE_SPEC_INIT (struct sample_spec) { \
|
||||
.format = SAMPLE_FLOAT32LE, \
|
||||
.rate = 44100, \
|
||||
.channels = 2, \
|
||||
};
|
||||
|
||||
static inline uint32_t sample_spec_frame_size(const struct sample_spec *ss)
|
||||
{
|
||||
|
|
@ -247,6 +252,12 @@ struct channel_map {
|
|||
enum channel_position map[CHANNELS_MAX];
|
||||
};
|
||||
|
||||
#define CHANNEL_MAP_INIT (struct channel_map) { \
|
||||
.channels = 2, \
|
||||
.map[0] = CHANNEL_POSITION_FRONT_LEFT, \
|
||||
.map[1] = CHANNEL_POSITION_FRONT_RIGHT, \
|
||||
}
|
||||
|
||||
static inline uint32_t channel_pa2id(enum channel_position channel)
|
||||
{
|
||||
if (channel < 0 || (size_t)channel >= SPA_N_ELEMENTS(audio_channels))
|
||||
|
|
@ -283,11 +294,6 @@ static void channel_map_to_positions(const struct channel_map *map, uint32_t *po
|
|||
pos[i] = channel_pa2id(map->map[i]);
|
||||
}
|
||||
|
||||
struct volume {
|
||||
uint8_t channels;
|
||||
float values[CHANNELS_MAX];
|
||||
};
|
||||
|
||||
enum encoding {
|
||||
ENCODING_ANY,
|
||||
ENCODING_PCM,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue