PipeWire  0.3.33
media-session.c File Reference

Data Structures

struct  data
 user data to add to an object More...
 
struct  param
 
struct  sync
 
struct  impl
 
struct  endpoint_link
 
struct  link
 
struct  object_info
 
struct  registry_event
 

Macros

#define NAME   "media-session"
 
#define SESSION_PREFIX   "media-session.d"
 
#define SESSION_CONF   "media-session.conf"
 
#define sm_object_emit(o, m, v, ...)   spa_hook_list_call(&(o)->hooks, struct sm_object_events, m, v, ##__VA_ARGS__)
 
#define sm_object_emit_update(s)   sm_object_emit(s, update, 0)
 
#define sm_object_emit_destroy(s)   sm_object_emit(s, destroy, 0)
 
#define sm_object_emit_free(s)   sm_object_emit(s, free, 0)
 
#define sm_media_session_emit(s, m, v, ...)   spa_hook_list_call(&(s)->hooks, struct sm_media_session_events, m, v, ##__VA_ARGS__)
 
#define sm_media_session_emit_info(s, i)   sm_media_session_emit(s, info, 0, i)
 
#define sm_media_session_emit_create(s, obj)   sm_media_session_emit(s, create, 0, obj)
 
#define sm_media_session_emit_remove(s, obj)   sm_media_session_emit(s, remove, 0, obj)
 
#define sm_media_session_emit_rescan(s, seq)   sm_media_session_emit(s, rescan, 0, seq)
 
#define sm_media_session_emit_shutdown(s)   sm_media_session_emit(s, shutdown, 0)
 
#define sm_media_session_emit_destroy(s)   sm_media_session_emit(s, destroy, 0)
 
#define sm_media_session_emit_seat_active(s, ...)   sm_media_session_emit(s, seat_active, 0, __VA_ARGS__)
 
#define sm_media_session_emit_dbus_disconnected(s)   sm_media_session_emit(s, dbus_disconnected, 0)
 

Functions

int sm_access_flatpak_start (struct sm_media_session *sess)
 
int sm_access_portal_start (struct sm_media_session *sess)
 
int sm_default_nodes_start (struct sm_media_session *sess)
 
int sm_default_profile_start (struct sm_media_session *sess)
 
int sm_default_routes_start (struct sm_media_session *sess)
 
int sm_restore_stream_start (struct sm_media_session *sess)
 
int sm_streams_follow_default_start (struct sm_media_session *sess)
 
int sm_alsa_midi_start (struct sm_media_session *sess)
 
int sm_v4l2_monitor_start (struct sm_media_session *sess)
 
int sm_libcamera_monitor_start (struct sm_media_session *sess)
 
int sm_bluez5_monitor_start (struct sm_media_session *sess)
 
int sm_bluez5_autoswitch_start (struct sm_media_session *sess)
 
int sm_alsa_monitor_start (struct sm_media_session *sess)
 
int sm_suspend_node_start (struct sm_media_session *sess)
 
int sm_policy_node_start (struct sm_media_session *sess)
 
int sm_session_manager_start (struct sm_media_session *sess)
 
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)
 
int sm_object_destroy (struct sm_object *obj)
 
int sm_object_sync_update (struct sm_object *obj)
 
int sm_object_add_listener (struct sm_object *obj, struct spa_hook *listener, const struct sm_object_events *events, void *data)
 
int sm_media_session_add_listener (struct sm_media_session *sess, struct spa_hook *listener, const struct sm_media_session_events *events, void *data)
 
struct sm_object * sm_media_session_find_object (struct sm_media_session *sess, uint32_t id)
 
int sm_media_session_destroy_object (struct sm_media_session *sess, uint32_t id)
 
int sm_media_session_for_each_object (struct sm_media_session *sess, int(*callback)(void *data, struct sm_object *object), void *data)
 
int sm_media_session_schedule_rescan (struct sm_media_session *sess)
 
int sm_media_session_sync (struct sm_media_session *sess, void(*callback)(void *data), void *data)
 
int sm_media_session_roundtrip (struct sm_media_session *sess)
 
struct pw_proxy * sm_media_session_export (struct sm_media_session *sess, const char *type, const struct spa_dict *props, void *object, size_t user_data_size)
 
struct sm_node * sm_media_session_export_node (struct sm_media_session *sess, const struct spa_dict *props, struct pw_impl_node *object)
 
struct sm_device * sm_media_session_export_device (struct sm_media_session *sess, const struct spa_dict *props, struct spa_device *object)
 
