mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-19 08:57:14 -05:00
Add volume and mute control support in audiomixer
This commit is contained in:
parent
4b84e34744
commit
cb3198c458
5 changed files with 212 additions and 81 deletions
51
spa/plugins/audiomixer/mix-ops.h
Normal file
51
spa/plugins/audiomixer/mix-ops.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/* Spa
|
||||
* Copyright (C) 2017 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
|
||||
typedef void (*mix_clear_func_t) (void *dst, int n_bytes);
|
||||
typedef void (*mix_func_t) (void *dst, const void *src, int n_bytes);
|
||||
typedef void (*mix_scale_func_t) (void *dst, const void *src, const double scale, int n_bytes);
|
||||
typedef void (*mix_i_func_t) (void *dst, int dst_stride,
|
||||
const void *src, int src_stride, int n_bytes);
|
||||
typedef void (*mix_scale_i_func_t) (void *dst, int dst_stride,
|
||||
const void *src, int src_stride, const double scale, int n_bytes);
|
||||
|
||||
enum {
|
||||
FMT_S16,
|
||||
FMT_F32,
|
||||
FMT_MAX,
|
||||
};
|
||||
|
||||
struct spa_audiomixer_ops {
|
||||
mix_clear_func_t clear[FMT_MAX];
|
||||
mix_func_t copy[FMT_MAX];
|
||||
mix_func_t add[FMT_MAX];
|
||||
mix_scale_func_t copy_scale[FMT_MAX];
|
||||
mix_scale_func_t add_scale[FMT_MAX];
|
||||
mix_i_func_t copy_i[FMT_MAX];
|
||||
mix_i_func_t add_i[FMT_MAX];
|
||||
mix_scale_i_func_t copy_scale_i[FMT_MAX];
|
||||
mix_scale_i_func_t add_scale_i[FMT_MAX];
|
||||
};
|
||||
|
||||
void spa_audiomixer_get_ops(struct spa_audiomixer_ops *ops);
|
||||
Loading…
Add table
Add a link
Reference in a new issue