mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
Improve enum_param
Add an argument to pass the result param to the caller instead of having the caller have to pick it up from the builder. Improve docs for node, clock and monitor Pass spa_pod everywhere instead of spa_pod_object. Pass result argument to spa_pod_filter to make things a little nicer.
This commit is contained in:
parent
cd5e697e9f
commit
440f681f4b
70 changed files with 872 additions and 858 deletions
|
|
@ -239,7 +239,8 @@ static int impl_port_get_info(struct spa_node *node, enum spa_direction directio
|
|||
static int port_enum_formats(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
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);
|
||||
|
|
@ -284,7 +285,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
2, &SPA_FRACTION(0,1),
|
||||
&SPA_FRACTION(30,1),
|
||||
NULL);
|
||||
spa_pod_builder_pop(builder);
|
||||
*result = spa_pod_builder_pop(builder);
|
||||
|
||||
(*index)++;
|
||||
|
||||
|
|
@ -294,7 +295,8 @@ static int port_enum_formats(struct spa_node *node,
|
|||
static int port_get_format(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
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);
|
||||
|
|
@ -302,7 +304,7 @@ static int port_get_format(struct spa_node *node,
|
|||
if (*index != 0 || d->format.format == 0)
|
||||
return 0;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
*result = spa_pod_builder_object(builder,
|
||||
d->t->param.idFormat, d->type.format,
|
||||
"I", d->type.media_type.video,
|
||||
"I", d->type.media_subtype.raw,
|
||||
|
|
@ -318,11 +320,13 @@ static int port_get_format(struct spa_node *node,
|
|||
static int impl_port_enum_params(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
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);
|
||||
struct pw_type *t = d->t;
|
||||
struct spa_pod *param;
|
||||
|
||||
if (id == t->param.idList) {
|
||||
uint32_t list[] = { t->param.idEnumFormat,
|
||||
|
|
@ -331,23 +335,23 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
t->param.idMeta };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
spa_pod_builder_object(builder,
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, t->param.List,
|
||||
":", t->param.listId, "I", list[*index]);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else if (id == t->param.idEnumFormat) {
|
||||
return port_enum_formats(node, direction, port_id, index, filter, builder);
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
}
|
||||
else if (id == t->param.idFormat) {
|
||||
return port_get_format(node, direction, port_id, index, filter, builder);
|
||||
return port_get_format(node, direction, port_id, index, filter, result, builder);
|
||||
}
|
||||
else if (id == t->param.idBuffers) {
|
||||
if (*index != 0)
|
||||
return 0;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, t->param_buffers.Buffers,
|
||||
":", t->param_buffers.size, "i", d->stride * d->format.size.height,
|
||||
":", t->param_buffers.stride, "i", d->stride,
|
||||
|
|
@ -359,7 +363,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
if (*index != 0)
|
||||
return 0;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
|
|
@ -369,12 +373,14 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
|
||||
(*index)++;
|
||||
|
||||
*result = param;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int port_set_format(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t flags, const struct spa_pod_object *format)
|
||||
uint32_t flags, const struct spa_pod *format)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
Uint32 sdl_format;
|
||||
|
|
@ -383,7 +389,7 @@ static int port_set_format(struct spa_node *node,
|
|||
if (format == NULL)
|
||||
return 0;
|
||||
|
||||
spa_debug_pod(&format->pod, SPA_DEBUG_FLAG_FORMAT);
|
||||
spa_debug_pod(format, SPA_DEBUG_FLAG_FORMAT);
|
||||
|
||||
spa_format_video_raw_parse(format, &d->format, &d->type.format_video);
|
||||
|
||||
|
|
@ -405,7 +411,7 @@ static int port_set_format(struct spa_node *node,
|
|||
static int impl_port_set_param(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
struct pw_type *t = d->t;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,8 @@ static int impl_port_get_info(struct spa_node *node, enum spa_direction directio
|
|||
static int port_enum_formats(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **param,
|
||||
struct spa_pod_builder *builder)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
|
|
@ -164,7 +165,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
if (*index != 0)
|
||||
return 0;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
*param = spa_pod_builder_object(builder,
|
||||
d->t->param.idEnumFormat, d->type.format,
|
||||
"I", d->type.media_type.audio,
|
||||
"I", d->type.media_subtype.raw,
|
||||
|
|
@ -180,7 +181,8 @@ static int port_enum_formats(struct spa_node *node,
|
|||
static int port_get_format(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **param,
|
||||
struct spa_pod_builder *builder)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
|
|
@ -191,7 +193,7 @@ static int port_get_format(struct spa_node *node,
|
|||
if (d->format.format == 0)
|
||||
return 0;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
*param = spa_pod_builder_object(builder,
|
||||
d->t->param.idFormat, d->type.format,
|
||||
"I", d->type.media_type.audio,
|
||||
"I", d->type.media_subtype.raw,
|
||||
|
|
@ -207,11 +209,13 @@ static int port_get_format(struct spa_node *node,
|
|||
static int impl_port_enum_params(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
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);
|
||||
struct pw_type *t = d->t;
|
||||
struct spa_pod *param;
|
||||
|
||||
if (id == t->param.idList) {
|
||||
uint32_t list[] = { t->param.idEnumFormat,
|
||||
|
|
@ -220,23 +224,23 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
t->param.idMeta };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
spa_pod_builder_object(builder,
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, t->param.List,
|
||||
":", t->param.listId, "I", list[*index]);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else if (id == t->param.idEnumFormat) {
|
||||
return port_enum_formats(node, direction, port_id, index, filter, builder);
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
}
|
||||
else if (id == t->param.idFormat) {
|
||||
return port_get_format(node, direction, port_id, index, filter, builder);
|
||||
return port_get_format(node, direction, port_id, index, filter, result, builder);
|
||||
}
|
||||
else if (id == t->param.idBuffers) {
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, t->param_buffers.Buffers,
|
||||
":", t->param_buffers.size, "iru", 1024,
|
||||
2, 32, 4096,
|
||||
|
|
@ -248,13 +252,13 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
else if (id == t->param.idMeta) {
|
||||
switch (*index) {
|
||||
case 0:
|
||||
spa_pod_builder_object(builder,
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
break;
|
||||
case 1:
|
||||
spa_pod_builder_object(builder,
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Ringbuffer,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_ringbuffer),
|
||||
|
|
@ -272,13 +276,14 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return -ENOENT;
|
||||
|
||||
(*index)++;
|
||||
*result = param;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int port_set_format(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t flags, const struct spa_pod_object *format)
|
||||
uint32_t flags, const struct spa_pod *format)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
|
||||
|
|
@ -287,7 +292,7 @@ static int port_set_format(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
|
||||
spa_debug_pod(&format->pod, SPA_DEBUG_FLAG_FORMAT);
|
||||
spa_debug_pod(format, SPA_DEBUG_FLAG_FORMAT);
|
||||
|
||||
if (spa_format_audio_raw_parse(format, &d->format, &d->type.format_audio) < 0)
|
||||
return -EINVAL;
|
||||
|
|
@ -301,7 +306,7 @@ static int port_set_format(struct spa_node *node,
|
|||
static int impl_port_set_param(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
struct pw_type *t = d->t;
|
||||
|
|
|
|||
|
|
@ -234,7 +234,8 @@ static int impl_port_get_info(struct spa_node *node, enum spa_direction directio
|
|||
static int port_enum_formats(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
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);
|
||||
|
|
@ -280,7 +281,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
2, &SPA_FRACTION(0,1),
|
||||
&SPA_FRACTION(30,1),
|
||||
NULL);
|
||||
spa_pod_builder_pop(builder);
|
||||
*result = spa_pod_builder_pop(builder);
|
||||
|
||||
(*index)++;
|
||||
|
||||
|
|
@ -290,20 +291,21 @@ static int port_enum_formats(struct spa_node *node,
|
|||
static int impl_port_enum_params(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
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);
|
||||
struct pw_type *t = d->t;
|
||||
|
||||
if (id == t->param.idEnumFormat) {
|
||||
return port_enum_formats(node, direction, port_id, index, filter, builder);
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
}
|
||||
else if (id == t->param.idBuffers) {
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
*result = spa_pod_builder_object(builder,
|
||||
id, t->param_buffers.Buffers,
|
||||
":", t->param_buffers.size, "i", d->stride * d->format.size.height,
|
||||
":", t->param_buffers.stride, "i", d->stride,
|
||||
|
|
@ -315,7 +317,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
spa_pod_builder_object(builder,
|
||||
*result = spa_pod_builder_object(builder,
|
||||
id, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
|
|
@ -328,7 +330,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
}
|
||||
|
||||
static int port_set_format(struct spa_node *node, enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t flags, const struct spa_pod_object *format)
|
||||
uint32_t flags, const struct spa_pod *format)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
Uint32 sdl_format;
|
||||
|
|
@ -337,7 +339,7 @@ static int port_set_format(struct spa_node *node, enum spa_direction direction,
|
|||
if (format == NULL)
|
||||
return 0;
|
||||
|
||||
spa_debug_pod(&format->pod, SPA_DEBUG_FLAG_FORMAT);
|
||||
spa_debug_pod(format, SPA_DEBUG_FLAG_FORMAT);
|
||||
|
||||
spa_format_video_raw_parse(format, &d->format, &d->type.format_video);
|
||||
|
||||
|
|
@ -359,7 +361,7 @@ static int port_set_format(struct spa_node *node, enum spa_direction direction,
|
|||
static int impl_port_set_param(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
struct pw_type *t = d->t;
|
||||
|
|
|
|||
|
|
@ -234,14 +234,14 @@ static Uint32 id_to_sdl_format(struct data *data, uint32_t id)
|
|||
}
|
||||
|
||||
static void
|
||||
on_stream_format_changed(void *_data, struct spa_pod_object *format)
|
||||
on_stream_format_changed(void *_data, struct spa_pod *format)
|
||||
{
|
||||
struct data *data = _data;
|
||||
struct pw_stream *stream = data->stream;
|
||||
struct pw_type *t = data->t;
|
||||
uint8_t params_buffer[1024];
|
||||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(params_buffer, sizeof(params_buffer));
|
||||
struct spa_pod_object *params[2];
|
||||
struct spa_pod *params[2];
|
||||
Uint32 sdl_format;
|
||||
void *d;
|
||||
|
||||
|
|
@ -302,7 +302,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
|
|||
|
||||
case PW_REMOTE_STATE_CONNECTED:
|
||||
{
|
||||
const struct spa_pod_object *params[1];
|
||||
const struct spa_pod *params[1];
|
||||
uint8_t buffer[1024];
|
||||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
|
||||
SDL_RendererInfo info;
|
||||
|
|
@ -351,7 +351,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
|
|||
params[0] = spa_pod_builder_pop(&b);
|
||||
|
||||
printf("supported formats:\n");
|
||||
spa_debug_pod(¶ms[0]->pod, SPA_DEBUG_FLAG_FORMAT);
|
||||
spa_debug_pod(params[0], SPA_DEBUG_FLAG_FORMAT);
|
||||
|
||||
pw_stream_add_listener(data->stream,
|
||||
&data->stream_listener,
|
||||
|
|
|
|||
|
|
@ -166,14 +166,14 @@ static void on_stream_state_changed(void *_data, enum pw_stream_state old, enum
|
|||
}
|
||||
|
||||
static void
|
||||
on_stream_format_changed(void *_data, struct spa_pod_object *format)
|
||||
on_stream_format_changed(void *_data, struct spa_pod *format)
|
||||
{
|
||||
struct data *data = _data;
|
||||
struct pw_stream *stream = data->stream;
|
||||
struct pw_type *t = data->t;
|
||||
uint8_t params_buffer[1024];
|
||||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(params_buffer, sizeof(params_buffer));
|
||||
struct spa_pod_object *params[2];
|
||||
struct spa_pod *params[2];
|
||||
|
||||
if (format == NULL) {
|
||||
pw_stream_finish_format(stream, 0, 0, NULL);
|
||||
|
|
@ -218,7 +218,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
|
|||
|
||||
case PW_REMOTE_STATE_CONNECTED:
|
||||
{
|
||||
const struct spa_pod_object *params[1];
|
||||
const struct spa_pod *params[1];
|
||||
uint8_t buffer[1024];
|
||||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
|
||||
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ struct pw_client_node_proxy_methods {
|
|||
uint32_t max_input_ports,
|
||||
uint32_t max_output_ports,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod_object **params);
|
||||
const struct spa_pod **params);
|
||||
|
||||
/**
|
||||
* Update a node port
|
||||
|
|
@ -215,7 +215,7 @@ struct pw_client_node_proxy_methods {
|
|||
#define PW_CLIENT_NODE_PORT_UPDATE_INFO (1 << 1)
|
||||
uint32_t change_mask,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod_object **params,
|
||||
const struct spa_pod **params,
|
||||
const struct spa_port_info *info);
|
||||
/**
|
||||
* Activate or deactivate the node
|
||||
|
|
@ -244,7 +244,7 @@ pw_client_node_proxy_update(struct pw_client_node_proxy *p,
|
|||
uint32_t max_input_ports,
|
||||
uint32_t max_output_ports,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod_object **params)
|
||||
const struct spa_pod **params)
|
||||
{
|
||||
pw_proxy_do((struct pw_proxy*)p, struct pw_client_node_proxy_methods, update, change_mask,
|
||||
max_input_ports,
|
||||
|
|
@ -259,7 +259,7 @@ pw_client_node_proxy_port_update(struct pw_client_node_proxy *p,
|
|||
uint32_t port_id,
|
||||
uint32_t change_mask,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod_object **params,
|
||||
const struct spa_pod **params,
|
||||
const struct spa_port_info *info)
|
||||
{
|
||||
pw_proxy_do((struct pw_proxy*)p, struct pw_client_node_proxy_methods, port_update, direction,
|
||||
|
|
@ -334,7 +334,7 @@ struct pw_client_node_proxy_events {
|
|||
*/
|
||||
void (*set_param) (void *object, uint32_t seq,
|
||||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param);
|
||||
const struct spa_pod *param);
|
||||
/**
|
||||
* Receive an event from the client node
|
||||
* \param event the received event */
|
||||
|
|
@ -386,7 +386,7 @@ struct pw_client_node_proxy_events {
|
|||
enum spa_direction direction,
|
||||
uint32_t port_id,
|
||||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param);
|
||||
const struct spa_pod *param);
|
||||
/**
|
||||
* Memory was added for a port
|
||||
*
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ new_node (GstPipeWireDeviceProvider *self, const struct pw_node_info *info, uint
|
|||
type = GST_PIPEWIRE_DEVICE_TYPE_SINK;
|
||||
|
||||
for (i = 0; i < info->n_input_params; i++) {
|
||||
if (info->input_params[i]->body.id != t->param.idEnumFormat)
|
||||
if (!spa_pod_is_object_id(info->input_params[i], t->param.idEnumFormat))
|
||||
continue;
|
||||
GstCaps *c1 = gst_caps_from_format (info->input_params[i], t->map);
|
||||
if (c1)
|
||||
|
|
@ -218,7 +218,7 @@ new_node (GstPipeWireDeviceProvider *self, const struct pw_node_info *info, uint
|
|||
else if (info->max_output_ports > 0 && info->max_input_ports == 0) {
|
||||
type = GST_PIPEWIRE_DEVICE_TYPE_SOURCE;
|
||||
for (i = 0; i < info->n_output_params; i++) {
|
||||
if (info->output_params[i]->body.id != t->param.idEnumFormat)
|
||||
if (!spa_pod_is_object_id(info->output_params[i], t->param.idEnumFormat))
|
||||
continue;
|
||||
GstCaps *c1 = gst_caps_from_format (info->output_params[i], t->map);
|
||||
if (c1)
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ write_pod (struct spa_pod_builder *b, const void *data, uint32_t size)
|
|||
return ref;
|
||||
}
|
||||
|
||||
static struct spa_pod_object *
|
||||
static struct spa_pod *
|
||||
convert_1 (GstCapsFeatures *cf, GstStructure *cs)
|
||||
{
|
||||
ConvertData d;
|
||||
|
|
@ -568,15 +568,15 @@ convert_1 (GstCapsFeatures *cf, GstStructure *cs)
|
|||
|
||||
spa_pod_builder_pop (&d.b);
|
||||
|
||||
return SPA_MEMBER (d.b.data, 0, struct spa_pod_object);
|
||||
return SPA_MEMBER (d.b.data, 0, struct spa_pod);
|
||||
}
|
||||
|
||||
struct spa_pod_object *
|
||||
struct spa_pod *
|
||||
gst_caps_to_format (GstCaps *caps, guint index, struct spa_type_map *map)
|
||||
{
|
||||
GstCapsFeatures *f;
|
||||
GstStructure *s;
|
||||
struct spa_pod_object *res;
|
||||
struct spa_pod *res;
|
||||
|
||||
g_return_val_if_fail (GST_IS_CAPS (caps), NULL);
|
||||
g_return_val_if_fail (gst_caps_is_fixed (caps), NULL);
|
||||
|
|
@ -596,7 +596,7 @@ foreach_func (GstCapsFeatures *features,
|
|||
GstStructure *structure,
|
||||
GPtrArray *array)
|
||||
{
|
||||
struct spa_pod_object *fmt;
|
||||
struct spa_pod *fmt;
|
||||
|
||||
if ((fmt = convert_1 (features, structure)))
|
||||
g_ptr_array_insert (array, -1, fmt);
|
||||
|
|
@ -794,7 +794,7 @@ handle_fraction_prop (struct spa_pod_prop *prop, const char *key, GstCaps *res)
|
|||
}
|
||||
}
|
||||
GstCaps *
|
||||
gst_caps_from_format (const struct spa_pod_object *format, struct spa_type_map *map)
|
||||
gst_caps_from_format (const struct spa_pod *format, struct spa_type_map *map)
|
||||
{
|
||||
GstCaps *res = NULL;
|
||||
uint32_t media_type, media_subtype;
|
||||
|
|
@ -808,7 +808,7 @@ gst_caps_from_format (const struct spa_pod_object *format, struct spa_type_map *
|
|||
if (media_type == type.media_type.video) {
|
||||
if (media_subtype == type.media_subtype.raw) {
|
||||
res = gst_caps_new_empty_simple ("video/x-raw");
|
||||
if ((prop = spa_pod_object_find_prop (format, type.format_video.format))) {
|
||||
if ((prop = spa_pod_find_prop (format, type.format_video.format))) {
|
||||
handle_id_prop (prop, "format", res);
|
||||
}
|
||||
}
|
||||
|
|
@ -821,13 +821,13 @@ gst_caps_from_format (const struct spa_pod_object *format, struct spa_type_map *
|
|||
"alignment", G_TYPE_STRING, "au",
|
||||
NULL);
|
||||
}
|
||||
if ((prop = spa_pod_object_find_prop (format, type.format_video.size))) {
|
||||
if ((prop = spa_pod_find_prop (format, type.format_video.size))) {
|
||||
handle_rect_prop (prop, "width", "height", res);
|
||||
}
|
||||
if ((prop = spa_pod_object_find_prop (format, type.format_video.framerate))) {
|
||||
if ((prop = spa_pod_find_prop (format, type.format_video.framerate))) {
|
||||
handle_fraction_prop (prop, "framerate", res);
|
||||
}
|
||||
if ((prop = spa_pod_object_find_prop (format, type.format_video.max_framerate))) {
|
||||
if ((prop = spa_pod_find_prop (format, type.format_video.max_framerate))) {
|
||||
handle_fraction_prop (prop, "max-framerate", res);
|
||||
}
|
||||
} else if (media_type == type.media_type.audio) {
|
||||
|
|
@ -835,13 +835,13 @@ gst_caps_from_format (const struct spa_pod_object *format, struct spa_type_map *
|
|||
res = gst_caps_new_simple ("audio/x-raw",
|
||||
"layout", G_TYPE_STRING, "interleaved",
|
||||
NULL);
|
||||
if ((prop = spa_pod_object_find_prop (format, type.format_audio.format))) {
|
||||
if ((prop = spa_pod_find_prop (format, type.format_audio.format))) {
|
||||
handle_id_prop (prop, "format", res);
|
||||
}
|
||||
if ((prop = spa_pod_object_find_prop (format, type.format_audio.rate))) {
|
||||
if ((prop = spa_pod_find_prop (format, type.format_audio.rate))) {
|
||||
handle_int_prop (prop, "rate", res);
|
||||
}
|
||||
if ((prop = spa_pod_object_find_prop (format, type.format_audio.channels))) {
|
||||
if ((prop = spa_pod_find_prop (format, type.format_audio.channels))) {
|
||||
handle_int_prop (prop, "channels", res);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
struct spa_pod_object * gst_caps_to_format (GstCaps *caps, guint index, struct spa_type_map *map);
|
||||
GPtrArray * gst_caps_to_format_all (GstCaps *caps, struct spa_type_map *map);
|
||||
struct spa_pod * gst_caps_to_format (GstCaps *caps, guint index, struct spa_type_map *map);
|
||||
GPtrArray * gst_caps_to_format_all (GstCaps *caps, struct spa_type_map *map);
|
||||
|
||||
GstCaps * gst_caps_from_format (const struct spa_pod_object *format, struct spa_type_map *map);
|
||||
GstCaps * gst_caps_from_format (const struct spa_pod *format, struct spa_type_map *map);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
guint size;
|
||||
guint min_buffers;
|
||||
guint max_buffers;
|
||||
struct spa_pod_object *port_params[3];
|
||||
struct spa_pod *port_params[3];
|
||||
struct spa_pod_builder b = { NULL };
|
||||
uint8_t buffer[1024];
|
||||
|
||||
|
|
@ -580,7 +580,7 @@ on_state_changed (void *data, enum pw_stream_state old, enum pw_stream_state sta
|
|||
}
|
||||
|
||||
static void
|
||||
on_format_changed (void *data, struct spa_pod_object *format)
|
||||
on_format_changed (void *data, struct spa_pod *format)
|
||||
{
|
||||
GstPipeWireSink *pwsink = data;
|
||||
|
||||
|
|
@ -618,7 +618,7 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
pwsink->path,
|
||||
flags,
|
||||
possible->len,
|
||||
(const struct spa_pod_object **) possible->pdata);
|
||||
(const struct spa_pod **) possible->pdata);
|
||||
|
||||
while (TRUE) {
|
||||
state = pw_stream_get_state (pwsink->stream, &error);
|
||||
|
|
|
|||
|
|
@ -663,7 +663,7 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc)
|
|||
pwsrc->path,
|
||||
PW_STREAM_FLAG_AUTOCONNECT,
|
||||
possible->len,
|
||||
(const struct spa_pod_object **)possible->pdata);
|
||||
(const struct spa_pod **)possible->pdata);
|
||||
g_ptr_array_free (possible, TRUE);
|
||||
|
||||
while (TRUE) {
|
||||
|
|
@ -725,8 +725,8 @@ connect_error:
|
|||
#define SPA_PROP_RANGE(min,max) 2,min,max
|
||||
|
||||
static void
|
||||
on_format_changed (void *data,
|
||||
struct spa_pod_object *format)
|
||||
on_format_changed (void *data,
|
||||
struct spa_pod *format)
|
||||
{
|
||||
GstPipeWireSrc *pwsrc = data;
|
||||
GstCaps *caps;
|
||||
|
|
@ -746,7 +746,7 @@ on_format_changed (void *data,
|
|||
gst_caps_unref (caps);
|
||||
|
||||
if (res) {
|
||||
struct spa_pod_object *params[2];
|
||||
struct spa_pod *params[2];
|
||||
struct spa_pod_builder b = { NULL };
|
||||
uint8_t buffer[512];
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ struct proxy_port {
|
|||
|
||||
bool have_format;
|
||||
uint32_t n_params;
|
||||
struct spa_pod_object **params;
|
||||
struct spa_pod **params;
|
||||
struct spa_port_io *io;
|
||||
|
||||
uint32_t n_buffers;
|
||||
|
|
@ -111,7 +111,7 @@ struct proxy {
|
|||
struct proxy_port out_ports[MAX_OUTPUTS];
|
||||
|
||||
uint32_t n_params;
|
||||
struct spa_pod_object **params;
|
||||
struct spa_pod **params;
|
||||
|
||||
uint8_t format_buffer[1024];
|
||||
uint32_t seq;
|
||||
|
|
@ -152,7 +152,8 @@ static int clear_buffers(struct proxy *this, struct proxy_port *port)
|
|||
|
||||
static int spa_proxy_node_enum_params(struct spa_node *node,
|
||||
uint32_t id, uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **result,
|
||||
struct spa_pod_builder *builder)
|
||||
{
|
||||
struct proxy *this;
|
||||
|
|
@ -167,17 +168,17 @@ static int spa_proxy_node_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_get_state(builder, &state);
|
||||
|
||||
while (true) {
|
||||
struct spa_pod_object *param;
|
||||
struct spa_pod *param;
|
||||
|
||||
if (*index >= this->n_params)
|
||||
return 0;
|
||||
|
||||
param = this->params[(*index)++];
|
||||
|
||||
if (param->body.id != id)
|
||||
if (!spa_pod_is_object_id(param, id))
|
||||
continue;
|
||||
|
||||
if (spa_pod_filter(builder, ¶m->pod, &filter->pod) == 0)
|
||||
if (spa_pod_filter(builder, result, param, filter) == 0)
|
||||
break;
|
||||
|
||||
spa_pod_builder_reset(builder, &state);
|
||||
|
|
@ -186,7 +187,7 @@ static int spa_proxy_node_enum_params(struct spa_node *node,
|
|||
}
|
||||
|
||||
static int spa_proxy_node_set_param(struct spa_node *node, uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
struct proxy *this;
|
||||
|
||||
|
|
@ -316,7 +317,7 @@ do_update_port(struct proxy *this,
|
|||
uint32_t port_id,
|
||||
uint32_t change_mask,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod_object **params,
|
||||
const struct spa_pod **params,
|
||||
const struct spa_port_info *info)
|
||||
{
|
||||
struct proxy_port *port;
|
||||
|
|
@ -333,11 +334,11 @@ do_update_port(struct proxy *this,
|
|||
for (i = 0; i < port->n_params; i++)
|
||||
free(port->params[i]);
|
||||
port->n_params = n_params;
|
||||
port->params = realloc(port->params, port->n_params * sizeof(struct spa_pod_object *));
|
||||
port->params = realloc(port->params, port->n_params * sizeof(struct spa_pod *));
|
||||
|
||||
for (i = 0; i < port->n_params; i++) {
|
||||
port->params[i] = spa_pod_object_copy(params[i]);
|
||||
if (port->params[i]->body.id == t->param.idFormat)
|
||||
port->params[i] = pw_spa_pod_copy(params[i]);
|
||||
if (spa_pod_is_object_id(port->params[i], t->param.idFormat))
|
||||
port->have_format = true;
|
||||
}
|
||||
|
||||
|
|
@ -451,7 +452,8 @@ static int
|
|||
spa_proxy_node_port_enum_params(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **result,
|
||||
struct spa_pod_builder *builder)
|
||||
{
|
||||
struct proxy *this;
|
||||
|
|
@ -471,17 +473,17 @@ spa_proxy_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_get_state(builder, &state);
|
||||
|
||||
while (true) {
|
||||
struct spa_pod_object *param;
|
||||
struct spa_pod *param;
|
||||
|
||||
if (*index >= port->n_params)
|
||||
return 0;
|
||||
|
||||
param = port->params[(*index)++];
|
||||
|
||||
if (param->body.id != id)
|
||||
if (!spa_pod_is_object_id(param, id))
|
||||
continue;
|
||||
|
||||
if (spa_pod_filter(builder, ¶m->pod, &filter->pod) == 0)
|
||||
if (spa_pod_filter(builder, result, param, filter) == 0)
|
||||
break;
|
||||
|
||||
spa_pod_builder_reset(builder, &state);
|
||||
|
|
@ -493,7 +495,7 @@ static int
|
|||
spa_proxy_node_port_set_param(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
struct proxy *this;
|
||||
|
||||
|
|
@ -652,7 +654,7 @@ static int
|
|||
spa_proxy_node_port_alloc_buffers(struct spa_node *node,
|
||||
enum spa_direction direction,
|
||||
uint32_t port_id,
|
||||
struct spa_pod_object **params,
|
||||
struct spa_pod **params,
|
||||
uint32_t n_params,
|
||||
struct spa_buffer **buffers,
|
||||
uint32_t *n_buffers)
|
||||
|
|
@ -845,7 +847,7 @@ client_node_update(void *data,
|
|||
uint32_t max_input_ports,
|
||||
uint32_t max_output_ports,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod_object **params)
|
||||
const struct spa_pod **params)
|
||||
{
|
||||
struct impl *impl = data;
|
||||
struct proxy *this = &impl->proxy;
|
||||
|
|
@ -861,10 +863,10 @@ client_node_update(void *data,
|
|||
for (i = 0; i < this->n_params; i++)
|
||||
free(this->params[i]);
|
||||
this->n_params = n_params;
|
||||
this->params = realloc(this->params, this->n_params * sizeof(struct spa_pod_object *));
|
||||
this->params = realloc(this->params, this->n_params * sizeof(struct spa_pod *));
|
||||
|
||||
for (i = 0; i < this->n_params; i++)
|
||||
this->params[i] = spa_pod_object_copy(params[i]);
|
||||
this->params[i] = pw_spa_pod_copy(params[i]);
|
||||
}
|
||||
spa_log_info(this->log, "proxy %p: got node update max_in %u, max_out %u", this,
|
||||
this->max_inputs, this->max_outputs);
|
||||
|
|
@ -876,7 +878,7 @@ client_node_port_update(void *data,
|
|||
uint32_t port_id,
|
||||
uint32_t change_mask,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod_object **params,
|
||||
const struct spa_pod **params,
|
||||
const struct spa_port_info *info)
|
||||
{
|
||||
struct impl *impl = data;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ client_node_marshal_update(void *object,
|
|||
uint32_t max_input_ports,
|
||||
uint32_t max_output_ports,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod_object **params)
|
||||
const struct spa_pod **params)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -82,7 +82,7 @@ client_node_marshal_port_update(void *object,
|
|||
uint32_t port_id,
|
||||
uint32_t change_mask,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod_object **params,
|
||||
const struct spa_pod **params,
|
||||
const struct spa_port_info *info)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
|
|
@ -188,7 +188,7 @@ static bool client_node_demarshal_set_param(void *object, void *data, size_t siz
|
|||
struct pw_proxy *proxy = object;
|
||||
struct spa_pod_parser prs;
|
||||
uint32_t seq, id, flags;
|
||||
const struct spa_pod_object *param = NULL;
|
||||
const struct spa_pod *param = NULL;
|
||||
|
||||
spa_pod_parser_init(&prs, data, size, 0);
|
||||
if (spa_pod_parser_get(&prs,
|
||||
|
|
@ -276,7 +276,7 @@ static bool client_node_demarshal_port_set_param(void *object, void *data, size_
|
|||
struct pw_proxy *proxy = object;
|
||||
struct spa_pod_parser prs;
|
||||
uint32_t seq, direction, port_id, id, flags;
|
||||
const struct spa_pod_object *param = NULL;
|
||||
const struct spa_pod *param = NULL;
|
||||
|
||||
spa_pod_parser_init(&prs, data, size, 0);
|
||||
if (spa_pod_parser_get(&prs,
|
||||
|
|
@ -432,7 +432,7 @@ static void client_node_marshal_transport(void *object, uint32_t node_id, int re
|
|||
|
||||
static void
|
||||
client_node_marshal_set_param(void *object, uint32_t seq, uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -514,7 +514,7 @@ client_node_marshal_port_set_param(void *object,
|
|||
uint32_t port_id,
|
||||
uint32_t id,
|
||||
uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -652,7 +652,7 @@ static bool client_node_demarshal_update(void *object, void *data, size_t size)
|
|||
struct pw_resource *resource = object;
|
||||
struct spa_pod_parser prs;
|
||||
uint32_t change_mask, max_input_ports, max_output_ports, n_params;
|
||||
const struct spa_pod_object **params;
|
||||
const struct spa_pod **params;
|
||||
int i;
|
||||
|
||||
spa_pod_parser_init(&prs, data, size, 0);
|
||||
|
|
@ -664,7 +664,7 @@ static bool client_node_demarshal_update(void *object, void *data, size_t size)
|
|||
"i", &n_params, NULL) < 0)
|
||||
return false;
|
||||
|
||||
params = alloca(n_params * sizeof(struct spa_pod_object *));
|
||||
params = alloca(n_params * sizeof(struct spa_pod *));
|
||||
for (i = 0; i < n_params; i++)
|
||||
if (spa_pod_parser_get(&prs, "O", ¶ms[i], NULL) < 0)
|
||||
return false;
|
||||
|
|
@ -682,7 +682,7 @@ static bool client_node_demarshal_port_update(void *object, void *data, size_t s
|
|||
struct pw_resource *resource = object;
|
||||
struct spa_pod_parser prs;
|
||||
uint32_t i, direction, port_id, change_mask, n_params;
|
||||
const struct spa_pod_object **params = NULL;
|
||||
const struct spa_pod **params = NULL;
|
||||
struct spa_port_info info, *infop = NULL;
|
||||
struct spa_pod *ipod;
|
||||
|
||||
|
|
@ -695,7 +695,7 @@ static bool client_node_demarshal_port_update(void *object, void *data, size_t s
|
|||
"i", &n_params, NULL) < 0)
|
||||
return false;
|
||||
|
||||
params = alloca(n_params * sizeof(struct spa_pod_object *));
|
||||
params = alloca(n_params * sizeof(struct spa_pod *));
|
||||
for (i = 0; i < n_params; i++)
|
||||
if (spa_pod_parser_get(&prs, "O", ¶ms[i], NULL) < 0)
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ do_create_link(void *data,
|
|||
uint32_t output_port_id,
|
||||
uint32_t input_node_id,
|
||||
uint32_t input_port_id,
|
||||
const struct spa_pod_object *filter,
|
||||
const struct spa_pod *filter,
|
||||
const struct spa_dict *props,
|
||||
uint32_t new_id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1297,6 +1297,7 @@ static bool on_global(void *data, struct pw_global *global)
|
|||
uint32_t index = 0;
|
||||
uint8_t buf[2048];
|
||||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buf, sizeof(buf));
|
||||
struct spa_pod *props;
|
||||
|
||||
if (pw_global_get_type(global) != impl->t->node)
|
||||
return true;
|
||||
|
|
@ -1328,9 +1329,8 @@ static bool on_global(void *data, struct pw_global *global)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (spa_node_enum_params(node->node, SPA_ID_INVALID, &index, NULL, &b) == 1) {
|
||||
if (spa_node_enum_params(node->node, impl->t->param.idProps, &index, NULL, &props, &b) == 1) {
|
||||
int min_latency = -1;
|
||||
struct spa_pod_object *props = spa_pod_builder_deref(&b, 0);
|
||||
|
||||
spa_pod_object_parse(props,
|
||||
":", impl->prop_min_latency, "?i", &min_latency, NULL);
|
||||
|
|
|
|||
|
|
@ -125,7 +125,8 @@ struct port_data {
|
|||
|
||||
static int node_enum_params(struct spa_node *node,
|
||||
uint32_t id, uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **param,
|
||||
struct spa_pod_builder *builder)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
|
|
@ -133,7 +134,7 @@ static int node_enum_params(struct spa_node *node,
|
|||
|
||||
static int node_set_param(struct spa_node *node,
|
||||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
|
@ -395,9 +396,9 @@ static int port_get_info(struct spa_node *node, enum spa_direction direction, ui
|
|||
static int port_enum_formats(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
struct spa_pod_builder *builder,
|
||||
struct spa_pod **param)
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **param,
|
||||
struct spa_pod_builder *builder)
|
||||
{
|
||||
struct node_data *nd = SPA_CONTAINER_OF(node, struct node_data, node_impl);
|
||||
struct port_data *pd = nd->port_data[direction][port_id];
|
||||
|
|
@ -441,7 +442,8 @@ static int port_enum_formats(struct spa_node *node,
|
|||
static int port_enum_params(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t *index,
|
||||
const struct spa_pod_object *filter,
|
||||
const struct spa_pod *filter,
|
||||
struct spa_pod **result,
|
||||
struct spa_pod_builder *builder)
|
||||
{
|
||||
struct node_data *nd = SPA_CONTAINER_OF(node, struct node_data, node_impl);
|
||||
|
|
@ -454,11 +456,11 @@ static int port_enum_params(struct spa_node *node,
|
|||
|
||||
next:
|
||||
if (id == t->param.idEnumFormat) {
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, filter, builder, ¶m)) <= 0)
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, filter, ¶m, builder)) <= 0)
|
||||
return res;
|
||||
}
|
||||
else if (id == t->param.idFormat) {
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, filter, builder, ¶m)) <= 0)
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, filter, ¶m, builder)) <= 0)
|
||||
return res;
|
||||
}
|
||||
else
|
||||
|
|
@ -467,7 +469,7 @@ static int port_enum_params(struct spa_node *node,
|
|||
(*index)++;
|
||||
|
||||
spa_pod_builder_reset(builder, &state);
|
||||
if ((res = spa_pod_filter(builder, param, (struct spa_pod*)filter)) < 0)
|
||||
if ((res = spa_pod_filter(builder, result, param, filter)) < 0)
|
||||
goto next;
|
||||
|
||||
return 1;
|
||||
|
|
@ -476,7 +478,7 @@ static int port_enum_params(struct spa_node *node,
|
|||
static int port_set_param(struct spa_node *node,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -515,7 +517,7 @@ static int port_use_buffers(struct spa_node *node, enum spa_direction direction,
|
|||
}
|
||||
|
||||
static int port_alloc_buffers(struct spa_node *node, enum spa_direction direction, uint32_t port_id,
|
||||
struct spa_pod_object **params, uint32_t n_params,
|
||||
struct spa_pod **params, uint32_t n_params,
|
||||
struct spa_buffer **buffers, uint32_t *n_buffers)
|
||||
{
|
||||
struct node_data *nd = SPA_CONTAINER_OF(node, struct node_data, node_impl);
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ core_marshal_create_link(void *object,
|
|||
uint32_t output_port_id,
|
||||
uint32_t input_node_id,
|
||||
uint32_t input_port_id,
|
||||
const struct spa_pod_object *filter,
|
||||
const struct spa_pod *filter,
|
||||
const struct spa_dict *props,
|
||||
uint32_t new_id)
|
||||
{
|
||||
|
|
@ -463,7 +463,7 @@ static bool core_demarshal_create_link(void *object, void *data, size_t size)
|
|||
struct spa_pod_parser prs;
|
||||
uint32_t new_id, i;
|
||||
uint32_t output_node_id, output_port_id, input_node_id, input_port_id;
|
||||
struct spa_pod_object *filter = NULL;
|
||||
struct spa_pod *filter = NULL;
|
||||
struct spa_dict props;
|
||||
|
||||
spa_pod_parser_init(&prs, data, size, 0);
|
||||
|
|
@ -751,7 +751,7 @@ static bool node_demarshal_info(void *object, void *data, size_t size)
|
|||
"i", &info.n_input_params, NULL) < 0)
|
||||
return false;
|
||||
|
||||
info.input_params = alloca(info.n_input_params * sizeof(struct spa_pod_object *));
|
||||
info.input_params = alloca(info.n_input_params * sizeof(struct spa_pod *));
|
||||
for (i = 0; i < info.n_input_params; i++)
|
||||
if (spa_pod_parser_get(&prs, "P", &info.input_params[i], NULL) < 0)
|
||||
return false;
|
||||
|
|
@ -762,7 +762,7 @@ static bool node_demarshal_info(void *object, void *data, size_t size)
|
|||
"i", &info.n_output_params, NULL) < 0)
|
||||
return false;
|
||||
|
||||
info.output_params = alloca(info.n_output_params * sizeof(struct spa_pod_object *));
|
||||
info.output_params = alloca(info.n_output_params * sizeof(struct spa_pod *));
|
||||
for (i = 0; i < info.n_output_params; i++)
|
||||
if (spa_pod_parser_get(&prs, "P", &info.output_params[i], NULL) < 0)
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ struct impl {
|
|||
struct spa_list item_list;
|
||||
};
|
||||
|
||||
static void add_item(struct pw_spa_monitor *this, struct spa_monitor_item *item)
|
||||
static void add_item(struct pw_spa_monitor *this, struct spa_pod *item)
|
||||
{
|
||||
struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this);
|
||||
int res;
|
||||
|
|
@ -72,7 +72,7 @@ static void add_item(struct pw_spa_monitor *this, struct spa_monitor_item *item)
|
|||
const struct spa_support *support;
|
||||
uint32_t n_support;
|
||||
|
||||
if (spa_pod_object_parse(&item->object,
|
||||
if (spa_pod_object_parse(item,
|
||||
":",t->monitor.name, "s", &name,
|
||||
":",t->monitor.id, "s", &id,
|
||||
":",t->monitor.klass, "s", &klass,
|
||||
|
|
@ -147,14 +147,14 @@ void destroy_item(struct monitor_item *mitem)
|
|||
free(mitem);
|
||||
}
|
||||
|
||||
static void remove_item(struct pw_spa_monitor *this, struct spa_monitor_item *item)
|
||||
static void remove_item(struct pw_spa_monitor *this, struct spa_pod *item)
|
||||
{
|
||||
struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this);
|
||||
struct monitor_item *mitem;
|
||||
const char *name, *id;
|
||||
struct pw_type *t = pw_core_get_type(impl->core);
|
||||
|
||||
if (spa_pod_object_parse(&item->object,
|
||||
if (spa_pod_object_parse(item,
|
||||
":",t->monitor.name, "s", &name,
|
||||
":",t->monitor.id, "s", &id, NULL) < 0)
|
||||
return;
|
||||
|
|
@ -172,16 +172,16 @@ static void on_monitor_event(void *data, struct spa_event *event)
|
|||
struct pw_type *t = pw_core_get_type(impl->core);
|
||||
|
||||
if (SPA_EVENT_TYPE(event) == t->monitor.Added) {
|
||||
struct spa_monitor_item *item = SPA_POD_CONTENTS(struct spa_event, event);
|
||||
struct spa_pod *item = SPA_POD_CONTENTS(struct spa_event, event);
|
||||
add_item(this, item);
|
||||
} else if (SPA_EVENT_TYPE(event) == t->monitor.Removed) {
|
||||
struct spa_monitor_item *item = SPA_POD_CONTENTS(struct spa_event, event);
|
||||
struct spa_pod *item = SPA_POD_CONTENTS(struct spa_event, event);
|
||||
remove_item(this, item);
|
||||
} else if (SPA_EVENT_TYPE(event) == t->monitor.Changed) {
|
||||
struct spa_monitor_item *item = SPA_POD_CONTENTS(struct spa_event, event);
|
||||
struct spa_pod *item = SPA_POD_CONTENTS(struct spa_event, event);
|
||||
const char *name;
|
||||
|
||||
if (spa_pod_object_parse(&item->object,
|
||||
if (spa_pod_object_parse(item,
|
||||
":",t->monitor.name, "s", &name, NULL) < 0)
|
||||
return;
|
||||
|
||||
|
|
@ -295,10 +295,12 @@ struct pw_spa_monitor *pw_spa_monitor_load(struct pw_core *core,
|
|||
spa_list_init(&impl->item_list);
|
||||
|
||||
for (index = 0;;) {
|
||||
struct spa_monitor_item *item;
|
||||
struct spa_pod *item;
|
||||
uint8_t buffer[4096];
|
||||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
|
||||
int res;
|
||||
|
||||
if ((res = spa_monitor_enum_items(this->monitor, &item, &index)) <= 0) {
|
||||
if ((res = spa_monitor_enum_items(this->monitor, &index, &item, &b)) <= 0) {
|
||||
if (res != 0)
|
||||
pw_log_debug("spa_monitor_enum_items: %s\n", spa_strerror(res));
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ static int
|
|||
setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_properties *pw_props)
|
||||
{
|
||||
int res;
|
||||
struct spa_pod_object *props;
|
||||
struct spa_pod *props;
|
||||
void *state = NULL;
|
||||
const char *key;
|
||||
struct pw_type *t = pw_core_get_type(core);
|
||||
|
|
@ -163,11 +163,10 @@ setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_propertie
|
|||
uint8_t buf[2048];
|
||||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buf, sizeof(buf));
|
||||
|
||||
if ((res = spa_node_enum_params(spa_node, t->param.idProps, &index, NULL, &b)) <= 0) {
|
||||
if ((res = spa_node_enum_params(spa_node, t->param.idProps, &index, NULL, &props, &b)) <= 0) {
|
||||
pw_log_debug("spa_node_get_props failed: %d", res);
|
||||
return res;
|
||||
}
|
||||
props = spa_pod_builder_deref(&b, 0);
|
||||
|
||||
while ((key = pw_properties_iterate(pw_props, &state))) {
|
||||
struct spa_pod_prop *prop;
|
||||
|
|
@ -180,7 +179,7 @@ setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_propertie
|
|||
if (id == SPA_ID_INVALID)
|
||||
continue;
|
||||
|
||||
if ((prop = spa_pod_object_find_prop(props, id))) {
|
||||
if ((prop = spa_pod_find_prop(props, id))) {
|
||||
const char *value = pw_properties_get(pw_props, key);
|
||||
|
||||
pw_log_info("configure prop %s", key);
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ core_create_link(void *object,
|
|||
uint32_t output_port_id,
|
||||
uint32_t input_node_id,
|
||||
uint32_t input_port_id,
|
||||
const struct spa_pod_object *filter,
|
||||
const struct spa_pod *filter,
|
||||
const struct spa_dict *props,
|
||||
uint32_t new_id)
|
||||
{
|
||||
|
|
@ -625,7 +625,7 @@ struct pw_port *pw_core_find_port(struct pw_core *core,
|
|||
uint32_t id,
|
||||
struct pw_properties *props,
|
||||
uint32_t n_format_filters,
|
||||
struct spa_pod_object **format_filters,
|
||||
struct spa_pod **format_filters,
|
||||
char **error)
|
||||
{
|
||||
struct pw_port *best = NULL;
|
||||
|
|
@ -660,6 +660,7 @@ struct pw_port *pw_core_find_port(struct pw_core *core,
|
|||
struct pw_port *p, *pin, *pout;
|
||||
uint8_t buf[4096];
|
||||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buf, sizeof(buf));
|
||||
struct spa_pod *dummy;
|
||||
|
||||
p = pw_node_get_free_port(n, pw_direction_reverse(other_port->direction));
|
||||
if (p == NULL)
|
||||
|
|
@ -679,6 +680,7 @@ struct pw_port *pw_core_find_port(struct pw_core *core,
|
|||
props,
|
||||
n_format_filters,
|
||||
format_filters,
|
||||
&dummy,
|
||||
&b,
|
||||
error) < 0) {
|
||||
free(*error);
|
||||
|
|
@ -714,7 +716,8 @@ int pw_core_find_format(struct pw_core *core,
|
|||
struct pw_port *input,
|
||||
struct pw_properties *props,
|
||||
uint32_t n_format_filters,
|
||||
struct spa_pod_object **format_filters,
|
||||
struct spa_pod **format_filters,
|
||||
struct spa_pod **format,
|
||||
struct spa_pod_builder *builder,
|
||||
char **error)
|
||||
{
|
||||
|
|
@ -739,7 +742,7 @@ int pw_core_find_format(struct pw_core *core,
|
|||
if ((res = spa_node_port_enum_params(output->node->node,
|
||||
output->direction, output->port_id,
|
||||
t->param.idFormat, &oidx,
|
||||
NULL, builder)) <= 0) {
|
||||
NULL, format, builder)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
asprintf(error, "error get output format: %s", spa_strerror(res));
|
||||
|
|
@ -750,7 +753,7 @@ int pw_core_find_format(struct pw_core *core,
|
|||
if ((res = spa_node_port_enum_params(input->node->node,
|
||||
input->direction, input->port_id,
|
||||
t->param.idFormat, &iidx,
|
||||
NULL, builder)) <= 0) {
|
||||
NULL, format, builder)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
asprintf(error, "error get input format: %s", spa_strerror(res));
|
||||
|
|
@ -759,7 +762,7 @@ int pw_core_find_format(struct pw_core *core,
|
|||
} else if (in_state == PW_PORT_STATE_CONFIGURE && out_state == PW_PORT_STATE_CONFIGURE) {
|
||||
struct spa_pod_builder fb = { 0 };
|
||||
uint8_t fbuf[4096];
|
||||
struct spa_pod_object *format;
|
||||
struct spa_pod *filter;
|
||||
again:
|
||||
/* both ports need a format */
|
||||
pw_log_debug("core %p: do enum input %d", core, iidx);
|
||||
|
|
@ -767,7 +770,7 @@ int pw_core_find_format(struct pw_core *core,
|
|||
if ((res = spa_node_port_enum_params(input->node->node,
|
||||
input->direction, input->port_id,
|
||||
t->param.idEnumFormat, &iidx,
|
||||
NULL, &fb)) <= 0) {
|
||||
NULL, &filter, &fb)) <= 0) {
|
||||
if (res == 0 && iidx == 0) {
|
||||
asprintf(error, "error input enum formats: %s", spa_strerror(res));
|
||||
goto error;
|
||||
|
|
@ -775,15 +778,14 @@ int pw_core_find_format(struct pw_core *core,
|
|||
asprintf(error, "no more input formats");
|
||||
goto error;
|
||||
}
|
||||
format = spa_pod_builder_deref(&fb, 0);
|
||||
pw_log_debug("enum output %d with filter: %p", oidx, format);
|
||||
pw_log_debug("enum output %d with filter: %p", oidx, filter);
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
|
||||
spa_debug_pod(&format->pod, SPA_DEBUG_FLAG_FORMAT);
|
||||
spa_debug_pod(filter, SPA_DEBUG_FLAG_FORMAT);
|
||||
|
||||
if ((res = spa_node_port_enum_params(output->node->node,
|
||||
output->direction, output->port_id,
|
||||
t->param.idEnumFormat, &oidx,
|
||||
format, builder)) <= 0) {
|
||||
filter, format, builder)) <= 0) {
|
||||
if (res == 0) {
|
||||
oidx = 0;
|
||||
goto again;
|
||||
|
|
@ -791,11 +793,10 @@ int pw_core_find_format(struct pw_core *core,
|
|||
asprintf(error, "error output enum formats: %d", res);
|
||||
goto error;
|
||||
}
|
||||
format = spa_pod_builder_deref(builder, 0);
|
||||
|
||||
pw_log_debug("Got filtered:");
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
|
||||
spa_debug_pod(&format->pod, SPA_DEBUG_FLAG_FORMAT);
|
||||
spa_debug_pod(*format, SPA_DEBUG_FLAG_FORMAT);
|
||||
} else {
|
||||
res = -EBADF;
|
||||
asprintf(error, "error node state");
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ struct pw_core_proxy_methods {
|
|||
uint32_t output_port_id,
|
||||
uint32_t input_node_id,
|
||||
uint32_t input_port_id,
|
||||
const struct spa_pod_object *filter,
|
||||
const struct spa_pod *filter,
|
||||
const struct spa_dict *props,
|
||||
uint32_t new_id);
|
||||
};
|
||||
|
|
@ -207,7 +207,7 @@ pw_core_proxy_create_link(struct pw_core_proxy *core,
|
|||
uint32_t output_port_id,
|
||||
uint32_t input_node_id,
|
||||
uint32_t input_port_id,
|
||||
const struct spa_pod_object *filter,
|
||||
const struct spa_pod *filter,
|
||||
const struct spa_dict *prop,
|
||||
size_t user_data_size)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -206,13 +206,13 @@ struct pw_node_info *pw_node_info_update(struct pw_node_info *info,
|
|||
if (info->n_input_params)
|
||||
info->input_params =
|
||||
realloc(info->input_params,
|
||||
info->n_input_params * sizeof(struct spa_pod_object *));
|
||||
info->n_input_params * sizeof(struct spa_pod *));
|
||||
else {
|
||||
free(info->input_params);
|
||||
info->input_params = NULL;
|
||||
}
|
||||
for (i = 0; i < info->n_input_params; i++) {
|
||||
info->input_params[i] = spa_pod_object_copy(update->input_params[i]);
|
||||
info->input_params[i] = pw_spa_pod_copy(update->input_params[i]);
|
||||
}
|
||||
}
|
||||
if (update->change_mask & PW_NODE_CHANGE_MASK_OUTPUT_PORTS) {
|
||||
|
|
@ -226,13 +226,13 @@ struct pw_node_info *pw_node_info_update(struct pw_node_info *info,
|
|||
if (info->n_output_params)
|
||||
info->output_params =
|
||||
realloc(info->output_params,
|
||||
info->n_output_params * sizeof(struct spa_pod_object *));
|
||||
info->n_output_params * sizeof(struct spa_pod *));
|
||||
else {
|
||||
free(info->output_params);
|
||||
info->output_params = NULL;
|
||||
}
|
||||
for (i = 0; i < info->n_output_params; i++) {
|
||||
info->output_params[i] = spa_pod_object_copy(update->output_params[i]);
|
||||
info->output_params[i] = pw_spa_pod_copy(update->output_params[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -414,7 +414,7 @@ struct pw_link_info *pw_link_info_update(struct pw_link_info *info,
|
|||
if (update->change_mask & PW_LINK_CHANGE_MASK_FORMAT) {
|
||||
if (info->format)
|
||||
free(info->format);
|
||||
info->format = spa_pod_object_copy(update->format);
|
||||
info->format = pw_spa_pod_copy(update->format);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,11 +153,11 @@ struct pw_node_info {
|
|||
uint32_t max_input_ports; /**< maximum number of inputs */
|
||||
uint32_t n_input_ports; /**< number of inputs */
|
||||
uint32_t n_input_params; /**< number of input params */
|
||||
struct spa_pod_object **input_params; /**< array of input params */
|
||||
struct spa_pod **input_params; /**< array of input params */
|
||||
uint32_t max_output_ports; /**< maximum number of outputs */
|
||||
uint32_t n_output_ports; /**< number of outputs */
|
||||
uint32_t n_output_params; /**< number of output params */
|
||||
struct spa_pod_object **output_params; /**< array of output params */
|
||||
struct spa_pod **output_params; /**< array of output params */
|
||||
enum pw_node_state state; /**< the current state of the node */
|
||||
const char *error; /**< an error reason if \a state is error */
|
||||
struct spa_dict *props; /**< the properties of the node */
|
||||
|
|
@ -200,7 +200,7 @@ struct pw_link_info {
|
|||
uint32_t output_port_id; /**< output port id */
|
||||
uint32_t input_node_id; /**< server side input node id */
|
||||
uint32_t input_port_id; /**< input port id */
|
||||
struct spa_pod_object *format; /**< format over link */
|
||||
struct spa_pod *format; /**< format over link */
|
||||
struct spa_dict *props; /**< the properties of the link */
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ struct impl {
|
|||
|
||||
struct pw_work_queue *work;
|
||||
|
||||
struct spa_pod_object *format_filter;
|
||||
struct spa_pod *format_filter;
|
||||
struct pw_properties *properties;
|
||||
|
||||
struct spa_hook input_port_listener;
|
||||
|
|
@ -115,7 +115,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
{
|
||||
struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this);
|
||||
int res = -EIO, res2;
|
||||
struct spa_pod_object *format = NULL, *current;
|
||||
struct spa_pod *format = NULL, *current;
|
||||
char *error = NULL;
|
||||
struct pw_resource *resource;
|
||||
bool changed = true;
|
||||
|
|
@ -133,24 +133,23 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
input = this->input;
|
||||
output = this->output;
|
||||
|
||||
if ((res = pw_core_find_format(this->core, output, input, NULL, 0, NULL, &b, &error)) < 0)
|
||||
if ((res = pw_core_find_format(this->core, output, input, NULL, 0, NULL, &format, &b, &error)) < 0)
|
||||
goto error;
|
||||
|
||||
format = spa_pod_object_copy(spa_pod_builder_deref(&b, 0));
|
||||
spa_pod_object_fixate(format);
|
||||
format = pw_spa_pod_copy(format);
|
||||
spa_pod_fixate(format);
|
||||
|
||||
if (out_state > PW_PORT_STATE_CONFIGURE && output->node->info.state == PW_NODE_STATE_IDLE) {
|
||||
if ((res = spa_node_port_enum_params(output->node->node,
|
||||
output->direction, output->port_id,
|
||||
t->param.idFormat, &index,
|
||||
NULL, &b)) <= 0) {
|
||||
NULL, ¤t, &b)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
asprintf(&error, "error get output format: %s", spa_strerror(res));
|
||||
goto error;
|
||||
}
|
||||
current = spa_pod_builder_deref(&b, 0);
|
||||
if (spa_pod_compare((struct spa_pod*)current, (struct spa_pod*)format) != 0) {
|
||||
if (spa_pod_compare(current, format) != 0) {
|
||||
pw_log_debug("link %p: output format change, renegotiate", this);
|
||||
pw_node_set_state(output->node, PW_NODE_STATE_SUSPENDED);
|
||||
out_state = PW_PORT_STATE_CONFIGURE;
|
||||
|
|
@ -164,14 +163,13 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
if ((res = spa_node_port_enum_params(input->node->node,
|
||||
input->direction, input->port_id,
|
||||
t->param.idFormat, &index,
|
||||
NULL, &b)) <= 0) {
|
||||
NULL, ¤t, &b)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
asprintf(&error, "error get input format: %s", spa_strerror(res));
|
||||
goto error;
|
||||
}
|
||||
current = spa_pod_builder_deref(&b, 0);
|
||||
if (spa_pod_compare((struct spa_pod*)current, (struct spa_pod*)format) != 0) {
|
||||
if (spa_pod_compare(current, format) != 0) {
|
||||
pw_log_debug("link %p: input format change, renegotiate", this);
|
||||
pw_node_set_state(input->node, PW_NODE_STATE_SUSPENDED);
|
||||
in_state = PW_PORT_STATE_CONFIGURE;
|
||||
|
|
@ -184,7 +182,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
|
||||
pw_log_debug("link %p: doing set format %p", this, format);
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
|
||||
spa_debug_pod(&format->pod, SPA_DEBUG_FLAG_FORMAT);
|
||||
spa_debug_pod(format, SPA_DEBUG_FLAG_FORMAT);
|
||||
|
||||
if (out_state == PW_PORT_STATE_CONFIGURE) {
|
||||
pw_log_debug("link %p: doing set format on output", this);
|
||||
|
|
@ -233,25 +231,24 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
return res;
|
||||
}
|
||||
|
||||
static struct spa_pod_object *find_param(struct spa_pod_object **params, int n_params, uint32_t type)
|
||||
static struct spa_pod *find_param(struct spa_pod **params, int n_params, uint32_t type)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < n_params; i++) {
|
||||
if (spa_pod_is_object_type(¶ms[i]->pod, type))
|
||||
if (spa_pod_is_object_type(params[i], type))
|
||||
return params[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct spa_pod_object *find_meta(struct pw_core *core, struct spa_pod_object **params,
|
||||
int n_params, uint32_t type)
|
||||
static struct spa_pod *find_meta(struct pw_core *core, struct spa_pod **params,
|
||||
int n_params, uint32_t type)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < n_params; i++) {
|
||||
if (spa_pod_is_object_type
|
||||
(¶ms[i]->pod, core->type.param_meta.Meta)) {
|
||||
if (spa_pod_is_object_type (params[i], core->type.param_meta.Meta)) {
|
||||
uint32_t qtype;
|
||||
|
||||
if (spa_pod_object_parse(params[i],
|
||||
|
|
@ -268,7 +265,7 @@ static struct spa_pod_object *find_meta(struct pw_core *core, struct spa_pod_obj
|
|||
static struct spa_buffer **alloc_buffers(struct pw_link *this,
|
||||
uint32_t n_buffers,
|
||||
uint32_t n_params,
|
||||
struct spa_pod_object **params,
|
||||
struct spa_pod **params,
|
||||
uint32_t n_datas,
|
||||
size_t *data_sizes,
|
||||
ssize_t *data_strides,
|
||||
|
|
@ -298,8 +295,7 @@ static struct spa_buffer **alloc_buffers(struct pw_link *this,
|
|||
|
||||
/* collect metadata */
|
||||
for (i = 0; i < n_params; i++) {
|
||||
if (spa_pod_is_object_type
|
||||
(¶ms[i]->pod, this->core->type.param_meta.Meta)) {
|
||||
if (spa_pod_is_object_type (params[i], this->core->type.param_meta.Meta)) {
|
||||
uint32_t type, size;
|
||||
|
||||
if (spa_pod_object_parse(params[i],
|
||||
|
|
@ -405,35 +401,29 @@ param_filter(struct pw_link *this,
|
|||
{
|
||||
uint8_t ibuf[4096];
|
||||
struct spa_pod_builder ib = { 0 };
|
||||
struct spa_pod_object *oparam, *iparam;
|
||||
struct spa_pod *oparam, *iparam;
|
||||
uint32_t iidx, oidx, num = 0;
|
||||
|
||||
for (iidx = 0;;) {
|
||||
spa_pod_builder_init(&ib, ibuf, sizeof(ibuf));
|
||||
pw_log_debug("iparam %d", iidx);
|
||||
if (spa_node_port_enum_params(in_port->node->node, in_port->direction, in_port->port_id,
|
||||
id, &iidx, NULL, &ib) <= 0)
|
||||
id, &iidx, NULL, &iparam, &ib) <= 0)
|
||||
break;
|
||||
iparam = spa_pod_builder_deref(&ib, 0);
|
||||
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
|
||||
spa_debug_pod(&iparam->pod, 0);
|
||||
spa_debug_pod(iparam, 0);
|
||||
|
||||
for (oidx = 0;;) {
|
||||
uint32_t offset;
|
||||
|
||||
offset = result->state.offset;
|
||||
|
||||
pw_log_debug("oparam %d %d", oidx, offset);
|
||||
pw_log_debug("oparam %d", oidx);
|
||||
if (spa_node_port_enum_params(out_port->node->node, out_port->direction,
|
||||
out_port->port_id, id, &oidx,
|
||||
iparam, result) <= 0) {
|
||||
iparam, &oparam, result) <= 0) {
|
||||
break;
|
||||
}
|
||||
oparam = spa_pod_builder_deref(result, offset);
|
||||
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
|
||||
spa_debug_pod(&oparam->pod, 0);
|
||||
spa_debug_pod(oparam, 0);
|
||||
|
||||
num++;
|
||||
}
|
||||
|
|
@ -520,7 +510,7 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s
|
|||
}
|
||||
|
||||
if (this->buffers == NULL) {
|
||||
struct spa_pod_object **params, *param;
|
||||
struct spa_pod **params, *param;
|
||||
uint8_t buffer[4096];
|
||||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
|
||||
int i, offset, n_params;
|
||||
|
|
@ -530,13 +520,13 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s
|
|||
n_params = param_filter(this, input, output, t->param.idBuffers, &b);
|
||||
n_params += param_filter(this, input, output, t->param.idMeta, &b);
|
||||
|
||||
params = alloca(n_params * sizeof(struct spa_pod_object *));
|
||||
params = alloca(n_params * sizeof(struct spa_pod *));
|
||||
for (i = 0, offset = 0; i < n_params; i++) {
|
||||
params[i] = SPA_MEMBER(buffer, offset, struct spa_pod_object);
|
||||
spa_pod_object_fixate(params[i]);
|
||||
params[i] = SPA_MEMBER(buffer, offset, struct spa_pod);
|
||||
spa_pod_fixate(params[i]);
|
||||
pw_log_debug("fixated param %d:", i);
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
|
||||
spa_debug_pod(¶ms[i]->pod, 0);
|
||||
spa_debug_pod(params[i], 0);
|
||||
offset += SPA_ROUND_UP_N(SPA_POD_SIZE(params[i]), 8);
|
||||
}
|
||||
|
||||
|
|
@ -1064,7 +1054,7 @@ static const struct pw_node_events output_node_events = {
|
|||
struct pw_link *pw_link_new(struct pw_core *core,
|
||||
struct pw_port *output,
|
||||
struct pw_port *input,
|
||||
struct spa_pod_object *format_filter,
|
||||
struct spa_pod *format_filter,
|
||||
struct pw_properties *properties,
|
||||
char **error,
|
||||
size_t user_data_size)
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ struct pw_link *
|
|||
pw_link_new(struct pw_core *core, /**< the core object */
|
||||
struct pw_port *output, /**< an output port */
|
||||
struct pw_port *input, /**< an input port */
|
||||
struct spa_pod_object *format_filter, /**< an optional format filter */
|
||||
struct spa_pod *format_filter, /**< an optional format filter */
|
||||
struct pw_properties *properties /**< extra properties */,
|
||||
char **error, /**< error string when result is NULL */
|
||||
size_t user_data_size /**< extra user data size */);
|
||||
|
|
|
|||
|
|
@ -231,20 +231,19 @@ update_info(struct pw_node *this)
|
|||
uint32_t state = 0;
|
||||
|
||||
for (this->info.n_input_params = 0;; this->info.n_input_params++) {
|
||||
struct spa_pod_object *fmt;
|
||||
struct spa_pod *fmt;
|
||||
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
if (spa_node_port_enum_params(port->node->node,
|
||||
port->direction, port->port_id,
|
||||
this->core->type.param.idEnumFormat, &state,
|
||||
NULL, &b) <= 0)
|
||||
NULL, &fmt, &b) <= 0)
|
||||
break;
|
||||
fmt = spa_pod_builder_deref(&b, 0);
|
||||
|
||||
this->info.input_params =
|
||||
realloc(this->info.input_params,
|
||||
sizeof(struct spa_pod_object *) * (this->info.n_input_params + 1));
|
||||
this->info.input_params[this->info.n_input_params] = spa_pod_object_copy(fmt);
|
||||
sizeof(struct spa_pod *) * (this->info.n_input_params + 1));
|
||||
this->info.input_params[this->info.n_input_params] = pw_spa_pod_copy(fmt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -254,20 +253,19 @@ update_info(struct pw_node *this)
|
|||
uint32_t state = 0;
|
||||
|
||||
for (this->info.n_output_params = 0;; this->info.n_output_params++) {
|
||||
struct spa_pod_object *fmt;
|
||||
struct spa_pod *fmt;
|
||||
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
if (spa_node_port_enum_params(port->node->node,
|
||||
port->direction, port->port_id,
|
||||
this->core->type.param.idEnumFormat, &state,
|
||||
NULL, &b) <= 0)
|
||||
NULL, &fmt, &b) <= 0)
|
||||
break;
|
||||
fmt = spa_pod_builder_deref(&b, 0);
|
||||
|
||||
this->info.output_params =
|
||||
realloc(this->info.output_params,
|
||||
sizeof(struct spa_pod_object *) * (this->info.n_output_params + 1));
|
||||
this->info.output_params[this->info.n_output_params] = spa_pod_object_copy(fmt);
|
||||
sizeof(struct spa_pod *) * (this->info.n_output_params + 1));
|
||||
this->info.output_params[this->info.n_output_params] = pw_spa_pod_copy(fmt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ do_port_pause(struct spa_loop *loop,
|
|||
}
|
||||
|
||||
int pw_port_set_param(struct pw_port *port, uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
int res;
|
||||
|
||||
|
|
@ -426,7 +426,7 @@ int pw_port_use_buffers(struct pw_port *port, struct spa_buffer **buffers, uint3
|
|||
}
|
||||
|
||||
int pw_port_alloc_buffers(struct pw_port *port,
|
||||
struct spa_pod_object **params, uint32_t n_params,
|
||||
struct spa_pod **params, uint32_t n_params,
|
||||
struct spa_buffer **buffers, uint32_t *n_buffers)
|
||||
{
|
||||
int res;
|
||||
|
|
|
|||
|
|
@ -395,7 +395,8 @@ int pw_core_find_format(struct pw_core *core,
|
|||
struct pw_port *input,
|
||||
struct pw_properties *props,
|
||||
uint32_t n_format_filters,
|
||||
struct spa_pod_object **format_filters,
|
||||
struct spa_pod **format_filters,
|
||||
struct spa_pod **format,
|
||||
struct spa_pod_builder *builder,
|
||||
char **error);
|
||||
|
||||
|
|
@ -406,7 +407,7 @@ pw_core_find_port(struct pw_core *core,
|
|||
uint32_t id,
|
||||
struct pw_properties *props,
|
||||
uint32_t n_format_filters,
|
||||
struct spa_pod_object **format_filters,
|
||||
struct spa_pod **format_filters,
|
||||
char **error);
|
||||
|
||||
/** Create a new port \memberof pw_port
|
||||
|
|
@ -428,14 +429,14 @@ void pw_port_destroy(struct pw_port *port);
|
|||
|
||||
/** Set a param on a port \memberof pw_port */
|
||||
int pw_port_set_param(struct pw_port *port, uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param);
|
||||
const struct spa_pod *param);
|
||||
|
||||
/** Use buffers on a port \memberof pw_port */
|
||||
int pw_port_use_buffers(struct pw_port *port, struct spa_buffer **buffers, uint32_t n_buffers);
|
||||
|
||||
/** Allocate memory for buffers on a port \memberof pw_port */
|
||||
int pw_port_alloc_buffers(struct pw_port *port,
|
||||
struct spa_pod_object **params, uint32_t n_params,
|
||||
struct spa_pod **params, uint32_t n_params,
|
||||
struct spa_buffer **buffers, uint32_t *n_buffers);
|
||||
|
||||
/** Change the state of the node */
|
||||
|
|
|
|||
|
|
@ -643,7 +643,7 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32
|
|||
const struct spa_port_info *port_info = NULL;
|
||||
struct spa_port_info pi;
|
||||
uint32_t n_params = 0;
|
||||
struct spa_pod_object **params = NULL;
|
||||
struct spa_pod **params = NULL;
|
||||
|
||||
if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_PARAMS) {
|
||||
uint32_t idx1, idx2, id;
|
||||
|
|
@ -651,15 +651,14 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32
|
|||
struct spa_pod_builder b = { 0 };
|
||||
|
||||
for (idx1 = 0;;) {
|
||||
struct spa_pod_object *param;
|
||||
struct spa_pod *param;
|
||||
|
||||
spa_pod_builder_init(&b, buf, sizeof(buf));
|
||||
if (spa_node_port_enum_params(port->node->node,
|
||||
port->direction, port->port_id,
|
||||
data->t->param.idList, &idx1,
|
||||
NULL, &b) <= 0)
|
||||
NULL, ¶m, &b) <= 0)
|
||||
break;
|
||||
param = spa_pod_builder_deref(&b, 0);
|
||||
|
||||
spa_pod_object_parse(param,
|
||||
":", data->t->param.listId, "I", &id, NULL);
|
||||
|
|
@ -669,12 +668,11 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32
|
|||
if (spa_node_port_enum_params(port->node->node,
|
||||
port->direction, port->port_id,
|
||||
id, &idx2,
|
||||
NULL, &b) <= 0)
|
||||
NULL, ¶m, &b) <= 0)
|
||||
break;
|
||||
param = spa_pod_builder_deref(&b, 0);
|
||||
|
||||
params = realloc(params, sizeof(struct spa_pod_object *) * (n_params + 1));
|
||||
params[n_params] = spa_pod_object_copy(param);
|
||||
params = realloc(params, sizeof(struct spa_pod *) * (n_params + 1));
|
||||
params[n_params] = pw_spa_pod_copy(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -689,7 +687,7 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32
|
|||
port->port_id,
|
||||
change_mask,
|
||||
n_params,
|
||||
(const struct spa_pod_object **)params,
|
||||
(const struct spa_pod **)params,
|
||||
&pi);
|
||||
if (params) {
|
||||
while (n_params > 0)
|
||||
|
|
@ -700,7 +698,7 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32
|
|||
|
||||
static void
|
||||
client_node_set_param(void *object, uint32_t seq, uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
pw_log_warn("set param not implemented");
|
||||
}
|
||||
|
|
@ -806,7 +804,7 @@ client_node_port_set_param(void *object,
|
|||
uint32_t seq,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
struct node_data *data = proxy->user_data;
|
||||
|
|
|
|||
|
|
@ -65,12 +65,12 @@ struct stream {
|
|||
uint32_t type_client_node;
|
||||
|
||||
uint32_t n_init_params;
|
||||
struct spa_pod_object **init_params;
|
||||
struct spa_pod **init_params;
|
||||
|
||||
uint32_t n_params;
|
||||
struct spa_pod_object **params;
|
||||
struct spa_pod **params;
|
||||
|
||||
struct spa_pod_object *format;
|
||||
struct spa_pod *format;
|
||||
|
||||
struct spa_port_info port_info;
|
||||
enum spa_direction direction;
|
||||
|
|
@ -309,7 +309,7 @@ static void unhandle_socket(struct pw_stream *stream)
|
|||
static void
|
||||
set_init_params(struct pw_stream *stream,
|
||||
int n_init_params,
|
||||
const struct spa_pod_object **init_params)
|
||||
const struct spa_pod **init_params)
|
||||
{
|
||||
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
|
||||
int i;
|
||||
|
|
@ -322,13 +322,13 @@ set_init_params(struct pw_stream *stream,
|
|||
}
|
||||
impl->n_init_params = n_init_params;
|
||||
if (n_init_params > 0) {
|
||||
impl->init_params = malloc(n_init_params * sizeof(struct spa_pod_object *));
|
||||
impl->init_params = malloc(n_init_params * sizeof(struct spa_pod *));
|
||||
for (i = 0; i < n_init_params; i++)
|
||||
impl->init_params[i] = spa_pod_object_copy(init_params[i]);
|
||||
impl->init_params[i] = pw_spa_pod_copy(init_params[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void set_params(struct pw_stream *stream, int n_params, struct spa_pod_object **params)
|
||||
static void set_params(struct pw_stream *stream, int n_params, struct spa_pod **params)
|
||||
{
|
||||
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
|
||||
int i;
|
||||
|
|
@ -341,9 +341,9 @@ static void set_params(struct pw_stream *stream, int n_params, struct spa_pod_ob
|
|||
}
|
||||
impl->n_params = n_params;
|
||||
if (n_params > 0) {
|
||||
impl->params = malloc(n_params * sizeof(struct spa_pod_object *));
|
||||
impl->params = malloc(n_params * sizeof(struct spa_pod *));
|
||||
for (i = 0; i < n_params; i++)
|
||||
impl->params[i] = spa_pod_object_copy(params[i]);
|
||||
impl->params[i] = pw_spa_pod_copy(params[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -405,18 +405,18 @@ static void add_port_update(struct pw_stream *stream, uint32_t change_mask)
|
|||
{
|
||||
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
|
||||
uint32_t n_params;
|
||||
struct spa_pod_object **params;
|
||||
struct spa_pod **params;
|
||||
int i, j;
|
||||
|
||||
n_params = impl->n_params + impl->n_init_params;
|
||||
if (impl->format)
|
||||
n_params += 1;
|
||||
|
||||
params = alloca(n_params * sizeof(struct spa_pod_object *));
|
||||
params = alloca(n_params * sizeof(struct spa_pod *));
|
||||
|
||||
j = 0;
|
||||
for (i = 0; i < impl->n_init_params; i++)
|
||||
params[j++] = (struct spa_pod_object *)impl->init_params[i];
|
||||
params[j++] = impl->init_params[i];
|
||||
if (impl->format)
|
||||
params[j++] = impl->format;
|
||||
for (i = 0; i < impl->n_params; i++)
|
||||
|
|
@ -427,7 +427,7 @@ static void add_port_update(struct pw_stream *stream, uint32_t change_mask)
|
|||
impl->port_id,
|
||||
change_mask,
|
||||
n_params,
|
||||
(const struct spa_pod_object **) params,
|
||||
(const struct spa_pod **) params,
|
||||
&impl->port_info);
|
||||
}
|
||||
|
||||
|
|
@ -659,7 +659,7 @@ static void handle_socket(struct pw_stream *stream, int rtreadfd, int rtwritefd)
|
|||
|
||||
static void
|
||||
client_node_set_param(void *data, uint32_t seq, uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
pw_log_warn("set param not implemented");
|
||||
}
|
||||
|
|
@ -746,7 +746,7 @@ client_node_port_set_param(void *data,
|
|||
uint32_t seq,
|
||||
enum spa_direction direction, uint32_t port_id,
|
||||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod_object *param)
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
struct stream *impl = data;
|
||||
struct pw_stream *stream = &impl->this;
|
||||
|
|
@ -757,9 +757,10 @@ client_node_port_set_param(void *data,
|
|||
|
||||
if (impl->format)
|
||||
free(impl->format);
|
||||
if (param) {
|
||||
impl->format = spa_pod_object_copy(param);
|
||||
impl->format->body.id = id;
|
||||
|
||||
if (spa_pod_is_object_type(param, t->spa_format)) {
|
||||
impl->format = pw_spa_pod_copy(param);
|
||||
((struct spa_pod_object*)impl->format)->body.id = id;
|
||||
}
|
||||
else
|
||||
impl->format = NULL;
|
||||
|
|
@ -988,7 +989,7 @@ pw_stream_connect(struct pw_stream *stream,
|
|||
const char *port_path,
|
||||
enum pw_stream_flags flags,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod_object **params)
|
||||
const struct spa_pod **params)
|
||||
{
|
||||
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
|
||||
|
||||
|
|
@ -1034,7 +1035,7 @@ void
|
|||
pw_stream_finish_format(struct pw_stream *stream,
|
||||
int res,
|
||||
uint32_t n_params,
|
||||
struct spa_pod_object **params)
|
||||
struct spa_pod **params)
|
||||
{
|
||||
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ struct pw_stream_events {
|
|||
/** when the format changed. The listener should call
|
||||
* pw_stream_finish_format() from within this callback or later to complete
|
||||
* the format negotiation and start the buffer negotiation. */
|
||||
void (*format_changed) (void *data, struct spa_pod_object *format);
|
||||
void (*format_changed) (void *data, struct spa_pod *format);
|
||||
|
||||
/** when a new buffer was created for this stream */
|
||||
void (*add_buffer) (void *data, uint32_t id);
|
||||
|
|
@ -265,7 +265,7 @@ pw_stream_connect(struct pw_stream *stream, /**< a \ref pw_stream */
|
|||
* to let the server choose a port */
|
||||
enum pw_stream_flags flags, /**< stream flags */
|
||||
uint32_t n_params, /**< number of items in \a params */
|
||||
const struct spa_pod_object **params /**< an array with params. The params
|
||||
const struct spa_pod **params /**< an array with params. The params
|
||||
* should ideally contain supported
|
||||
* formats. */);
|
||||
|
||||
|
|
@ -287,7 +287,7 @@ void
|
|||
pw_stream_finish_format(struct pw_stream *stream, /**< a \ref pw_stream */
|
||||
int res, /**< a result code */
|
||||
uint32_t n_params, /**< number of elements in \a params */
|
||||
struct spa_pod_object **params /**< an array of params. The params should
|
||||
struct spa_pod **params /**< an array of params. The params should
|
||||
* ideally contain parameters for doing
|
||||
* buffer allocation. */);
|
||||
|
||||
|
|
|
|||
|
|
@ -54,12 +54,6 @@ pw_spa_pod_copy(const struct spa_pod *pod)
|
|||
return pod ? memcpy(malloc(SPA_POD_SIZE(pod)), pod, SPA_POD_SIZE(pod)) : NULL;
|
||||
}
|
||||
|
||||
static inline struct spa_pod_object *
|
||||
spa_pod_object_copy(const struct spa_pod_object *pod)
|
||||
{
|
||||
return (struct spa_pod_object*) pw_spa_pod_copy(&pod->pod);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -533,18 +533,18 @@ static void info_node(struct proxy_data *pd)
|
|||
fprintf(stdout, "%c\tinput params:\n", MARK_CHANGE(2));
|
||||
for (i = 0; i < info->n_input_params; i++) {
|
||||
uint32_t flags = 0;
|
||||
if (info->input_params[i]->body.type == t->spa_format)
|
||||
if (spa_pod_is_object_type(info->input_params[i], t->spa_format))
|
||||
flags |= SPA_DEBUG_FLAG_FORMAT;
|
||||
spa_debug_pod(&info->input_params[i]->pod, flags);
|
||||
spa_debug_pod(info->input_params[i], flags);
|
||||
}
|
||||
|
||||
fprintf(stdout, "%c\toutput ports: %u/%u\n", MARK_CHANGE(3), info->n_output_ports, info->max_output_ports);
|
||||
fprintf(stdout, "%c\toutput params:\n", MARK_CHANGE(4));
|
||||
for (i = 0; i < info->n_output_params; i++) {
|
||||
uint32_t flags = 0;
|
||||
if (info->output_params[i]->body.type == t->spa_format)
|
||||
if (spa_pod_is_object_type(info->output_params[i], t->spa_format))
|
||||
flags |= SPA_DEBUG_FLAG_FORMAT;
|
||||
spa_debug_pod(&info->output_params[i]->pod, flags);
|
||||
spa_debug_pod(info->output_params[i], flags);
|
||||
}
|
||||
fprintf(stdout, "%c\tstate: \"%s\"", MARK_CHANGE(5), pw_node_state_as_string(info->state));
|
||||
if (info->state == PW_NODE_STATE_ERROR && info->error)
|
||||
|
|
@ -587,7 +587,7 @@ static void info_link(struct proxy_data *pd)
|
|||
fprintf(stdout, "%c\tinput-port-id: %u\n", MARK_CHANGE(1), info->input_port_id);
|
||||
fprintf(stdout, "%c\tformat:\n", MARK_CHANGE(2));
|
||||
if (info->format)
|
||||
spa_debug_pod(&info->format->pod, SPA_DEBUG_FLAG_FORMAT);
|
||||
spa_debug_pod(info->format, SPA_DEBUG_FLAG_FORMAT);
|
||||
else
|
||||
fprintf(stdout, "\t\tnone\n");
|
||||
print_properties(info->props, MARK_CHANGE(3));
|
||||
|
|
|
|||
|
|
@ -156,18 +156,18 @@ static void node_event_info(void *object, struct pw_node_info *info)
|
|||
printf("%c\tinput params:\n", MARK_CHANGE(2));
|
||||
for (i = 0; i < info->n_input_params; i++) {
|
||||
uint32_t flags = 0;
|
||||
if (info->input_params[i]->body.type == t->spa_format)
|
||||
if (spa_pod_is_object_type(info->input_params[i], t->spa_format))
|
||||
flags |= SPA_DEBUG_FLAG_FORMAT;
|
||||
spa_debug_pod(&info->input_params[i]->pod, flags);
|
||||
spa_debug_pod(info->input_params[i], flags);
|
||||
}
|
||||
|
||||
printf("%c\toutput ports: %u/%u\n", MARK_CHANGE(3), info->n_output_ports, info->max_output_ports);
|
||||
printf("%c\toutput params:\n", MARK_CHANGE(4));
|
||||
for (i = 0; i < info->n_output_params; i++) {
|
||||
uint32_t flags = 0;
|
||||
if (info->output_params[i]->body.type == t->spa_format)
|
||||
if (spa_pod_is_object_type(info->output_params[i], t->spa_format))
|
||||
flags |= SPA_DEBUG_FLAG_FORMAT;
|
||||
spa_debug_pod(&info->output_params[i]->pod, flags);
|
||||
spa_debug_pod(info->output_params[i], flags);
|
||||
}
|
||||
|
||||
printf("%c\tstate: \"%s\"", MARK_CHANGE(5), pw_node_state_as_string(info->state));
|
||||
|
|
@ -283,7 +283,7 @@ static void link_event_info(void *object, struct pw_link_info *info)
|
|||
printf("%c\tinput-port-id: %u\n", MARK_CHANGE(1), info->input_port_id);
|
||||
printf("%c\tformat:\n", MARK_CHANGE(2));
|
||||
if (info->format)
|
||||
spa_debug_pod(&info->format->pod, SPA_DEBUG_FLAG_FORMAT);
|
||||
spa_debug_pod(info->format, SPA_DEBUG_FLAG_FORMAT);
|
||||
else
|
||||
printf("\t\tnone\n");
|
||||
print_properties(info->props, MARK_CHANGE(3));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue