proxy.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_PROXY_H__
#define __PIPEWIRE_PROXY_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/utils/hook.h>
struct pw_proxy;
#include <pipewire/protocol.h>
struct pw_proxy_events {
#define PW_VERSION_PROXY_EVENTS 0
uint32_t version;
void (*destroy) (void *data);
};
struct pw_proxy *
pw_proxy_new(struct pw_proxy *factory,
uint32_t type,
size_t user_data_size );
void pw_proxy_add_listener(struct pw_proxy *proxy,
struct spa_hook *listener,
const struct pw_proxy_events *events,
void *data);
void pw_proxy_add_proxy_listener(struct pw_proxy *proxy,
struct spa_hook *listener,
const void *events,
void *data );
void pw_proxy_destroy(struct pw_proxy *proxy);
void *pw_proxy_get_user_data(struct pw_proxy *proxy);
uint32_t pw_proxy_get_id(struct pw_proxy *proxy);
struct pw_protocol *pw_proxy_get_protocol(struct pw_proxy *proxy);
struct spa_hook_list *pw_proxy_get_proxy_listeners(struct pw_proxy *proxy);
const struct pw_protocol_marshal *pw_proxy_get_marshal(struct pw_proxy *proxy);
#define pw_proxy_notify(p,type,event,ver,...) spa_hook_list_call(pw_proxy_get_proxy_listeners(p),type,event,ver,## __VA_ARGS__)
#define pw_proxy_do(p,type,method,...) ((type*) pw_proxy_get_marshal(p)->method_marshal)->method(p, ## __VA_ARGS__)
#ifdef __cplusplus
}
#endif
#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:92
pw_protocol
Manages protocols and their implementation.
pw_proxy_destroy
void pw_proxy_destroy(struct pw_proxy *proxy)
destroy a proxy
pw_proxy_get_user_data
void * pw_proxy_get_user_data(struct pw_proxy *proxy)
Get the user_data.
Definition: proxy.c:80
pw_protocol_marshal
Definition: protocol.h:70
pw_proxy_new
struct pw_proxy * pw_proxy_new(struct pw_proxy *factory, uint32_t type, size_t user_data_size)
Make a new proxy object.
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:98
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:86
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:107
pw_proxy_events::destroy
void(* destroy)(void *data)
The proxy is destroyed.
Definition: proxy.h:107
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:138
pw_proxy_events::version
uint32_t version
Definition: proxy.h:104
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:144