pipewire/spa/plugins/avb/avb.c

38 lines
813 B
C
Raw Normal View History

/* Spa AVB support */
/* SPDX-FileCopyrightText: Copyright © 2022 Wim Taymans */
/* SPDX-License-Identifier: MIT */
2022-03-07 20:24:46 +01:00
#include <errno.h>
#include <spa/support/plugin.h>
#include <spa/support/log.h>
#include "avb.h"
2022-03-07 20:24:46 +01:00
extern const struct spa_handle_factory spa_avb_sink_factory;
2022-03-09 16:27:38 +01:00
extern const struct spa_handle_factory spa_avb_source_factory;
2022-03-07 20:24:46 +01:00
2023-12-23 21:07:45 +02:00
SPA_LOG_TOPIC_DEFINE(avb_log_topic, "spa.avb");
SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED;
2022-03-07 20:24:46 +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_avb_sink_factory;
break;
2022-03-09 16:27:38 +01:00
case 1:
*factory = &spa_avb_source_factory;
break;
2022-03-07 20:24:46 +01:00
default:
return 0;
}
(*index)++;
return 1;
}