names: add standard factory name definitions

Define a set of standard factory names and document what they
contain. This makes it possible to change the implementation by
mapping the factory-name to a different shared library.
This commit is contained in:
Wim Taymans 2019-06-21 13:31:34 +02:00
parent 4494f9c7c9
commit 6720ded529
40 changed files with 188 additions and 55 deletions

View file

@ -34,6 +34,7 @@
#include <spa/support/plugin.h>
#include <spa/utils/type.h>
#include <spa/utils/hook.h>
#include <spa/utils/names.h>
#define NAME "cpu"
@ -209,7 +210,7 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
const struct spa_handle_factory spa_support_cpu_factory = {
SPA_VERSION_HANDLE_FACTORY,
NAME,
SPA_NAME_SUPPORT_CPU,
NULL,
impl_get_size,
impl_init,

View file

@ -33,6 +33,7 @@
#include <dbus/dbus.h>
#include <spa/utils/type.h>
#include <spa/utils/names.h>
#include <spa/support/log.h>
#include <spa/support/plugin.h>
#include <spa/support/dbus.h>
@ -439,7 +440,7 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
static const struct spa_handle_factory dbus_factory = {
SPA_VERSION_HANDLE_FACTORY,
NAME,
SPA_NAME_SUPPORT_DBUS,
NULL,
impl_get_size,
impl_init,

View file

@ -34,6 +34,7 @@
#include <spa/support/plugin.h>
#include <spa/utils/ringbuffer.h>
#include <spa/utils/type.h>
#include <spa/utils/names.h>
#define NAME "logger"
@ -294,7 +295,7 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
const struct spa_handle_factory spa_support_logger_factory = {
SPA_VERSION_HANDLE_FACTORY,
.name = NAME,
.name = SPA_NAME_SUPPORT_LOG,
.info = NULL,
.get_size = impl_get_size,
.init = impl_init,

View file

@ -35,6 +35,7 @@
#include <spa/support/log.h>
#include <spa/support/plugin.h>
#include <spa/utils/list.h>
#include <spa/utils/names.h>
#include <spa/utils/result.h>
#include <spa/utils/type.h>
#include <spa/utils/ringbuffer.h>
@ -815,7 +816,7 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
const struct spa_handle_factory spa_support_loop_factory = {
SPA_VERSION_HANDLE_FACTORY,
NAME,
SPA_NAME_SUPPORT_LOOP,
NULL,
impl_get_size,
impl_init,

View file

@ -38,6 +38,7 @@
#include <spa/support/system.h>
#include <spa/support/plugin.h>
#include <spa/utils/type.h>
#include <spa/utils/names.h>
#define NAME "system"
@ -398,7 +399,7 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
const struct spa_handle_factory spa_support_system_factory = {
SPA_VERSION_HANDLE_FACTORY,
NAME,
SPA_NAME_SUPPORT_SYSTEM,
NULL,
impl_get_size,
impl_init,