mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
client-stream: run the driver graph
This commit is contained in:
parent
32e4d676b4
commit
575e177a48
2 changed files with 18 additions and 9 deletions
|
|
@ -32,10 +32,7 @@
|
||||||
#include <spa/buffer/alloc.h>
|
#include <spa/buffer/alloc.h>
|
||||||
#include <spa/pod/parser.h>
|
#include <spa/pod/parser.h>
|
||||||
#include <spa/param/audio/format-utils.h>
|
#include <spa/param/audio/format-utils.h>
|
||||||
#include <spa/debug/pod.h>
|
|
||||||
#include <spa/debug/format.h>
|
|
||||||
|
|
||||||
#include "pipewire/core.h"
|
|
||||||
#include "pipewire/pipewire.h"
|
#include "pipewire/pipewire.h"
|
||||||
#include "pipewire/interfaces.h"
|
#include "pipewire/interfaces.h"
|
||||||
#include "pipewire/control.h"
|
#include "pipewire/control.h"
|
||||||
|
|
@ -45,6 +42,14 @@
|
||||||
#include "client-node.h"
|
#include "client-node.h"
|
||||||
#include "client-stream.h"
|
#include "client-stream.h"
|
||||||
|
|
||||||
|
#ifndef spa_debug
|
||||||
|
#define spa_debug pw_log_trace
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <spa/debug/pod.h>
|
||||||
|
#include <spa/debug/format.h>
|
||||||
|
|
||||||
|
#include "pipewire/core.h"
|
||||||
/** \cond */
|
/** \cond */
|
||||||
|
|
||||||
struct node {
|
struct node {
|
||||||
|
|
@ -881,6 +886,7 @@ static void client_node_initialized(void *data)
|
||||||
exclusive = false;
|
exclusive = false;
|
||||||
|
|
||||||
spa_graph_node_add(impl->client_node->node->rt.driver, &impl->client_node->node->rt.root);
|
spa_graph_node_add(impl->client_node->node->rt.driver, &impl->client_node->node->rt.root);
|
||||||
|
impl->client_node->node->driver_node = impl->this.node;
|
||||||
|
|
||||||
impl->client_port = pw_node_find_port(impl->client_node->node, impl->direction, 0);
|
impl->client_port = pw_node_find_port(impl->client_node->node, impl->direction, 0);
|
||||||
if (impl->client_port == NULL)
|
if (impl->client_port == NULL)
|
||||||
|
|
@ -1064,6 +1070,7 @@ static void node_initialized(void *data)
|
||||||
static void node_driver_changed(void *data, struct pw_node *driver)
|
static void node_driver_changed(void *data, struct pw_node *driver)
|
||||||
{
|
{
|
||||||
struct impl *impl = data;
|
struct impl *impl = data;
|
||||||
|
pw_log_debug("client-stream %p: driver changed %p", &impl->this, driver);
|
||||||
impl->client_node->node->driver_node = driver;
|
impl->client_node->node->driver_node = driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -762,17 +762,19 @@ static void node_event(void *data, struct spa_event *event)
|
||||||
|
|
||||||
static void node_process(void *data, int status)
|
static void node_process(void *data, int status)
|
||||||
{
|
{
|
||||||
struct pw_node *node = data;
|
struct pw_node *node = data, *driver;
|
||||||
struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this);
|
struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this);
|
||||||
|
|
||||||
pw_log_trace("node %p: process driver:%d exported:%d", node,
|
driver = node->driver_node;
|
||||||
node->driver, node->exported);
|
|
||||||
|
|
||||||
if (node->driver && (node->rt.driver->state->pending == 0 || !node->remote)) {
|
pw_log_trace("node %p: process driver:%d exported:%d %p", node,
|
||||||
|
node->driver, node->exported, driver->rt.driver);
|
||||||
|
|
||||||
|
if (node->driver && (driver->rt.driver->state->pending == 0 || !node->remote)) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
struct pw_driver_quantum *q = node->rt.quantum;
|
struct pw_driver_quantum *q = node->rt.quantum;
|
||||||
|
|
||||||
if (node->rt.driver->state->pending != 0) {
|
if (driver->rt.driver->state->pending != 0) {
|
||||||
pw_log_warn("node %p: graph not finished", node);
|
pw_log_warn("node %p: graph not finished", node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -793,7 +795,7 @@ static void node_process(void *data, int status)
|
||||||
q->nsec, q->rate.num, q->rate.denom,
|
q->nsec, q->rate.num, q->rate.denom,
|
||||||
q->position, q->delay, q->size);
|
q->position, q->delay, q->size);
|
||||||
|
|
||||||
spa_graph_run(node->rt.driver);
|
spa_graph_run(driver->rt.driver);
|
||||||
|
|
||||||
impl->next_position += q->size;
|
impl->next_position += q->size;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue