PipeWire  0.1.4
remote.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_REMOTE_H__
21 #define __PIPEWIRE_REMOTE_H__
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include <spa/hook.h>
28 
101 struct pw_remote;
102 
103 #include <pipewire/core.h>
104 #include <pipewire/properties.h>
105 #include <pipewire/protocol.h>
106 #include <pipewire/proxy.h>
107 
114 };
115 
118 
120 #define PW_VERSION_REMOTE_EVENTS 0
121  uint32_t version;
122 
123  void (*destroy) (void *data);
125  void (*info_changed) (void *data, const struct pw_core_info *info);
127  void (*sync_reply) (void *data, uint32_t seq);
129  void (*state_changed) (void *data, enum pw_remote_state old,
130  enum pw_remote_state state, const char *error);
131 };
132 
135 struct pw_remote *
136 pw_remote_new(struct pw_core *core,
137  struct pw_properties *properties );
139 
141 void pw_remote_destroy(struct pw_remote *remote);
142 
144 struct pw_core *pw_remote_get_core(struct pw_remote *remote);
145 
147 enum pw_remote_state pw_remote_get_state(struct pw_remote *remote, const char **error);
148 
150 void pw_remote_add_listener(struct pw_remote *remote,
151  struct spa_hook *listener,
152  const struct pw_remote_events *events,
153  void *data);
154 
157 int pw_remote_connect(struct pw_remote *remote);
158 
162 int pw_remote_connect_fd(struct pw_remote *remote, int fd);
163 
165 struct pw_core_proxy * pw_remote_get_core_proxy(struct pw_remote *remote);
166 
168 const struct pw_core_info *pw_remote_get_core_info(struct pw_remote *remote);
169 
170 struct pw_proxy *pw_remote_get_proxy(struct pw_remote *remote, uint32_t id);
171 
174 
176 void pw_remote_update_state(struct pw_remote *remote, enum pw_remote_state state, const char *fmt, ...);
177 
179 struct pw_proxy *pw_remote_export(struct pw_remote *remote, struct pw_node *node);
180 
181 #ifdef __cplusplus
182 }
183 #endif
184 
185 #endif /* __PIPEWIRE_REMOTE_H__ */
A collection of key/value pairs.
Definition: properties.h:38
void pw_remote_add_listener(struct pw_remote *remote, struct spa_hook *listener, const struct pw_remote_events *events, void *data)
Add listener for events.
Definition: remote.c:298
not connected
Definition: remote.h:111
struct pw_core * pw_remote_get_core(struct pw_remote *remote)
Get the core used to construct this remote.
Definition: remote.c:286
Represents an object on the client side.
Definition: private.h:306
uint32_t version
Definition: remote.h:121
connecting to remote PipeWire
Definition: remote.h:112
The core information.
Definition: introspect.h:76
struct pw_proxy * pw_remote_export(struct pw_remote *remote, struct pw_node *node)
run a local node in a remote graph
Definition: remote.c:985
void(* destroy)(void *data)
Definition: remote.h:123
void pw_remote_update_state(struct pw_remote *remote, enum pw_remote_state state, const char *fmt,...)
Update the state of the remote, mostly used by protocols.
Definition: remote.c:107
void(* sync_reply)(void *data, uint32_t seq)
emited when a reply to a sync was received
Definition: remote.h:127
Represents a connection with the PipeWire server.
Definition: private.h:320
int pw_remote_connect(struct pw_remote *remote)
Definition: remote.c:345
void pw_remote_destroy(struct pw_remote *remote)
Definition: remote.c:262
PipeWire node class.
Definition: private.h:205
int pw_remote_connect_fd(struct pw_remote *remote, int fd)
Definition: remote.c:359
struct pw_proxy * pw_remote_get_proxy(struct pw_remote *remote, uint32_t id)
Definition: remote.c:340
struct pw_remote * remote
the owner remote of this proxy
Definition: private.h:307
remote is connected and ready
Definition: remote.h:113
struct pw_properties * properties
extra properties
Definition: private.h:323
enum pw_remote_state pw_remote_get_state(struct pw_remote *remote, const char **error)
Get the current state, error is set when state is PW_REMOTE_STATE_ERROR.
Definition: remote.c:291
void(* state_changed)(void *data, enum pw_remote_state old, enum pw_remote_state state, const char *error)
emited when the state changes
Definition: remote.h:129
struct pw_remote * pw_remote_new(struct pw_core *core, struct pw_properties *properties)
Definition: remote.c:197
struct pw_core_proxy * pw_remote_get_core_proxy(struct pw_remote *remote)
Get the core proxy, can only be called when connected.
Definition: remote.c:330
void pw_remote_disconnect(struct pw_remote *remote)
Definition: remote.c:373
void(* info_changed)(void *data, const struct pw_core_info *info)
emited when the remote core info changed
Definition: remote.h:125
Definition: remote.h:119
pw_remote_state
The state of a pw_remote.
Definition: remote.h:109
remote is in error
Definition: remote.h:110
enum pw_remote_state state
Definition: private.h:339
const struct pw_core_info * pw_remote_get_core_info(struct pw_remote *remote)
Get the remote core info, can only be called when connected.
Definition: remote.c:335
the core PipeWire object
Definition: private.h:103
const char * pw_remote_state_as_string(enum pw_remote_state state)
Convert a pw_remote_state to a readable string.
Definition: remote.c:91
struct pw_core * core
core
Definition: private.h:321