mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-25 06:59:57 -05:00
port to meson
This commit is contained in:
parent
924824d0a3
commit
67dd3adb87
69 changed files with 1056 additions and 999 deletions
|
|
@ -17,8 +17,6 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
#include <errno.h>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@
|
|||
#include <glib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <server/module.h>
|
||||
#include <pinos/client/pinos.h>
|
||||
#include <pinos/server/module.h>
|
||||
|
||||
#include "command.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#include <server/daemon.h>
|
||||
#include <pinos/server/daemon.h>
|
||||
|
||||
typedef struct _PinosCommand PinosCommand;
|
||||
|
||||
|
|
|
|||
|
|
@ -554,11 +554,17 @@ do_start (PinosLink *this, SpaNodeState in_state, SpaNodeState out_state)
|
|||
} else {
|
||||
pinos_link_update_state (this, PINOS_LINK_STATE_PAUSED);
|
||||
|
||||
if (in_state == SPA_NODE_STATE_PAUSED)
|
||||
if (in_state == SPA_NODE_STATE_PAUSED) {
|
||||
pinos_node_set_state (this->input_node, PINOS_NODE_STATE_RUNNING);
|
||||
if (pinos_node_get_state (this->input_node) != PINOS_NODE_STATE_RUNNING)
|
||||
res = SPA_RESULT_RETURN_ASYNC (0);
|
||||
}
|
||||
|
||||
if (out_state == SPA_NODE_STATE_PAUSED)
|
||||
if (out_state == SPA_NODE_STATE_PAUSED) {
|
||||
pinos_node_set_state (this->output_node, PINOS_NODE_STATE_RUNNING);
|
||||
if (pinos_node_get_state (this->output_node) != PINOS_NODE_STATE_RUNNING)
|
||||
res = SPA_RESULT_RETURN_ASYNC (0);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
42
pinos/server/meson.build
Normal file
42
pinos/server/meson.build
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
pinoscore_headers = [
|
||||
'client.h',
|
||||
'client-node.h',
|
||||
'command.h',
|
||||
'daemon.h',
|
||||
'link.h',
|
||||
'module.h',
|
||||
'node.h',
|
||||
'node-factory.h',
|
||||
]
|
||||
|
||||
pinoscore_sources = [
|
||||
'client.c',
|
||||
'client-node.c',
|
||||
'command.c',
|
||||
'daemon.c',
|
||||
'link.c',
|
||||
'module.c',
|
||||
'node.c',
|
||||
'node-factory.c',
|
||||
]
|
||||
|
||||
libpinoscore_c_args = [
|
||||
'-DHAVE_CONFIG_H',
|
||||
'-D_GNU_SOURCE',
|
||||
]
|
||||
|
||||
|
||||
libpinoscore = shared_library('pinoscore', pinoscore_sources, gdbus_target,
|
||||
version : libversion,
|
||||
soversion : soversion,
|
||||
c_args : libpinoscore_c_args,
|
||||
include_directories : [configinc, spa_inc],
|
||||
link_with : spalib,
|
||||
install : true,
|
||||
dependencies : [gobject_dep, gmodule_dep, glib_dep, gio_dep, mathlib, dl_lib, pinos_dep],
|
||||
)
|
||||
|
||||
pinoscore_dep = declare_dependency(link_with : libpinoscore,
|
||||
include_directories : [configinc, spa_inc],
|
||||
dependencies : [glib_dep, gobject_dep, gmodule_dep, pinos_dep],
|
||||
)
|
||||
|
|
@ -25,6 +25,7 @@
|
|||
#include <glib.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "pinos/client/pinos.h"
|
||||
#include "pinos/server/module.h"
|
||||
|
||||
#define PINOS_SYMBOL_MODULE_INIT "pinos__module_init"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ typedef struct _PinosNodeFactory PinosNodeFactory;
|
|||
typedef struct _PinosNodeFactoryClass PinosNodeFactoryClass;
|
||||
typedef struct _PinosNodeFactoryPrivate PinosNodeFactoryPrivate;
|
||||
|
||||
#include <server/daemon.h>
|
||||
#include <pinos/server/daemon.h>
|
||||
|
||||
#define PINOS_TYPE_NODE_FACTORY (pinos_node_factory_get_type ())
|
||||
#define PINOS_IS_NODE_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PINOS_TYPE_NODE_FACTORY))
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ struct _PinosNodePrivate
|
|||
guint n_used_input_links;
|
||||
|
||||
SpaNodeEventAsyncComplete ac;
|
||||
uint32_t pending_state_seq;
|
||||
PinosNodeState pending_state;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (PinosNode, pinos_node, G_TYPE_OBJECT);
|
||||
|
|
@ -359,13 +361,20 @@ start_node (PinosNode *this)
|
|||
static SpaResult
|
||||
suspend_node (PinosNode *this)
|
||||
{
|
||||
SpaResult res;
|
||||
PinosNodePrivate *priv = this->priv;
|
||||
SpaResult res = SPA_RESULT_OK;
|
||||
guint i;
|
||||
|
||||
g_debug ("node %p: suspend node", this);
|
||||
|
||||
if ((res = spa_node_port_set_format (this->node, 0, 0, NULL)) < 0)
|
||||
g_warning ("error unset format output: %d", res);
|
||||
|
||||
for (i = 0; i < priv->n_input_ports; i++) {
|
||||
if ((res = spa_node_port_set_format (this->node, priv->input_port_ids[i], 0, NULL)) < 0)
|
||||
g_warning ("error unset format output: %d", res);
|
||||
}
|
||||
for (i = 0; i < priv->n_output_ports; i++) {
|
||||
if ((res = spa_node_port_set_format (this->node, priv->output_port_ids[i], 0, NULL)) < 0)
|
||||
g_warning ("error unset format output: %d", res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -404,6 +413,7 @@ static gboolean
|
|||
node_set_state (PinosNode *this,
|
||||
PinosNodeState state)
|
||||
{
|
||||
PinosNodePrivate *priv = this->priv;
|
||||
SpaResult res = SPA_RESULT_OK;
|
||||
|
||||
g_debug ("node %p: set state %s", this, pinos_node_state_as_string (state));
|
||||
|
|
@ -434,7 +444,12 @@ node_set_state (PinosNode *this,
|
|||
if (SPA_RESULT_IS_ERROR (res))
|
||||
return FALSE;
|
||||
|
||||
pinos_node_update_state (this, state);
|
||||
if (SPA_RESULT_IS_ASYNC (res)) {
|
||||
priv->pending_state_seq = SPA_RESULT_ASYNC_SEQ (res);
|
||||
priv->pending_state = state;
|
||||
} else {
|
||||
pinos_node_update_state (this, state);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -482,6 +497,9 @@ do_handle_async_complete (PinosNode *this)
|
|||
init_complete (this);
|
||||
priv->async_init = FALSE;
|
||||
}
|
||||
if (priv->pending_state_seq == ac->seq) {
|
||||
pinos_node_update_state (this, priv->pending_state);
|
||||
}
|
||||
g_signal_emit (this, signals[SIGNAL_ASYNC_COMPLETE], 0, ac->seq, ac->res);
|
||||
}
|
||||
|
||||
|
|
@ -1029,6 +1047,7 @@ pinos_node_init (PinosNode * node)
|
|||
(GCallback) handle_remove,
|
||||
node);
|
||||
priv->state = PINOS_NODE_STATE_CREATING;
|
||||
priv->pending_state_seq = SPA_ID_INVALID;
|
||||
pinos_node1_set_state (priv->iface, priv->state);
|
||||
|
||||
priv->input_links = g_array_new (FALSE, TRUE, sizeof (NodeLink));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue