mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
module-session-manager: use dynamic builder
The buffer is very small and we should use a dynamic builder if we don't know what pod we will expect.
This commit is contained in:
parent
bbf8f1a0c8
commit
0b2d9ee007
8 changed files with 88 additions and 80 deletions
|
|
@ -10,6 +10,7 @@
|
|||
#include <spa/utils/result.h>
|
||||
#include <spa/pod/builder.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/pod/dynamic.h>
|
||||
|
||||
#define MAX_PARAMS 32
|
||||
|
||||
|
|
@ -84,8 +85,8 @@ static int method_enum_params(void *object, int seq,
|
|||
struct param_data *pdata;
|
||||
struct spa_pod *result;
|
||||
struct spa_pod *param;
|
||||
uint8_t buffer[1024];
|
||||
struct spa_pod_builder b = { 0 };
|
||||
uint8_t buffer[2048];
|
||||
struct spa_pod_dynamic_builder b = { 0 };
|
||||
uint32_t index;
|
||||
uint32_t next = start;
|
||||
uint32_t count = 0;
|
||||
|
|
@ -103,15 +104,15 @@ static int method_enum_params(void *object, int seq,
|
|||
|
||||
param = *pw_array_get_unchecked(&pdata->params, index, struct spa_pod*);
|
||||
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
if (spa_pod_filter(&b, &result, param, filter) != 0)
|
||||
continue;
|
||||
spa_pod_dynamic_builder_init(&b, buffer, sizeof(buffer), 4096);
|
||||
if (spa_pod_filter(&b.b, &result, param, filter) == 0) {
|
||||
pw_log_debug(NAME" %p: %d param %u", impl, seq, index);
|
||||
pw_endpoint_stream_resource_param(d->resource, seq, id, index, next, result);
|
||||
count++;
|
||||
}
|
||||
spa_pod_dynamic_builder_clean(&b);
|
||||
|
||||
pw_log_debug(NAME" %p: %d param %u", impl, seq, index);
|
||||
|
||||
pw_endpoint_stream_resource_param(d->resource, seq, id, index, next, result);
|
||||
|
||||
if (++count == num)
|
||||
if (count == num)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue