2023-02-08 18:12:00 +01:00
|
|
|
/* PipeWire */
|
|
|
|
|
/* SPDX-FileCopyrightText: Copyright © 2020 Wim Taymans */
|
|
|
|
|
/* SPDX-License-Identifier: MIT */
|
2020-11-17 11:37:39 +01:00
|
|
|
|
2021-06-18 23:51:54 +02:00
|
|
|
#include <spa/utils/defs.h>
|
2021-05-18 11:36:13 +10:00
|
|
|
#include <spa/utils/string.h>
|
|
|
|
|
|
2021-10-18 15:00:33 +02:00
|
|
|
#include "defs.h"
|
2021-06-18 23:51:54 +02:00
|
|
|
#include "extension.h"
|
2021-10-18 15:00:33 +02:00
|
|
|
#include "extensions/registry.h"
|
2021-06-18 23:51:54 +02:00
|
|
|
|
|
|
|
|
static const struct extension extensions[] = {
|
2022-01-17 10:28:09 +01:00
|
|
|
{ "module-stream-restore", 0 | MODULE_EXTENSION_FLAG, do_extension_stream_restore, },
|
|
|
|
|
{ "module-device-restore", 1 | MODULE_EXTENSION_FLAG, do_extension_device_restore, },
|
|
|
|
|
{ "module-device-manager", 2 | MODULE_EXTENSION_FLAG, do_extension_device_manager, },
|
2020-11-17 11:37:39 +01:00
|
|
|
};
|
|
|
|
|
|
2022-01-17 11:28:40 +01:00
|
|
|
const struct extension *extension_find(uint32_t index, const char *name)
|
2020-11-17 11:37:39 +01:00
|
|
|
{
|
2022-09-30 16:21:28 +02:00
|
|
|
SPA_FOR_EACH_ELEMENT_VAR(extensions, ext) {
|
2022-01-17 11:28:40 +01:00
|
|
|
if (index == ext->index || spa_streq(name, ext->name))
|
2021-10-18 15:30:50 +02:00
|
|
|
return ext;
|
2020-11-17 11:37:39 +01:00
|
|
|
}
|
2021-10-18 15:28:59 +02:00
|
|
|
return NULL;
|
2020-11-17 11:37:39 +01:00
|
|
|
}
|