PipeWire: PipeWire Protocol

PipeWire 0.3.37

Data Structures | Macros | Functions
PipeWire Protocol

Manages protocols and their implementation. More...

## Data Structures
struct | pw_protocol_client
struct | pw_protocol_server
struct | pw_protocol_marshal
struct | pw_protocol_implementation
struct | pw_protocol_events

## Macros
#define | PW_TYPE_INFO_Protocol "PipeWire:Protocol"
#define | PW_TYPE_INFO_PROTOCOL_BASE PW_TYPE_INFO_Protocol ":"
#define | pw_protocol_client_connect(c, p, cb, d) ((c)->connect(c,p,cb,d))
#define | pw_protocol_client_connect_fd(c, fd, cl) ((c)->connect_fd(c,fd,cl))
#define | pw_protocol_client_steal_fd(c) ((c)->steal_fd(c))
#define | pw_protocol_client_disconnect(c) ((c)->disconnect(c))
#define | pw_protocol_client_destroy(c) ((c)->destroy(c))
#define | pw_protocol_client_set_paused(c, p) ((c)->set_paused(c,p))
#define | pw_protocol_server_destroy(l) ((l)->destroy(l))
#define | pw_protocol_new_client(p, ...) (pw_protocol_get_implementation(p)->new_client(p,__VA_ARGS__))
#define | pw_protocol_add_server(p, ...) (pw_protocol_get_implementation(p)->add_server(p,__VA_ARGS__))
#define | pw_protocol_ext(p, type, method, ...) (((type*)pw_protocol_get_extension(p))->method( __VA_ARGS__))

## Functions
struct pw_protocol * | pw_protocol_new (struct pw_context *context, const char *name, size_t user_data_size)
void | pw_protocol_destroy (struct pw_protocol *protocol)
struct pw_context * | pw_protocol_get_context (struct pw_protocol *protocol)
void * | pw_protocol_get_user_data (struct pw_protocol *protocol)
const struct pw_protocol_implementation * | pw_protocol_get_implementation (struct pw_protocol *protocol)
const void * | pw_protocol_get_extension (struct pw_protocol *protocol)
void | pw_protocol_add_listener (struct pw_protocol *protocol, struct spa_hook *listener, const struct pw_protocol_events *events, void *data)
int | pw_protocol_add_marshal (struct pw_protocol *protocol, const struct pw_protocol_marshal *marshal)
const struct pw_protocol_marshal * | pw_protocol_get_marshal (struct pw_protocol *protocol, const char *type, uint32_t version, uint32_t flags)
struct pw_protocol * | pw_context_find_protocol (struct pw_context *context, const char *name)

## Detailed Description

Manages protocols and their implementation.

## Macro Definition Documentation

## ◆ pw_protocol_add_server

#define pw_protocol_add_server | ( |  | p,
|  |  | ...
| ) |  | (pw_protocol_get_implementation(p)->add_server(p,__VA_ARGS__))

## ◆ pw_protocol_client_connect

#define pw_protocol_client_connect | ( |  | c,
|  |  | p,
|  |  | cb,
|  |  | d
| ) |  | ((c)->connect(c,p,cb,d))

## ◆ pw_protocol_client_connect_fd

#define pw_protocol_client_connect_fd | ( |  | c,
|  |  | fd,
|  |  | cl
| ) |  | ((c)->connect_fd(c,fd,cl))

## ◆ pw_protocol_client_destroy

#define pw_protocol_client_destroy | ( |  | c | ) | ((c)->destroy(c))

## ◆ pw_protocol_client_disconnect

#define pw_protocol_client_disconnect | ( |  | c | ) | ((c)->disconnect(c))

## ◆ pw_protocol_client_set_paused

#define pw_protocol_client_set_paused | ( |  | c,
|  |  | p
| ) |  | ((c)->set_paused(c,p))

## ◆ pw_protocol_client_steal_fd

#define pw_protocol_client_steal_fd | ( |  | c | ) | ((c)->steal_fd(c))

## ◆ pw_protocol_ext

#define pw_protocol_ext | ( |  | p,
|  |  | type,
|  |  | method,
|  |  | ...
| ) |  | (((type*)pw_protocol_get_extension(p))->method( __VA_ARGS__))

## ◆ pw_protocol_new_client

#define pw_protocol_new_client | ( |  | p,
|  |  | ...
| ) |  | (pw_protocol_get_implementation(p)->new_client(p,__VA_ARGS__))

## ◆ pw_protocol_server_destroy

#define pw_protocol_server_destroy | ( |  | l | ) | ((l)->destroy(l))

## ◆ PW_TYPE_INFO_Protocol

#define PW_TYPE_INFO_Protocol "PipeWire:Protocol"

## ◆ PW_TYPE_INFO_PROTOCOL_BASE

#define PW_TYPE_INFO_PROTOCOL_BASE PW_TYPE_INFO_Protocol ":"

## Function Documentation

## ◆ pw_context_find_protocol()

struct pw_protocol * pw_context_find_protocol | ( | struct pw_context * | context,
|  | const char * | name
| ) |  |

References name, spa_list_for_each, and spa_streq().

Referenced by pipewire__module_init().

## ◆ pw_protocol_add_listener()

void pw_protocol_add_listener | ( | struct pw_protocol * | protocol,
|  | struct spa_hook * | listener,
|  | const struct pw_protocol_events * | events,
|  | void * | data
| ) |  |

References pw_protocol_client::protocol, and spa_hook_list_append().

## ◆ pw_protocol_add_marshal()

int pw_protocol_add_marshal | ( | struct pw_protocol * | protocol,
|  | const struct pw_protocol_marshal * | marshal
| ) |  |

References NAME, pw_log_debug, spa_list_append, pw_protocol_marshal::type, and pw_protocol_marshal::version.

## ◆ pw_protocol_destroy()

void pw_protocol_destroy | ( | struct pw_protocol * | protocol | ) |

References NAME, pw_protocol_client::protocol, pw_log_debug, pw_protocol_client_destroy, pw_protocol_server_destroy, SPA_CONTAINER_OF, spa_hook_list_clean(), spa_list_consume, spa_list_for_each_safe, and spa_list_remove().

## ◆ pw_protocol_get_context()

struct pw_context * pw_protocol_get_context | ( | struct pw_protocol * | protocol | ) |

## ◆ pw_protocol_get_extension()

const void * pw_protocol_get_extension | ( | struct pw_protocol * | protocol | ) |

## ◆ pw_protocol_get_implementation()

const struct pw_protocol_implementation * pw_protocol_get_implementation | ( | struct pw_protocol * | protocol | ) |

## ◆ pw_protocol_get_marshal()

const struct pw_protocol_marshal * pw_protocol_get_marshal | ( | struct pw_protocol * | protocol,
|  | const char * | type,
|  | uint32_t | version,
|  | uint32_t | flags
| ) |  |

References NAME, pw_log_debug, spa_list_for_each, and spa_streq().

Referenced by pw_proxy_install_marshal(), and pw_resource_install_marshal().

## ◆ pw_protocol_get_user_data()

void * pw_protocol_get_user_data | ( | struct pw_protocol * | protocol | ) |

## ◆ pw_protocol_new()

struct pw_protocol * pw_protocol_new | ( | struct pw_context * | context,
|  | const char * | name,
|  | size_t | user_data_size
| ) |  |

References name, NAME, pw_log_debug, spa_hook_list_init(), spa_list_append, spa_list_init(), and SPA_PTROFF.

Referenced by pipewire__module_init().