PipeWire 0.3.77
Loading...
Searching...
No Matches
protocol-native.h
Go to the documentation of this file.
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef PIPEWIRE_EXT_PROTOCOL_NATIVE_H
6#define PIPEWIRE_EXT_PROTOCOL_NATIVE_H
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#include <spa/utils/defs.h>
13
14#include <pipewire/proxy.h>
15#include <pipewire/resource.h>
16
25#define PW_TYPE_INFO_PROTOCOL_Native PW_TYPE_INFO_PROTOCOL_BASE "Native"
26
28 uint32_t id;
29 uint32_t opcode;
30 void *data;
31 uint32_t size;
32 uint32_t n_fds;
33 int *fds;
34 int seq;
35};
38 int (*func) (void *object, const struct pw_protocol_native_message *msg);
39 uint32_t permissions;
40 uint32_t flags;
41};
45#define PW_VERSION_PROTOCOL_NATIVE_EXT 0
46 uint32_t version;
47
48 struct spa_pod_builder * (*begin_proxy) (struct pw_proxy *proxy,
49 uint8_t opcode, struct pw_protocol_native_message **msg);
50
51 uint32_t (*add_proxy_fd) (struct pw_proxy *proxy, int fd);
52 int (*get_proxy_fd) (struct pw_proxy *proxy, uint32_t index);
53
54 int (*end_proxy) (struct pw_proxy *proxy,
55 struct spa_pod_builder *builder);
56
57 struct spa_pod_builder * (*begin_resource) (struct pw_resource *resource,
58 uint8_t opcode, struct pw_protocol_native_message **msg);
59
60 uint32_t (*add_resource_fd) (struct pw_resource *resource, int fd);
61 int (*get_resource_fd) (struct pw_resource *resource, uint32_t index);
62
63 int (*end_resource) (struct pw_resource *resource,
64 struct spa_pod_builder *builder);
65};
67#define pw_protocol_native_begin_proxy(p,...) pw_protocol_ext(pw_proxy_get_protocol(p),struct pw_protocol_native_ext,begin_proxy,p,__VA_ARGS__)
68#define pw_protocol_native_add_proxy_fd(p,...) pw_protocol_ext(pw_proxy_get_protocol(p),struct pw_protocol_native_ext,add_proxy_fd,p,__VA_ARGS__)
69#define pw_protocol_native_get_proxy_fd(p,...) pw_protocol_ext(pw_proxy_get_protocol(p),struct pw_protocol_native_ext,get_proxy_fd,p,__VA_ARGS__)
70#define pw_protocol_native_end_proxy(p,...) pw_protocol_ext(pw_proxy_get_protocol(p),struct pw_protocol_native_ext,end_proxy,p,__VA_ARGS__)
71
72#define pw_protocol_native_begin_resource(r,...) pw_protocol_ext(pw_resource_get_protocol(r),struct pw_protocol_native_ext,begin_resource,r,__VA_ARGS__)
73#define pw_protocol_native_add_resource_fd(r,...) pw_protocol_ext(pw_resource_get_protocol(r),struct pw_protocol_native_ext,add_resource_fd,r,__VA_ARGS__)
74#define pw_protocol_native_get_resource_fd(r,...) pw_protocol_ext(pw_resource_get_protocol(r),struct pw_protocol_native_ext,get_resource_fd,r,__VA_ARGS__)
75#define pw_protocol_native_end_resource(r,...) pw_protocol_ext(pw_resource_get_protocol(r),struct pw_protocol_native_ext,end_resource,r,__VA_ARGS__)
81#ifdef __cplusplus
82} /* extern "C" */
83#endif
84
85#endif /* PIPEWIRE_EXT_PROTOCOL_NATIVE_H */
spa/utils/defs.h
pipewire/proxy.h
pipewire/resource.h
Definition: protocol-native.h:42
uint32_t flags
Definition: protocol-native.h:45
uint32_t permissions
Definition: protocol-native.h:44
int(* func)(void *object, const struct pw_protocol_native_message *msg)
Definition: protocol-native.h:43
pw_protocol_native_ext methods
Definition: protocol-native.h:49
int(* get_proxy_fd)(struct pw_proxy *proxy, uint32_t index)
Definition: protocol-native.h:58
int(* end_resource)(struct pw_resource *resource, struct spa_pod_builder *builder)
Definition: protocol-native.h:69
uint32_t(* add_proxy_fd)(struct pw_proxy *proxy, int fd)
Definition: protocol-native.h:57
uint32_t version
Definition: protocol-native.h:52
int(* end_proxy)(struct pw_proxy *proxy, struct spa_pod_builder *builder)
Definition: protocol-native.h:60
uint32_t(* add_resource_fd)(struct pw_resource *resource, int fd)
Definition: protocol-native.h:66
int(* get_resource_fd)(struct pw_resource *resource, uint32_t index)
Definition: protocol-native.h:67
Definition: protocol-native.h:32
uint32_t id
Definition: protocol-native.h:33
int seq
Definition: protocol-native.h:39
void * data
Definition: protocol-native.h:35
uint32_t n_fds
Definition: protocol-native.h:37
int * fds
Definition: protocol-native.h:38
uint32_t size
Definition: protocol-native.h:36
uint32_t opcode
Definition: protocol-native.h:34
Definition: builder.h:53