PipeWire: pw_core_methods Struct Reference

PipeWire 1.2.2

Loading...
Searching...
No Matches
Data Fields
pw_core_methods Struct Reference
Core API » Core

Core methods. More...

`#include <pipewire/core.h>`

## Data Fields
uint32_t | version
int(* | add_listener )(void *object, struct spa_hook *listener, const struct pw_core_events *events, void *data)
int(* | hello )(void *object, uint32_t version)
| Start a conversation with the server.
int(* | sync )(void *object, uint32_t id, int seq)
| Do server roundtrip.
int(* | pong )(void *object, uint32_t id, int seq)
| Reply to a server ping event.
int(* | error )(void *object, uint32_t id, int seq, int res, const char *message)
| Fatal error event.
struct pw_registry *(* | get_registry )(void *object, uint32_t version, size_t user_data_size)
| Get the registry object.
void *(* | create_object )(void *object, const char *factory_name, const char *type, uint32_t version, const struct spa_dict *props, size_t user_data_size)
| Create a new object on the PipeWire server from a factory.
int(* | destroy )(void *object, void *proxy)
| Destroy an resource.

## Detailed Description

Core methods.

The core global object. This is a singleton object used for creating new objects in the remote PipeWire instance. It is also used for internal features.

## Field Documentation

## ◆ version

uint32_t pw_core_methods::version

## ◆ add_listener

int(* pw_core_methods::add_listener) (void *object, struct spa_hook *listener, const struct pw_core_events *events, void *data)

## ◆ hello

int(* pw_core_methods::hello) (void *object, uint32_t version)

Start a conversation with the server.

This will send the core info and will destroy all resources for the client (except the core and client resource).

This requires X permissions on the core.

## ◆ sync

int(* pw_core_methods::sync) (void *object, uint32_t id, int seq)

Do server roundtrip.

Ask the server to emit the 'done' event with seq.

Since methods are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous methods and the resulting events have been handled.

Parameters

  seq | the seq number passed to the done event

This requires X permissions on the core.

## ◆ pong

int(* pw_core_methods::pong) (void *object, uint32_t id, int seq)

Reply to a server ping event.

Reply to the server ping event with the same seq.

Parameters

  seq | the seq number received in the ping event

This requires X permissions on the core.

## ◆ error

int(* pw_core_methods::error) (void *object, uint32_t id, int seq, int res, const char *message)

Fatal error event.

The error method is sent out when a fatal (non-recoverable) error has occurred. The id argument is the proxy object where the error occurred, most often in response to an event on that object. The message is a brief description of the error, for (debugging) convenience.

This method is usually also emitted on the resource object with id.

Parameters

  id | resource id where the error occurred
  res | error code
  message | error description

This requires X permissions on the core.

## ◆ get_registry

struct pw_registry *(* pw_core_methods::get_registry) (void *object, uint32_t version, size_t user_data_size)

Get the registry object.

Create a registry object that allows the client to list and bind the global objects available from the PipeWire server

Parameters

  version | the client version
  user_data_size | extra size

This requires X permissions on the core.

## ◆ create_object

void *(* pw_core_methods::create_object) (void *object, const char *factory_name, const char *type, uint32_t version, const struct spa_dict *props, size_t user_data_size)

Create a new object on the PipeWire server from a factory.

Parameters

  factory_name | the factory name to use
  type | the interface to bind to
  version | the version of the interface
  props | extra properties
  user_data_size | extra size

This requires X permissions on the core.

## ◆ destroy

int(* pw_core_methods::destroy) (void *object, void *proxy)

Destroy an resource.

Destroy the server resource for the given proxy.

Parameters

  obj | the proxy to destroy

This requires X permissions on the core.

The documentation for this struct was generated from the following file:

- pipewire/core.h