struct pw_proxy * sm_media_session_create_object (struct sm_media_session *sess, const char *factory_name, const char *type, uint32_t version, const struct spa_dict *props, size_t user_data_size)
 
struct sm_node * sm_media_session_create_node (struct sm_media_session *sess, const char *factory_name, const struct spa_dict *props)
 
int sm_media_session_create_links (struct sm_media_session *sess, const struct spa_dict *dict)
 
int sm_media_session_remove_links (struct sm_media_session *sess, const struct spa_dict *dict)
 
int sm_media_session_load_conf (struct sm_media_session *sess, const char *name, struct pw_properties *conf)
 
int sm_media_session_load_state (struct sm_media_session *sess, const char *name, struct pw_properties *props)
 
int sm_media_session_save_state (struct sm_media_session *sess, const char *name, const struct pw_properties *props)
 
char * sm_media_session_sanitize_name (char *name, int size, char sub, const char *fmt,...)
 
char * sm_media_session_sanitize_description (char *name, int size, char sub, const char *fmt,...)
 
int sm_media_session_seat_active_changed (struct sm_media_session *sess, bool active)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ NAME

#define NAME   "media-session"

◆ SESSION_CONF

#define SESSION_CONF   "media-session.conf"

◆ SESSION_PREFIX

#define SESSION_PREFIX   "media-session.d"

◆ sm_media_session_emit

#define sm_media_session_emit (   s,
  m,
  v,
  ... 
)    spa_hook_list_call(&(s)->hooks, struct sm_media_session_events, m, v, ##__VA_ARGS__)

◆ sm_media_session_emit_create

#define sm_media_session_emit_create (   s,
  obj 
)    sm_media_session_emit(s, create, 0, obj)

◆ sm_media_session_emit_dbus_disconnected

#define sm_media_session_emit_dbus_disconnected (   s)    sm_media_session_emit(s, dbus_disconnected, 0)

◆ sm_media_session_emit_destroy

#define sm_media_session_emit_destroy (   s)    sm_media_session_emit(s, destroy, 0)

◆ sm_media_session_emit_info

#define sm_media_session_emit_info (   s,
 
)    sm_media_session_emit(s, info, 0, i)

◆ sm_media_session_emit_remove

#define sm_media_session_emit_remove (   s,
  obj 
)    sm_media_session_emit(s, remove, 0, obj)

◆ sm_media_session_emit_rescan

#define sm_media_session_emit_rescan (   s,
  seq 
)    sm_media_session_emit(s, rescan, 0, seq)

◆ sm_media_session_emit_seat_active

#define sm_media_session_emit_seat_active (   s,
  ... 
)    sm_media_session_emit(s, seat_active, 0, __VA_ARGS__)

◆ sm_media_session_emit_shutdown

#define sm_media_session_emit_shutdown (   s)    sm_media_session_emit(s, shutdown, 0)

◆ sm_object_emit

