mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: make a #define for default rate and channels
This commit is contained in:
parent
b53f96eae9
commit
0c359a6819
3 changed files with 10 additions and 4 deletions
|
|
@ -195,7 +195,7 @@ spa_alsa_enum_format(struct state *state, uint32_t *index,
|
|||
prop = spa_pod_builder_deref(&b,
|
||||
spa_pod_builder_push_prop(&b, state->type.format_audio.rate, SPA_POD_PROP_RANGE_NONE));
|
||||
|
||||
spa_pod_builder_int(&b, SPA_CLAMP(48000, min, max));
|
||||
spa_pod_builder_int(&b, SPA_CLAMP(DEFAULT_RATE, min, max));
|
||||
if (min != max) {
|
||||
spa_pod_builder_int(&b, min);
|
||||
spa_pod_builder_int(&b, max);
|
||||
|
|
@ -209,7 +209,7 @@ spa_alsa_enum_format(struct state *state, uint32_t *index,
|
|||
prop = spa_pod_builder_deref(&b,
|
||||
spa_pod_builder_push_prop(&b, state->type.format_audio.channels, SPA_POD_PROP_RANGE_NONE));
|
||||
|
||||
spa_pod_builder_int(&b, SPA_CLAMP(2, min, max));
|
||||
spa_pod_builder_int(&b, SPA_CLAMP(DEFAULT_CHANNELS, min, max));
|
||||
if (min != max) {
|
||||
spa_pod_builder_int(&b, min);
|
||||
spa_pod_builder_int(&b, max);
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ extern "C" {
|
|||
#include <spa/param/meta.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
|
||||
#define DEFAULT_RATE 48000
|
||||
#define DEFAULT_CHANNELS 2
|
||||
|
||||
struct props {
|
||||
char device[64];
|
||||
char device_name[128];
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@
|
|||
|
||||
#define NAME "fmtconvert"
|
||||
|
||||
#define DEFAULT_RATE 44100
|
||||
#define DEFAULT_CHANNELS 2
|
||||
|
||||
#define MAX_BUFFERS 32
|
||||
|
||||
#define PROP_DEFAULT_TRUNCATE false
|
||||
|
|
@ -369,9 +372,9 @@ static int port_enum_formats(struct spa_node *node,
|
|||
":", t->format_audio.layout, "ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_POD_PROP_ENUM(2, SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_AUDIO_LAYOUT_NON_INTERLEAVED),
|
||||
":", t->format_audio.rate, "iru", 44100,
|
||||
":", t->format_audio.rate, "iru", DEFAULT_RATE,
|
||||
SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", t->format_audio.channels, "iru", 2,
|
||||
":", t->format_audio.channels, "iru", DEFAULT_CHANNELS,
|
||||
SPA_POD_PROP_MIN_MAX(1, INT32_MAX));
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue