pipewire/spa/plugins/videotestsrc/plugin.c

30 lines
648 B
C
Raw Normal View History

/* Spa Video Test Source plugin */
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
/* SPDX-License-Identifier: MIT */
2016-09-09 15:15:49 +02:00
#include <errno.h>
#include <spa/support/plugin.h>
#include <spa/support/log.h>
2016-09-09 15:15:49 +02:00
extern const struct spa_handle_factory spa_videotestsrc_factory;
2016-09-09 15:15:49 +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)
2016-09-09 15:15:49 +02:00
{
spa_return_val_if_fail(factory != NULL, -EINVAL);
spa_return_val_if_fail(index != NULL, -EINVAL);
2016-09-09 15:15:49 +02:00
switch (*index) {
case 0:
*factory = &spa_videotestsrc_factory;
break;
default:
return 0;
}
(*index)++;
return 1;
2016-09-09 15:15:49 +02:00
}