#define sm_object_emit (   o,
  m,
  v,
  ... 
)    spa_hook_list_call(&(o)->hooks, struct sm_object_events, m, v, ##__VA_ARGS__)

◆ sm_object_emit_destroy

#define sm_object_emit_destroy (   s)    sm_object_emit(s, destroy, 0)

◆ sm_object_emit_free

#define sm_object_emit_free (   s)    sm_object_emit(s, free, 0)

◆ sm_object_emit_update

#define sm_object_emit_update (   s)    sm_object_emit(s, update, 0)

Function Documentation

◆ main()

◆ sm_access_flatpak_start()

int sm_access_flatpak_start ( struct sm_media_session *  sess)

◆ sm_access_portal_start()

int sm_access_portal_start ( struct sm_media_session *  sess)

◆ sm_alsa_midi_start()

◆ sm_alsa_monitor_start()

◆ sm_bluez5_autoswitch_start()

◆ sm_bluez5_monitor_start()

◆ sm_default_nodes_start()

◆ sm_default_profile_start()

◆ sm_default_routes_start()

◆ sm_libcamera_monitor_start()

◆ sm_media_session_add_listener()

◆ sm_media_session_create_links()

int sm_media_session_create_links ( struct sm_media_session *  sess,
const struct spa_dict dict 
)

◆ sm_media_session_create_node()

struct sm_node* sm_media_session_create_node ( struct sm_media_session *  sess,
const char *  factory_name,
const struct spa_dict props 
)

References NAME, pw_log_debug, and SPA_CONTAINER_OF.

◆ sm_media_session_create_object()

struct pw_proxy* sm_media_session_create_object ( struct sm_media_session *  sess,
const char *  factory_name,
const char *  type,
uint32_t  version,
const struct spa_dict props,
size_t  user_data_size 
)

References SPA_CONTAINER_OF.

◆ sm_media_session_destroy_object()

int sm_media_session_destroy_object ( struct sm_media_session *  sess,
uint32_t  id 
)

◆ sm_media_session_export()

struct pw_proxy* sm_media_session_export ( struct sm_media_session *  sess,
const char *  type,
const struct spa_dict props,
void *  object,
size_t  user_data_size 
)

◆ sm_media_session_export_device()

struct sm_device* sm_media_session_export_device ( struct sm_media_session *  sess,
const struct spa_dict props,
struct spa_device object 
)

◆ sm_media_session_export_node()

struct sm_node* sm_media_session_export_node ( struct sm_media_session *  sess,
const struct spa_dict props,
struct pw_impl_node *  object 
)

◆ sm_media_session_find_object()

struct sm_object* sm_media_session_find_object ( struct sm_media_session *  sess,
uint32_t  id 
)

References SPA_CONTAINER_OF.

◆ sm_media_session_for_each_object()

int sm_media_session_for_each_object ( struct sm_media_session *  sess,
int(*)(void *data, struct sm_object *object)  callback,
void *  data 
)

◆ sm_media_session_load_conf()

int sm_media_session_load_conf ( struct sm_media_session *  sess,
const char *  name,
struct pw_properties conf 
)

◆ sm_media_session_load_state()

int sm_media_session_load_state ( struct sm_media_session *  sess,
const char *  name,
struct pw_properties props 
)

◆ sm_media_session_remove_links()

int sm_media_session_remove_links ( struct sm_media_session *  sess,
const struct spa_dict dict 
)

◆ sm_media_session_roundtrip()

int sm_media_session_roundtrip ( struct sm_media_session *  sess)

◆ sm_media_session_sanitize_description()

char* sm_media_session_sanitize_description ( char *  name,
int  size,
char  sub,
const char *  fmt,
  ... 
)

References name.

◆ sm_media_session_sanitize_name()

char* sm_media_session_sanitize_name ( char *  name,
int  size,
char  sub,
const char *  fmt,
  ... 
)

References name.

◆ sm_media_session_save_state()

int sm_media_session_save_state ( struct sm_media_session *  sess,
const char *  name,
const struct pw_properties props 
)

◆ sm_media_session_schedule_rescan()

int sm_media_session_schedule_rescan ( struct sm_media_session *  sess)

◆ sm_media_session_seat_active_changed()

int sm_media_session_seat_active_changed ( struct sm_media_session *  sess,
bool  active 
)

◆ sm_media_session_sync()

int sm_media_session_sync ( struct sm_media_session *  sess,
void(*)(void *data callback,
void *  data 
)

◆ sm_object_add_data()

void* sm_object_add_data ( struct sm_object *  obj,
const char *  id,
size_t  size 
)

◆ sm_object_add_listener()

int sm_object_add_listener ( struct sm_object *  obj,
struct spa_hook listener,
const struct sm_object_events *  events,
void *  data 
)

◆ sm_object_destroy()

int sm_object_destroy ( struct sm_object *  obj)

◆ sm_object_get_data()

void* sm_object_get_data ( struct sm_object *  obj,
const char *  id 
)

◆ sm_object_remove_data()

int sm_object_remove_data ( struct sm_object *  obj,
const char *  id 
)

◆ sm_object_sync_update()

int sm_object_sync_update ( struct sm_object *  obj)

References pw_log_debug, and pw_proxy_sync().

◆ sm_policy_node_start()

◆ sm_restore_stream_start()

int sm_restore_stream_start ( struct sm_media_session *  sess)

◆ sm_session_manager_start()

int sm_session_manager_start ( struct sm_media_session *  sess)

◆ sm_streams_follow_default_start()

int sm_streams_follow_default_start ( struct sm_media_session *  sess)

References KEY_NAME, and pw_properties_set().

◆ sm_suspend_node_start()

int sm_suspend_node_start ( struct sm_media_session *  sess)

◆ sm_v4l2_monitor_start()

Variable Documentation

◆ desc

const char* desc

◆ name

◆ props

◆ start

int(* start) (struct sm_media_session *sess)