mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
node: improve async handling
Remove the done and error callbacks. The error callback is in an error message. The done callback is replace with spa_pending. Make enum_params take a callback and data for the results. This allows us to push the results one after another to the app and avoids ownership issues of the passed data. We can then extend this to handle the async case by doing a _wait call with a spa_pending+callback+data that will be called when the _enum_params returns and async result. Add a sync method. All methods can now return SPA_RESULT_IS_ASYNC return values and you can use spa_node_wait() to register a callback when they complete with optional extra parameters. This makes it easier to sync and handle the reply. Make helper methods to simulate the sync enum_params behaviour for sync nodes. Let the transport generate the sequence number for pw_resource_sync() and pw_proxy_sync(). That way we don't need to keep track of numbers ourselves and we can match the reply to the request easily.
This commit is contained in:
parent
b743518f78
commit
7b12212eeb
67 changed files with 1894 additions and 1209 deletions
|
|
@ -30,6 +30,7 @@
|
|||
#include <spa/param/props.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/control/control.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/debug/format.h>
|
||||
#include <spa/debug/pod.h>
|
||||
|
||||
|
|
@ -179,36 +180,24 @@ static int impl_port_set_io(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int port_enum_formats(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t *index,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **result,
|
||||
struct spa_pod_builder *builder)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
SDL_RendererInfo info;
|
||||
|
||||
if (*index != 0)
|
||||
return 0;
|
||||
|
||||
SDL_GetRendererInfo(d->renderer, &info);
|
||||
*result = sdl_build_formats(&info, builder);
|
||||
|
||||
(*index)++;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int impl_port_enum_params(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t *index,
|
||||
uint32_t id, uint32_t start, uint32_t num,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **result,
|
||||
struct spa_pod_builder *builder)
|
||||
spa_result_func_t func, void *data)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
struct spa_pod *param;
|
||||
struct spa_pod_builder b = { 0 };
|
||||
uint8_t buffer[1024];
|
||||
struct spa_result_node_enum_params result;
|
||||
uint32_t count = 0;
|
||||
int res;
|
||||
|
||||
result.next = start;
|
||||
|
||||
next:
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_PARAM_List:
|
||||
|
|
@ -219,28 +208,36 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_add_object(builder,
|
||||
if (result.next < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamList, id,
|
||||
SPA_PARAM_LIST_id, SPA_POD_Id(list[*index]));
|
||||
SPA_PARAM_LIST_id, SPA_POD_Id(list[result.next]));
|
||||
else
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
{
|
||||
SDL_RendererInfo info;
|
||||
|
||||
case SPA_PARAM_Format:
|
||||
if (*index != 0 || d->format.format == 0)
|
||||
if (result.next != 0)
|
||||
return 0;
|
||||
param = spa_format_video_raw_build(builder, id, &d->format);
|
||||
|
||||
SDL_GetRendererInfo(d->renderer, &info);
|
||||
param = sdl_build_formats(&info, &b);
|
||||
break;
|
||||
}
|
||||
case SPA_PARAM_Format:
|
||||
if (result.next != 0 || d->format.format == 0)
|
||||
return 0;
|
||||
param = spa_format_video_raw_build(&b, id, &d->format);
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Buffers:
|
||||
if (*index != 0)
|
||||
if (result.next != 0)
|
||||
return 0;
|
||||
|
||||
param = spa_pod_builder_add_object(builder,
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, id,
|
||||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 2, MAX_BUFFERS),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
|
|
@ -250,15 +247,15 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
switch (*index) {
|
||||
switch (result.next) {
|
||||
case 0:
|
||||
param = spa_pod_builder_add_object(builder,
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamMeta, id,
|
||||
SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header),
|
||||
SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)));
|
||||
break;
|
||||
case 1:
|
||||
param = spa_pod_builder_add_object(builder,
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamMeta, id,
|
||||
SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoDamage),
|
||||
SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_region)));
|
||||
|
|
@ -269,15 +266,15 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
break;
|
||||
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
switch (result.next) {
|
||||
case 0:
|
||||
param = spa_pod_builder_add_object(builder,
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamIO, id,
|
||||
SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Buffers),
|
||||
SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_buffers)));
|
||||
break;
|
||||
case 1:
|
||||
param = spa_pod_builder_add_object(builder,
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamIO, id,
|
||||
SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Notify),
|
||||
SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_sequence) + 1024));
|
||||
|
|
@ -289,12 +286,18 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
default:
|
||||
return -ENOENT;
|
||||
}
|
||||
result.next++;
|
||||
|
||||
(*index)++;
|
||||
if (spa_pod_filter(&b, &result.param, param, filter) < 0)
|
||||
goto next;
|
||||
|
||||
*result = param;
|
||||
if ((res = func(data, count, 1, &result)) != 0)
|
||||
return res;
|
||||
|
||||
return 1;
|
||||
if (++count != num)
|
||||
goto next;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int port_set_format(struct spa_node *node,
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/debug/format.h>
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
|
|
@ -147,43 +148,24 @@ static int impl_port_set_io(struct spa_node *node, enum spa_direction direction,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int port_enum_formats(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t *index,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **param,
|
||||
struct spa_pod_builder *builder)
|
||||
{
|
||||
if (*index != 0)
|
||||
return 0;
|
||||
|
||||
*param = spa_pod_builder_add_object(builder,
|
||||
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
|
||||
SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_audio),
|
||||
SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw),
|
||||
SPA_FORMAT_AUDIO_format, SPA_POD_CHOICE_ENUM_Id(5,
|
||||
SPA_AUDIO_FORMAT_S16,
|
||||
SPA_AUDIO_FORMAT_S16P,
|
||||
SPA_AUDIO_FORMAT_S16,
|
||||
SPA_AUDIO_FORMAT_F32P,
|
||||
SPA_AUDIO_FORMAT_F32),
|
||||
SPA_FORMAT_AUDIO_channels, SPA_POD_CHOICE_RANGE_Int(2, 1, INT32_MAX),
|
||||
SPA_FORMAT_AUDIO_rate, SPA_POD_CHOICE_RANGE_Int(44100, 1, INT32_MAX));
|
||||
|
||||
(*index)++;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int impl_port_enum_params(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t *index,
|
||||
uint32_t id, uint32_t start, uint32_t num,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **result,
|
||||
struct spa_pod_builder *builder)
|
||||
spa_result_func_t func, void *data)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
struct spa_pod *param;
|
||||
struct spa_pod_builder b = { 0 };
|
||||
uint8_t buffer[1024];
|
||||
struct spa_result_node_enum_params result;
|
||||
uint32_t count = 0;
|
||||
int res;
|
||||
|
||||
result.next = start;
|
||||
|
||||
next:
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_PARAM_List:
|
||||
|
|
@ -194,30 +176,45 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_add_object(builder,
|
||||
if (result.next < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamList, id,
|
||||
SPA_PARAM_LIST_id, SPA_POD_Id(list[*index]));
|
||||
SPA_PARAM_LIST_id, SPA_POD_Id(list[result.next]));
|
||||
else
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
if (result.next != 0)
|
||||
return 0;
|
||||
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
|
||||
SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_audio),
|
||||
SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw),
|
||||
SPA_FORMAT_AUDIO_format, SPA_POD_CHOICE_ENUM_Id(5,
|
||||
SPA_AUDIO_FORMAT_S16,
|
||||
SPA_AUDIO_FORMAT_S16P,
|
||||
SPA_AUDIO_FORMAT_S16,
|
||||
SPA_AUDIO_FORMAT_F32P,
|
||||
SPA_AUDIO_FORMAT_F32),
|
||||
SPA_FORMAT_AUDIO_channels, SPA_POD_CHOICE_RANGE_Int(2, 1, INT32_MAX),
|
||||
SPA_FORMAT_AUDIO_rate, SPA_POD_CHOICE_RANGE_Int(44100, 1, INT32_MAX));
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Format:
|
||||
if (*index != 0)
|
||||
if (result.next != 0)
|
||||
return 0;
|
||||
if (d->format.format == 0)
|
||||
return 0;
|
||||
param = spa_format_audio_raw_build(builder, id, &d->format);
|
||||
param = spa_format_audio_raw_build(&b, id, &d->format);
|
||||
break;
|
||||
|
||||
case SPA_PARAM_Buffers:
|
||||
if (*index > 0)
|
||||
if (result.next > 0)
|
||||
return 0;
|
||||
|
||||
param = spa_pod_builder_add_object(builder,
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, id,
|
||||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(1, 1, 32),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
|
|
@ -227,9 +224,9 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
switch (*index) {
|
||||
switch (result.next) {
|
||||
case 0:
|
||||
param = spa_pod_builder_add_object(builder,
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamMeta, id,
|
||||
SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header),
|
||||
SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)));
|
||||
|
|
@ -239,15 +236,15 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
switch (result.next) {
|
||||
case 0:
|
||||
param = spa_pod_builder_add_object(builder,
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamIO, id,
|
||||
SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Buffers),
|
||||
SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_buffers)));
|
||||
break;
|
||||
case 1:
|
||||
param = spa_pod_builder_add_object(builder,
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamIO, id,
|
||||
SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Notify),
|
||||
SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_sequence) + 1024));
|
||||
|
|
@ -260,10 +257,18 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
(*index)++;
|
||||
*result = param;
|
||||
result.next++;
|
||||
|
||||
return 1;
|
||||
if (spa_pod_filter(&b, &result.param, param, filter) < 0)
|
||||
goto next;
|
||||
|
||||
if ((res = func(data, count, 1, &result)) != 0)
|
||||
return res;
|
||||
|
||||
if (++count != num)
|
||||
goto next;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int port_set_format(struct spa_node *node,
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include <spa/param/video/format-utils.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/debug/format.h>
|
||||
|
||||
|
|
@ -121,45 +122,42 @@ static int impl_port_set_io(struct spa_node *node, enum spa_direction direction,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int port_enum_formats(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t *index,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **result,
|
||||
struct spa_pod_builder *builder)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
SDL_RendererInfo info;
|
||||
|
||||
if (*index != 0)
|
||||
return 0;
|
||||
|
||||
SDL_GetRendererInfo(d->renderer, &info);
|
||||
*result = sdl_build_formats(&info, builder);
|
||||
|
||||
(*index)++;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int impl_port_enum_params(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t *index,
|
||||
uint32_t id, uint32_t start, uint32_t num,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **result,
|
||||
struct spa_pod_builder *builder)
|
||||
spa_result_func_t func, void *data)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
struct spa_pod *param;
|
||||
struct spa_pod_builder b = { 0 };
|
||||
uint8_t buffer[1024];
|
||||
struct spa_result_node_enum_params result;
|
||||
uint32_t count = 0;
|
||||
int res;
|
||||
|
||||
result.next = start;
|
||||
|
||||
next:
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
{
|
||||
SDL_RendererInfo info;
|
||||
|
||||
case SPA_PARAM_Buffers:
|
||||
if (*index > 0)
|
||||
if (result.next > 0)
|
||||
return 0;
|
||||
|
||||
*result = spa_pod_builder_add_object(builder,
|
||||
SDL_GetRendererInfo(d->renderer, &info);
|
||||
param = sdl_build_formats(&info, &b);
|
||||
break;
|
||||
}
|
||||
case SPA_PARAM_Buffers:
|
||||
if (result.next > 0)
|
||||
return 0;
|
||||
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, id,
|
||||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, 32),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
|
||||
|
|
@ -169,10 +167,10 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
break;
|
||||
|
||||
case SPA_PARAM_Meta:
|
||||
if (*index > 0)
|
||||
if (result.next > 0)
|
||||
return 0;
|
||||
|
||||
*result = spa_pod_builder_add_object(builder,
|
||||
param = spa_pod_builder_add_object(&b,
|
||||
SPA_TYPE_OBJECT_ParamMeta, id,
|
||||
SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header),
|
||||
SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)));
|
||||
|
|
@ -182,8 +180,18 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
(*index)++;
|
||||
return 1;
|
||||
result.next++;
|
||||
|
||||
if (spa_pod_filter(&b, &result.param, param, filter) < 0)
|
||||
goto next;
|
||||
|
||||
if ((res = func(data, count, 1, &result)) != 0)
|
||||
return res;
|
||||
|
||||
if (++count != num)
|
||||
goto next;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int port_set_format(struct spa_node *node, enum spa_direction direction, uint32_t port_id,
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ static void *find_object(struct impl *impl, uint32_t id)
|
|||
static void schedule_rescan(struct impl *impl)
|
||||
{
|
||||
if (impl->core_proxy)
|
||||
pw_core_proxy_sync(impl->core_proxy, 0, ++impl->seq);
|
||||
impl->seq = pw_core_proxy_sync(impl->core_proxy, 0);
|
||||
}
|
||||
|
||||
static void remove_idle_timeout(struct session *sess)
|
||||
|
|
@ -574,7 +574,8 @@ handle_node(struct impl *impl, uint32_t id, uint32_t parent_id,
|
|||
node->type = NODE_TYPE_DEVICE;
|
||||
node->manager = sess;
|
||||
|
||||
pw_log_debug(NAME" %p: new session for device node %d", impl, id);
|
||||
pw_log_debug(NAME" %p: new session for device node %d %d", impl, id,
|
||||
need_dsp);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -687,14 +688,15 @@ handle_port(struct impl *impl, uint32_t id, uint32_t parent_id, uint32_t type,
|
|||
|
||||
spa_list_append(&node->port_list, &port->l);
|
||||
|
||||
pw_log_debug(NAME" %p: new port %d for node %d type %d %08x", impl, id, parent_id,
|
||||
node->type, port->flags);
|
||||
|
||||
if (node->type == NODE_TYPE_DEVICE) {
|
||||
pw_port_proxy_enum_params((struct pw_port_proxy*)p,
|
||||
SPA_PARAM_EnumFormat,
|
||||
0, -1, NULL);
|
||||
}
|
||||
|
||||
pw_log_debug(NAME" %p: new port %d for node %d type %d %08x", impl, id, parent_id,
|
||||
node->type, port->flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1240,12 +1242,16 @@ static void rescan_session(struct impl *impl, struct session *sess)
|
|||
struct spa_pod *param;
|
||||
const char *str;
|
||||
|
||||
if (node->info->props == NULL)
|
||||
if (node->info->props == NULL) {
|
||||
pw_log_debug(NAME " %p: node %p has no properties", impl, node);
|
||||
return;
|
||||
}
|
||||
|
||||
if (node->media_type != SPA_MEDIA_TYPE_audio ||
|
||||
node->media_subtype != SPA_MEDIA_SUBTYPE_raw)
|
||||
node->media_subtype != SPA_MEDIA_SUBTYPE_raw) {
|
||||
pw_log_debug(NAME " %p: node %p has no media type", impl, node);
|
||||
return;
|
||||
}
|
||||
|
||||
info = node->format;
|
||||
|
||||
|
|
@ -1290,6 +1296,7 @@ static void do_rescan(struct impl *impl)
|
|||
struct node *node;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &impl->now);
|
||||
pw_log_debug("media-session %p: do rescan", impl);
|
||||
|
||||
spa_list_for_each(sess, &impl->session_list, l)
|
||||
rescan_session(impl, sess);
|
||||
|
|
@ -1300,6 +1307,7 @@ static void do_rescan(struct impl *impl)
|
|||
static int core_done(void *data, uint32_t id, uint32_t seq)
|
||||
{
|
||||
struct impl *impl = data;
|
||||
pw_log_debug("media-session %p: sync %d %u/%u", impl, id, seq, impl->seq);
|
||||
if (impl->seq == seq)
|
||||
do_rescan(impl);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue