mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
monitor: pass info to factory
This commit is contained in:
parent
29cb7bf39a
commit
e90166678c
2 changed files with 18 additions and 76 deletions
|
|
@ -76,23 +76,6 @@ add_item (PinosSpaMonitor *this, SpaMonitorItem *item)
|
||||||
|
|
||||||
pinos_log_debug ("monitor %p: add: \"%s\" (%s)", this, name, id);
|
pinos_log_debug ("monitor %p: add: \"%s\" (%s)", this, name, id);
|
||||||
|
|
||||||
handle = calloc (1, factory->size);
|
|
||||||
if ((res = spa_handle_factory_init (factory,
|
|
||||||
handle,
|
|
||||||
NULL, //item->info,
|
|
||||||
impl->core->support,
|
|
||||||
impl->core->n_support)) < 0) {
|
|
||||||
pinos_log_error ("can't make factory instance: %d", res);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ((res = spa_handle_get_interface (handle, impl->core->type.spa_node, &node_iface)) < 0) {
|
|
||||||
pinos_log_error ("can't get NODE interface: %d", res);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ((res = spa_handle_get_interface (handle, impl->core->type.spa_clock, &clock_iface)) < 0) {
|
|
||||||
pinos_log_info ("no CLOCK interface: %d", res);
|
|
||||||
}
|
|
||||||
|
|
||||||
props = pinos_properties_new (NULL, NULL);
|
props = pinos_properties_new (NULL, NULL);
|
||||||
|
|
||||||
if (info) {
|
if (info) {
|
||||||
|
|
@ -108,6 +91,24 @@ add_item (PinosSpaMonitor *this, SpaMonitorItem *item)
|
||||||
}
|
}
|
||||||
pinos_properties_set (props, "media.class", klass);
|
pinos_properties_set (props, "media.class", klass);
|
||||||
|
|
||||||
|
handle = calloc (1, factory->size);
|
||||||
|
if ((res = spa_handle_factory_init (factory,
|
||||||
|
handle,
|
||||||
|
&props->dict,
|
||||||
|
impl->core->support,
|
||||||
|
impl->core->n_support)) < 0) {
|
||||||
|
pinos_log_error ("can't make factory instance: %d", res);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ((res = spa_handle_get_interface (handle, impl->core->type.spa_node, &node_iface)) < 0) {
|
||||||
|
pinos_log_error ("can't get NODE interface: %d", res);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ((res = spa_handle_get_interface (handle, impl->core->type.spa_clock, &clock_iface)) < 0) {
|
||||||
|
pinos_log_info ("no CLOCK interface: %d", res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
mitem = calloc (1, sizeof (PinosSpaMonitorItem));
|
mitem = calloc (1, sizeof (PinosSpaMonitorItem));
|
||||||
mitem->id = strdup (id);
|
mitem->id = strdup (id);
|
||||||
mitem->node = pinos_node_new (impl->core,
|
mitem->node = pinos_node_new (impl->core,
|
||||||
|
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
/* Simple Plugin API
|
|
||||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library; if not, write to the
|
|
||||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
||||||
* Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* No glibc wrappers exist for memfd_create(2), so provide our own.
|
|
||||||
*
|
|
||||||
* Also define memfd fcntl sealing macros. While they are already
|
|
||||||
* defined in the kernel header file <linux/fcntl.h>, that file as
|
|
||||||
* a whole conflicts with the original glibc header <fnctl.h>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static inline int memfd_create(const char *name, unsigned int flags) {
|
|
||||||
return syscall(SYS_memfd_create, name, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* memfd_create(2) flags */
|
|
||||||
|
|
||||||
#ifndef MFD_CLOEXEC
|
|
||||||
#define MFD_CLOEXEC 0x0001U
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MFD_ALLOW_SEALING
|
|
||||||
#define MFD_ALLOW_SEALING 0x0002U
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* fcntl() seals-related flags */
|
|
||||||
|
|
||||||
#ifndef F_LINUX_SPECIFIC_BASE
|
|
||||||
#define F_LINUX_SPECIFIC_BASE 1024
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef F_ADD_SEALS
|
|
||||||
#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
|
|
||||||
#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
|
|
||||||
|
|
||||||
#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
|
|
||||||
#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
|
|
||||||
#define F_SEAL_GROW 0x0004 /* prevent file from growing */
|
|
||||||
#define F_SEAL_WRITE 0x0008 /* prevent writes */
|
|
||||||
#endif
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue