PipeWire  0.1.4
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/hook.h>
28 
87 struct pw_proxy;
88 
89 #include <pipewire/protocol.h>
90 
92 #define PW_VERSION_PROXY_EVENTS 0
93  uint32_t version;
94 
95  void (*destroy) (void *data);
96 };
97 
99 struct pw_proxy *
100 pw_proxy_new(struct pw_proxy *factory,
101  uint32_t type,
102  size_t user_data_size );
103 
104 void
105 pw_proxy_add_listener(struct pw_proxy *proxy,
106  struct spa_hook *listener,
107  const struct pw_proxy_events *events,
108  void *data);
109 
110 void
112  struct spa_hook *listener,
113  const void *events,
114  void *data );
115 
116 void pw_proxy_destroy(struct pw_proxy *proxy);
117 
118 void *pw_proxy_get_user_data(struct pw_proxy *proxy);
119 
120 uint32_t pw_proxy_get_id(struct pw_proxy *proxy);
121 
122 struct pw_protocol *pw_proxy_get_protocol(struct pw_proxy *proxy);
123 
124 struct spa_hook_list *pw_proxy_get_proxy_listeners(struct pw_proxy *proxy);
125 
126 const struct pw_protocol_marshal *pw_proxy_get_marshal(struct pw_proxy *proxy);
127 
128 #define pw_proxy_notify(p,type,event,...) spa_hook_list_call(pw_proxy_get_proxy_listeners(p),type,event,## __VA_ARGS__)
129 #define pw_proxy_do(p,type,method,...) ((type*) pw_proxy_get_marshal(p)->method_marshal)->method(p, ## __VA_ARGS__)
130 
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif /* __PIPEWIRE_PROXY_H__ */
struct pw_protocol * pw_proxy_get_protocol(struct pw_proxy *proxy)
Definition: proxy.c:88
void pw_proxy_destroy(struct pw_proxy *proxy)
void * pw_proxy_get_user_data(struct pw_proxy *proxy)
Definition: proxy.c:78
Definition: protocol.h:66
struct pw_proxy * pw_proxy_new(struct pw_proxy *factory, uint32_t type, size_t user_data_size)
Make a new proxy object.
void pw_proxy_add_listener(struct pw_proxy *proxy, struct spa_hook *listener, const struct pw_proxy_events *events, void *data)
Definition: proxy.c:93
Represents an object on the client side.
Definition: private.h:306
uint32_t pw_proxy_get_id(struct pw_proxy *proxy)
Definition: proxy.c:83
Definition: proxy.h:91
void pw_proxy_add_proxy_listener(struct pw_proxy *proxy, struct spa_hook *listener, const void *events, void *data)
Definition: proxy.c:101
void(* destroy)(void *data)
Definition: proxy.h:95
Manages protocols and their implementation.
Definition: private.h:40
struct spa_hook_list * pw_proxy_get_proxy_listeners(struct pw_proxy *proxy)
Definition: proxy.c:130
uint32_t version
Definition: proxy.h:93
const struct pw_protocol_marshal * pw_proxy_get_marshal(struct pw_proxy *proxy)
Definition: proxy.c:135