impl-link.h
Go to the documentation of this file.
/* PipeWire
*
* Copyright © 2018 Wim Taymans
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef PIPEWIRE_IMPL_LINK_H
#define PIPEWIRE_IMPL_LINK_H
#ifdef __cplusplus
extern "C" {
#endif
struct pw_impl_link;
struct pw_impl_port;
#include <pipewire/impl.h>
struct pw_impl_link_events {
#define PW_VERSION_IMPL_LINK_EVENTS 0
uint32_t version;
void (*destroy) (void *data);
void (*free) (void *data);
void (*initialized) (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_impl_port *port);
};
struct pw_impl_link *
pw_context_create_link(struct pw_context *context,
struct pw_impl_port *output,
struct pw_impl_port *input,
struct spa_pod *format_filter,
struct pw_properties *properties ,
size_t user_data_size );
void pw_impl_link_destroy(struct pw_impl_link *link);
void pw_impl_link_add_listener(struct pw_impl_link *link,
struct spa_hook *listener,
const struct pw_impl_link_events *events,
void *data);
int pw_impl_link_register(struct pw_impl_link *link,
struct pw_properties *properties );
struct pw_context *pw_impl_link_get_context(struct pw_impl_link *link);
void *pw_impl_link_get_user_data(struct pw_impl_link *link);
const struct pw_link_info *pw_impl_link_get_info(struct pw_impl_link *link);
struct pw_global *pw_impl_link_get_global(struct pw_impl_link *link);
struct pw_impl_port *pw_impl_link_get_output(struct pw_impl_link *link);
struct pw_impl_port *pw_impl_link_get_input(struct pw_impl_link *link);
struct pw_impl_link *pw_impl_link_find(struct pw_impl_port *output, struct pw_impl_port *input);
#ifdef __cplusplus
}
#endif
#endif /* PIPEWIRE_IMPL_LINK_H */
pw_impl_link_register
int pw_impl_link_register(struct pw_impl_link *link, struct pw_properties *properties)
Finish link configuration and register.
Definition: impl-link.c:1339
pw_impl_link_get_input
struct pw_impl_port * pw_impl_link_get_input(struct pw_impl_link *link)
Get the input port of the link.
Definition: impl-link.c:1502
pw_impl_link_get_user_data
void * pw_impl_link_get_user_data(struct pw_impl_link *link)
Get the user_data of a link, the size of the memory is given when constructing the link.
Definition: impl-link.c:1478
pw_context_create_link
struct pw_impl_link * pw_context_create_link(struct pw_context *context, struct pw_impl_port *output, struct pw_impl_port *input, struct spa_pod *format_filter, struct pw_properties *properties, size_t user_data_size)
Make a new link between two ports.
Definition: impl-link.c:1162
pw_impl_link_add_listener
void pw_impl_link_add_listener(struct pw_impl_link *link, struct spa_hook *listener, const struct pw_impl_link_events *events, void *data)
Add an event listener to link.
Definition: impl-link.c:1451
pw_impl_link_destroy
void pw_impl_link_destroy(struct pw_impl_link *link)
Destroy a link.
Definition: impl-link.c:1408
pw_impl_link_get_context
struct pw_context * pw_impl_link_get_context(struct pw_impl_link *link)
Get the context of a link.
Definition: impl-link.c:1472
pw_impl_link_get_info
const struct pw_link_info * pw_impl_link_get_info(struct pw_impl_link *link)
Get the link info.
Definition: impl-link.c:1484
pw_impl_link_get_global
struct pw_global * pw_impl_link_get_global(struct pw_impl_link *link)
Get the global of the link.
Definition: impl-link.c:1490
pw_impl_link_get_output
struct pw_impl_port * pw_impl_link_get_output(struct pw_impl_link *link)
Get the output port of the link.
Definition: impl-link.c:1496
pw_impl_link_find
struct pw_impl_link * pw_impl_link_find(struct pw_impl_port *output, struct pw_impl_port *input)
Find the link between 2 ports.
Definition: impl-link.c:1460
pw_link_state
pw_link_state
The different link states.
Definition: link.h:65
impl.h
pipewire/impl.h
pw_context
pw_global
Definition: context.h:67
pw_impl_link_events
link events added with pw_impl_link_add_listener
Definition: impl-link.h:53
pw_impl_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: impl-link.h:72
pw_impl_link_events::version
uint32_t version
Definition: impl-link.h:56
pw_impl_link_events::info_changed
void(* info_changed)(void *data, const struct pw_link_info *info)
The info changed on a link.
Definition: impl-link.h:68
pw_impl_link_events::free
void(* free)(void *data)
A link is freed.
Definition: impl-link.h:62
pw_impl_link_events::destroy
void(* destroy)(void *data)
A link is destroyed.
Definition: impl-link.h:59
pw_impl_link_events::port_unlinked
void(* port_unlinked)(void *data, struct pw_impl_port *port)
A port is unlinked.
Definition: impl-link.h:76
pw_impl_link_events::initialized
void(* initialized)(void *data)
a Link is initialized
Definition: impl-link.h:65
pw_impl_link
pw_impl_port
Definition: impl.h:47
pw_link_info
The link information.
Definition: link.h:78
pw_link_info::state
enum pw_link_state state
the current state of the link
Definition: link.h:93
pw_link_info::error
const char * error
an error reason if state is error
Definition: link.h:94
pw_properties
Definition: properties.h:53
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:342
spa_pod
Definition: pod.h:63