Loading...
Searching...
No Matches
protocol-native.h
Go to the documentation of this file.
/* PipeWire */
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#ifndef PIPEWIRE_EXT_PROTOCOL_NATIVE_H
#define PIPEWIRE_EXT_PROTOCOL_NATIVE_H
#include <spa/utils/defs.h>
#include <pipewire/proxy.h>
#include <pipewire/resource.h>
#ifdef __cplusplus
extern "C" {
#endif
#define PW_TYPE_INFO_PROTOCOL_Native PW_TYPE_INFO_PROTOCOL_BASE "Native"
struct pw_protocol_native_message {
uint32_t id;
uint32_t opcode;
void *data;
uint32_t size;
uint32_t n_fds;
int *fds;
int seq;
};
struct pw_protocol_native_demarshal {
int (*func) (void *object, const struct pw_protocol_native_message *msg);
uint32_t permissions;
uint32_t flags;
};
struct pw_protocol_native_ext {
#define PW_VERSION_PROTOCOL_NATIVE_EXT 0
uint32_t version;
struct spa_pod_builder * (*begin_proxy) (struct pw_proxy *proxy,
uint8_t opcode, struct pw_protocol_native_message **msg);
uint32_t (*add_proxy_fd) (struct pw_proxy *proxy, int fd);
int (*get_proxy_fd) (struct pw_proxy *proxy, uint32_t index);
int (*end_proxy) (struct pw_proxy *proxy,
struct spa_pod_builder *builder);
struct spa_pod_builder * (*begin_resource) (struct pw_resource *resource,
uint8_t opcode, struct pw_protocol_native_message **msg);
uint32_t (*add_resource_fd) (struct pw_resource *resource, int fd);
int (*get_resource_fd) (struct pw_resource *resource, uint32_t index);
int (*end_resource) (struct pw_resource *resource,
struct spa_pod_builder *builder);
};
#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__)
#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__)
#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__)
#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__)
#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__)
#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__)
#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__)
#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__)
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* PIPEWIRE_EXT_PROTOCOL_NATIVE_H */
defs.h
spa/utils/defs.h
proxy.h
pipewire/proxy.h
resource.h
pipewire/resource.h
pw_protocol_native_demarshal
Definition protocol-native.h:42
pw_protocol_native_demarshal::flags
uint32_t flags
Definition protocol-native.h:45
pw_protocol_native_demarshal::permissions
uint32_t permissions
Definition protocol-native.h:44
pw_protocol_native_demarshal::func
int(* func)(void *object, const struct pw_protocol_native_message *msg)
Definition protocol-native.h:43
pw_protocol_native_ext
pw_protocol_native_ext methods
Definition protocol-native.h:49
pw_protocol_native_ext::get_proxy_fd
int(* get_proxy_fd)(struct pw_proxy *proxy, uint32_t index)
Definition protocol-native.h:58
pw_protocol_native_ext::end_resource
int(* end_resource)(struct pw_resource *resource, struct spa_pod_builder *builder)
Definition protocol-native.h:69
pw_protocol_native_ext::add_proxy_fd
uint32_t(* add_proxy_fd)(struct pw_proxy *proxy, int fd)
Definition protocol-native.h:57
pw_protocol_native_ext::version
uint32_t version
Definition protocol-native.h:52
pw_protocol_native_ext::end_proxy
int(* end_proxy)(struct pw_proxy *proxy, struct spa_pod_builder *builder)
Definition protocol-native.h:60
pw_protocol_native_ext::add_resource_fd
uint32_t(* add_resource_fd)(struct pw_resource *resource, int fd)
Definition protocol-native.h:66
pw_protocol_native_ext::get_resource_fd
int(* get_resource_fd)(struct pw_resource *resource, uint32_t index)
Definition protocol-native.h:67
pw_protocol_native_message
Definition protocol-native.h:32
pw_protocol_native_message::id
uint32_t id
Definition protocol-native.h:33
pw_protocol_native_message::seq
int seq
Definition protocol-native.h:39
pw_protocol_native_message::n_fds
uint32_t n_fds
Definition protocol-native.h:37
pw_protocol_native_message::fds
int * fds
Definition protocol-native.h:38
pw_protocol_native_message::size
uint32_t size
Definition protocol-native.h:36
pw_protocol_native_message::opcode
uint32_t opcode
Definition protocol-native.h:34
pw_proxy
pw_resource
spa_pod_builder
Definition builder.h:63