link.h
Go to the documentation of this file.
/* PipeWire
* Copyright (C) 2015 Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __PIPEWIRE_LINK_H__
#define __PIPEWIRE_LINK_H__
#ifdef __cplusplus
extern "C" {
#endif
struct pw_link;
#include <pipewire/core.h>
#include <pipewire/introspect.h>
#include <pipewire/port.h>
#define PW_TYPE__Link PW_TYPE_OBJECT_BASE "Link"
#define PW_TYPE_LINK_BASE PW_TYPE__Link ":"
struct pw_link_events {
#define PW_VERSION_LINK_EVENTS 0
uint32_t version;
void (*destroy) (void *data);
void (*free) (void *data);
void (*info_changed) (void *data, const struct pw_link_info *info);
void (*state_changed) (void *data, enum pw_link_state old,
enum pw_link_state state, const char *error);
void (*port_unlinked) (void *data, struct pw_port *port);
};
#define PW_LINK_PROP_PASSIVE "pipewire.link.passive"
struct pw_link *
pw_link_new(struct pw_core *core,
struct pw_port *output,
struct pw_port *input,
struct spa_pod *format_filter,
struct pw_properties *properties ,
char **error,
size_t user_data_size );
void pw_link_destroy(struct pw_link *link);
void pw_link_add_listener(struct pw_link *link,
struct spa_hook *listener,
const struct pw_link_events *events,
void *data);
int pw_link_register(struct pw_link *link,
struct pw_client *owner,
struct pw_global *parent,
struct pw_properties *properties );
struct pw_core *pw_link_get_core(struct pw_link *link);
void *pw_link_get_user_data(struct pw_link *link);
const struct pw_link_info *pw_link_get_info(struct pw_link *link);
struct pw_global *pw_link_get_global(struct pw_link *link);
struct pw_port *pw_link_get_output(struct pw_link *link);
struct pw_port *pw_link_get_input(struct pw_link *link);
struct pw_link *pw_link_find(struct pw_port *output, struct pw_port *input);
#ifdef __cplusplus
}
#endif
#endif /* __PIPEWIRE_LINK_H__ */
pw_link_events
link events added with pw_link_add_listener
Definition: link.h:52
pw_properties
A collection of key/value pairs.
Definition: properties.h:38
pw_link_events::state_changed
void(* state_changed)(void *data, enum pw_link_state old, enum pw_link_state state, const char *error)
The link state changed, error is only valid when the state is in error.
Definition: link.h:67
introspect.h
pw_link
PipeWire link object.
pw_link_events::port_unlinked
void(* port_unlinked)(void *data, struct pw_port *port)
A port is unlinked.
Definition: link.h:71
pw_link_events::info_changed
void(* info_changed)(void *data, const struct pw_link_info *info)
The info changed on a link.
Definition: link.h:63
core.h
pw_core
the core PipeWire object
pw_link_get_info
const struct pw_link_info * pw_link_get_info(struct pw_link *link)
Get the link info.
Definition: link.c:1406
pw_link_add_listener
void pw_link_add_listener(struct pw_link *link, struct spa_hook *listener, const struct pw_link_events *events, void *data)
Add an event listener to link.
Definition: link.c:1372
pw_link_state
pw_link_state
The different link states.
Definition: introspect.h:56
pw_link_get_user_data
void * pw_link_get_user_data(struct pw_link *link)
Get the user_data of a link, the size of the memory is given when constructing the link...
Definition: link.c:1400
pw_link_get_core
struct pw_core * pw_link_get_core(struct pw_link *link)
Get the core of a link.
Definition: link.c:1394
pw_link_get_input
struct pw_port * pw_link_get_input(struct pw_link *link)
Get the input port of the link.
Definition: link.c:1424
pw_link_events::version
uint32_t version
Definition: link.h:54
pw_link_events::destroy
void(* destroy)(void *data)
A link is destroyed.
Definition: link.h:57
pw_link_find
SPA_EXPORT struct pw_link * pw_link_find(struct pw_port *output_port, struct pw_port *input_port)
Definition: link.c:1382
pw_client
PipeWire client object class.
pw_link_register
int pw_link_register(struct pw_link *link, struct pw_client *owner, struct pw_global *parent, struct pw_properties *properties)
Finish link configuration and register.
Definition: link.c:1275
pw_link_info
The link information.
Definition: introspect.h:204
pw_link_get_global
struct pw_global * pw_link_get_global(struct pw_link *link)
Get the global of the link.
Definition: link.c:1412
pw_link_events::free
void(* free)(void *data)
A link is freed.
Definition: link.h:60
port.h
pw_global
A global object visible to remote clients.
pw_link_new
SPA_EXPORT struct pw_link * pw_link_new(struct pw_core *core, struct pw_port *output, struct pw_port *input, struct spa_pod *format_filter, struct pw_properties *properties, char **error, size_t user_data_size)
Definition: link.c:1132
pw_port
The port object.
pw_link_destroy
SPA_EXPORT void pw_link_destroy(struct pw_link *link)
Definition: link.c:1331
pw_link_get_output
struct pw_port * pw_link_get_output(struct pw_link *link)
Get the output port of the link.
Definition: link.c:1418