2017-07-12 18:04:00 +02:00
|
|
|
/* PipeWire
|
|
|
|
|
*
|
2018-11-05 17:48:52 +01:00
|
|
|
* Copyright © 2018 Wim Taymans
|
2017-07-12 18:04:00 +02:00
|
|
|
*
|
2018-11-05 17:48:52 +01:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
2017-07-12 18:04:00 +02:00
|
|
|
*
|
2018-11-05 17:48:52 +01:00
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
|
* Software.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
2017-07-12 18:04:00 +02:00
|
|
|
*/
|
|
|
|
|
|
2019-01-14 12:58:23 +01:00
|
|
|
#ifndef PIPEWIRE_EXT_PROTOCOL_NATIVE_H
|
|
|
|
|
#define PIPEWIRE_EXT_PROTOCOL_NATIVE_H
|
2017-07-12 18:04:00 +02:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-11-10 13:36:14 +01:00
|
|
|
#include <spa/utils/defs.h>
|
|
|
|
|
#include <spa/param/param.h>
|
|
|
|
|
#include <spa/node/node.h>
|
2017-07-12 18:04:00 +02:00
|
|
|
|
2019-01-14 12:58:23 +01:00
|
|
|
#define PW_TYPE_INFO_PROTOCOL_Native PW_TYPE_INFO_PROTOCOL_BASE "Native"
|
2017-07-12 18:04:00 +02:00
|
|
|
|
2017-08-01 20:11:38 +02:00
|
|
|
struct pw_protocol_native_demarshal {
|
2017-12-18 11:38:30 +01:00
|
|
|
int (*func) (void *object, void *data, size_t size);
|
2018-11-05 15:27:13 +01:00
|
|
|
uint32_t permissions;
|
2017-08-01 20:11:38 +02:00
|
|
|
};
|
|
|
|
|
|
2017-07-12 18:04:00 +02:00
|
|
|
/** \ref pw_protocol_native_ext methods */
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
uint32_t (*add_proxy_fd) (struct pw_proxy *proxy, int fd);
|
|
|
|
|
int (*get_proxy_fd) (struct pw_proxy *proxy, uint32_t index);
|
|
|
|
|
|
2019-02-18 12:31:36 +01:00
|
|
|
int (*end_proxy) (struct pw_proxy *proxy,
|
|
|
|
|
struct spa_pod_builder *builder);
|
2017-07-12 18:04:00 +02:00
|
|
|
|
|
|
|
|
struct spa_pod_builder * (*begin_resource) (struct pw_resource *resource,
|
|
|
|
|
uint8_t opcode);
|
|
|
|
|
|
|
|
|
|
uint32_t (*add_resource_fd) (struct pw_resource *resource, int fd);
|
|
|
|
|
int (*get_resource_fd) (struct pw_resource *resource, uint32_t index);
|
|
|
|
|
|
2019-02-18 12:31:36 +01:00
|
|
|
int (*end_resource) (struct pw_resource *resource,
|
|
|
|
|
struct spa_pod_builder *builder);
|
2017-07-12 18:04:00 +02:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2017-08-06 06:42:26 +02:00
|
|
|
#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__)
|
2017-07-12 18:04:00 +02:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
} /* extern "C" */
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-01-14 12:58:23 +01:00
|
|
|
#endif /* PIPEWIRE_EXT_PROTOCOL_NATIVE_H */
|