pipewire/spa/plugins/audiomixer/plugin.c

34 lines
754 B
C
Raw Permalink Normal View History

/* Spa Audiomixer plugin */
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#include <errno.h>
#include <spa/support/plugin.h>
2023-12-23 21:07:45 +02:00
#include <spa/support/log.h>
extern const struct spa_handle_factory spa_audiomixer_factory;
extern const struct spa_handle_factory spa_mixer_dsp_factory;
2023-12-23 21:07:45 +02:00
SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED;
2019-02-06 13:24:41 +01:00
SPA_EXPORT
int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
{
spa_return_val_if_fail(factory != NULL, -EINVAL);
spa_return_val_if_fail(index != NULL, -EINVAL);
switch (*index) {
case 0:
*factory = &spa_audiomixer_factory;
break;
case 1:
*factory = &spa_mixer_dsp_factory;
break;
default:
return 0;
}
(*index)++;
return 1;
}