client-stream: run the driver graph

This commit is contained in:
Wim Taymans 2018-10-02 07:11:45 +02:00
parent 32e4d676b4
commit 575e177a48
2 changed files with 18 additions and 9 deletions

View file

@ -32,10 +32,7 @@
#include <spa/buffer/alloc.h>
#include <spa/pod/parser.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/interfaces.h"
#include "pipewire/control.h"
@ -45,6 +42,14 @@
#include "client-node.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 */
struct node {
@ -881,6 +886,7 @@ static void client_node_initialized(void *data)
exclusive = false;
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);
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)
{
struct impl *impl = data;
pw_log_debug("client-stream %p: driver changed %p", &impl->this, driver);
impl->client_node->node->driver_node = driver;
}

View file

@ -762,17 +762,19 @@ static void node_event(void *data, struct spa_event *event)
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);
pw_log_trace("node %p: process driver:%d exported:%d", node,
node->driver, node->exported);
driver = node->driver_node;
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 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);
}
@ -793,7 +795,7 @@ static void node_process(void *data, int status)
q->nsec, q->rate.num, q->rate.denom,
q->position, q->delay, q->size);
spa_graph_run(node->rt.driver);
spa_graph_run(driver->rt.driver);
impl->next_position += q->size;
}