2019-11-14 18:35:29 +01:00
|
|
|
/* PipeWire
|
|
|
|
|
*
|
|
|
|
|
* Copyright © 2019 Wim Taymans
|
|
|
|
|
*
|
|
|
|
|
* 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:
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef SM_MEDIA_SESSION_H
|
|
|
|
|
#define SM_MEDIA_SESSION_H
|
|
|
|
|
|
2019-12-11 10:57:10 +01:00
|
|
|
#include <spa/monitor/device.h>
|
2020-01-07 16:07:51 +01:00
|
|
|
#include <pipewire/impl.h>
|
2019-12-11 10:57:10 +01:00
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-12-16 10:28:18 +01:00
|
|
|
#define SM_TYPE_MEDIA_SESSION PW_TYPE_INFO_OBJECT_BASE "SessionManager"
|
|
|
|
|
|
2021-04-25 19:11:43 +03:00
|
|
|
#define SM_MAX_PARAMS 32
|
|
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
struct sm_media_session;
|
|
|
|
|
|
2019-11-26 12:53:28 +01:00
|
|
|
struct sm_object_events {
|
|
|
|
|
#define SM_VERSION_OBJECT_EVENTS 0
|
|
|
|
|
uint32_t version;
|
|
|
|
|
|
|
|
|
|
void (*update) (void *data);
|
|
|
|
|
void (*destroy) (void *data);
|
2020-06-04 17:41:01 +02:00
|
|
|
void (*free) (void *data);
|
2019-11-26 12:53:28 +01:00
|
|
|
};
|
|
|
|
|
|
2020-02-19 18:15:57 +01:00
|
|
|
struct sm_object_methods {
|
|
|
|
|
#define SM_VERSION_OBJECT_METHODS 0
|
|
|
|
|
uint32_t version;
|
|
|
|
|
|
|
|
|
|
int (*acquire) (void *data);
|
|
|
|
|
int (*release) (void *data);
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
struct sm_object {
|
|
|
|
|
uint32_t id;
|
2019-12-19 13:15:10 +01:00
|
|
|
const char *type;
|
2019-11-14 18:35:29 +01:00
|
|
|
|
2019-11-19 16:07:41 +01:00
|
|
|
struct spa_list link;
|
2019-11-14 18:35:29 +01:00
|
|
|
struct sm_media_session *session;
|
|
|
|
|
|
2019-11-29 13:21:55 +01:00
|
|
|
#define SM_OBJECT_CHANGE_MASK_LISTENER (1<<1)
|
|
|
|
|
#define SM_OBJECT_CHANGE_MASK_PROPERTIES (1<<2)
|
|
|
|
|
#define SM_OBJECT_CHANGE_MASK_BIND (1<<3)
|
2019-11-27 12:18:40 +01:00
|
|
|
#define SM_OBJECT_CHANGE_MASK_LAST (1<<8)
|
2019-11-14 18:35:29 +01:00
|
|
|
uint32_t mask; /**< monitored info */
|
|
|
|
|
uint32_t avail; /**< available info */
|
2019-11-27 12:18:40 +01:00
|
|
|
uint32_t changed; /**< changed since last update */
|
2019-11-14 18:35:29 +01:00
|
|
|
struct pw_properties *props; /**< global properties */
|
|
|
|
|
|
|
|
|
|
struct pw_proxy *proxy;
|
|
|
|
|
struct spa_hook proxy_listener;
|
|
|
|
|
struct spa_hook object_listener;
|
|
|
|
|
pw_destroy_t destroy;
|
2019-12-16 13:37:19 +01:00
|
|
|
int pending;
|
2019-11-14 18:35:29 +01:00
|
|
|
|
2019-12-17 10:47:31 +01:00
|
|
|
struct pw_proxy *handle;
|
2019-12-18 12:15:03 +01:00
|
|
|
struct spa_hook handle_listener;
|
2019-11-26 12:53:28 +01:00
|
|
|
struct spa_hook_list hooks;
|
|
|
|
|
|
2020-02-19 18:15:57 +01:00
|
|
|
struct spa_callbacks methods;
|
|
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
struct spa_list data;
|
media-session: deal with global id race conditions
To resolve monitor and policy core global ids racing with each other,
use separate registry event handlers for both cores. Each handles only
their own objects, determined by where the object handle was created.
Postpone handling of policy core new global events after monitor sync,
which orders them after the corresponding monitor proxy and registry
events. Monitor core is then more up-to-date, so we resolve id clashes
in favor of monitor globals, which avoids duplicate objects.
Fix use-after-free by tracking whether a monitor holds references to
sm_object. Keep also objects pending for id in a list, so that they can
be cleaned up on session_shutdown (monitors may leak objects at
shutdown, because spa objectinfo events won't be handled then).
Caveats:
Zombie objects may still created if policy core is late by several
events, but in those cases the corresponding remove events are already
in the queue.
Also, there's a (theoretical) possibility that pw_registry_bind will
bind the wrong object, if the registry event is handled too late and an
id is reused by the server.
For details, see reverted 77e4fdb1e485681635b282579d1c8d26f828a0a6
for which this is a another approach.
2021-02-27 14:55:13 +02:00
|
|
|
|
|
|
|
|
unsigned int monitor_global:1; /**< whether handle is from monitor core */
|
|
|
|
|
unsigned int destroyed:1; /**< whether proxies have been destroyed */
|
|
|
|
|
unsigned int discarded:1; /**< whether monitors hold no references */
|
2019-11-14 18:35:29 +01:00
|
|
|
};
|
|
|
|
|
|
2019-11-26 12:53:28 +01:00
|
|
|
int sm_object_add_listener(struct sm_object *obj, struct spa_hook *listener,
|
|
|
|
|
const struct sm_object_events *events, void *data);
|
|
|
|
|
|
2020-02-19 18:15:57 +01:00
|
|
|
#define sm_object_call(o,...) spa_callbacks_call(&(o)->methods, struct sm_object_methods, __VA_ARGS__)
|
|
|
|
|
#define sm_object_call_res(o,...) spa_callbacks_call_res(&(o)->methods, struct sm_object_methods, 0, __VA_ARGS__)
|
|
|
|
|
|
|
|
|
|
#define sm_object_acquire(o) sm_object_call(o, acquire, 0)
|
|
|
|
|
#define sm_object_release(o) sm_object_call(o, release, 0)
|
|
|
|
|
|
2019-11-19 16:08:40 +01:00
|
|
|
struct sm_param {
|
|
|
|
|
uint32_t id;
|
2019-11-26 12:53:28 +01:00
|
|
|
struct spa_list link; /**< link in param_list */
|
2019-11-19 16:08:40 +01:00
|
|
|
struct spa_pod *param;
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
/** get user data with \a id and \a size to an object */
|
|
|
|
|
void *sm_object_add_data(struct sm_object *obj, const char *id, size_t size);
|
|
|
|
|
void *sm_object_get_data(struct sm_object *obj, const char *id);
|
|
|
|
|
int sm_object_remove_data(struct sm_object *obj, const char *id);
|
|
|
|
|
|
2019-12-16 13:37:19 +01:00
|
|
|
int sm_object_sync_update(struct sm_object *obj);
|
|
|
|
|
|
2019-11-28 11:13:53 +01:00
|
|
|
int sm_object_destroy(struct sm_object *obj);
|
|
|
|
|
|
media-session: deal with global id race conditions
To resolve monitor and policy core global ids racing with each other,
use separate registry event handlers for both cores. Each handles only
their own objects, determined by where the object handle was created.
Postpone handling of policy core new global events after monitor sync,
which orders them after the corresponding monitor proxy and registry
events. Monitor core is then more up-to-date, so we resolve id clashes
in favor of monitor globals, which avoids duplicate objects.
Fix use-after-free by tracking whether a monitor holds references to
sm_object. Keep also objects pending for id in a list, so that they can
be cleaned up on session_shutdown (monitors may leak objects at
shutdown, because spa objectinfo events won't be handled then).
Caveats:
Zombie objects may still created if policy core is late by several
events, but in those cases the corresponding remove events are already
in the queue.
Also, there's a (theoretical) possibility that pw_registry_bind will
bind the wrong object, if the registry event is handled too late and an
id is reused by the server.
For details, see reverted 77e4fdb1e485681635b282579d1c8d26f828a0a6
for which this is a another approach.
2021-02-27 14:55:13 +02:00
|
|
|
#define sm_object_discard(o) do { (o)->discarded = true; } while (0)
|
|
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
struct sm_client {
|
|
|
|
|
struct sm_object obj;
|
|
|
|
|
|
2019-11-27 12:18:40 +01:00
|
|
|
#define SM_CLIENT_CHANGE_MASK_INFO (SM_OBJECT_CHANGE_MASK_LAST<<0)
|
|
|
|
|
#define SM_CLIENT_CHANGE_MASK_PERMISSIONS (SM_OBJECT_CHANGE_MASK_LAST<<1)
|
2019-11-14 18:35:29 +01:00
|
|
|
struct pw_client_info *info;
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-28 11:13:53 +01:00
|
|
|
struct sm_device {
|
|
|
|
|
struct sm_object obj;
|
|
|
|
|
|
2020-02-19 18:15:57 +01:00
|
|
|
unsigned int locked:1; /**< if the device is locked by someone else right now */
|
2019-11-28 11:13:53 +01:00
|
|
|
|
|
|
|
|
#define SM_DEVICE_CHANGE_MASK_INFO (SM_OBJECT_CHANGE_MASK_LAST<<0)
|
|
|
|
|
#define SM_DEVICE_CHANGE_MASK_PARAMS (SM_OBJECT_CHANGE_MASK_LAST<<1)
|
|
|
|
|
#define SM_DEVICE_CHANGE_MASK_NODES (SM_OBJECT_CHANGE_MASK_LAST<<2)
|
|
|
|
|
uint32_t n_params;
|
|
|
|
|
struct spa_list param_list; /**< list of sm_param */
|
2021-04-25 19:11:43 +03:00
|
|
|
int param_seq[SM_MAX_PARAMS];
|
2019-11-28 11:13:53 +01:00
|
|
|
struct pw_device_info *info;
|
|
|
|
|
struct spa_list node_list;
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
struct sm_node {
|
|
|
|
|
struct sm_object obj;
|
|
|
|
|
|
2019-11-28 11:13:53 +01:00
|
|
|
struct sm_device *device; /**< optional device */
|
|
|
|
|
struct spa_list link; /**< link in device node_list */
|
2019-11-19 16:08:40 +01:00
|
|
|
|
2019-11-27 12:18:40 +01:00
|
|
|
#define SM_NODE_CHANGE_MASK_INFO (SM_OBJECT_CHANGE_MASK_LAST<<0)
|
2019-11-28 11:13:53 +01:00
|
|
|
#define SM_NODE_CHANGE_MASK_PARAMS (SM_OBJECT_CHANGE_MASK_LAST<<1)
|
|
|
|
|
#define SM_NODE_CHANGE_MASK_PORTS (SM_OBJECT_CHANGE_MASK_LAST<<2)
|
2019-11-27 12:18:40 +01:00
|
|
|
uint32_t n_params;
|
|
|
|
|
struct spa_list param_list; /**< list of sm_param */
|
2021-04-25 19:11:43 +03:00
|
|
|
int param_seq[SM_MAX_PARAMS];
|
2019-11-14 18:35:29 +01:00
|
|
|
struct pw_node_info *info;
|
|
|
|
|
struct spa_list port_list;
|
2020-10-14 12:35:27 +02:00
|
|
|
|
2021-08-07 20:51:46 +03:00
|
|
|
char *target_node; /**< desired target node */
|
|
|
|
|
unsigned int fixed_target:1; /**< target_node has priority over node.target */
|
2019-11-14 18:35:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct sm_port {
|
|
|
|
|
struct sm_object obj;
|
|
|
|
|
|
|
|
|
|
enum pw_direction direction;
|
2020-07-22 11:27:23 +02:00
|
|
|
#define SM_PORT_TYPE_UNKNOWN 0
|
|
|
|
|
#define SM_PORT_TYPE_DSP_AUDIO 1
|
|
|
|
|
#define SM_PORT_TYPE_DSP_MIDI 2
|
|
|
|
|
uint32_t type;
|
|
|
|
|
uint32_t channel;
|
2019-11-14 18:35:29 +01:00
|
|
|
struct sm_node *node;
|
|
|
|
|
struct spa_list link; /**< link in node port_list */
|
|
|
|
|
|
2019-11-27 12:18:40 +01:00
|
|
|
#define SM_PORT_CHANGE_MASK_INFO (SM_OBJECT_CHANGE_MASK_LAST<<0)
|
2019-11-14 18:35:29 +01:00
|
|
|
struct pw_port_info *info;
|
2020-07-22 15:05:45 +02:00
|
|
|
|
|
|
|
|
unsigned int visited:1;
|
2019-11-14 18:35:29 +01:00
|
|
|
};
|
|
|
|
|
|
2019-11-20 16:18:46 +01:00
|
|
|
struct sm_session {
|
|
|
|
|
struct sm_object obj;
|
|
|
|
|
|
2019-11-29 13:21:55 +01:00
|
|
|
#define SM_SESSION_CHANGE_MASK_INFO (SM_OBJECT_CHANGE_MASK_LAST<<0)
|
|
|
|
|
#define SM_SESSION_CHANGE_MASK_ENDPOINTS (SM_OBJECT_CHANGE_MASK_LAST<<1)
|
2019-11-20 16:18:46 +01:00
|
|
|
struct pw_session_info *info;
|
|
|
|
|
struct spa_list endpoint_list;
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
struct sm_endpoint {
|
|
|
|
|
struct sm_object obj;
|
|
|
|
|
|
|
|
|
|
int32_t priority;
|
|
|
|
|
|
2019-11-20 16:18:46 +01:00
|
|
|
struct sm_session *session;
|
|
|
|
|
struct spa_list link; /**< link in session endpoint_list */
|
|
|
|
|
|
2019-11-27 12:18:40 +01:00
|
|
|
#define SM_ENDPOINT_CHANGE_MASK_INFO (SM_OBJECT_CHANGE_MASK_LAST<<0)
|
|
|
|
|
#define SM_ENDPOINT_CHANGE_MASK_STREAMS (SM_OBJECT_CHANGE_MASK_LAST<<1)
|
2019-11-14 18:35:29 +01:00
|
|
|
struct pw_endpoint_info *info;
|
|
|
|
|
struct spa_list stream_list;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct sm_endpoint_stream {
|
|
|
|
|
struct sm_object obj;
|
|
|
|
|
|
|
|
|
|
int32_t priority;
|
|
|
|
|
|
|
|
|
|
struct sm_endpoint *endpoint;
|
|
|
|
|
struct spa_list link; /**< link in endpoint stream_list */
|
|
|
|
|
|
2019-11-15 17:13:45 +01:00
|
|
|
struct spa_list link_list; /**< list of links */
|
|
|
|
|
|
2019-11-27 12:18:40 +01:00
|
|
|
#define SM_ENDPOINT_STREAM_CHANGE_MASK_INFO (SM_OBJECT_CHANGE_MASK_LAST<<0)
|
2019-11-14 18:35:29 +01:00
|
|
|
struct pw_endpoint_stream_info *info;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct sm_endpoint_link {
|
|
|
|
|
struct sm_object obj;
|
|
|
|
|
|
2019-11-15 17:13:45 +01:00
|
|
|
struct spa_list link; /**< link in session link_list */
|
|
|
|
|
|
|
|
|
|
struct spa_list output_link;
|
|
|
|
|
struct sm_endpoint_stream *output;
|
|
|
|
|
struct spa_list input_link;
|
|
|
|
|
struct sm_endpoint_stream *input;
|
2019-11-14 18:35:29 +01:00
|
|
|
|
2019-11-27 12:18:40 +01:00
|
|
|
#define SM_ENDPOINT_LINK_CHANGE_MASK_INFO (SM_OBJECT_CHANGE_MASK_LAST<<0)
|
2019-11-14 18:35:29 +01:00
|
|
|
struct pw_endpoint_link_info *info;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct sm_media_session_events {
|
|
|
|
|
#define SM_VERSION_MEDIA_SESSION_EVENTS 0
|
|
|
|
|
uint32_t version;
|
|
|
|
|
|
2020-01-09 15:52:53 +01:00
|
|
|
void (*info) (void *data, const struct pw_core_info *info);
|
|
|
|
|
|
2019-11-26 12:53:28 +01:00
|
|
|
void (*create) (void *data, struct sm_object *object);
|
2019-11-14 18:35:29 +01:00
|
|
|
void (*remove) (void *data, struct sm_object *object);
|
|
|
|
|
|
|
|
|
|
void (*rescan) (void *data, int seq);
|
2020-12-01 12:03:28 +01:00
|
|
|
void (*shutdown) (void *data);
|
2019-12-18 12:15:03 +01:00
|
|
|
void (*destroy) (void *data);
|
2021-04-10 16:49:14 +03:00
|
|
|
|
|
|
|
|
void (*seat_active) (void *data, bool active);
|
2021-05-17 15:17:54 +02:00
|
|
|
|
|
|
|
|
void (*dbus_disconnected) (void *data);
|
2019-11-14 18:35:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct sm_media_session {
|
2019-11-20 16:18:46 +01:00
|
|
|
struct sm_session *session; /** session object managed by this session */
|
|
|
|
|
|
2020-03-30 14:09:44 +02:00
|
|
|
struct pw_properties *props;
|
|
|
|
|
|
2020-01-07 16:07:51 +01:00
|
|
|
uint32_t session_id;
|
|
|
|
|
struct pw_client_session *client_session;
|
|
|
|
|
|
2019-11-20 16:18:46 +01:00
|
|
|
struct pw_loop *loop; /** the main loop */
|
2019-12-10 18:19:56 +01:00
|
|
|
struct pw_context *context;
|
2019-11-14 18:35:29 +01:00
|
|
|
|
2019-11-20 16:18:46 +01:00
|
|
|
struct spa_dbus_connection *dbus_connection;
|
2020-07-15 14:21:35 +02:00
|
|
|
struct pw_metadata *metadata;
|
2020-01-09 15:52:53 +01:00
|
|
|
|
|
|
|
|
struct pw_core_info *info;
|
2019-11-14 18:35:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int sm_media_session_add_listener(struct sm_media_session *sess, struct spa_hook *listener,
|
|
|
|
|
const struct sm_media_session_events *events, void *data);
|
|
|
|
|
|
2019-11-15 12:07:26 +01:00
|
|
|
int sm_media_session_roundtrip(struct sm_media_session *sess);
|
|
|
|
|
|
2019-11-18 13:10:21 +01:00
|
|
|
int sm_media_session_sync(struct sm_media_session *sess,
|
|
|
|
|
void (*callback) (void *data), void *data);
|
|
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
struct sm_object *sm_media_session_find_object(struct sm_media_session *sess, uint32_t id);
|
2020-04-02 15:26:39 +02:00
|
|
|
int sm_media_session_destroy_object(struct sm_media_session *sess, uint32_t id);
|
2019-11-14 18:35:29 +01:00
|
|
|
|
2020-07-16 17:48:29 +02:00
|
|
|
int sm_media_session_for_each_object(struct sm_media_session *sess,
|
|
|
|
|
int (*callback) (void *data, struct sm_object *object),
|
|
|
|
|
void *data);
|
|
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
int sm_media_session_schedule_rescan(struct sm_media_session *sess);
|
|
|
|
|
|
2020-11-20 17:58:08 +01:00
|
|
|
struct pw_metadata *sm_media_session_export_metadata(struct sm_media_session *sess,
|
|
|
|
|
const char *name);
|
2019-11-14 18:35:29 +01:00
|
|
|
struct pw_proxy *sm_media_session_export(struct sm_media_session *sess,
|
2019-12-19 13:15:10 +01:00
|
|
|
const char *type, const struct spa_dict *props,
|
2019-11-14 18:35:29 +01:00
|
|
|
void *object, size_t user_data_size);
|
|
|
|
|
|
2020-01-07 16:07:51 +01:00
|
|
|
struct sm_node *sm_media_session_export_node(struct sm_media_session *sess,
|
|
|
|
|
const struct spa_dict *props, struct pw_impl_node *node);
|
2019-11-29 13:21:55 +01:00
|
|
|
struct sm_device *sm_media_session_export_device(struct sm_media_session *sess,
|
2019-12-13 11:26:05 +01:00
|
|
|
const struct spa_dict *props, struct spa_device *device);
|
2019-11-29 13:21:55 +01:00
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
struct pw_proxy *sm_media_session_create_object(struct sm_media_session *sess,
|
2019-12-19 13:15:10 +01:00
|
|
|
const char *factory_name, const char *type, uint32_t version,
|
2019-11-14 18:35:29 +01:00
|
|
|
const struct spa_dict *props, size_t user_data_size);
|
|
|
|
|
|
2019-11-26 12:53:28 +01:00
|
|
|
struct sm_node *sm_media_session_create_node(struct sm_media_session *sess,
|
2019-11-29 13:21:55 +01:00
|
|
|
const char *factory_name, const struct spa_dict *props);
|
2019-11-26 12:53:28 +01:00
|
|
|
|
2019-11-15 12:08:46 +01:00
|
|
|
int sm_media_session_create_links(struct sm_media_session *sess,
|
|
|
|
|
const struct spa_dict *dict);
|
2020-07-15 14:20:46 +02:00
|
|
|
int sm_media_session_remove_links(struct sm_media_session *sess,
|
|
|
|
|
const struct spa_dict *dict);
|
2019-11-15 12:08:46 +01:00
|
|
|
|
2020-12-30 13:12:48 +01:00
|
|
|
int sm_media_session_load_conf(struct sm_media_session *sess,
|
|
|
|
|
const char *name, struct pw_properties *conf);
|
|
|
|
|
|
2020-08-13 11:31:57 +02:00
|
|
|
int sm_media_session_load_state(struct sm_media_session *sess,
|
2021-03-05 09:23:19 +01:00
|
|
|
const char *name, struct pw_properties *props);
|
2020-08-13 11:31:57 +02:00
|
|
|
int sm_media_session_save_state(struct sm_media_session *sess,
|
2021-03-05 09:23:19 +01:00
|
|
|
const char *name, const struct pw_properties *props);
|
2020-08-13 11:31:57 +02:00
|
|
|
|
2021-01-12 20:38:47 +01:00
|
|
|
int sm_media_session_match_rules(const char *rules, size_t size,
|
|
|
|
|
struct pw_properties *props);
|
|
|
|
|
|
2021-02-12 20:47:41 +01:00
|
|
|
char *sm_media_session_sanitize_name(char *name, int size, char sub,
|
|
|
|
|
const char *fmt, ...) SPA_PRINTF_FUNC(4, 5);
|
2021-02-17 13:12:22 +01:00
|
|
|
char *sm_media_session_sanitize_description(char *name, int size, char sub,
|
|
|
|
|
const char *fmt, ...) SPA_PRINTF_FUNC(4, 5);
|
2021-02-12 20:47:41 +01:00
|
|
|
|
2021-04-10 16:49:14 +03:00
|
|
|
int sm_media_session_seat_active_changed(struct sm_media_session *sess, bool active);
|
|
|
|
|
|
2019-11-14 18:35:29 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|