PipeWire 1.6.8

Loading...
Searching...
No Matches
Plugin Handle
SPA » Support

SPA plugin handle and factory interfaces. More...

## Files
file | plugin.h
| spa/support/plugin.h

## Data Structures
struct | spa_handle
struct | spa_interface_info
| This structure lists the information about available interfaces on handles. More...
struct | spa_support
| Extra supporting infrastructure passed to the init() function of a factory. More...
struct | spa_handle_factory

## Typedefs
typedef int(* | spa_handle_factory_enum_func_t) (const struct spa_handle_factory **factory, uint32_t *index)
| The function signature of the entry point in a plugin.

## Macros
#define | SPA_VERSION_HANDLE 0
| Version of this struct.
#define | SPA_SUPPORT_INIT(type, data)
#define | SPA_VERSION_HANDLE_FACTORY 1
| The version of this structure.
#define | SPA_HANDLE_FACTORY_ENUM_FUNC_NAME "spa_handle_factory_enum"
#define | SPA_KEY_FACTORY_NAME "factory.name"
| the name of a factory
#define | SPA_KEY_FACTORY_AUTHOR "factory.author"
| a comma separated list of factory authors
#define | SPA_KEY_FACTORY_DESCRIPTION "factory.description"
| description of a factory
#define | SPA_KEY_FACTORY_USAGE "factory.usage"
| usage of a factory
#define | SPA_KEY_LIBRARY_NAME "library.name"
| the name of a library.

## Functions
SPA_API_PLUGIN int | spa_handle_get_interface (struct spa_handle *object, const char *type, void **iface)
SPA_API_PLUGIN int | spa_handle_clear (struct spa_handle *object)
SPA_API_PLUGIN void * | spa_support_find (const struct spa_support *support, uint32_t n_support, const char *type)
| Find a support item of the given type.
SPA_API_PLUGIN size_t | spa_handle_factory_get_size (const struct spa_handle_factory *object, const struct spa_dict *params)
SPA_API_PLUGIN int | spa_handle_factory_init (const struct spa_handle_factory *object, struct spa_handle *handle, const struct spa_dict *info, const struct spa_support *support, uint32_t n_support)
SPA_API_PLUGIN int | spa_handle_factory_enum_interface_info (const struct spa_handle_factory *object, const struct spa_interface_info **info, uint32_t *index)
int | spa_handle_factory_enum (const struct spa_handle_factory **factory, uint32_t *index)
| The entry point in a plugin.

## Detailed Description

SPA plugin handle and factory interfaces.

See: SPA Plugins

## Typedef Documentation

## ◆ spa_handle_factory_enum_func_t

typedef int(* spa_handle_factory_enum_func_t) (const struct spa_handle_factory **factory, uint32_t *index)

The function signature of the entry point in a plugin.

Parameters

  factory | a location to hold the factory result
  index | index to keep track of the enumeration

Returns
  1 on success 0 when there are no more factories -EINVAL when factory is NULL

Examples
  local-v4l2.c, spa/examples/adapter-control.c, spa/examples/example-control.c, spa/examples/local-libcamera.c, spa/examples/local-v4l2.c, and spa/examples/local-videotestsrc.c.

## Macro Definition Documentation

## ◆ SPA_VERSION_HANDLE

#define SPA_VERSION_HANDLE 0

Version of this struct.

## ◆ SPA_SUPPORT_INIT

#define SPA_SUPPORT_INIT | ( |  | type,
|  |  | data )

Value:
((struct spa_support) { (type), (data) })
spa_support
Extra supporting infrastructure passed to the init() function of a factory.
Definition plugin.h:98

Examples
  local-v4l2.c, spa/examples/adapter-control.c, spa/examples/example-control.c, spa/examples/local-libcamera.c, spa/examples/local-v4l2.c, and spa/examples/local-videotestsrc.c.

## ◆ SPA_VERSION_HANDLE_FACTORY

