mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
media-session: add method to iterate objects
This commit is contained in:
parent
0e21464da2
commit
d720724d48
2 changed files with 19 additions and 0 deletions
|
|
@ -1244,6 +1244,21 @@ int sm_media_session_destroy_object(struct sm_media_session *sess, uint32_t id)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int sm_media_session_for_each_object(struct sm_media_session *sess,
|
||||||
|
int (*callback) (void *data, struct sm_object *object),
|
||||||
|
void *data)
|
||||||
|
{
|
||||||
|
struct impl *impl = SPA_CONTAINER_OF(sess, struct impl, this);
|
||||||
|
struct sm_object *obj;
|
||||||
|
int res;
|
||||||
|
|
||||||
|
spa_list_for_each(obj, &impl->global_list, link) {
|
||||||
|
if ((res = callback(data, obj)) != 0)
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int sm_media_session_schedule_rescan(struct sm_media_session *sess)
|
int sm_media_session_schedule_rescan(struct sm_media_session *sess)
|
||||||
{
|
{
|
||||||
struct impl *impl = SPA_CONTAINER_OF(sess, struct impl, this);
|
struct impl *impl = SPA_CONTAINER_OF(sess, struct impl, this);
|
||||||
|
|
|
||||||
|
|
@ -252,6 +252,10 @@ int sm_media_session_sync(struct sm_media_session *sess,
|
||||||
struct sm_object *sm_media_session_find_object(struct sm_media_session *sess, uint32_t id);
|
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_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_schedule_rescan(struct sm_media_session *sess);
|
||||||
|
|
||||||
struct pw_proxy *sm_media_session_export(struct sm_media_session *sess,
|
struct pw_proxy *sm_media_session_export(struct sm_media_session *sess,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue