PipeWire 0.1.9

proxy.h
Go to the documentation of this file.
1 /* PipeWire
2 * Copyright (C) 2015 Wim Taymans <wim.taymans@gmail.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef __PIPEWIRE_PROXY_H__
21 #define __PIPEWIRE_PROXY_H__
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #include <spa/utils/hook.h>
28
97 struct pw_proxy;
98
99 #include <pipewire/protocol.h>
100
102 struct pw_proxy_events {
103 #define PW_VERSION_PROXY_EVENTS 0
104 uint32_t version;
105
107 void (*destroy) (void *data);
108 };
109
112 struct pw_proxy *
113 pw_proxy_new(struct pw_proxy *factory,
114 uint32_t type,
115 size_t user_data_size );
116
118 void pw_proxy_add_listener(struct pw_proxy *proxy,
119 struct spa_hook *listener,
120 const struct pw_proxy_events *events,
121 void *data);
122
125 void pw_proxy_add_proxy_listener(struct pw_proxy *proxy,
126 struct spa_hook *listener,
127 const void *events,
128 void *data );
129
131 void pw_proxy_destroy(struct pw_proxy *proxy);
132
134 void *pw_proxy_get_user_data(struct pw_proxy *proxy);
135
137 uint32_t pw_proxy_get_id(struct pw_proxy *proxy);
138
140 struct pw_protocol *pw_proxy_get_protocol(struct pw_proxy *proxy);
141
143 struct spa_hook_list *pw_proxy_get_proxy_listeners(struct pw_proxy *proxy);
144
146 const struct pw_protocol_marshal *pw_proxy_get_marshal(struct pw_proxy *proxy);
147
148 #define pw_proxy_notify(p,type,event,...) spa_hook_list_call(pw_proxy_get_proxy_listeners(p),type,event,## __VA_ARGS__)
149 #define pw_proxy_do(p,type,method,...) ((type*) pw_proxy_get_marshal(p)->method_marshal)->method(p, ## __VA_ARGS__)
150
151 #ifdef __cplusplus
152 }
153 #endif
154
155 #endif /* __PIPEWIRE_PROXY_H__ */
pw_proxy_get_protocol
struct pw_protocol * pw_proxy_get_protocol(struct pw_proxy *proxy)
Get the protocol used for the proxy.
Definition: proxy.c:88
pw_protocol
Manages protocols and their implementation.
pw_proxy_get_user_data
void * pw_proxy_get_user_data(struct pw_proxy *proxy)
Get the user_data.
Definition: proxy.c:78
pw_protocol_marshal
Definition: protocol.h:70
pw_proxy_add_listener
void pw_proxy_add_listener(struct pw_proxy *proxy, struct spa_hook *listener, const struct pw_proxy_events *events, void *data)
Add an event listener to proxy.
Definition: proxy.c:93
protocol.h
pw_proxy
Represents an object on the client side.
pw_proxy_get_id
uint32_t pw_proxy_get_id(struct pw_proxy *proxy)
Get the local id of the proxy.
Definition: proxy.c:83
pw_proxy_events
Proxy events, use pw_proxy_add_listener.
Definition: proxy.h:102
pw_proxy_add_proxy_listener
void pw_proxy_add_proxy_listener(struct pw_proxy *proxy, struct spa_hook *listener, const void *events, void *data)
Add a listener for the events received from the remote resource.
Definition: proxy.c:101
pw_proxy_events::destroy
void(* destroy)(void *data)
The proxy is destroyed.
Definition: proxy.h:107
pw_proxy::pw_proxy_destroy
void pw_proxy_destroy(struct pw_proxy *proxy)
Destroy a proxy object.
Definition: proxy.c:117
pw_proxy_get_proxy_listeners
struct spa_hook_list * pw_proxy_get_proxy_listeners(struct pw_proxy *proxy)
Get the listener of proxy.
Definition: proxy.c:130
pw_proxy_events::version
uint32_t version
Definition: proxy.h:104
pw_proxy::pw_proxy_new
struct pw_proxy * pw_proxy_new(struct pw_proxy *factory, uint32_t type, size_t user_data_size)
Create a proxy object with a given id and type.
Definition: proxy.c:46
pw_proxy_get_marshal
const struct pw_protocol_marshal * pw_proxy_get_marshal(struct pw_proxy *proxy)
Get the marshal functions for the proxy.
Definition: proxy.c:135