2023-02-08 18:12:00 +01:00
|
|
|
/* Spa Audioconvert plugin */
|
|
|
|
|
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
|
|
|
|
|
/* SPDX-License-Identifier: MIT */
|
2018-04-02 11:21:29 +02:00
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
|
|
#include <spa/support/plugin.h>
|
2023-12-23 21:07:45 +02:00
|
|
|
#include <spa/support/log.h>
|
2018-04-02 11:21:29 +02:00
|
|
|
|
2022-06-16 09:19:05 +02:00
|
|
|
extern const struct spa_handle_factory spa_audioconvert_factory;
|
2019-07-10 18:04:59 +02:00
|
|
|
extern const struct spa_handle_factory spa_audioadapter_factory;
|
2018-04-02 11:21:29 +02:00
|
|
|
|
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)
|
2018-04-02 11:21:29 +02:00
|
|
|
{
|
|
|
|
|
spa_return_val_if_fail(factory != NULL, -EINVAL);
|
|
|
|
|
spa_return_val_if_fail(index != NULL, -EINVAL);
|
|
|
|
|
|
|
|
|
|
switch (*index) {
|
|
|
|
|
case 0:
|
2022-06-16 09:19:05 +02:00
|
|
|
*factory = &spa_audioconvert_factory;
|
2018-04-02 11:21:29 +02:00
|
|
|
break;
|
2018-04-06 18:39:07 +02:00
|
|
|
case 1:
|
2019-07-10 18:04:59 +02:00
|
|
|
*factory = &spa_audioadapter_factory;
|
|
|
|
|
break;
|
2018-04-02 11:21:29 +02:00
|
|
|
default:
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
(*index)++;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|