#define SPA_VERSION_HANDLE_FACTORY 1

The version of this structure.

## ◆ SPA_HANDLE_FACTORY_ENUM_FUNC_NAME

#define SPA_HANDLE_FACTORY_ENUM_FUNC_NAME "spa_handle_factory_enum"

Examples
  local-v4l2.c, spa/examples/adapter-control.c, spa/examples/example-control.c, spa/examples/local-libcamera.c, spa/examples/local-v4l2.c, and spa/examples/local-videotestsrc.c.

## ◆ SPA_KEY_FACTORY_NAME

#define SPA_KEY_FACTORY_NAME "factory.name"

the name of a factory

Examples
  export-spa-device.c, export-spa.c, and internal.c.

## ◆ SPA_KEY_FACTORY_AUTHOR

#define SPA_KEY_FACTORY_AUTHOR "factory.author"

a comma separated list of factory authors

## ◆ SPA_KEY_FACTORY_DESCRIPTION

#define SPA_KEY_FACTORY_DESCRIPTION "factory.description"

description of a factory

## ◆ SPA_KEY_FACTORY_USAGE

#define SPA_KEY_FACTORY_USAGE "factory.usage"

usage of a factory

## ◆ SPA_KEY_LIBRARY_NAME

#define SPA_KEY_LIBRARY_NAME "library.name"

the name of a library.

This is usually the filename of the plugin without the path or the plugin extension.

Examples
  export-spa-device.c, export-spa.c, and internal.c.

## Function Documentation

## ◆ spa_handle_get_interface()

SPA_API_PLUGIN int spa_handle_get_interface | ( | struct spa_handle * | object,
|  | const char * | type,
|  | void ** | iface )

Examples
  bluez-session.c, export-spa.c, local-v4l2.c, spa/examples/adapter-control.c, spa/examples/example-control.c, spa/examples/local-libcamera.c, spa/examples/local-v4l2.c, and spa/examples/local-videotestsrc.c.

## ◆ spa_handle_clear()

SPA_API_PLUGIN int spa_handle_clear | ( | struct spa_handle * | object | ) |

## ◆ spa_support_find()

SPA_API_PLUGIN void * spa_support_find | ( | const struct spa_support * | support,
|  | uint32_t | n_support,
|  | const char * | type )

Find a support item of the given type.

## ◆ spa_handle_factory_get_size()

SPA_API_PLUGIN size_t spa_handle_factory_get_size | ( | const struct spa_handle_factory * | object,
|  | const struct spa_dict * | params )

Examples
  local-v4l2.c, spa/examples/adapter-control.c, spa/examples/example-control.c, spa/examples/local-libcamera.c, spa/examples/local-v4l2.c, and spa/examples/local-videotestsrc.c.

## ◆ spa_handle_factory_init()

SPA_API_PLUGIN int spa_handle_factory_init | ( | const struct spa_handle_factory * | object,
|  | struct spa_handle * | handle,
|  | const struct spa_dict * | info,
|  | const struct spa_support * | support,
|  | uint32_t | n_support )

Examples
  local-v4l2.c, spa/examples/adapter-control.c, spa/examples/example-control.c, spa/examples/local-libcamera.c, spa/examples/local-v4l2.c, and spa/examples/local-videotestsrc.c.

## ◆ spa_handle_factory_enum_interface_info()

SPA_API_PLUGIN int spa_handle_factory_enum_interface_info | ( | const struct spa_handle_factory * | object,
|  | const struct spa_interface_info ** | info,
|  | uint32_t * | index )

## ◆ spa_handle_factory_enum()

int spa_handle_factory_enum | ( | const struct spa_handle_factory ** | factory,
|  | uint32_t * | index )

The entry point in a plugin.

Parameters

  factory | a location to hold the factory result
  index | index to keep track of the enumeration

Returns
  1 on success 0 when no more items are available < 0 errno type error