mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
More type fixes
Param ids and IO ids are now simple enums. Move some type info in one place, delete some type-info files Fix type debug Make audio layout an enum Mark more enums as enums in types so they show us with their names in the debug.
This commit is contained in:
parent
93a8747a44
commit
d26aecfef2
82 changed files with 869 additions and 1118 deletions
|
|
@ -38,7 +38,6 @@ spa_debug_format_value(const struct spa_type_info *info,
|
|||
fprintf(stderr, "%s", *(int32_t *) body ? "true" : "false");
|
||||
break;
|
||||
case SPA_ID_Enum:
|
||||
case SPA_ID_Int:
|
||||
{
|
||||
const char *str = spa_debug_type_find_name(info, *(int32_t *) body);
|
||||
char tmp[64];
|
||||
|
|
@ -53,6 +52,9 @@ spa_debug_format_value(const struct spa_type_info *info,
|
|||
fprintf(stderr, "%s", str);
|
||||
break;
|
||||
}
|
||||
case SPA_ID_Int:
|
||||
fprintf(stderr, "%d", *(int32_t *) body);
|
||||
break;
|
||||
case SPA_ID_Long:
|
||||
fprintf(stderr, "%" PRIi64, *(int64_t *) body);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info,
|
|||
{
|
||||
struct spa_pod_pointer_body *b = body;
|
||||
spa_debug("%*s" "Pointer %s %p", indent, "",
|
||||
spa_debug_type_find_name(info, b->type), b->value);
|
||||
spa_debug_type_find_name(spa_types, b->type), b->value);
|
||||
break;
|
||||
}
|
||||
case SPA_ID_Rectangle:
|
||||
|
|
@ -89,8 +89,12 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info,
|
|||
{
|
||||
struct spa_pod_array_body *b = body;
|
||||
void *p;
|
||||
spa_debug("%*s" "Array: child.size %d, child.type %d", indent, "",
|
||||
b->child.size, b->child.type);
|
||||
const struct spa_type_info *ti = spa_debug_type_find(info, b->child.type);
|
||||
|
||||
spa_debug("%*s" "Array: child.size %d, child.type %s", indent, "",
|
||||
b->child.size, ti ? ti->name : "unknown");
|
||||
|
||||
info = ti ? ti->values : info;
|
||||
|
||||
SPA_POD_ARRAY_BODY_FOREACH(b, size, p)
|
||||
spa_debug_pod_value(indent + 2, info, b->child.type, p, b->child.size);
|
||||
|
|
@ -112,8 +116,11 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info,
|
|||
|
||||
spa_debug("%*s" "Object: size %d, id %s, type %s", indent, "", size,
|
||||
spa_debug_type_find_name(info, b->id), ti ? ti->name : "unknown");
|
||||
|
||||
info = ti ? ti->values : info;
|
||||
|
||||
SPA_POD_OBJECT_BODY_FOREACH(b, size, p)
|
||||
spa_debug_pod_value(indent + 2, ti ? ti->values : NULL,
|
||||
spa_debug_pod_value(indent + 2, info,
|
||||
p->type, SPA_POD_BODY(p), p->size);
|
||||
break;
|
||||
}
|
||||
|
|
@ -122,13 +129,18 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info,
|
|||
struct spa_pod_prop_body *b = body;
|
||||
void *alt;
|
||||
int i;
|
||||
const struct spa_type_info *ti = spa_debug_type_find(info, b->key);
|
||||
|
||||
spa_debug("%*s" "Prop: key %s, flags %d", indent, "",
|
||||
spa_debug_type_find_name(info, b->key), b->flags);
|
||||
ti ? ti->name : "unknown", b->flags);
|
||||
|
||||
info = ti ? ti->values : info;
|
||||
|
||||
if (b->flags & SPA_POD_PROP_FLAG_UNSET)
|
||||
spa_debug("%*s" "Unset (Default):", indent + 2, "");
|
||||
else
|
||||
spa_debug("%*s" "Value: size %u", indent + 2, "", b->value.size);
|
||||
|
||||
spa_debug_pod_value(indent + 4, info, b->value.type, SPA_POD_BODY(&b->value),
|
||||
b->value.size);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,8 @@ install_headers(spa_node_headers,
|
|||
spa_param_headers = [
|
||||
'param/param.h',
|
||||
'param/props.h',
|
||||
'param/buffers.h',
|
||||
'param/meta.h',
|
||||
'param/io.h',
|
||||
'param/format.h',
|
||||
'param/type-info.h',
|
||||
]
|
||||
|
||||
install_headers(spa_param_headers,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/pod/pod.h>
|
||||
|
||||
/** Buffers IO area
|
||||
*
|
||||
|
|
@ -32,6 +33,17 @@ extern "C" {
|
|||
* by the host and configured on all ports for which IO is requested.
|
||||
*/
|
||||
|
||||
/** Different IO area types */
|
||||
enum spa_io_type {
|
||||
SPA_IO_BASE,
|
||||
|
||||
SPA_IO_Buffers,
|
||||
SPA_IO_ControlRange,
|
||||
SPA_IO_Clock,
|
||||
SPA_IO_Latency,
|
||||
SPA_IO_Events,
|
||||
};
|
||||
|
||||
struct spa_io_buffers {
|
||||
#define SPA_STATUS_OK 0
|
||||
#define SPA_STATUS_NEED_BUFFER (1<<0)
|
||||
|
|
@ -69,6 +81,11 @@ struct spa_io_latency {
|
|||
uint64_t max; /**< max latency */
|
||||
};
|
||||
|
||||
/** event stream */
|
||||
struct spa_io_events {
|
||||
struct spa_pod_sequence sequence; /**< sequence of timed events */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -28,24 +28,12 @@ extern "C" {
|
|||
#include <spa/pod/parser.h>
|
||||
#include <spa/param/audio/format.h>
|
||||
|
||||
#if 0
|
||||
#define SPA_TYPE_FORMAT__Audio SPA_TYPE_FORMAT_BASE "Audio"
|
||||
#define SPA_TYPE_FORMAT_AUDIO_BASE SPA_TYPE_FORMAT__Audio ":"
|
||||
|
||||
#define SPA_TYPE_FORMAT_AUDIO__format SPA_TYPE_FORMAT_AUDIO_BASE "format"
|
||||
#define SPA_TYPE_FORMAT_AUDIO__flags SPA_TYPE_FORMAT_AUDIO_BASE "flags"
|
||||
#define SPA_TYPE_FORMAT_AUDIO__layout SPA_TYPE_FORMAT_AUDIO_BASE "layout"
|
||||
#define SPA_TYPE_FORMAT_AUDIO__rate SPA_TYPE_FORMAT_AUDIO_BASE "rate"
|
||||
#define SPA_TYPE_FORMAT_AUDIO__channels SPA_TYPE_FORMAT_AUDIO_BASE "channels"
|
||||
#define SPA_TYPE_FORMAT_AUDIO__channelMask SPA_TYPE_FORMAT_AUDIO_BASE "channel-mask"
|
||||
#endif
|
||||
|
||||
static inline int
|
||||
spa_format_audio_raw_parse(const struct spa_pod *format, struct spa_audio_info_raw *info)
|
||||
{
|
||||
return spa_pod_object_parse(format,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", &info->format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", &info->layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", &info->layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", &info->rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", &info->channels,
|
||||
":", SPA_FORMAT_AUDIO_flags, "?i", &info->flags,
|
||||
|
|
|
|||
|
|
@ -1,58 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_BUFFERS_TYPES_H__
|
||||
#define __SPA_PARAM_BUFFERS_TYPES_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param-types.h>
|
||||
|
||||
#define SPA_TYPE_PARAM__Buffers SPA_TYPE_PARAM_BASE "Buffers"
|
||||
#define SPA_TYPE_PARAM_BUFFERS_BASE SPA_TYPE_PARAM__Buffers ":"
|
||||
|
||||
#define SPA_TYPE_PARAM_BUFFERS__buffers SPA_TYPE_PARAM_BUFFERS_BASE "buffers"
|
||||
#define SPA_TYPE_PARAM_BUFFERS__blocks SPA_TYPE_PARAM_BUFFERS_BASE "blocks"
|
||||
|
||||
#define SPA_TYPE_PARAM__BlockInfo SPA_TYPE_PARAM_BASE "BlockInfo"
|
||||
#define SPA_TYPE_PARAM_BLOCK_INFO_BASE SPA_TYPE_PARAM__BlockInfo ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param_buffers_items[] = {
|
||||
{ SPA_PARAM_BUFFERS_buffers, SPA_TYPE_PARAM_BUFFERS_BASE "buffers", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_blocks, SPA_TYPE_PARAM_BUFFERS_BASE "blocks", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_size, SPA_TYPE_PARAM_BLOCK_INFO_BASE "size", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_stride, SPA_TYPE_PARAM_BLOCK_INFO_BASE "stride", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_align, SPA_TYPE_PARAM_BLOCK_INFO_BASE "align", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
static const struct spa_type_info spa_type_param_buffers[] = {
|
||||
{ SPA_ID_OBJECT_ParamBuffers, SPA_TYPE_PARAM__Buffers, SPA_ID_Object,
|
||||
spa_type_param_buffers_items },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_BUFFERS_TYPES_H__ */
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_BUFFERS_H__
|
||||
#define __SPA_PARAM_BUFFERS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamBuffers */
|
||||
enum spa_param_buffers {
|
||||
SPA_PARAM_BUFFERS_buffers, /**< number of buffers */
|
||||
SPA_PARAM_BUFFERS_blocks, /**< number of data blocks per buffer */
|
||||
SPA_PARAM_BUFFERS_size, /**< size of a data block memory */
|
||||
SPA_PARAM_BUFFERS_stride, /**< stride of data block memory */
|
||||
SPA_PARAM_BUFFERS_align, /**< alignment of data block memory */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_BUFFERS_H__ */
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_IO_H__
|
||||
#define __SPA_PARAM_IO_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/support/type-map.h>
|
||||
|
||||
/** type ID of property, uniquely identifies the io area for a port */
|
||||
#define SPA_TYPE_PARAM_IO__id SPA_TYPE_PARAM_IO_BASE "id"
|
||||
/** size of the io area for a port */
|
||||
#define SPA_TYPE_PARAM_IO__size SPA_TYPE_PARAM_IO_BASE "size"
|
||||
|
||||
/** enumerate buffer io areas */
|
||||
#define SPA_TYPE_PARAM_ID_IO__Buffers SPA_TYPE_PARAM_ID_IO_BASE "Buffers"
|
||||
/* an io area to exchange buffers */
|
||||
#define SPA_TYPE_PARAM_IO__Buffers SPA_TYPE_PARAM_IO_BASE "Buffers"
|
||||
|
||||
/** enumerate Control io areas */
|
||||
#define SPA_TYPE_PARAM_ID_IO__Control SPA_TYPE_PARAM_ID_IO_BASE "Control"
|
||||
/* an io area to exchange control information */
|
||||
#define SPA_TYPE_PARAM_IO__Control SPA_TYPE_PARAM_IO_BASE "Control"
|
||||
|
||||
/** enumerate input or output properties */
|
||||
#define SPA_TYPE_PARAM_ID_IO__Props SPA_TYPE_PARAM_ID_IO_BASE "Props"
|
||||
#define SPA_TYPE_PARAM_ID_IO_PROPS_BASE SPA_TYPE_PARAM_ID_IO__Props ":"
|
||||
/** enumerate input property io areas */
|
||||
#define SPA_TYPE_PARAM_ID_IO_PROPS__In SPA_TYPE_PARAM_ID_IO_PROPS_BASE "In"
|
||||
/** enumerate output property io areas */
|
||||
#define SPA_TYPE_PARAM_ID_IO_PROPS__Out SPA_TYPE_PARAM_ID_IO_PROPS_BASE "Out"
|
||||
|
||||
/* an io area to exchange properties. Contents can include
|
||||
* SPA_TYPE_PARAM__PropInfo */
|
||||
#define SPA_TYPE_PARAM_IO__Prop SPA_TYPE_PARAM_IO_BASE "Prop"
|
||||
#define SPA_TYPE_PARAM_IO_PROP_BASE SPA_TYPE_PARAM_IO__Prop ":"
|
||||
|
||||
/** enumerate clock io areas */
|
||||
#define SPA_TYPE_PARAM_ID_IO__Clock SPA_TYPE_PARAM_ID_IO_BASE "Clock"
|
||||
/* an io area to exchange clock information */
|
||||
#define SPA_TYPE_PARAM_IO__Clock SPA_TYPE_PARAM_IO_BASE "Clock"
|
||||
|
||||
struct spa_type_param_io {
|
||||
uint32_t id; /**< id to configure the io area */
|
||||
uint32_t size; /**< size of io area */
|
||||
uint32_t idBuffers; /**< id to enumerate buffer io */
|
||||
uint32_t Buffers; /**< object type of buffer io area */
|
||||
uint32_t idControl; /**< id to enumerate control io */
|
||||
uint32_t Control; /**< object type of Control area */
|
||||
uint32_t idPropsIn; /**< id to enumerate input properties io */
|
||||
uint32_t idPropsOut; /**< id to enumerate output properties io */
|
||||
uint32_t Prop; /**< object type of property area */
|
||||
uint32_t idClock; /**< id to enumerate clock io */
|
||||
uint32_t Clock; /**< object type of clock io area */
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_param_io_map(struct spa_type_map *map,
|
||||
struct spa_type_param_io *type)
|
||||
{
|
||||
if (type->id == 0) {
|
||||
type->id = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__id);
|
||||
type->size = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__size);
|
||||
type->idBuffers = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID_IO__Buffers);
|
||||
type->Buffers = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__Buffers);
|
||||
type->idControl = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID_IO__Control);
|
||||
type->Control = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__Control);
|
||||
type->idPropsIn = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID_IO_PROPS__In);
|
||||
type->idPropsOut = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID_IO_PROPS__Out);
|
||||
type->Prop = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__Prop);
|
||||
type->idClock = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID_IO__Clock);
|
||||
type->Clock = spa_type_map_get_id(map, SPA_TYPE_PARAM_IO__Clock);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_IO_H__ */
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_IO_H__
|
||||
#define __SPA_PARAM_IO_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamIO */
|
||||
enum spa_param_io {
|
||||
SPA_PARAM_IO_id, /**< type ID, uniquely identifies the io area */
|
||||
SPA_PARAM_IO_size, /**< size of the io area */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_IO_H__ */
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_META_H__
|
||||
#define __SPA_PARAM_META_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <fcntl.h> /* for off_t */
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/support/type-map.h>
|
||||
|
||||
#define SPA_TYPE_PARAM__Meta SPA_TYPE_PARAM_BASE "Meta"
|
||||
#define SPA_TYPE_PARAM_META_BASE SPA_TYPE_PARAM__Meta ":"
|
||||
#define SPA_TYPE_PARAM_META__type SPA_TYPE_PARAM_META_BASE "type"
|
||||
#define SPA_TYPE_PARAM_META__size SPA_TYPE_PARAM_META_BASE "size"
|
||||
|
||||
struct spa_type_param_meta {
|
||||
uint32_t Meta;
|
||||
uint32_t type;
|
||||
uint32_t size;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_param_meta_map(struct spa_type_map *map,
|
||||
struct spa_type_param_meta *type)
|
||||
{
|
||||
if (type->Meta == 0) {
|
||||
size_t i;
|
||||
#define OFF(n) offsetof(struct spa_type_param_meta, n)
|
||||
static struct { off_t offset; const char *type; } tab[] = {
|
||||
{ OFF(Meta), SPA_TYPE_PARAM__Meta },
|
||||
{ OFF(type), SPA_TYPE_PARAM_META__type },
|
||||
{ OFF(size), SPA_TYPE_PARAM_META__size },
|
||||
};
|
||||
#undef OFF
|
||||
for (i = 0; i < SPA_N_ELEMENTS(tab); i++)
|
||||
*SPA_MEMBER(type, tab[i].offset, uint32_t) = spa_type_map_get_id(map, tab[i].type);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_META_H__ */
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_META_H__
|
||||
#define __SPA_PARAM_META_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/param/param.h>
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamMeta */
|
||||
enum spa_param_meta {
|
||||
SPA_PARAM_META_type, /**< the metadata, one of enum spa_meta_type */
|
||||
SPA_PARAM_META_size, /**< the expected maximum size the meta */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_META_H__ */
|
||||
|
|
@ -41,6 +41,8 @@ extern "C" {
|
|||
/* object with supported parameter id */
|
||||
#define SPA_TYPE_PARAM__List SPA_TYPE_PARAM_BASE "List"
|
||||
#define SPA_TYPE_PARAM_LIST_BASE SPA_TYPE_PARAM__List ":"
|
||||
|
||||
|
||||
#define SPA_TYPE_PARAM_LIST__id SPA_TYPE_PARAM_LIST_BASE "id"
|
||||
|
||||
/** Enum Property info */
|
||||
|
|
|
|||
|
|
@ -26,11 +26,43 @@ extern "C" {
|
|||
|
||||
#include <spa/utils/defs.h>
|
||||
|
||||
/** different parameter types that can be queried */
|
||||
enum spa_param_type {
|
||||
SPA_PARAM_List, /**< available params */
|
||||
SPA_PARAM_PropInfo, /**< property information */
|
||||
SPA_PARAM_Props, /**< properties */
|
||||
SPA_PARAM_EnumFormat, /**< available formats */
|
||||
SPA_PARAM_Format, /**< configured format */
|
||||
SPA_PARAM_Buffers, /**< buffer configurations */
|
||||
SPA_PARAM_Meta, /**< allowed metadata for buffers */
|
||||
SPA_PARAM_IO, /**< configurable IO areas */
|
||||
};
|
||||
|
||||
/** Properties for SPA_ID_OBJECT_ParamList */
|
||||
enum spa_param_list {
|
||||
SPA_PARAM_LIST_id, /**< id of the supported list param */
|
||||
};
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamBuffers */
|
||||
enum spa_param_buffers {
|
||||
SPA_PARAM_BUFFERS_buffers, /**< number of buffers */
|
||||
SPA_PARAM_BUFFERS_blocks, /**< number of data blocks per buffer */
|
||||
SPA_PARAM_BUFFERS_size, /**< size of a data block memory */
|
||||
SPA_PARAM_BUFFERS_stride, /**< stride of data block memory */
|
||||
SPA_PARAM_BUFFERS_align, /**< alignment of data block memory */
|
||||
};
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamMeta */
|
||||
enum spa_param_meta {
|
||||
SPA_PARAM_META_type, /**< the metadata, one of enum spa_meta_type */
|
||||
SPA_PARAM_META_size, /**< the expected maximum size the meta */
|
||||
};
|
||||
|
||||
/** properties for SPA_ID_OBJECT_ParamIO */
|
||||
enum spa_param_io {
|
||||
SPA_PARAM_IO_id, /**< type ID, uniquely identifies the io area */
|
||||
SPA_PARAM_IO_size, /**< size of the io area */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
|
|
|||
|
|
@ -1,70 +0,0 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_PROPS_TYPES_H__
|
||||
#define __SPA_PARAM_PROPS_TYPES_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/param/param.h>
|
||||
|
||||
#define SPA_TYPE__Props SPA_TYPE_PARAM_BASE "Props"
|
||||
#define SPA_TYPE_PROPS_BASE SPA_TYPE__Props ":"
|
||||
|
||||
/** an unknown property */
|
||||
#define SPA_TYPE_PROPS__unknown SPA_TYPE_PROPS_BASE "unknown"
|
||||
|
||||
/** Common property ids */
|
||||
#define SPA_TYPE_PROPS__device SPA_TYPE_PROPS_BASE "device"
|
||||
#define SPA_TYPE_PROPS__deviceName SPA_TYPE_PROPS_BASE "deviceName"
|
||||
#define SPA_TYPE_PROPS__deviceFd SPA_TYPE_PROPS_BASE "deviceFd"
|
||||
#define SPA_TYPE_PROPS__card SPA_TYPE_PROPS_BASE "card"
|
||||
#define SPA_TYPE_PROPS__cardName SPA_TYPE_PROPS_BASE "cardName"
|
||||
|
||||
#define SPA_TYPE_PROPS__minLatency SPA_TYPE_PROPS_BASE "minLatency"
|
||||
#define SPA_TYPE_PROPS__maxLatency SPA_TYPE_PROPS_BASE "maxLatency"
|
||||
#define SPA_TYPE_PROPS__periods SPA_TYPE_PROPS_BASE "periods"
|
||||
#define SPA_TYPE_PROPS__periodSize SPA_TYPE_PROPS_BASE "periodSize"
|
||||
#define SPA_TYPE_PROPS__periodEvent SPA_TYPE_PROPS_BASE "periodEvent"
|
||||
|
||||
#define SPA_TYPE_PROPS__live SPA_TYPE_PROPS_BASE "live"
|
||||
#define SPA_TYPE_PROPS__waveType SPA_TYPE_PROPS_BASE "waveType"
|
||||
#define SPA_TYPE_PROPS__frequency SPA_TYPE_PROPS_BASE "frequency"
|
||||
#define SPA_TYPE_PROPS__volume SPA_TYPE_PROPS_BASE "volume"
|
||||
#define SPA_TYPE_PROPS__mute SPA_TYPE_PROPS_BASE "mute"
|
||||
#define SPA_TYPE_PROPS__patternType SPA_TYPE_PROPS_BASE "patternType"
|
||||
#define SPA_TYPE_PROPS__ditherType SPA_TYPE_PROPS_BASE "ditherType"
|
||||
#define SPA_TYPE_PROPS__truncate SPA_TYPE_PROPS_BASE "truncate"
|
||||
|
||||
#define SPA_TYPE_PROPS__brightness SPA_TYPE_PROPS_BASE "brightness"
|
||||
#define SPA_TYPE_PROPS__contrast SPA_TYPE_PROPS_BASE "contrast"
|
||||
#define SPA_TYPE_PROPS__saturation SPA_TYPE_PROPS_BASE "saturation"
|
||||
#define SPA_TYPE_PROPS__hue SPA_TYPE_PROPS_BASE "hue"
|
||||
#define SPA_TYPE_PROPS__gamma SPA_TYPE_PROPS_BASE "gamma"
|
||||
#define SPA_TYPE_PROPS__exposure SPA_TYPE_PROPS_BASE "exposure"
|
||||
#define SPA_TYPE_PROPS__gain SPA_TYPE_PROPS_BASE "gain"
|
||||
#define SPA_TYPE_PROPS__sharpness SPA_TYPE_PROPS_BASE "sharpness"
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_PROPS_TYPES_H__ */
|
||||
148
spa/include/spa/param/type-info.h
Normal file
148
spa/include/spa/param/type-info.h
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
/* Simple Plugin API
|
||||
* Copyright (C) 2016 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SPA_PARAM_TYPES_H__
|
||||
#define __SPA_PARAM_TYPES_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/utils/type-info.h>
|
||||
#include <spa/param/props.h>
|
||||
|
||||
/* base for parameter objects */
|
||||
#define SPA_TYPE__Param SPA_TYPE_OBJECT_BASE "Param"
|
||||
#define SPA_TYPE_PARAM_BASE SPA_TYPE__Param ":"
|
||||
|
||||
/* object with supported parameter id */
|
||||
#define SPA_TYPE_PARAM__List SPA_TYPE_PARAM_BASE "List"
|
||||
#define SPA_TYPE_PARAM_LIST_BASE SPA_TYPE_PARAM__List ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param_list[] = {
|
||||
{ SPA_PARAM_LIST_id, SPA_TYPE_PARAM_LIST_BASE "id", SPA_ID_Enum, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
#define SPA_TYPE__Props SPA_TYPE_PARAM_BASE "Props"
|
||||
#define SPA_TYPE_PROPS_BASE SPA_TYPE__Props ":"
|
||||
|
||||
static const struct spa_type_info spa_type_props[] = {
|
||||
{ SPA_PROP_unknown, SPA_TYPE_PROPS_BASE "unknown", SPA_ID_INVALID, },
|
||||
{ SPA_PROP_device, SPA_TYPE_PROPS_BASE "device", SPA_ID_String, },
|
||||
{ SPA_PROP_deviceName, SPA_TYPE_PROPS_BASE "deviceName", SPA_ID_String, },
|
||||
{ SPA_PROP_deviceFd, SPA_TYPE_PROPS_BASE "deviceFd", SPA_ID_Fd, },
|
||||
{ SPA_PROP_card, SPA_TYPE_PROPS_BASE "card", SPA_ID_String, },
|
||||
{ SPA_PROP_cardName, SPA_TYPE_PROPS_BASE "cardName", SPA_ID_String, },
|
||||
{ SPA_PROP_minLatency, SPA_TYPE_PROPS_BASE "minLatency", SPA_ID_Int, },
|
||||
{ SPA_PROP_maxLatency, SPA_TYPE_PROPS_BASE "maxLatency", SPA_ID_Int, },
|
||||
{ SPA_PROP_periods, SPA_TYPE_PROPS_BASE "periods", SPA_ID_Int, },
|
||||
{ SPA_PROP_periodSize, SPA_TYPE_PROPS_BASE "periodSize", SPA_ID_Int, },
|
||||
{ SPA_PROP_periodEvent, SPA_TYPE_PROPS_BASE "periodEvent", SPA_ID_Bool, },
|
||||
{ SPA_PROP_live, SPA_TYPE_PROPS_BASE "live", SPA_ID_Bool, },
|
||||
{ SPA_PROP_waveType, SPA_TYPE_PROPS_BASE "waveType", SPA_ID_Enum, },
|
||||
{ SPA_PROP_frequency, SPA_TYPE_PROPS_BASE "frequency", SPA_ID_Int, },
|
||||
{ SPA_PROP_volume, SPA_TYPE_PROPS_BASE "volume", SPA_ID_Float, },
|
||||
{ SPA_PROP_mute, SPA_TYPE_PROPS_BASE "mute", SPA_ID_Bool, },
|
||||
{ SPA_PROP_patternType, SPA_TYPE_PROPS_BASE "patternType", SPA_ID_Enum, },
|
||||
{ SPA_PROP_ditherType, SPA_TYPE_PROPS_BASE "ditherType", SPA_ID_Enum, },
|
||||
{ SPA_PROP_truncate, SPA_TYPE_PROPS_BASE "truncate", SPA_ID_Bool, },
|
||||
{ SPA_PROP_brightness, SPA_TYPE_PROPS_BASE "brightness", SPA_ID_Int, },
|
||||
{ SPA_PROP_contrast, SPA_TYPE_PROPS_BASE "contrast", SPA_ID_Int, },
|
||||
{ SPA_PROP_saturation, SPA_TYPE_PROPS_BASE "saturation", SPA_ID_Int, },
|
||||
{ SPA_PROP_hue, SPA_TYPE_PROPS_BASE "hue", SPA_ID_Int, },
|
||||
{ SPA_PROP_gamma, SPA_TYPE_PROPS_BASE "gamma", SPA_ID_Int, },
|
||||
{ SPA_PROP_exposure, SPA_TYPE_PROPS_BASE "exposure", SPA_ID_Int, },
|
||||
{ SPA_PROP_gain, SPA_TYPE_PROPS_BASE "gain", SPA_ID_Int, },
|
||||
{ SPA_PROP_sharpness, SPA_TYPE_PROPS_BASE "sharpness", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
/** Enum Property info */
|
||||
#define SPA_TYPE__PropInfo SPA_TYPE_PARAM_BASE "PropInfo"
|
||||
#define SPA_TYPE_PROP_INFO_BASE SPA_TYPE__PropInfo ":"
|
||||
|
||||
static const struct spa_type_info spa_type_prop_info[] = {
|
||||
{ SPA_PROP_INFO_id, SPA_TYPE_PROP_INFO_BASE "id", SPA_ID_Enum, spa_type_props },
|
||||
{ SPA_PROP_INFO_name, SPA_TYPE_PROP_INFO_BASE "name", SPA_ID_String, },
|
||||
{ SPA_PROP_INFO_type, SPA_TYPE_PROP_INFO_BASE "type", SPA_ID_Prop, },
|
||||
{ SPA_PROP_INFO_labels, SPA_TYPE_PROP_INFO_BASE "labels", SPA_ID_Struct, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
#define SPA_TYPE_PARAM__Meta SPA_TYPE_PARAM_BASE "Meta"
|
||||
#define SPA_TYPE_PARAM_META_BASE SPA_TYPE_PARAM__Meta ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param_meta[] = {
|
||||
{ SPA_PARAM_META_type, SPA_TYPE_PARAM_META_BASE "type", SPA_ID_Enum, },
|
||||
{ SPA_PARAM_META_size, SPA_TYPE_PARAM_META_BASE "size", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
/** Base for parameters that describe IO areas to exchange data,
|
||||
* control and properties with a node.
|
||||
*/
|
||||
#define SPA_TYPE_PARAM__IO SPA_TYPE_PARAM_BASE "IO"
|
||||
#define SPA_TYPE_PARAM_IO_BASE SPA_TYPE_PARAM__IO ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param_io[] = {
|
||||
{ SPA_PARAM_IO_id, SPA_TYPE_PARAM_IO_BASE "id", SPA_ID_Enum, },
|
||||
{ SPA_PARAM_IO_size, SPA_TYPE_PARAM_IO_BASE "size", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
#include <spa/param/format-types.h>
|
||||
|
||||
#define SPA_TYPE_PARAM__Buffers SPA_TYPE_PARAM_BASE "Buffers"
|
||||
#define SPA_TYPE_PARAM_BUFFERS_BASE SPA_TYPE_PARAM__Buffers ":"
|
||||
|
||||
#define SPA_TYPE_PARAM__BlockInfo SPA_TYPE_PARAM_BUFFERS_BASE "BlockInfo"
|
||||
#define SPA_TYPE_PARAM_BLOCK_INFO_BASE SPA_TYPE_PARAM__BlockInfo ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param_buffers[] = {
|
||||
{ SPA_PARAM_BUFFERS_buffers, SPA_TYPE_PARAM_BUFFERS_BASE "buffers", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_blocks, SPA_TYPE_PARAM_BUFFERS_BASE "blocks", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_size, SPA_TYPE_PARAM_BLOCK_INFO_BASE "size", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_stride, SPA_TYPE_PARAM_BLOCK_INFO_BASE "stride", SPA_ID_Int, },
|
||||
{ SPA_PARAM_BUFFERS_align, SPA_TYPE_PARAM_BLOCK_INFO_BASE "align", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
/* base for parameter object enumerations */
|
||||
#define SPA_TYPE__ParamId SPA_TYPE_ENUM_BASE "ParamId"
|
||||
#define SPA_TYPE_PARAM_ID_BASE SPA_TYPE__ParamId ":"
|
||||
|
||||
static const struct spa_type_info spa_type_param[] = {
|
||||
{ SPA_PARAM_List, SPA_TYPE_PARAM_ID_BASE "List", SPA_ID_Int, },
|
||||
{ SPA_PARAM_PropInfo, SPA_TYPE_PARAM_ID_BASE "PropInfo", SPA_ID_Int, },
|
||||
{ SPA_PARAM_Props, SPA_TYPE_PARAM_ID_BASE "Props", SPA_ID_Int, },
|
||||
{ SPA_PARAM_EnumFormat, SPA_TYPE_PARAM_ID_BASE "EnumFormat", SPA_ID_Int, },
|
||||
{ SPA_PARAM_Format, SPA_TYPE_PARAM_ID_BASE "Format", SPA_ID_Int, },
|
||||
{ SPA_PARAM_Buffers, SPA_TYPE_PARAM_ID_BASE "Buffers", SPA_ID_Int, },
|
||||
{ SPA_PARAM_Meta, SPA_TYPE_PARAM_ID_BASE "Meta", SPA_ID_Int, },
|
||||
{ SPA_PARAM_IO, SPA_TYPE_PARAM_ID_BASE "IO", SPA_ID_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_TYPES_H__ */
|
||||
|
|
@ -195,11 +195,11 @@ static inline uint32_t spa_pod_builder_bool(struct spa_pod_builder *builder, boo
|
|||
return spa_pod_builder_primitive(builder, &p.pod);
|
||||
}
|
||||
|
||||
#define SPA_POD_ID_INIT(val) (struct spa_pod_id){ { sizeof(uint32_t), SPA_ID_Enum }, val, 0 }
|
||||
#define SPA_POD_ENUM_INIT(val) (struct spa_pod_enum){ { sizeof(uint32_t), SPA_ID_Enum }, val, 0 }
|
||||
|
||||
static inline uint32_t spa_pod_builder_id(struct spa_pod_builder *builder, uint32_t val)
|
||||
static inline uint32_t spa_pod_builder_enum(struct spa_pod_builder *builder, uint32_t val)
|
||||
{
|
||||
const struct spa_pod_id p = SPA_POD_ID_INIT(val);
|
||||
const struct spa_pod_enum p = SPA_POD_ENUM_INIT(val);
|
||||
return spa_pod_builder_primitive(builder, &p.pod);
|
||||
}
|
||||
|
||||
|
|
@ -412,7 +412,7 @@ do { \
|
|||
spa_pod_builder_bool(builder, va_arg(args, int)); \
|
||||
break; \
|
||||
case 'I': \
|
||||
spa_pod_builder_id(builder, va_arg(args, uint32_t)); \
|
||||
spa_pod_builder_enum(builder, va_arg(args, uint32_t)); \
|
||||
break; \
|
||||
case 'i': \
|
||||
spa_pod_builder_int(builder, va_arg(args, int)); \
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ struct spa_pod_bool {
|
|||
int32_t __padding;
|
||||
};
|
||||
|
||||
struct spa_pod_id {
|
||||
struct spa_pod_enum {
|
||||
struct spa_pod pod;
|
||||
uint32_t value;
|
||||
int32_t __padding;
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ struct spa_type_info {
|
|||
|
||||
#include <spa/monitor/type-info.h>
|
||||
#include <spa/node/type-info.h>
|
||||
#include <spa/param/type-info.h>
|
||||
|
||||
static const struct spa_type_info spa_types[] = {
|
||||
{ SPA_ID_INVALID, "*invalid*", SPA_ID_INVALID, },
|
||||
|
|
@ -97,6 +98,11 @@ static const struct spa_type_info spa_types[] = {
|
|||
{ SPA_ID_Fd, SPA_TYPE_BASE "Fd", SPA_ID_Fd, },
|
||||
{ SPA_ID_Prop, SPA_TYPE_POD_BASE "Prop", SPA_ID_Pod, },
|
||||
|
||||
{ SPA_ID_POINTER_BASE, SPA_TYPE__Pointer, SPA_ID_Pointer, },
|
||||
{ SPA_ID_POINTER_Buffer, SPA_TYPE_POINTER_BASE "Buffer", SPA_ID_Pointer, },
|
||||
{ SPA_ID_POINTER_Meta, SPA_TYPE_POINTER_BASE "Meta", SPA_ID_Pointer, },
|
||||
{ SPA_ID_POINTER_Dict, SPA_TYPE_POINTER_BASE "Dict", SPA_ID_Pointer, },
|
||||
|
||||
{ SPA_ID_INTERFACE_BASE, SPA_TYPE__Interface, SPA_ID_Pointer, },
|
||||
{ SPA_ID_INTERFACE_Handle, SPA_TYPE_INTERFACE_BASE "Handle", SPA_ID_INTERFACE_BASE, },
|
||||
{ SPA_ID_INTERFACE_HandleFactory, SPA_TYPE_INTERFACE_BASE "HandleFactory", SPA_ID_INTERFACE_BASE, },
|
||||
|
|
@ -117,6 +123,16 @@ static const struct spa_type_info spa_types[] = {
|
|||
{ SPA_ID_COMMAND_BASE, SPA_TYPE__Command, SPA_ID_Object, },
|
||||
{ SPA_ID_COMMAND_Node, SPA_TYPE_COMMAND_BASE "Node", SPA_ID_COMMAND_BASE, },
|
||||
|
||||
{ SPA_ID_OBJECT_BASE, SPA_TYPE__Object, SPA_ID_Object, },
|
||||
{ SPA_ID_OBJECT_MonitorItem, SPA_TYPE__MonitorItem, SPA_ID_Object, spa_type_monitor_item },
|
||||
{ SPA_ID_OBJECT_ParamList, SPA_TYPE_PARAM__List, SPA_ID_Object, spa_type_param_list, },
|
||||
{ SPA_ID_OBJECT_PropInfo, SPA_TYPE__PropInfo, SPA_ID_Object, spa_type_prop_info, },
|
||||
{ SPA_ID_OBJECT_Props, SPA_TYPE__Props, SPA_ID_Object, spa_type_props },
|
||||
{ SPA_ID_OBJECT_Format, SPA_TYPE__Format, SPA_ID_Object, },
|
||||
{ SPA_ID_OBJECT_ParamBuffers, SPA_TYPE_PARAM__Buffers, SPA_ID_Object, spa_type_param_buffers, },
|
||||
{ SPA_ID_OBJECT_ParamMeta, SPA_TYPE_PARAM__Meta, SPA_ID_Object, spa_type_param_meta },
|
||||
{ SPA_ID_OBJECT_ParamIO, SPA_TYPE_PARAM__IO, SPA_ID_Object, spa_type_param_io },
|
||||
|
||||
{ 0, NULL, }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,14 @@ enum {
|
|||
SPA_ID_Prop,
|
||||
SPA_ID_Pod,
|
||||
|
||||
/* Pointers */
|
||||
SPA_ID_POINTER_BASE = 0x10000,
|
||||
SPA_ID_POINTER_Buffer,
|
||||
SPA_ID_POINTER_Meta,
|
||||
SPA_ID_POINTER_Dict,
|
||||
|
||||
/* Interfaces */
|
||||
SPA_ID_INTERFACE_BASE = 0x10000,
|
||||
SPA_ID_INTERFACE_BASE = 0x20000,
|
||||
SPA_ID_INTERFACE_Handle,
|
||||
SPA_ID_INTERFACE_HandleFactory,
|
||||
SPA_ID_INTERFACE_Log,
|
||||
|
|
@ -67,18 +73,17 @@ enum {
|
|||
SPA_ID_INTERFACE_Node,
|
||||
|
||||
/* Events */
|
||||
SPA_ID_EVENT_BASE = 0x20000,
|
||||
SPA_ID_EVENT_BASE = 0x30000,
|
||||
SPA_ID_EVENT_Monitor,
|
||||
SPA_ID_EVENT_Node,
|
||||
|
||||
/* Commands */
|
||||
SPA_ID_COMMAND_BASE = 0x30000,
|
||||
SPA_ID_COMMAND_BASE = 0x40000,
|
||||
SPA_ID_COMMAND_Node,
|
||||
|
||||
/* Objects */
|
||||
SPA_ID_OBJECT_BASE = 0x40000,
|
||||
SPA_ID_OBJECT_BASE = 0x50000,
|
||||
SPA_ID_OBJECT_MonitorItem,
|
||||
|
||||
SPA_ID_OBJECT_ParamList,
|
||||
SPA_ID_OBJECT_PropInfo,
|
||||
SPA_ID_OBJECT_Props,
|
||||
|
|
@ -87,31 +92,6 @@ enum {
|
|||
SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_ID_OBJECT_ParamIO,
|
||||
|
||||
/* IO */
|
||||
SPA_ID_IO_BASE = 0x40000,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_ID_IO_ControlRange,
|
||||
SPA_ID_IO_Clock,
|
||||
SPA_ID_IO_Prop,
|
||||
SPA_ID_IO_Latency,
|
||||
|
||||
/* Params */
|
||||
SPA_ID_PARAM_BASE = 0x50000,
|
||||
SPA_ID_PARAM_List, /**< available params */
|
||||
SPA_ID_PARAM_PropInfo, /**< property information */
|
||||
SPA_ID_PARAM_Props, /**< properties */
|
||||
SPA_ID_PARAM_EnumFormat, /**< available formats */
|
||||
SPA_ID_PARAM_Format, /**< configured format */
|
||||
SPA_ID_PARAM_Buffers, /**< buffer configurations */
|
||||
SPA_ID_PARAM_Meta, /**< allowed metadata for buffers */
|
||||
SPA_ID_PARAM_IO, /**< configurable IO areas */
|
||||
|
||||
/* Pointers */
|
||||
SPA_ID_POINTER_BASE = 0x60000,
|
||||
SPA_ID_POINTER_Buffer,
|
||||
SPA_ID_POINTER_Meta,
|
||||
SPA_ID_POINTER_Dict,
|
||||
|
||||
/* vendor extensions */
|
||||
SPA_ID_VENDOR_PipeWire = 0x01000000,
|
||||
|
||||
|
|
|
|||
|
|
@ -163,8 +163,8 @@ fill_item(struct impl *this, snd_ctl_card_info_t *card_info,
|
|||
spa_pod_builder_add(builder,
|
||||
"<", 0, SPA_ID_OBJECT_MonitorItem,
|
||||
":", SPA_MONITOR_ITEM_id, "s", id,
|
||||
":", SPA_MONITOR_ITEM_flags, "i", SPA_MONITOR_ITEM_FLAG_NONE,
|
||||
":", SPA_MONITOR_ITEM_state, "i", SPA_MONITOR_ITEM_STATE_AVAILABLE,
|
||||
":", SPA_MONITOR_ITEM_flags, "I", SPA_MONITOR_ITEM_FLAG_NONE,
|
||||
":", SPA_MONITOR_ITEM_state, "I", SPA_MONITOR_ITEM_STATE_AVAILABLE,
|
||||
":", SPA_MONITOR_ITEM_name, "s", name,
|
||||
":", SPA_MONITOR_ITEM_class, "s", klass,
|
||||
":", SPA_MONITOR_ITEM_factory, "p", SPA_ID_INTERFACE_HandleFactory, factory,
|
||||
|
|
|
|||
|
|
@ -63,10 +63,10 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_PropInfo,
|
||||
SPA_ID_PARAM_Props };
|
||||
uint32_t list[] = { SPA_PARAM_PropInfo,
|
||||
SPA_PARAM_Props };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -75,7 +75,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_PropInfo:
|
||||
case SPA_PARAM_PropInfo:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
|
|||
|
||||
this = SPA_CONTAINER_OF(node, struct state, node);
|
||||
|
||||
if (id == SPA_ID_PARAM_Props) {
|
||||
if (id == SPA_PARAM_Props) {
|
||||
struct props *p = &this->props;
|
||||
|
||||
if (param == NULL) {
|
||||
|
|
@ -318,13 +318,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO, };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO, };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -333,10 +333,10 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return spa_alsa_enum_format(this, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if (!this->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -347,12 +347,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->current_format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", this->current_format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", this->current_format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", this->current_format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", this->current_format.info.raw.channels);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (!this->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -371,7 +371,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!this->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -387,24 +387,24 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
case 1:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range));
|
||||
break;
|
||||
case 2:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Clock,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Clock,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_clock));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -486,7 +486,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(node, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -583,13 +583,13 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_IO_Buffers:
|
||||
case SPA_IO_Buffers:
|
||||
this->io = data;
|
||||
break;
|
||||
case SPA_ID_IO_ControlRange:
|
||||
case SPA_IO_ControlRange:
|
||||
this->range = data;
|
||||
break;
|
||||
case SPA_ID_IO_Clock:
|
||||
case SPA_IO_Clock:
|
||||
this->clock = data;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -67,10 +67,10 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_PropInfo,
|
||||
SPA_ID_PARAM_Props, };
|
||||
uint32_t list[] = { SPA_PARAM_PropInfo,
|
||||
SPA_PARAM_Props, };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -79,7 +79,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_PropInfo:
|
||||
case SPA_PARAM_PropInfo:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
|
|
@ -123,7 +123,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
|
|
@ -161,7 +161,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
|
|||
this = SPA_CONTAINER_OF(node, struct state, node);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -319,11 +319,11 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->current_format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", this->current_format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", this->current_format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", this->current_format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", this->current_format.info.raw.channels);
|
||||
|
||||
|
|
@ -356,12 +356,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -370,15 +370,15 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return spa_alsa_enum_format(this, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (!this->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -397,7 +397,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!this->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -413,18 +413,18 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
case 1:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Clock,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Clock,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_clock));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -504,7 +504,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(node, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -599,13 +599,16 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
switch (id) {
|
||||
case SPA_IO_Buffers:
|
||||
this->io = data;
|
||||
else if (id == SPA_ID_IO_Clock)
|
||||
break;
|
||||
case SPA_IO_Clock:
|
||||
this->clock = data;
|
||||
else
|
||||
break;
|
||||
default:
|
||||
return -ENOENT;
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ spa_alsa_enum_format(struct state *state, uint32_t *index,
|
|||
snd_pcm_hw_params_alloca(¶ms);
|
||||
CHECK(snd_pcm_hw_params_any(hndl, params), "Broken configuration: no configurations available");
|
||||
|
||||
spa_pod_builder_push_object(&b, SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_push_object(&b, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_add(&b,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw, 0);
|
||||
|
|
@ -150,8 +150,8 @@ spa_alsa_enum_format(struct state *state, uint32_t *index,
|
|||
|
||||
if (snd_pcm_format_mask_test(fmask, fi->format)) {
|
||||
if (j++ == 0)
|
||||
spa_pod_builder_id(&b, fi->spa_format);
|
||||
spa_pod_builder_id(&b, fi->spa_format);
|
||||
spa_pod_builder_enum(&b, fi->spa_format);
|
||||
spa_pod_builder_enum(&b, fi->spa_format);
|
||||
}
|
||||
}
|
||||
if (j > 1)
|
||||
|
|
@ -167,13 +167,13 @@ spa_alsa_enum_format(struct state *state, uint32_t *index,
|
|||
j = 0;
|
||||
if (snd_pcm_access_mask_test(amask, SND_PCM_ACCESS_MMAP_INTERLEAVED)) {
|
||||
if (j++ == 0)
|
||||
spa_pod_builder_int(&b, SPA_AUDIO_LAYOUT_INTERLEAVED);
|
||||
spa_pod_builder_int(&b, SPA_AUDIO_LAYOUT_INTERLEAVED);
|
||||
spa_pod_builder_enum(&b, SPA_AUDIO_LAYOUT_INTERLEAVED);
|
||||
spa_pod_builder_enum(&b, SPA_AUDIO_LAYOUT_INTERLEAVED);
|
||||
}
|
||||
if (snd_pcm_access_mask_test(amask, SND_PCM_ACCESS_MMAP_NONINTERLEAVED)) {
|
||||
if (j++ == 0)
|
||||
spa_pod_builder_int(&b, SPA_AUDIO_LAYOUT_NON_INTERLEAVED);
|
||||
spa_pod_builder_int(&b, SPA_AUDIO_LAYOUT_NON_INTERLEAVED);
|
||||
spa_pod_builder_enum(&b, SPA_AUDIO_LAYOUT_NON_INTERLEAVED);
|
||||
spa_pod_builder_enum(&b, SPA_AUDIO_LAYOUT_NON_INTERLEAVED);
|
||||
}
|
||||
if (j > 1)
|
||||
prop->body.flags |= SPA_POD_PROP_RANGE_ENUM | SPA_POD_PROP_FLAG_UNSET;
|
||||
|
|
|
|||
|
|
@ -34,9 +34,7 @@ extern "C" {
|
|||
|
||||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
|
||||
#define DEFAULT_RATE 48000
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@
|
|||
#include <spa/buffer/alloc.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/debug/pod.h>
|
||||
#include <spa/debug/types.h>
|
||||
|
|
@ -124,14 +122,14 @@ static int make_link(struct impl *this,
|
|||
&l->out_info);
|
||||
spa_node_port_set_io(out_node,
|
||||
SPA_DIRECTION_OUTPUT, out_port,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&l->io, sizeof(l->io));
|
||||
spa_node_port_get_info(in_node,
|
||||
SPA_DIRECTION_INPUT, in_port,
|
||||
&l->in_info);
|
||||
spa_node_port_set_io(in_node,
|
||||
SPA_DIRECTION_INPUT, in_port,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&l->io, sizeof(l->io));
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -140,10 +138,10 @@ static void clean_link(struct impl *this, struct link *link)
|
|||
{
|
||||
spa_node_port_set_param(link->in_node,
|
||||
SPA_DIRECTION_INPUT, link->in_port,
|
||||
SPA_ID_PARAM_Format, 0, NULL);
|
||||
SPA_PARAM_Format, 0, NULL);
|
||||
spa_node_port_set_param(link->out_node,
|
||||
SPA_DIRECTION_OUTPUT, link->out_port,
|
||||
SPA_ID_PARAM_Format, 0, NULL);
|
||||
SPA_PARAM_Format, 0, NULL);
|
||||
if (link->buffers)
|
||||
free(link->buffers);
|
||||
link->buffers = NULL;
|
||||
|
|
@ -197,20 +195,20 @@ static int negotiate_link_format(struct impl *this, struct link *link)
|
|||
filter = NULL;
|
||||
if ((res = spa_node_port_enum_params(link->out_node,
|
||||
SPA_DIRECTION_OUTPUT, link->out_port,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
filter, &format, &b)) <= 0) {
|
||||
debug_params(this, link->out_node, SPA_DIRECTION_OUTPUT, link->out_port,
|
||||
SPA_ID_PARAM_EnumFormat, filter);
|
||||
SPA_PARAM_EnumFormat, filter);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
filter = format;
|
||||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(link->in_node,
|
||||
SPA_DIRECTION_INPUT, link->in_port,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
filter, &format, &b)) <= 0) {
|
||||
debug_params(this, link->in_node, SPA_DIRECTION_INPUT, link->in_port,
|
||||
SPA_ID_PARAM_EnumFormat, filter);
|
||||
SPA_PARAM_EnumFormat, filter);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
filter = format;
|
||||
|
|
@ -219,13 +217,13 @@ static int negotiate_link_format(struct impl *this, struct link *link)
|
|||
|
||||
if ((res = spa_node_port_set_param(link->out_node,
|
||||
SPA_DIRECTION_OUTPUT, link->out_port,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
filter)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_param(link->in_node,
|
||||
SPA_DIRECTION_INPUT, link->in_port,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
filter)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
@ -281,19 +279,19 @@ static int negotiate_link_buffers(struct impl *this, struct link *link)
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(link->in_node,
|
||||
SPA_DIRECTION_INPUT, link->in_port,
|
||||
SPA_ID_PARAM_Buffers, &state,
|
||||
SPA_PARAM_Buffers, &state,
|
||||
param, ¶m, &b)) <= 0) {
|
||||
debug_params(this, link->out_node, SPA_DIRECTION_OUTPUT, link->out_port,
|
||||
SPA_ID_PARAM_Buffers, param);
|
||||
SPA_PARAM_Buffers, param);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(link->out_node,
|
||||
SPA_DIRECTION_OUTPUT, link->out_port,
|
||||
SPA_ID_PARAM_Buffers, &state,
|
||||
SPA_PARAM_Buffers, &state,
|
||||
param, ¶m, &b)) <= 0) {
|
||||
debug_params(this, link->in_node, SPA_DIRECTION_INPUT, link->in_port,
|
||||
SPA_ID_PARAM_Buffers, param);
|
||||
SPA_PARAM_Buffers, param);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
|
|
@ -564,13 +562,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
|
||||
switch (id) {
|
||||
next:
|
||||
case SPA_ID_PARAM_PropInfo:
|
||||
case SPA_PARAM_PropInfo:
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, SPA_ID_PARAM_PropInfo,
|
||||
id, SPA_ID_OBJECT_PropInfo,
|
||||
":", SPA_PROP_INFO_id, "I", SPA_PROP_volume,
|
||||
":", SPA_PROP_INFO_type, "fru", 1.0,
|
||||
SPA_POD_PROP_MIN_MAX(0.0, 10.0));
|
||||
|
|
@ -655,7 +653,7 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
spa_log_debug(this->log, "set io %d %d %d", id, direction, port_id);
|
||||
|
||||
if (id == SPA_ID_IO_ControlRange)
|
||||
if (id == SPA_IO_ControlRange)
|
||||
res = spa_node_port_set_io(this->resample, direction, 0, id, data, size);
|
||||
// else if (id == t->io_prop_volume)
|
||||
// res = spa_node_port_set_io(this->channelmix, direction, 0, id, data, size);
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
||||
#define NAME "channelmix"
|
||||
|
|
@ -314,21 +312,21 @@ static int port_enum_formats(struct spa_node *node,
|
|||
case 0:
|
||||
if (other->have_format) {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", other->format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "iru", 2,
|
||||
SPA_POD_PROP_MIN_MAX(1, INT32_MAX));
|
||||
} else {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "iru", DEFAULT_RATE,
|
||||
SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_FORMAT_AUDIO_channels, "iru", DEFAULT_CHANNELS,
|
||||
|
|
@ -356,11 +354,11 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", port->format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", port->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", port->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", port->format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", port->format.info.raw.channels);
|
||||
|
||||
|
|
@ -397,13 +395,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -412,17 +410,17 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
{
|
||||
uint32_t buffers, size;
|
||||
|
||||
|
|
@ -450,7 +448,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -466,12 +464,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -563,7 +561,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(node, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -656,7 +654,7 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
port->io = data;
|
||||
// else if (id == t->io_prop_volume)
|
||||
// port->control.volume = data;
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/debug/types.h>
|
||||
|
||||
|
|
@ -423,21 +421,21 @@ static int port_enum_formats(struct spa_node *node,
|
|||
case 0:
|
||||
if (other->info.raw.channels > 0) {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "Ieu", other->info.raw.format,
|
||||
SPA_POD_PROP_ENUM(3, other->info.raw.format,
|
||||
SPA_AUDIO_FORMAT_F32,
|
||||
SPA_AUDIO_FORMAT_F32_OE),
|
||||
":", SPA_FORMAT_AUDIO_layout, "ieu", other->info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "Ieu", other->info.raw.layout,
|
||||
SPA_POD_PROP_ENUM(2, SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_AUDIO_LAYOUT_NON_INTERLEAVED),
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", other->info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", other->info.raw.channels);
|
||||
} else {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_S16,
|
||||
|
|
@ -452,7 +450,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
SPA_AUDIO_FORMAT_S24_OE,
|
||||
SPA_AUDIO_FORMAT_S24_32,
|
||||
SPA_AUDIO_FORMAT_S24_32_OE),
|
||||
":", SPA_FORMAT_AUDIO_layout, "ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "Ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_POD_PROP_ENUM(2, SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_AUDIO_LAYOUT_NON_INTERLEAVED),
|
||||
":", SPA_FORMAT_AUDIO_rate, "iru", DEFAULT_RATE,
|
||||
|
|
@ -482,11 +480,11 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", port->format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", port->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", port->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", port->format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", port->format.info.raw.channels);
|
||||
|
||||
|
|
@ -524,13 +522,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -539,17 +537,17 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
{
|
||||
uint32_t buffers, size;
|
||||
const char *size_fmt;
|
||||
|
|
@ -580,7 +578,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -596,12 +594,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -737,7 +735,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
default:
|
||||
return -ENOENT;
|
||||
|
|
@ -836,10 +834,10 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
this, direction, port_id, id, data);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_IO_Buffers:
|
||||
case SPA_IO_Buffers:
|
||||
port->io = data;
|
||||
break;
|
||||
case SPA_ID_IO_ControlRange:
|
||||
case SPA_IO_ControlRange:
|
||||
port->ctrl = data;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/debug/types.h>
|
||||
|
||||
|
|
@ -321,7 +319,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
|
||||
if (direction == SPA_DIRECTION_OUTPUT) {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_F32,
|
||||
|
|
@ -337,7 +335,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
SPA_AUDIO_FORMAT_S16,
|
||||
SPA_AUDIO_FORMAT_S16_OE,
|
||||
SPA_AUDIO_FORMAT_U8),
|
||||
":", SPA_FORMAT_AUDIO_layout, "ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "Ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_POD_PROP_ENUM(2, SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_AUDIO_LAYOUT_NON_INTERLEAVED),
|
||||
":", SPA_FORMAT_AUDIO_rate, rspec, rate,
|
||||
|
|
@ -346,11 +344,11 @@ static int port_enum_formats(struct spa_node *node,
|
|||
}
|
||||
else {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, rspec, rate,
|
||||
SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", 1);
|
||||
|
|
@ -377,11 +375,11 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", port->format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", port->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", port->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", port->format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", port->format.info.raw.channels);
|
||||
|
||||
|
|
@ -419,13 +417,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_log_debug(this->log, NAME " %p: enum param %d %d", this, id, this->have_format);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO, };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO, };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -433,15 +431,15 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
else
|
||||
return 0;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -457,7 +455,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_stride, "i", port->stride,
|
||||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -472,12 +470,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -673,7 +671,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
default:
|
||||
return -ENOENT;
|
||||
|
|
@ -786,10 +784,10 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_IO_Buffers:
|
||||
case SPA_IO_Buffers:
|
||||
port->io = data;
|
||||
break;
|
||||
case SPA_ID_IO_ControlRange:
|
||||
case SPA_IO_ControlRange:
|
||||
port->ctrl = data;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -28,9 +28,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
||||
#define NAME "resample"
|
||||
|
|
@ -284,21 +282,21 @@ static int port_enum_formats(struct spa_node *node,
|
|||
case 0:
|
||||
if (other->have_format) {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "iru", other->format.info.raw.rate,
|
||||
SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", other->format.info.raw.channels);
|
||||
} else {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "iru", DEFAULT_RATE,
|
||||
SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_FORMAT_AUDIO_channels, "iru", DEFAULT_CHANNELS,
|
||||
|
|
@ -326,11 +324,11 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", port->format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", port->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", port->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", port->format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", port->format.info.raw.channels);
|
||||
|
||||
|
|
@ -367,13 +365,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -382,15 +380,15 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
{
|
||||
uint32_t buffers, size;
|
||||
|
||||
|
|
@ -419,7 +417,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -434,12 +432,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -530,7 +528,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(node, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -625,9 +623,9 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
port->io = data;
|
||||
else if (id == SPA_ID_IO_ControlRange)
|
||||
else if (id == SPA_IO_ControlRange)
|
||||
port->ctrl = data;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/debug/types.h>
|
||||
|
||||
|
|
@ -321,7 +319,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
|
||||
if (direction == SPA_DIRECTION_INPUT) {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_F32,
|
||||
|
|
@ -337,7 +335,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
SPA_AUDIO_FORMAT_S16,
|
||||
SPA_AUDIO_FORMAT_S16_OE,
|
||||
SPA_AUDIO_FORMAT_U8),
|
||||
":", SPA_FORMAT_AUDIO_layout, "ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "Ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_POD_PROP_ENUM(2, SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_AUDIO_LAYOUT_NON_INTERLEAVED),
|
||||
":", SPA_FORMAT_AUDIO_rate, rspec, rate,
|
||||
|
|
@ -346,11 +344,11 @@ static int port_enum_formats(struct spa_node *node,
|
|||
}
|
||||
else {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, rspec, rate,
|
||||
SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", 1);
|
||||
|
|
@ -377,11 +375,11 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", port->format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", port->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", port->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", port->format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", port->format.info.raw.channels);
|
||||
|
||||
|
|
@ -419,13 +417,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_log_debug(this->log, NAME " %p: enum param %d %d", this, id, this->have_format);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -434,15 +432,15 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -459,7 +457,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -474,12 +472,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -675,7 +673,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
default:
|
||||
return -ENOENT;
|
||||
|
|
@ -787,9 +785,9 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
port->io = data;
|
||||
else if (id == SPA_ID_IO_ControlRange)
|
||||
else if (id == SPA_IO_ControlRange)
|
||||
port->ctrl = data;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
||||
#include "mix-ops.h"
|
||||
|
|
@ -329,7 +327,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
case 0:
|
||||
if (this->have_format) {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format,
|
||||
|
|
@ -337,7 +335,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
":", SPA_FORMAT_AUDIO_channels, "i", this->format.info.raw.channels);
|
||||
} else {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_S16,
|
||||
|
|
@ -370,7 +368,7 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format,
|
||||
|
|
@ -409,13 +407,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO, };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO, };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -424,15 +422,15 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -448,7 +446,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_stride, "i", 0,
|
||||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -463,18 +461,18 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
case 1:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -615,7 +613,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -703,9 +701,9 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
port->io = data;
|
||||
else if (id == SPA_ID_IO_ControlRange)
|
||||
else if (id == SPA_IO_ControlRange)
|
||||
port->io_range = data;
|
||||
#if 0
|
||||
else if (id == t->io_prop_volume && direction == SPA_DIRECTION_INPUT)
|
||||
|
|
|
|||
|
|
@ -30,9 +30,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
||||
#define NAME "audiotestsrc"
|
||||
|
|
@ -144,10 +142,10 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_PropInfo,
|
||||
SPA_ID_PARAM_Props };
|
||||
uint32_t list[] = { SPA_PARAM_PropInfo,
|
||||
SPA_PARAM_Props };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -156,7 +154,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_PropInfo:
|
||||
case SPA_PARAM_PropInfo:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -199,7 +197,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -238,7 +236,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
|
|||
|
||||
this = SPA_CONTAINER_OF(node, struct impl, node);
|
||||
|
||||
if (id == SPA_ID_PARAM_Props) {
|
||||
if (id == SPA_PARAM_Props) {
|
||||
struct props *p = &this->props;
|
||||
|
||||
if (param == NULL) {
|
||||
|
|
@ -526,7 +524,7 @@ port_enum_formats(struct impl *this,
|
|||
switch (*index) {
|
||||
case 0:
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_S16,
|
||||
|
|
@ -559,7 +557,7 @@ port_get_format(struct impl *this,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->current_format.info.raw.format,
|
||||
|
|
@ -595,13 +593,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO, };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO, };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -610,16 +608,16 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(this, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(this, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (!this->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -635,7 +633,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_stride, "i", 0,
|
||||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!this->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -650,18 +648,18 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
case 1:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -794,7 +792,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format)
|
||||
if (id == SPA_PARAM_Format)
|
||||
return port_set_format(this, direction, port_id, flags, param);
|
||||
|
||||
return -ENOENT;
|
||||
|
|
@ -882,9 +880,9 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
this->io = data;
|
||||
else if (id == SPA_ID_IO_ControlRange)
|
||||
else if (id == SPA_IO_ControlRange)
|
||||
this->io_range = data;
|
||||
#if 0
|
||||
else if (id == t->io_prop_wave) {
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@
|
|||
|
||||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
|
@ -161,10 +160,10 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_PropInfo,
|
||||
SPA_ID_PARAM_Props };
|
||||
uint32_t list[] = { SPA_PARAM_PropInfo,
|
||||
SPA_PARAM_Props };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -173,7 +172,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_PropInfo:
|
||||
case SPA_PARAM_PropInfo:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -199,7 +198,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -237,7 +236,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
|
|||
this = SPA_CONTAINER_OF(node, struct impl, node);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -939,12 +938,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -953,7 +952,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -971,7 +970,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", channels);
|
||||
}
|
||||
|
|
@ -979,7 +978,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return -EIO;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if (!this->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -990,12 +989,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->current_format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", this->current_format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", this->current_format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", this->current_format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", this->current_format.info.raw.channels);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (!this->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -1014,7 +1013,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!this->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -1103,7 +1102,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(node, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -1194,10 +1193,10 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_IO_Buffers:
|
||||
case SPA_IO_Buffers:
|
||||
this->io = data;
|
||||
break;
|
||||
case SPA_ID_IO_ControlRange:
|
||||
case SPA_IO_ControlRange:
|
||||
this->range = data;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ static void fill_item(struct spa_bt_monitor *this, struct spa_bt_transport *tran
|
|||
spa_pod_builder_add(builder,
|
||||
"<", 0, SPA_ID_OBJECT_MonitorItem,
|
||||
":", SPA_MONITOR_ITEM_id, "s", transport->path,
|
||||
":", SPA_MONITOR_ITEM_flags, "i", SPA_MONITOR_ITEM_FLAG_NONE,
|
||||
":", SPA_MONITOR_ITEM_state, "i", SPA_MONITOR_ITEM_STATE_AVAILABLE,
|
||||
":", SPA_MONITOR_ITEM_flags, "I", SPA_MONITOR_ITEM_FLAG_NONE,
|
||||
":", SPA_MONITOR_ITEM_state, "I", SPA_MONITOR_ITEM_STATE_AVAILABLE,
|
||||
":", SPA_MONITOR_ITEM_name, "s", transport->path,
|
||||
":", SPA_MONITOR_ITEM_class, "s", "Adapter/Bluetooth",
|
||||
":", SPA_MONITOR_ITEM_factory, "p", SPA_ID_INTERFACE_HandleFactory, &spa_a2dp_sink_factory,
|
||||
|
|
|
|||
|
|
@ -269,10 +269,10 @@ spa_ffmpeg_dec_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -281,12 +281,12 @@ spa_ffmpeg_dec_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
|
@ -352,7 +352,7 @@ spa_ffmpeg_dec_node_port_set_param(struct spa_node *node,
|
|||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -407,7 +407,7 @@ spa_ffmpeg_dec_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
port->io = data;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
|
|
|||
|
|
@ -258,10 +258,10 @@ spa_ffmpeg_enc_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -270,12 +270,12 @@ spa_ffmpeg_enc_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
|
@ -332,7 +332,7 @@ spa_ffmpeg_enc_node_port_set_param(struct spa_node *node,
|
|||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -386,7 +386,7 @@ spa_ffmpeg_enc_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
port->io = data;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
|
|
|||
|
|
@ -29,8 +29,7 @@
|
|||
#include <spa/utils/list.h>
|
||||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/param/format.h>
|
||||
#include <spa/pod/parser.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
|
@ -112,15 +111,15 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamList,
|
||||
":", SPA_PARAM_LIST_id, "I", SPA_ID_PARAM_Props);
|
||||
":", SPA_PARAM_LIST_id, "I", SPA_PARAM_Props);
|
||||
break;
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -150,7 +149,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
|
|||
this = SPA_CONTAINER_OF(node, struct impl, node);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
if (param == NULL) {
|
||||
reset_props(this, &this->props);
|
||||
return 0;
|
||||
|
|
@ -453,12 +452,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -467,15 +466,15 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -488,7 +487,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_stride, "i", 1,
|
||||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
|
|
@ -553,7 +552,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(node, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -640,7 +639,7 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
this->io = data;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
|
|
|||
|
|
@ -29,8 +29,7 @@
|
|||
#include <spa/utils/list.h>
|
||||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/param/format.h>
|
||||
#include <spa/pod/parser.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
|
@ -117,16 +116,16 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamList,
|
||||
":", SPA_PARAM_LIST_id, "I", SPA_ID_PARAM_Props);
|
||||
":", SPA_PARAM_LIST_id, "I", SPA_PARAM_Props);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -162,7 +161,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
|
|||
this = SPA_CONTAINER_OF(node, struct impl, node);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -469,12 +468,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -483,15 +482,15 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -504,7 +503,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_stride, "i", 1,
|
||||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
|
|
@ -569,7 +568,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(node, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -658,7 +657,7 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
this->io = data;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
|
|
|||
|
|
@ -100,8 +100,8 @@ static void fill_item(struct impl *this, struct item *item, struct udev_device *
|
|||
spa_pod_builder_add(builder,
|
||||
"<", 0, SPA_ID_OBJECT_MonitorItem,
|
||||
":", SPA_MONITOR_ITEM_id, "s", udev_device_get_syspath(item->udevice),
|
||||
":", SPA_MONITOR_ITEM_flags, "i", SPA_MONITOR_ITEM_FLAG_NONE,
|
||||
":", SPA_MONITOR_ITEM_state, "i", SPA_MONITOR_ITEM_STATE_AVAILABLE,
|
||||
":", SPA_MONITOR_ITEM_flags, "I", SPA_MONITOR_ITEM_FLAG_NONE,
|
||||
":", SPA_MONITOR_ITEM_state, "I", SPA_MONITOR_ITEM_STATE_AVAILABLE,
|
||||
":", SPA_MONITOR_ITEM_name, "s", name,
|
||||
":", SPA_MONITOR_ITEM_class, "s", "Video/Source",
|
||||
":", SPA_MONITOR_ITEM_factory, "p", SPA_ID_INTERFACE_HandleFactory, &spa_v4l2_source_factory,
|
||||
|
|
|
|||
|
|
@ -30,9 +30,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
||||
#define NAME "v4l2-source"
|
||||
|
|
@ -158,10 +156,10 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_PropInfo,
|
||||
SPA_ID_PARAM_Props };
|
||||
uint32_t list[] = { SPA_PARAM_PropInfo,
|
||||
SPA_PARAM_Props };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -170,7 +168,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_PropInfo:
|
||||
case SPA_PARAM_PropInfo:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -201,7 +199,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -241,7 +239,7 @@ static int impl_node_set_param(struct spa_node *node,
|
|||
this = SPA_CONTAINER_OF(node, struct impl, node);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -394,7 +392,7 @@ static int port_get_format(struct spa_node *node,
|
|||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
spa_pod_builder_push_object(builder, SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_push_object(builder, SPA_PARAM_Format, SPA_ID_OBJECT_Format);
|
||||
|
||||
spa_pod_builder_add(builder,
|
||||
"I", port->current_format.media_type,
|
||||
|
|
@ -457,14 +455,14 @@ static int impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_PropInfo,
|
||||
SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_PropInfo,
|
||||
SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -473,17 +471,17 @@ static int impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_PropInfo:
|
||||
case SPA_PARAM_PropInfo:
|
||||
return spa_v4l2_enum_controls(this, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return spa_v4l2_enum_format(this, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if((res = port_get_format(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -499,7 +497,7 @@ static int impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
|
|
@ -516,18 +514,18 @@ static int impl_node_port_enum_params(struct spa_node *node,
|
|||
return spa_v4l2_enum_controls(this, index, filter, result, builder);
|
||||
}
|
||||
#endif
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
case 1:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Clock,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Clock,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_clock));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -635,7 +633,7 @@ static int impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(node, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -734,10 +732,10 @@ static int impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers) {
|
||||
if (id == SPA_IO_Buffers) {
|
||||
port->io = data;
|
||||
}
|
||||
else if (id == SPA_ID_IO_Clock) {
|
||||
else if (id == SPA_IO_Clock) {
|
||||
port->clock = data;
|
||||
}
|
||||
else if ((control = find_control(port, id))) {
|
||||
|
|
|
|||
|
|
@ -675,7 +675,7 @@ spa_v4l2_enum_format(struct impl *this,
|
|||
}
|
||||
}
|
||||
|
||||
spa_pod_builder_push_object(builder, SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_push_object(builder, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_add(builder,
|
||||
"I", info->media_type,
|
||||
"I", info->media_subtype, 0);
|
||||
|
|
@ -1052,7 +1052,7 @@ spa_v4l2_enum_controls(struct impl *this,
|
|||
switch (queryctrl.type) {
|
||||
case V4L2_CTRL_TYPE_INTEGER:
|
||||
param = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_PropInfo, SPA_ID_OBJECT_PropInfo,
|
||||
SPA_PARAM_PropInfo, SPA_ID_OBJECT_PropInfo,
|
||||
":", SPA_PROP_INFO_id, "I", prop_id,
|
||||
":", SPA_PROP_INFO_type, "isu", queryctrl.default_value,
|
||||
SPA_POD_PROP_STEP(queryctrl.minimum,
|
||||
|
|
@ -1062,7 +1062,7 @@ spa_v4l2_enum_controls(struct impl *this,
|
|||
break;
|
||||
case V4L2_CTRL_TYPE_BOOLEAN:
|
||||
param = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_PropInfo, SPA_ID_OBJECT_PropInfo,
|
||||
SPA_PARAM_PropInfo, SPA_ID_OBJECT_PropInfo,
|
||||
":", SPA_PROP_INFO_id, "I", prop_id,
|
||||
":", SPA_PROP_INFO_type, "b-u", queryctrl.default_value,
|
||||
":", SPA_PROP_INFO_name, "s", queryctrl.name);
|
||||
|
|
@ -1071,7 +1071,7 @@ spa_v4l2_enum_controls(struct impl *this,
|
|||
{
|
||||
struct v4l2_querymenu querymenu;
|
||||
|
||||
spa_pod_builder_push_object(&b, SPA_ID_PARAM_PropInfo, SPA_ID_OBJECT_PropInfo);
|
||||
spa_pod_builder_push_object(&b, SPA_PARAM_PropInfo, SPA_ID_OBJECT_PropInfo);
|
||||
spa_pod_builder_add(&b,
|
||||
":", SPA_PROP_INFO_id, "I", prop_id,
|
||||
":", SPA_PROP_INFO_type, "i-u", queryctrl.default_value,
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
||||
#define NAME "videotestsrc"
|
||||
|
|
@ -126,10 +125,10 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_PropInfo,
|
||||
SPA_ID_PARAM_Props };
|
||||
uint32_t list[] = { SPA_PARAM_PropInfo,
|
||||
SPA_PARAM_Props };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -138,7 +137,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_PropInfo:
|
||||
case SPA_PARAM_PropInfo:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -165,7 +164,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -203,7 +202,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
|
|||
this = SPA_CONTAINER_OF(node, struct impl, node);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -464,7 +463,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
switch (*index) {
|
||||
case 0:
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_video,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_VIDEO_format, "Ieu", SPA_VIDEO_FORMAT_RGB,
|
||||
|
|
@ -498,7 +497,7 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_video,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_VIDEO_format, "I", this->current_format.info.raw.format,
|
||||
|
|
@ -534,12 +533,12 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -548,17 +547,17 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
{
|
||||
struct spa_video_info_raw *raw_info = &this->current_format.info.raw;
|
||||
|
||||
|
|
@ -577,7 +576,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!this->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -670,7 +669,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(node, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -759,7 +758,7 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
this->io = data;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
||||
#define NAME "volume"
|
||||
|
|
@ -121,10 +119,10 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_PropInfo,
|
||||
SPA_ID_PARAM_Props };
|
||||
uint32_t list[] = { SPA_PARAM_PropInfo,
|
||||
SPA_PARAM_Props };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -133,7 +131,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_PropInfo:
|
||||
case SPA_PARAM_PropInfo:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
|
|
@ -154,7 +152,7 @@ static int impl_node_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
|
|
@ -188,7 +186,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
|
|||
this = SPA_CONTAINER_OF(node, struct impl, node);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_Props:
|
||||
case SPA_PARAM_Props:
|
||||
{
|
||||
struct props *p = &this->props;
|
||||
|
||||
|
|
@ -329,7 +327,7 @@ static int port_enum_formats(struct spa_node *node,
|
|||
switch (*index) {
|
||||
case 0:
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_S16,
|
||||
|
|
@ -364,7 +362,7 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->current_format.info.raw.format,
|
||||
|
|
@ -403,13 +401,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -418,15 +416,15 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, filter, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -442,7 +440,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_stride, "i", 0,
|
||||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
|
|
@ -454,18 +452,18 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
case 1:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -539,7 +537,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(node, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -627,9 +625,9 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
port->io = data;
|
||||
else if (id == SPA_ID_IO_ControlRange)
|
||||
else if (id == SPA_IO_ControlRange)
|
||||
port->range = data;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@
|
|||
#include <spa/param/param.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/io.h>
|
||||
|
||||
#define M_PI_M2 ( M_PI + M_PI )
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <spa/param/param.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/io.h>
|
||||
|
||||
#define M_PI_M2 ( M_PI + M_PI )
|
||||
|
||||
|
|
@ -281,7 +280,7 @@ static int make_nodes(struct data *data, const char *device)
|
|||
|
||||
spa_debug_pod(0, spa_debug_types, props);
|
||||
|
||||
if ((res = spa_node_set_param(data->sink, SPA_ID_PARAM_Props, 0, props)) < 0)
|
||||
if ((res = spa_node_set_param(data->sink, SPA_PARAM_Props, 0, props)) < 0)
|
||||
printf("got set_props error %d\n", res);
|
||||
|
||||
if ((res = make_node(data, &data->source,
|
||||
|
|
@ -301,7 +300,7 @@ static int make_nodes(struct data *data, const char *device)
|
|||
data->ctrl_source_freq = SPA_POD_DOUBLE_INIT(600.0);
|
||||
data->ctrl_source_volume = SPA_POD_DOUBLE_INIT(0.5);
|
||||
|
||||
if ((res = spa_node_set_param(data->source, SPA_ID_PARAM_Props, 0, props)) < 0)
|
||||
if ((res = spa_node_set_param(data->source, SPA_PARAM_Props, 0, props)) < 0)
|
||||
printf("got set_props error %d\n", res);
|
||||
|
||||
#if 0
|
||||
|
|
@ -344,11 +343,11 @@ static int make_nodes(struct data *data, const char *device)
|
|||
|
||||
spa_node_port_set_io(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source_sink_io[0], sizeof(data->source_sink_io[0]));
|
||||
spa_node_port_set_io(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source_sink_io[0], sizeof(data->source_sink_io[0]));
|
||||
|
||||
spa_graph_node_init(&data->source_node, &data->source_state);
|
||||
|
|
@ -382,7 +381,7 @@ static int negotiate_formats(struct data *data)
|
|||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", 44100,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", 2);
|
||||
|
||||
|
|
@ -391,7 +390,7 @@ static int negotiate_formats(struct data *data)
|
|||
spa_log_debug(&default_log.log, "enum_params");
|
||||
if ((res = spa_node_port_enum_params(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
filter, &format, &b)) <= 0)
|
||||
return -EBADF;
|
||||
|
||||
|
|
@ -400,12 +399,12 @@ static int negotiate_formats(struct data *data)
|
|||
spa_log_debug(&default_log.log, "sink set_param");
|
||||
if ((res = spa_node_port_set_param(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0, format)) < 0)
|
||||
SPA_PARAM_Format, 0, format)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_param(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0, format)) < 0)
|
||||
SPA_PARAM_Format, 0, format)) < 0)
|
||||
return res;
|
||||
|
||||
init_buffer(data, data->source_buffers, data->source_buffer, 1, BUFFER_SIZE);
|
||||
|
|
|
|||
|
|
@ -211,13 +211,13 @@ static int negotiate_formats(struct data *data)
|
|||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", 44100,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", 2);
|
||||
|
||||
if ((res = spa_node_port_set_param(data->conv,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
@ -226,11 +226,11 @@ static int negotiate_formats(struct data *data)
|
|||
|
||||
spa_node_port_set_io(data->conv,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->io_in[0], sizeof(data->io_in[0]));
|
||||
spa_node_port_set_io(data->conv,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->io_out[0], sizeof(data->io_out[0]));
|
||||
|
||||
|
||||
|
|
@ -240,14 +240,14 @@ static int negotiate_formats(struct data *data)
|
|||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", 44100,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", 2);
|
||||
|
||||
|
||||
if ((res = spa_node_port_set_param(data->conv,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
@ -267,7 +267,7 @@ static int negotiate_buffers(struct data *data)
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(data->conv,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_Buffers, &state,
|
||||
SPA_PARAM_Buffers, &state,
|
||||
NULL, ¶m, &b)) <= 0)
|
||||
return -EBADF;
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ static int negotiate_buffers(struct data *data)
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(data->conv,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_PARAM_Buffers, &state,
|
||||
SPA_PARAM_Buffers, &state,
|
||||
NULL, ¶m, &b)) <= 0)
|
||||
return -EBADF;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#include <spa/node/io.h>
|
||||
#include <spa/buffer/alloc.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/props.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/debug/pod.h>
|
||||
|
|
@ -174,7 +173,7 @@ static int make_link(struct data *data, struct link *link,
|
|||
&link->out_info);
|
||||
spa_node_port_set_io(out_node->node,
|
||||
SPA_DIRECTION_OUTPUT, out_port,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&link->io, sizeof(link->io));
|
||||
}
|
||||
if (in_node != NULL) {
|
||||
|
|
@ -183,7 +182,7 @@ static int make_link(struct data *data, struct link *link,
|
|||
&link->in_info);
|
||||
spa_node_port_set_io(in_node->node,
|
||||
SPA_DIRECTION_INPUT, in_port,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&link->io, sizeof(link->io));
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -213,7 +212,7 @@ static int negotiate_link_format(struct data *data, struct link *link, struct sp
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(link->out_node->node,
|
||||
SPA_DIRECTION_OUTPUT, link->out_port,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
filter, &format, &b)) <= 0)
|
||||
return -ENOTSUP;
|
||||
|
||||
|
|
@ -223,7 +222,7 @@ static int negotiate_link_format(struct data *data, struct link *link, struct sp
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(link->in_node->node,
|
||||
SPA_DIRECTION_INPUT, link->in_port,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
filter, &format, &b)) <= 0)
|
||||
return -ENOTSUP;
|
||||
|
||||
|
|
@ -236,14 +235,14 @@ static int negotiate_link_format(struct data *data, struct link *link, struct sp
|
|||
if (link->out_node != NULL) {
|
||||
if ((res = spa_node_port_set_param(link->out_node->node,
|
||||
SPA_DIRECTION_OUTPUT, link->out_port,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
filter)) < 0)
|
||||
return res;
|
||||
}
|
||||
if (link->in_node != NULL) {
|
||||
if ((res = spa_node_port_set_param(link->in_node->node,
|
||||
SPA_DIRECTION_INPUT, link->in_port,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
filter)) < 0)
|
||||
return res;
|
||||
}
|
||||
|
|
@ -263,7 +262,7 @@ static int negotiate_formats(struct data *data)
|
|||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", 44100,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", 2);
|
||||
|
||||
|
|
@ -276,7 +275,7 @@ static int negotiate_formats(struct data *data)
|
|||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", 48000,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", 1);
|
||||
|
||||
|
|
@ -311,7 +310,7 @@ static int negotiate_link_buffers(struct data *data, struct link *link)
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(link->out_node->node,
|
||||
SPA_DIRECTION_OUTPUT, link->out_port,
|
||||
SPA_ID_PARAM_Buffers, &state,
|
||||
SPA_PARAM_Buffers, &state,
|
||||
param, ¶m, &b)) <= 0)
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
|
@ -319,7 +318,7 @@ static int negotiate_link_buffers(struct data *data, struct link *link)
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(link->in_node->node,
|
||||
SPA_DIRECTION_INPUT, link->in_port,
|
||||
SPA_ID_PARAM_Buffers, &state,
|
||||
SPA_PARAM_Buffers, &state,
|
||||
param, ¶m, &b)) <= 0)
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ static int make_nodes(struct data *data, const char *device)
|
|||
|
||||
spa_debug_pod(0, spa_debug_types, props);
|
||||
|
||||
if ((res = spa_node_set_param(data->sink, SPA_ID_PARAM_Props, 0, props)) < 0)
|
||||
if ((res = spa_node_set_param(data->sink, SPA_PARAM_Props, 0, props)) < 0)
|
||||
printf("got set_props error %d\n", res);
|
||||
|
||||
if ((res = make_node(data, &data->volume,
|
||||
|
|
@ -286,7 +286,7 @@ static int make_nodes(struct data *data, const char *device)
|
|||
":", SPA_PROP_volume, "d", 0.5,
|
||||
":", SPA_PROP_live, "b", false);
|
||||
|
||||
if ((res = spa_node_set_param(data->source, SPA_ID_PARAM_Props, 0, props)) < 0)
|
||||
if ((res = spa_node_set_param(data->source, SPA_PARAM_Props, 0, props)) < 0)
|
||||
printf("got set_props error %d\n", res);
|
||||
|
||||
data->source_volume_io[0] = SPA_IO_BUFFERS_INIT;
|
||||
|
|
@ -294,19 +294,19 @@ static int make_nodes(struct data *data, const char *device)
|
|||
|
||||
spa_node_port_set_io(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source_volume_io[0], sizeof(data->source_volume_io[0]));
|
||||
spa_node_port_set_io(data->volume,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source_volume_io[0], sizeof(data->source_volume_io[0]));
|
||||
spa_node_port_set_io(data->volume,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->volume_sink_io[0], sizeof(data->volume_sink_io[0]));
|
||||
spa_node_port_set_io(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->volume_sink_io[0], sizeof(data->volume_sink_io[0]));
|
||||
|
||||
spa_graph_node_init(&data->source_node, &data->source_state);
|
||||
|
|
@ -351,7 +351,7 @@ static int negotiate_formats(struct data *data)
|
|||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", 44100,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", 2);
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ static int negotiate_formats(struct data *data)
|
|||
spa_log_debug(&default_log.log, "enum_params");
|
||||
if ((res = spa_node_port_enum_params(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
filter, &format, &b)) <= 0)
|
||||
return -EBADF;
|
||||
|
||||
|
|
@ -369,13 +369,13 @@ static int negotiate_formats(struct data *data)
|
|||
spa_log_debug(&default_log.log, "sink set_param");
|
||||
if ((res = spa_node_port_set_param(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0, format)) < 0)
|
||||
SPA_PARAM_Format, 0, format)) < 0)
|
||||
return res;
|
||||
|
||||
spa_log_debug(&default_log.log, "volume set_param");
|
||||
if ((res = spa_node_port_set_param(data->volume,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0, format)) < 0)
|
||||
SPA_PARAM_Format, 0, format)) < 0)
|
||||
return res;
|
||||
|
||||
init_buffer(data, data->volume_buffers, data->volume_buffer, 1, BUFFER_SIZE);
|
||||
|
|
@ -390,11 +390,11 @@ static int negotiate_formats(struct data *data)
|
|||
|
||||
if ((res = spa_node_port_set_param(data->volume,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0, format)) < 0)
|
||||
SPA_PARAM_Format, 0, format)) < 0)
|
||||
return res;
|
||||
if ((res = spa_node_port_set_param(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0, format)) < 0)
|
||||
SPA_PARAM_Format, 0, format)) < 0)
|
||||
return res;
|
||||
|
||||
init_buffer(data, data->source_buffers, data->source_buffer, 1, BUFFER_SIZE);
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ static int make_nodes(struct data *data, const char *device)
|
|||
":", SPA_PROP_device, "s", device ? device : "hw:0",
|
||||
":", SPA_PROP_minLatency, "i", MIN_LATENCY);
|
||||
|
||||
if ((res = spa_node_set_param(data->sink, SPA_ID_PARAM_Props, 0, props)) < 0)
|
||||
if ((res = spa_node_set_param(data->sink, SPA_PARAM_Props, 0, props)) < 0)
|
||||
error(0, -res, "set_param props");
|
||||
|
||||
if ((res = make_node(data, &data->mix,
|
||||
|
|
@ -342,12 +342,12 @@ static int make_nodes(struct data *data, const char *device)
|
|||
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
props = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_Props, SPA_ID_OBJECT_Props,
|
||||
SPA_PARAM_Props, SPA_ID_OBJECT_Props,
|
||||
":", SPA_PROP_frequency, "d", 600.0,
|
||||
":", SPA_PROP_volume, "d", 1.0,
|
||||
":", SPA_PROP_live, "b", false);
|
||||
|
||||
if ((res = spa_node_set_param(data->source1, SPA_ID_PARAM_Props, 0, props)) < 0)
|
||||
if ((res = spa_node_set_param(data->source1, SPA_PARAM_Props, 0, props)) < 0)
|
||||
printf("got set_props error %d\n", res);
|
||||
|
||||
if ((res = make_node(data, &data->source2,
|
||||
|
|
@ -359,12 +359,12 @@ static int make_nodes(struct data *data, const char *device)
|
|||
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
props = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_Props, SPA_ID_OBJECT_Props,
|
||||
SPA_PARAM_Props, SPA_ID_OBJECT_Props,
|
||||
":", SPA_PROP_frequency, "d", 440.0,
|
||||
":", SPA_PROP_volume, "d", 1.0,
|
||||
":", SPA_PROP_live, "b", false);
|
||||
|
||||
if ((res = spa_node_set_param(data->source2, SPA_ID_PARAM_Props, 0, props)) < 0)
|
||||
if ((res = spa_node_set_param(data->source2, SPA_PARAM_Props, 0, props)) < 0)
|
||||
printf("got set_props error %d\n", res);
|
||||
|
||||
data->mix_ports[0] = 0;
|
||||
|
|
@ -381,27 +381,27 @@ static int make_nodes(struct data *data, const char *device)
|
|||
|
||||
spa_node_port_set_io(data->source1,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source1_mix_io[0], sizeof(data->source1_mix_io[0]));
|
||||
spa_node_port_set_io(data->source2,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source2_mix_io[0], sizeof(data->source2_mix_io[0]));
|
||||
spa_node_port_set_io(data->mix,
|
||||
SPA_DIRECTION_INPUT, data->mix_ports[0],
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source1_mix_io[0], sizeof(data->source1_mix_io[0]));
|
||||
spa_node_port_set_io(data->mix,
|
||||
SPA_DIRECTION_INPUT, data->mix_ports[1],
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source2_mix_io[0], sizeof(data->source2_mix_io[0]));
|
||||
spa_node_port_set_io(data->mix,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->mix_sink_io[0], sizeof(data->mix_sink_io[0]));
|
||||
spa_node_port_set_io(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->mix_sink_io[0], sizeof(data->mix_sink_io[0]));
|
||||
|
||||
data->ctrl_volume[0] = SPA_POD_DOUBLE_INIT(0.5);
|
||||
|
|
@ -477,26 +477,26 @@ static int negotiate_formats(struct data *data)
|
|||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", 44100,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", 2);
|
||||
|
||||
if ((res =
|
||||
spa_node_port_enum_params(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
filter, &format, &b)) <= 0)
|
||||
return -EBADF;
|
||||
|
||||
if ((res = spa_node_port_set_param(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_param(data->mix,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
@ -511,13 +511,13 @@ static int negotiate_formats(struct data *data)
|
|||
|
||||
if ((res = spa_node_port_set_param(data->mix,
|
||||
SPA_DIRECTION_INPUT, data->mix_ports[0],
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_param(data->source1,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
@ -534,13 +534,13 @@ static int negotiate_formats(struct data *data)
|
|||
if ((res =
|
||||
spa_node_port_set_param(data->mix,
|
||||
SPA_DIRECTION_INPUT, data->mix_ports[1],
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_param(data->source2,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
|
|||
|
|
@ -324,11 +324,11 @@ static int make_nodes(struct data *data)
|
|||
|
||||
spa_node_port_set_io(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source_sink_io[0], sizeof(data->source_sink_io[0]));
|
||||
spa_node_port_set_io(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source_sink_io[0], sizeof(data->source_sink_io[0]));
|
||||
|
||||
spa_graph_node_init(&data->source_node, &data->source_state);
|
||||
|
|
@ -365,13 +365,13 @@ static int negotiate_formats(struct data *data)
|
|||
|
||||
if ((res = spa_node_port_set_param(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_param(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
|
|||
|
|
@ -170,8 +170,8 @@ static void do_static_struct(void)
|
|||
struct spa_pod_object fmt;
|
||||
|
||||
struct {
|
||||
struct spa_pod_id media_type SPA_ALIGNED(8);
|
||||
struct spa_pod_id media_subtype SPA_ALIGNED(8);
|
||||
struct spa_pod_enum media_type SPA_ALIGNED(8);
|
||||
struct spa_pod_enum media_subtype SPA_ALIGNED(8);
|
||||
|
||||
struct spa_pod_prop prop_format SPA_ALIGNED(8);
|
||||
struct {
|
||||
|
|
@ -197,8 +197,8 @@ static void do_static_struct(void)
|
|||
SPA_POD_OBJECT_INIT(sizeof(test_format.props) + sizeof(struct spa_pod_object_body),
|
||||
0, SPA_ID_OBJECT_Format),
|
||||
{
|
||||
SPA_POD_ID_INIT(SPA_MEDIA_TYPE_video),
|
||||
SPA_POD_ID_INIT(SPA_MEDIA_SUBTYPE_raw),
|
||||
SPA_POD_ENUM_INIT(SPA_MEDIA_TYPE_video),
|
||||
SPA_POD_ENUM_INIT(SPA_MEDIA_SUBTYPE_raw),
|
||||
|
||||
SPA_POD_PROP_INIT(sizeof(test_format.props.format_vals) +
|
||||
sizeof(struct spa_pod_prop_body),
|
||||
|
|
@ -266,14 +266,14 @@ int main(int argc, char *argv[])
|
|||
|
||||
spa_pod_builder_push_object(&b, 0, SPA_ID_OBJECT_Format);
|
||||
|
||||
spa_pod_builder_id(&b, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_id(&b, SPA_MEDIA_SUBTYPE_raw);
|
||||
spa_pod_builder_enum(&b, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_enum(&b, SPA_MEDIA_SUBTYPE_raw);
|
||||
|
||||
spa_pod_builder_push_prop(&b, SPA_FORMAT_VIDEO_format,
|
||||
SPA_POD_PROP_RANGE_ENUM | SPA_POD_PROP_FLAG_UNSET);
|
||||
spa_pod_builder_id(&b, SPA_VIDEO_FORMAT_I420);
|
||||
spa_pod_builder_id(&b, SPA_VIDEO_FORMAT_I420);
|
||||
spa_pod_builder_id(&b, SPA_VIDEO_FORMAT_YUY2);
|
||||
spa_pod_builder_enum(&b, SPA_VIDEO_FORMAT_I420);
|
||||
spa_pod_builder_enum(&b, SPA_VIDEO_FORMAT_I420);
|
||||
spa_pod_builder_enum(&b, SPA_VIDEO_FORMAT_YUY2);
|
||||
spa_pod_builder_pop(&b);
|
||||
|
||||
struct spa_rectangle size_min_max[] = { {1, 1}, {INT32_MAX, INT32_MAX} };
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ static int make_nodes(struct data *data, const char *device)
|
|||
":", SPA_PROP_device, "s", device ? device : "hw:0",
|
||||
":", SPA_PROP_minLatency, "i", 64);
|
||||
|
||||
if ((res = spa_node_set_param(data->sink, SPA_ID_PARAM_Props, 0, props)) < 0)
|
||||
if ((res = spa_node_set_param(data->sink, SPA_PARAM_Props, 0, props)) < 0)
|
||||
printf("got set_props error %d\n", res);
|
||||
|
||||
if ((res = make_node(data, &data->source,
|
||||
|
|
@ -255,7 +255,7 @@ static int make_nodes(struct data *data, const char *device)
|
|||
0, SPA_ID_OBJECT_Props,
|
||||
":", SPA_PROP_live, "b", false);
|
||||
|
||||
if ((res = spa_node_set_param(data->source, SPA_ID_PARAM_Props, 0, props)) < 0)
|
||||
if ((res = spa_node_set_param(data->source, SPA_PARAM_Props, 0, props)) < 0)
|
||||
printf("got set_props error %d\n", res);
|
||||
return res;
|
||||
}
|
||||
|
|
@ -275,19 +275,19 @@ static int negotiate_formats(struct data *data)
|
|||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", 44100,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", 2);
|
||||
|
||||
if ((res = spa_node_port_enum_params(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
filter, &format, &b)) <= 0)
|
||||
return -EBADF;
|
||||
|
||||
if ((res = spa_node_port_set_param(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
@ -295,16 +295,16 @@ static int negotiate_formats(struct data *data)
|
|||
|
||||
spa_node_port_set_io(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source_sink_io[0], sizeof(data->source_sink_io[0]));
|
||||
spa_node_port_set_io(data->sink,
|
||||
SPA_DIRECTION_INPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source_sink_io[0], sizeof(data->source_sink_io[0]));
|
||||
|
||||
if ((res = spa_node_port_set_param(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ static int make_nodes(struct data *data, const char *device)
|
|||
0, SPA_ID_OBJECT_Props,
|
||||
":", SPA_PROP_device, "s", device ? device : "/dev/video0");
|
||||
|
||||
if ((res = spa_node_set_param(data->source, SPA_ID_PARAM_Props, 0, props)) < 0)
|
||||
if ((res = spa_node_set_param(data->source, SPA_PARAM_Props, 0, props)) < 0)
|
||||
printf("got set_props error %d\n", res);
|
||||
|
||||
return res;
|
||||
|
|
@ -383,7 +383,7 @@ static int negotiate_formats(struct data *data)
|
|||
if ((res =
|
||||
spa_node_port_set_io(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&data->source_output[0], sizeof(data->source_output[0]))) < 0)
|
||||
return res;
|
||||
|
||||
|
|
@ -397,7 +397,7 @@ static int negotiate_formats(struct data *data)
|
|||
|
||||
if ((res = spa_node_port_set_param(data->source,
|
||||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ inspect_node_params(struct data *data, struct spa_node *node)
|
|||
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
if ((res = spa_node_enum_params(node,
|
||||
SPA_ID_PARAM_List, &idx1,
|
||||
SPA_PARAM_List, &idx1,
|
||||
NULL, ¶m, &b)) <= 0) {
|
||||
if (res != 0)
|
||||
error(0, -res, "enum_params");
|
||||
|
|
@ -100,7 +100,7 @@ inspect_port_params(struct data *data, struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
if ((res = spa_node_port_enum_params(node,
|
||||
direction, port_id,
|
||||
SPA_ID_PARAM_List, &idx1,
|
||||
SPA_PARAM_List, &idx1,
|
||||
NULL, ¶m, &b)) <= 0) {
|
||||
if (res != 0)
|
||||
error(0, -res, "port_enum_params");
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ struct data {
|
|||
|
||||
static void inspect_item(struct data *data, struct spa_pod *item)
|
||||
{
|
||||
spa_debug_pod(0, spa_type_monitor_item, item);
|
||||
spa_debug_pod(0, spa_types, item);
|
||||
}
|
||||
|
||||
static void on_monitor_event(void *_data, struct spa_event *event)
|
||||
|
|
|
|||
|
|
@ -113,11 +113,11 @@ int main(int argc, char *argv[])
|
|||
data.remote = pw_stream_get_remote(data.stream);
|
||||
|
||||
params[0] = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", DEFAULT_CHANNELS,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", DEFAULT_RATE);
|
||||
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ static int impl_port_set_io(struct spa_node *node,
|
|||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
d->io = data;
|
||||
#if 0
|
||||
else if (id == d->type.io_prop_param) {
|
||||
|
|
@ -218,7 +218,7 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*result = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_video,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_VIDEO_format, "I", d->format.format,
|
||||
|
|
@ -241,13 +241,13 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
struct spa_pod *param;
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(builder,
|
||||
|
|
@ -257,13 +257,13 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
return port_get_format(node, direction, port_id, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (*index != 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -277,7 +277,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(builder,
|
||||
|
|
@ -360,7 +360,7 @@ static int impl_port_set_param(struct spa_node *node,
|
|||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ static int impl_port_set_io(struct spa_node *node, enum spa_direction direction,
|
|||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
d->io = data;
|
||||
#if 0
|
||||
else if (id == type.io_prop_volume) {
|
||||
|
|
@ -181,13 +181,13 @@ static int port_enum_formats(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_S16,
|
||||
SPA_POD_PROP_ENUM(2, SPA_AUDIO_FORMAT_S16,
|
||||
SPA_AUDIO_FORMAT_F32),
|
||||
":", SPA_FORMAT_AUDIO_layout, "ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "Ieu", SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_POD_PROP_ENUM(2, SPA_AUDIO_LAYOUT_INTERLEAVED,
|
||||
SPA_AUDIO_LAYOUT_NON_INTERLEAVED),
|
||||
":", SPA_FORMAT_AUDIO_channels, "iru", 2,
|
||||
|
|
@ -216,11 +216,11 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", d->format.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", d->format.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", d->format.layout,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", d->format.channels,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", d->format.rate);
|
||||
|
||||
|
|
@ -239,13 +239,13 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
struct spa_pod *param;
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(builder,
|
||||
|
|
@ -255,13 +255,13 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
return port_get_format(node, direction, port_id, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -275,7 +275,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_stride, "i", 0,
|
||||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(builder,
|
||||
|
|
@ -287,12 +287,12 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(builder,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -356,7 +356,7 @@ static int impl_port_set_param(struct spa_node *node,
|
|||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ static int impl_port_set_io(struct spa_node *node, enum spa_direction direction,
|
|||
{
|
||||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
d->io = data;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
|
@ -225,9 +225,9 @@ static int port_enum_formats(struct spa_node *node,
|
|||
|
||||
SDL_GetRendererInfo(d->renderer, &info);
|
||||
|
||||
spa_pod_builder_push_object(builder, SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_id(builder, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_id(builder, SPA_MEDIA_SUBTYPE_raw);
|
||||
spa_pod_builder_push_object(builder, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_enum(builder, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_enum(builder, SPA_MEDIA_SUBTYPE_raw);
|
||||
|
||||
spa_pod_builder_push_prop(builder, SPA_FORMAT_VIDEO_format,
|
||||
SPA_POD_PROP_FLAG_UNSET |
|
||||
|
|
@ -237,13 +237,13 @@ static int port_enum_formats(struct spa_node *node,
|
|||
if (id == 0)
|
||||
continue;
|
||||
if (c++ == 0)
|
||||
spa_pod_builder_id(builder, id);
|
||||
spa_pod_builder_id(builder, id);
|
||||
spa_pod_builder_enum(builder, id);
|
||||
spa_pod_builder_enum(builder, id);
|
||||
}
|
||||
for (i = 0; i < SPA_N_ELEMENTS(video_formats); i++) {
|
||||
uint32_t id = video_formats[i].id;
|
||||
if (id != SPA_VIDEO_FORMAT_UNKNOWN)
|
||||
spa_pod_builder_id(builder, id);
|
||||
spa_pod_builder_enum(builder, id);
|
||||
}
|
||||
spa_pod_builder_pop(builder);
|
||||
|
||||
|
|
@ -273,10 +273,10 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
struct data *d = SPA_CONTAINER_OF(node, struct data, impl_node);
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
return port_enum_formats(node, direction, port_id, index, filter, result, builder);
|
||||
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -290,7 +290,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -342,7 +342,7 @@ static int impl_port_set_param(struct spa_node *node,
|
|||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -97,9 +97,9 @@ static struct spa_pod *sdl_build_formats(SDL_RendererInfo *info, struct spa_pod_
|
|||
{
|
||||
int i, c;
|
||||
|
||||
spa_pod_builder_push_object(b, SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_id(b, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_id(b, SPA_MEDIA_SUBTYPE_raw);
|
||||
spa_pod_builder_push_object(b, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_enum(b, SPA_MEDIA_TYPE_video);
|
||||
spa_pod_builder_enum(b, SPA_MEDIA_SUBTYPE_raw);
|
||||
|
||||
spa_pod_builder_push_prop(b, SPA_FORMAT_VIDEO_format,
|
||||
SPA_POD_PROP_FLAG_UNSET |
|
||||
|
|
@ -109,13 +109,13 @@ static struct spa_pod *sdl_build_formats(SDL_RendererInfo *info, struct spa_pod_
|
|||
if (id == 0)
|
||||
continue;
|
||||
if (c++ == 0)
|
||||
spa_pod_builder_id(b, id);
|
||||
spa_pod_builder_id(b, id);
|
||||
spa_pod_builder_enum(b, id);
|
||||
spa_pod_builder_enum(b, id);
|
||||
}
|
||||
for (i = 0; i < SPA_N_ELEMENTS(sdl_video_formats); i++) {
|
||||
uint32_t id = sdl_video_formats[i].id;
|
||||
if (id != SPA_VIDEO_FORMAT_UNKNOWN)
|
||||
spa_pod_builder_id(b, id);
|
||||
spa_pod_builder_enum(b, id);
|
||||
}
|
||||
spa_pod_builder_pop(b);
|
||||
spa_pod_builder_add(b,
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
|
|||
SDL_UnlockTexture(data->texture);
|
||||
|
||||
params[0] = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", 8,
|
||||
SPA_POD_PROP_MIN_MAX(2, 16),
|
||||
":", SPA_PARAM_BUFFERS_blocks, "i", 1,
|
||||
|
|
@ -178,7 +178,7 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
|
||||
params[1] = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header));
|
||||
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
|
|||
data->stride = SPA_ROUND_UP_N(data->format.size.width * BPP, 4);
|
||||
|
||||
params[0] = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", 2,
|
||||
SPA_POD_PROP_MIN_MAX(1, 32),
|
||||
":", SPA_PARAM_BUFFERS_blocks, "i", 1,
|
||||
|
|
@ -177,12 +177,12 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
|
||||
params[1] = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header));
|
||||
|
||||
params[2] = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_VideoDamage,
|
||||
":", SPA_PARAM_META_size, "iru", sizeof(struct spa_meta_region) * 16,
|
||||
SPA_POD_PROP_MIN_MAX(sizeof(struct spa_meta_region) * 1,
|
||||
|
|
@ -223,7 +223,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
|
|||
NULL));
|
||||
|
||||
params[0] = spa_pod_builder_object(&b,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_video,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_VIDEO_format, "I", SPA_VIDEO_FORMAT_RGB,
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ static void port_event_info(void *data, struct pw_port_info *info)
|
|||
|
||||
if (info->change_mask & PW_PORT_CHANGE_MASK_ENUM_PARAMS) {
|
||||
pw_port_proxy_enum_params((struct pw_port_proxy*)port_data->proxy,
|
||||
SPA_ID_PARAM_EnumFormat, 0, 0, NULL);
|
||||
SPA_PARAM_EnumFormat, 0, 0, NULL);
|
||||
add_pending(self, &port_data->pending_param, do_add_node, port_data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ handle_audio_fields (ConvertData *d)
|
|||
SPA_FORMAT_AUDIO_layout,
|
||||
get_range_type (value));
|
||||
|
||||
spa_pod_builder_int (&d->b, layout);
|
||||
spa_pod_builder_enum (&d->b, layout);
|
||||
}
|
||||
prop = spa_pod_builder_pop(&d->b);
|
||||
if (i > 1)
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers, &max_buffers);
|
||||
|
||||
spa_pod_builder_init (&b, buffer, sizeof (buffer));
|
||||
spa_pod_builder_push_object (&b, SPA_ID_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers);
|
||||
spa_pod_builder_push_object (&b, SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers);
|
||||
if (size == 0)
|
||||
spa_pod_builder_add (&b,
|
||||
":", SPA_PARAM_BUFFERS_size, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX), NULL);
|
||||
|
|
@ -248,7 +248,7 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
port_params[0] = spa_pod_builder_pop (&b);
|
||||
|
||||
port_params[1] = spa_pod_builder_object (&b,
|
||||
SPA_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof (struct spa_meta_header));
|
||||
|
||||
|
|
@ -510,7 +510,7 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
|
||||
pwsink = GST_PIPEWIRE_SINK (bsink);
|
||||
|
||||
possible = gst_caps_to_format_all (caps, SPA_ID_PARAM_EnumFormat);
|
||||
possible = gst_caps_to_format_all (caps, SPA_PARAM_EnumFormat);
|
||||
|
||||
pw_thread_loop_lock (pwsink->main_loop);
|
||||
state = pw_stream_get_state (pwsink->stream, &error);
|
||||
|
|
|
|||
|
|
@ -587,7 +587,7 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc)
|
|||
GST_DEBUG_OBJECT (basesrc, "have common caps: %" GST_PTR_FORMAT, caps);
|
||||
|
||||
/* open a connection with these caps */
|
||||
possible = gst_caps_to_format_all (caps, SPA_ID_PARAM_EnumFormat);
|
||||
possible = gst_caps_to_format_all (caps, SPA_PARAM_EnumFormat);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
/* first disconnect */
|
||||
|
|
@ -702,7 +702,7 @@ on_format_changed (void *data,
|
|||
|
||||
spa_pod_builder_init (&b, buffer, sizeof (buffer));
|
||||
params[0] = spa_pod_builder_object (&b,
|
||||
SPA_ID_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", 16, SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_PARAM_BUFFERS_blocks, "iru", 0, SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_PARAM_BUFFERS_size, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX),
|
||||
|
|
@ -710,7 +710,7 @@ on_format_changed (void *data,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
|
||||
params[1] = spa_pod_builder_object (&b,
|
||||
SPA_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof (struct spa_meta_header));
|
||||
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ do_update_port(struct node *this,
|
|||
for (i = 0; i < port->n_params; i++) {
|
||||
port->params[i] = pw_spa_pod_copy(params[i]);
|
||||
|
||||
if (spa_pod_is_object_id(port->params[i], SPA_ID_PARAM_Format))
|
||||
if (spa_pod_is_object_id(port->params[i], SPA_PARAM_Format))
|
||||
port->have_format = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1279,7 +1279,7 @@ static void node_initialized(void *data)
|
|||
pw_log_debug("client-node %p: io areas %p", node, impl->io_areas->ptr);
|
||||
|
||||
pw_client_node_resource_set_io(this->resource,
|
||||
PW_ID_IO_ClientNodePosition,
|
||||
PW_IO_ClientNodePosition,
|
||||
m->id,
|
||||
area_size,
|
||||
sizeof(struct pw_client_node_position));
|
||||
|
|
@ -1434,7 +1434,7 @@ static int impl_mix_port_set_io(struct spa_node *node,
|
|||
if (mix == NULL)
|
||||
return -EIO;
|
||||
|
||||
if (id == SPA_ID_IO_Buffers) {
|
||||
if (id == SPA_IO_Buffers) {
|
||||
if (data && size >= sizeof(struct spa_io_buffers))
|
||||
mix->io = data;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ impl_node_add_port(struct spa_node *node, enum spa_direction direction, uint32_t
|
|||
|
||||
if ((res = spa_node_port_set_io(impl->adapter_mix,
|
||||
direction, port_id,
|
||||
SPA_ID_IO_ControlRange,
|
||||
SPA_IO_ControlRange,
|
||||
&impl->ctrl,
|
||||
sizeof(&impl->ctrl))) < 0)
|
||||
return res;
|
||||
|
|
@ -374,20 +374,20 @@ static int negotiate_format(struct impl *impl)
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(impl->adapter_mix,
|
||||
SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
NULL, &format, &b)) <= 0) {
|
||||
debug_params(impl, impl->adapter_mix, SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_PARAM_EnumFormat, NULL);
|
||||
SPA_PARAM_EnumFormat, NULL);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(impl->cnode,
|
||||
impl->direction, 0,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
format, &format, &b)) <= 0) {
|
||||
debug_params(impl, impl->cnode, impl->direction, 0,
|
||||
SPA_ID_PARAM_EnumFormat, format);
|
||||
SPA_PARAM_EnumFormat, format);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
|
|
@ -396,13 +396,13 @@ static int negotiate_format(struct impl *impl)
|
|||
|
||||
if ((res = spa_node_port_set_param(impl->adapter_mix,
|
||||
SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_param(impl->cnode,
|
||||
impl->direction, 0,
|
||||
SPA_ID_PARAM_Format, 0,
|
||||
SPA_PARAM_Format, 0,
|
||||
format)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
@ -433,10 +433,10 @@ static int negotiate_buffers(struct impl *impl)
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(impl->adapter_mix,
|
||||
SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_PARAM_Buffers, &state,
|
||||
SPA_PARAM_Buffers, &state,
|
||||
param, ¶m, &b)) <= 0) {
|
||||
debug_params(impl, impl->adapter_mix, SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_PARAM_Buffers, param);
|
||||
SPA_PARAM_Buffers, param);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
if (res == 0)
|
||||
|
|
@ -445,10 +445,10 @@ static int negotiate_buffers(struct impl *impl)
|
|||
state = 0;
|
||||
if ((res = spa_node_port_enum_params(impl->cnode,
|
||||
impl->direction, 0,
|
||||
SPA_ID_PARAM_Buffers, &state,
|
||||
SPA_PARAM_Buffers, &state,
|
||||
param, ¶m, &b)) < 0) {
|
||||
debug_params(impl, impl->cnode, impl->direction, 0,
|
||||
SPA_ID_PARAM_Buffers, param);
|
||||
SPA_PARAM_Buffers, param);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -597,7 +597,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
flags, param)) < 0)
|
||||
return res;
|
||||
|
||||
if (id == SPA_ID_PARAM_Format && impl->use_converter) {
|
||||
if (id == SPA_PARAM_Format && impl->use_converter) {
|
||||
if (param == NULL) {
|
||||
if ((res = spa_node_port_set_param(impl->adapter_mix,
|
||||
SPA_DIRECTION_REVERSE(direction), 0, id,
|
||||
|
|
@ -636,7 +636,7 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
if (impl->use_converter)
|
||||
res = spa_node_port_set_io(impl->adapter_mix, direction, port_id, id, data, size);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers && size >= sizeof(struct spa_io_buffers)) {
|
||||
if (id == SPA_IO_Buffers && size >= sizeof(struct spa_io_buffers)) {
|
||||
impl->io = data;
|
||||
}
|
||||
|
||||
|
|
@ -874,7 +874,7 @@ static void client_node_initialized(void *data)
|
|||
|
||||
if ((res = spa_node_port_set_io(impl->client_port->mix,
|
||||
impl->direction, 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
impl->client_port_mix.io,
|
||||
sizeof(impl->client_port_mix.io))) < 0)
|
||||
return;
|
||||
|
|
@ -883,7 +883,7 @@ static void client_node_initialized(void *data)
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
if ((res = spa_node_port_enum_params(impl->cnode,
|
||||
impl->direction, 0,
|
||||
SPA_ID_PARAM_EnumFormat, &state,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
NULL, &format, &b)) <= 0) {
|
||||
pw_log_warn("client-stream %p: no format given", &impl->this);
|
||||
impl->adapter = impl->cnode;
|
||||
|
|
@ -920,7 +920,7 @@ static void client_node_initialized(void *data)
|
|||
if (impl->use_converter) {
|
||||
if ((res = spa_node_port_set_io(impl->adapter_mix,
|
||||
SPA_DIRECTION_REVERSE(impl->direction), 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
impl->client_port_mix.io,
|
||||
sizeof(impl->client_port_mix.io))) < 0)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -662,7 +662,7 @@ static int find_port_format(struct impl *impl, struct pw_port *port,
|
|||
struct channel_data data = { impl, 0, 0 };
|
||||
|
||||
pw_port_for_each_param(port,
|
||||
SPA_ID_PARAM_EnumFormat,
|
||||
SPA_PARAM_EnumFormat,
|
||||
0, 0, NULL,
|
||||
collect_audio_format, &data);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/pod/filter.h>
|
||||
|
||||
#define NAME "floatmix"
|
||||
|
|
@ -327,20 +325,20 @@ static int port_enum_formats(struct spa_node *node,
|
|||
case 0:
|
||||
if (this->have_format) {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", this->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", this->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", this->format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", this->format.info.raw.channels);
|
||||
} else {
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", SPA_AUDIO_LAYOUT_NON_INTERLEAVED,
|
||||
":", SPA_FORMAT_AUDIO_rate, "iru", 44100,
|
||||
SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_FORMAT_AUDIO_channels, "iru", 1);
|
||||
|
|
@ -367,11 +365,11 @@ static int port_get_format(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
*param = spa_pod_builder_object(builder,
|
||||
SPA_ID_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
SPA_PARAM_Format, SPA_ID_OBJECT_Format,
|
||||
"I", SPA_MEDIA_TYPE_audio,
|
||||
"I", SPA_MEDIA_SUBTYPE_raw,
|
||||
":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format,
|
||||
":", SPA_FORMAT_AUDIO_layout, "i", this->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_layout, "I", this->format.info.raw.layout,
|
||||
":", SPA_FORMAT_AUDIO_rate, "i", this->format.info.raw.rate,
|
||||
":", SPA_FORMAT_AUDIO_channels, "i", this->format.info.raw.channels);
|
||||
|
||||
|
|
@ -407,13 +405,13 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
switch (id) {
|
||||
case SPA_ID_PARAM_List:
|
||||
case SPA_PARAM_List:
|
||||
{
|
||||
uint32_t list[] = { SPA_ID_PARAM_EnumFormat,
|
||||
SPA_ID_PARAM_Format,
|
||||
SPA_ID_PARAM_Buffers,
|
||||
SPA_ID_PARAM_Meta,
|
||||
SPA_ID_PARAM_IO };
|
||||
uint32_t list[] = { SPA_PARAM_EnumFormat,
|
||||
SPA_PARAM_Format,
|
||||
SPA_PARAM_Buffers,
|
||||
SPA_PARAM_Meta,
|
||||
SPA_PARAM_IO };
|
||||
|
||||
if (*index < SPA_N_ELEMENTS(list))
|
||||
param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList,
|
||||
|
|
@ -422,16 +420,16 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
case SPA_ID_PARAM_EnumFormat:
|
||||
case SPA_PARAM_EnumFormat:
|
||||
if ((res = port_enum_formats(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Format:
|
||||
case SPA_PARAM_Format:
|
||||
if ((res = port_get_format(node, direction, port_id, index, ¶m, &b)) <= 0)
|
||||
return res;
|
||||
break;
|
||||
case SPA_ID_PARAM_Buffers:
|
||||
case SPA_PARAM_Buffers:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
if (*index > 0)
|
||||
|
|
@ -448,7 +446,7 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_Meta:
|
||||
case SPA_PARAM_Meta:
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
|
||||
|
|
@ -464,18 +462,18 @@ impl_node_port_enum_params(struct spa_node *node,
|
|||
}
|
||||
break;
|
||||
|
||||
case SPA_ID_PARAM_IO:
|
||||
case SPA_PARAM_IO:
|
||||
switch (*index) {
|
||||
case 0:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_Buffers,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers));
|
||||
break;
|
||||
case 1:
|
||||
param = spa_pod_builder_object(&b,
|
||||
id, SPA_ID_OBJECT_ParamIO,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_ID_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange,
|
||||
":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -628,7 +626,7 @@ impl_node_port_set_param(struct spa_node *node,
|
|||
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
@ -714,9 +712,9 @@ impl_node_port_set_io(struct spa_node *node,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers)
|
||||
if (id == SPA_IO_Buffers)
|
||||
port->io = data;
|
||||
else if (id == SPA_ID_IO_ControlRange)
|
||||
else if (id == SPA_IO_ControlRange)
|
||||
port->ctrl = data;
|
||||
#if 0
|
||||
else if (id == t->io_prop_volume && direction == SPA_DIRECTION_INPUT)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ static struct monitor_item *add_item(struct pw_spa_monitor *this,
|
|||
|
||||
if (spa_pod_object_parse(item,
|
||||
":", SPA_MONITOR_ITEM_id, "s", &id,
|
||||
":", SPA_MONITOR_ITEM_state, "i", &state,
|
||||
":", SPA_MONITOR_ITEM_state, "I", &state,
|
||||
":", SPA_MONITOR_ITEM_name, "s", &name,
|
||||
":", SPA_MONITOR_ITEM_class, "s", &klass,
|
||||
":", SPA_MONITOR_ITEM_factory, "p", &factory,
|
||||
|
|
@ -185,7 +185,7 @@ static void change_item(struct pw_spa_monitor *this, struct spa_pod *item, uint6
|
|||
|
||||
if (spa_pod_object_parse(item,
|
||||
":", SPA_MONITOR_ITEM_name, "s", &name,
|
||||
":", SPA_MONITOR_ITEM_state, "i", &state,
|
||||
":", SPA_MONITOR_ITEM_state, "I", &state,
|
||||
":", SPA_MONITOR_ITEM_id, "s", &id, NULL) < 0)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ 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, SPA_ID_PARAM_Props, &index, NULL, &props, &b)) <= 0) {
|
||||
if ((res = spa_node_enum_params(spa_node, SPA_PARAM_Props, &index, NULL, &props, &b)) <= 0) {
|
||||
pw_log_debug("spa_node_get_props failed: %d", res);
|
||||
return res;
|
||||
}
|
||||
|
|
@ -192,7 +192,7 @@ setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_propertie
|
|||
pw_properties_parse_bool(value);
|
||||
break;
|
||||
case SPA_ID_Enum:
|
||||
SPA_POD_VALUE(struct spa_pod_id, &prop->body.value) =
|
||||
SPA_POD_VALUE(struct spa_pod_enum, &prop->body.value) =
|
||||
spa_debug_type_find_id(spa_debug_types, value);
|
||||
break;
|
||||
case SPA_ID_Int:
|
||||
|
|
@ -219,7 +219,7 @@ setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_propertie
|
|||
}
|
||||
}
|
||||
|
||||
if ((res = spa_node_set_param(spa_node, SPA_ID_PARAM_Props, 0, props)) < 0) {
|
||||
if ((res = spa_node_set_param(spa_node, SPA_PARAM_Props, 0, props)) < 0) {
|
||||
pw_log_debug("spa_node_set_props failed: %d", res);
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ pw_control_new(struct pw_core *core,
|
|||
|
||||
direction = SPA_DIRECTION_OUTPUT;
|
||||
#if 0
|
||||
direction = spa_pod_is_object_id(param, SPA_ID_PARAM_PropsOut) ?
|
||||
direction = spa_pod_is_object_id(param, SPA_PARAM_PropsOut) ?
|
||||
SPA_DIRECTION_OUTPUT : SPA_DIRECTION_INPUT;
|
||||
|
||||
if (spa_pod_object_parse(param,
|
||||
|
|
|
|||
|
|
@ -726,7 +726,7 @@ int pw_core_find_format(struct pw_core *core,
|
|||
/* only input needs format */
|
||||
if ((res = spa_node_port_enum_params(output->node->node,
|
||||
output->direction, output->port_id,
|
||||
SPA_ID_PARAM_Format, &oidx,
|
||||
SPA_PARAM_Format, &oidx,
|
||||
NULL, format, builder)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
|
|
@ -740,7 +740,7 @@ int pw_core_find_format(struct pw_core *core,
|
|||
/* only output needs format */
|
||||
if ((res = spa_node_port_enum_params(input->node->node,
|
||||
input->direction, input->port_id,
|
||||
SPA_ID_PARAM_Format, &iidx,
|
||||
SPA_PARAM_Format, &iidx,
|
||||
NULL, format, builder)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
|
|
@ -760,7 +760,7 @@ int pw_core_find_format(struct pw_core *core,
|
|||
spa_pod_builder_init(&fb, fbuf, sizeof(fbuf));
|
||||
if ((res = spa_node_port_enum_params(input->node->node,
|
||||
input->direction, input->port_id,
|
||||
SPA_ID_PARAM_EnumFormat, &iidx,
|
||||
SPA_PARAM_EnumFormat, &iidx,
|
||||
NULL, &filter, &fb)) <= 0) {
|
||||
if (res == 0 && iidx == 0) {
|
||||
asprintf(error, "error input enum formats: %s", spa_strerror(res));
|
||||
|
|
@ -775,7 +775,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,
|
||||
SPA_ID_PARAM_EnumFormat, &oidx,
|
||||
SPA_PARAM_EnumFormat, &oidx,
|
||||
filter, format, builder)) <= 0) {
|
||||
if (res == 0) {
|
||||
oidx = 0;
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
index = 0;
|
||||
if ((res = spa_node_port_enum_params(output->node->node,
|
||||
output->direction, output->port_id,
|
||||
SPA_ID_PARAM_Format, &index,
|
||||
SPA_PARAM_Format, &index,
|
||||
format, ¤t, &b)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
|
|
@ -204,7 +204,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
|||
index = 0;
|
||||
if ((res = spa_node_port_enum_params(input->node->node,
|
||||
input->direction, input->port_id,
|
||||
SPA_ID_PARAM_Format, &index,
|
||||
SPA_PARAM_Format, &index,
|
||||
format, ¤t, &b)) <= 0) {
|
||||
if (res == 0)
|
||||
res = -EBADF;
|
||||
|
|
@ -230,7 +230,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 on output mix", this);
|
||||
if ((res = pw_port_set_param(output,
|
||||
this->rt.out_mix.port.port_id,
|
||||
SPA_ID_PARAM_Format, SPA_NODE_PARAM_FLAG_NEAREST,
|
||||
SPA_PARAM_Format, SPA_NODE_PARAM_FLAG_NEAREST,
|
||||
format)) < 0) {
|
||||
asprintf(&error, "error set output format: %d", res);
|
||||
goto error;
|
||||
|
|
@ -243,7 +243,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 on input mix", this);
|
||||
if ((res2 = pw_port_set_param(input,
|
||||
this->rt.in_mix.port.port_id,
|
||||
SPA_ID_PARAM_Format, SPA_NODE_PARAM_FLAG_NEAREST,
|
||||
SPA_PARAM_Format, SPA_NODE_PARAM_FLAG_NEAREST,
|
||||
format)) < 0) {
|
||||
asprintf(&error, "error set input format: %d", res2);
|
||||
goto error;
|
||||
|
|
@ -536,7 +536,7 @@ static int port_set_io(struct pw_link *this, struct pw_port *port, void *data, s
|
|||
if ((res = spa_node_port_set_io(port->mix,
|
||||
p->direction,
|
||||
p->port_id,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
data, size)) < 0)
|
||||
pw_log_warn("port %p: can't set io: %s", port, spa_strerror(res));
|
||||
}
|
||||
|
|
@ -642,8 +642,8 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s
|
|||
size_t data_sizes[1];
|
||||
ssize_t data_strides[1];
|
||||
|
||||
n_params = param_filter(this, input, output, SPA_ID_PARAM_Buffers, &b);
|
||||
n_params += param_filter(this, input, output, SPA_ID_PARAM_Meta, &b);
|
||||
n_params = param_filter(this, input, output, SPA_PARAM_Buffers, &b);
|
||||
n_params += param_filter(this, input, output, SPA_PARAM_Meta, &b);
|
||||
|
||||
params = alloca(n_params * sizeof(struct spa_pod *));
|
||||
for (i = 0, offset = 0; i < n_params; i++) {
|
||||
|
|
|
|||
|
|
@ -112,14 +112,14 @@ static int suspend_node(struct pw_node *this)
|
|||
pw_log_debug("node %p: suspend node", this);
|
||||
|
||||
spa_list_for_each(p, &this->input_ports, link) {
|
||||
if ((res = pw_port_set_param(p, SPA_ID_INVALID, SPA_ID_PARAM_Format, 0, NULL)) < 0)
|
||||
if ((res = pw_port_set_param(p, SPA_ID_INVALID, SPA_PARAM_Format, 0, NULL)) < 0)
|
||||
pw_log_warn("error unset format input: %s", spa_strerror(res));
|
||||
/* force CONFIGURE in case of async */
|
||||
p->state = PW_PORT_STATE_CONFIGURE;
|
||||
}
|
||||
|
||||
spa_list_for_each(p, &this->output_ports, link) {
|
||||
if ((res = pw_port_set_param(p, SPA_ID_INVALID, SPA_ID_PARAM_Format, 0, NULL)) < 0)
|
||||
if ((res = pw_port_set_param(p, SPA_ID_INVALID, SPA_PARAM_Format, 0, NULL)) < 0)
|
||||
pw_log_warn("error unset format output: %s", spa_strerror(res));
|
||||
/* force CONFIGURE in case of async */
|
||||
p->state = PW_PORT_STATE_CONFIGURE;
|
||||
|
|
|
|||
|
|
@ -527,26 +527,26 @@ int pw_port_add(struct pw_port *port, struct pw_node *node)
|
|||
}
|
||||
|
||||
#if 0
|
||||
pw_port_for_each_param(port, SPA_ID_PARAM_PropsOut, 0, 0, NULL, make_control, port);
|
||||
pw_port_for_each_param(port, SPA_ID_PARAM_PropsIn, 0, 0, NULL, make_control, port);
|
||||
pw_port_for_each_param(port, SPA_PARAM_PropsOut, 0, 0, NULL, make_control, port);
|
||||
pw_port_for_each_param(port, SPA_PARAM_PropsIn, 0, 0, NULL, make_control, port);
|
||||
#endif
|
||||
|
||||
pw_log_debug("port %p: setting node io", port);
|
||||
spa_node_port_set_io(node->node,
|
||||
port->direction, port_id,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&port->rt.io, sizeof(port->rt.io));
|
||||
|
||||
if (port->mix && port->mix->port_set_io) {
|
||||
spa_node_port_set_io(port->mix,
|
||||
pw_direction_reverse(port->direction), 0,
|
||||
SPA_ID_IO_Buffers,
|
||||
SPA_IO_Buffers,
|
||||
&port->rt.io, sizeof(port->rt.io));
|
||||
}
|
||||
|
||||
if (spa_node_port_set_io(node->node,
|
||||
port->direction, port_id,
|
||||
SPA_ID_IO_Clock,
|
||||
SPA_IO_Clock,
|
||||
&port->rt.clock, sizeof(port->rt.clock)) >= 0) {
|
||||
node->rt.clock = &port->rt.clock;
|
||||
pw_log_debug("port %p: set node clock %p", port, node->rt.clock);
|
||||
|
|
@ -813,7 +813,7 @@ int pw_port_set_param(struct pw_port *port, uint32_t mix_id, uint32_t id, uint32
|
|||
}
|
||||
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
if (param == NULL || res < 0) {
|
||||
free_allocation(&port->allocation);
|
||||
port->allocated = false;
|
||||
|
|
|
|||
|
|
@ -775,7 +775,7 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32
|
|||
spa_pod_builder_init(&b, buf, sizeof(buf));
|
||||
if (spa_node_port_enum_params(port->node->node,
|
||||
port->direction, port->port_id,
|
||||
SPA_ID_PARAM_List, &idx1,
|
||||
SPA_PARAM_List, &idx1,
|
||||
NULL, ¶m, &b) <= 0)
|
||||
break;
|
||||
|
||||
|
|
@ -855,7 +855,7 @@ client_node_set_io(void *object,
|
|||
pw_log_debug("node %p: set io %s %p", proxy,
|
||||
spa_debug_type_find_name(spa_debug_types, id), ptr);
|
||||
|
||||
if (id == PW_ID_IO_ClientNodePosition) {
|
||||
if (id == PW_IO_ClientNodePosition) {
|
||||
if (ptr == NULL && data->position) {
|
||||
m = find_mem_ptr(data, data->position);
|
||||
if (m && --m->ref == 0)
|
||||
|
|
@ -973,7 +973,7 @@ client_node_port_set_param(void *object,
|
|||
goto done;
|
||||
}
|
||||
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
struct mix *mix;
|
||||
spa_list_for_each(mix, &data->mix[direction], link) {
|
||||
if (mix->port->port_id == port_id)
|
||||
|
|
@ -1202,7 +1202,7 @@ client_node_port_set_io(void *object,
|
|||
pw_log_debug("port %p: set io %s %p", mix->port,
|
||||
spa_debug_type_find_name(spa_debug_types, id), ptr);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers) {
|
||||
if (id == SPA_IO_Buffers) {
|
||||
if (ptr == NULL && mix->mix.io) {
|
||||
deactivate_mix(data, mix);
|
||||
m = find_mem_ptr(data, mix->mix.io);
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ static int impl_port_set_io(struct spa_node *node, enum spa_direction direction,
|
|||
pw_log_debug("stream %p: set io %s %p %zd", impl,
|
||||
spa_debug_type_find_name(spa_debug_types, id), data, size);
|
||||
|
||||
if (id == SPA_ID_IO_Buffers) {
|
||||
if (id == SPA_IO_Buffers) {
|
||||
if (data && size >= sizeof(struct spa_io_buffers))
|
||||
impl->io = data;
|
||||
else
|
||||
|
|
@ -395,7 +395,7 @@ static int impl_port_enum_params(struct spa_node *node,
|
|||
|
||||
(*index)++;
|
||||
|
||||
if (id == SPA_ID_PARAM_List) {
|
||||
if (id == SPA_PARAM_List) {
|
||||
uint32_t new_id = ((struct spa_pod_object *) param)->body.id;
|
||||
|
||||
if (last_id == SPA_ID_INVALID){
|
||||
|
|
@ -438,7 +438,7 @@ static int port_set_format(struct spa_node *node,
|
|||
if (p == NULL)
|
||||
goto no_mem;
|
||||
|
||||
((struct spa_pod_object*)p->param)->body.id = SPA_ID_PARAM_Format;
|
||||
((struct spa_pod_object*)p->param)->body.id = SPA_PARAM_Format;
|
||||
}
|
||||
else
|
||||
p = NULL;
|
||||
|
|
@ -466,7 +466,7 @@ static int impl_port_set_param(struct spa_node *node,
|
|||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
if (id == SPA_ID_PARAM_Format) {
|
||||
if (id == SPA_PARAM_Format) {
|
||||
return port_set_format(node, direction, port_id, flags, param);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ extern "C" {
|
|||
#include <spa/node/event.h>
|
||||
#include <spa/node/command.h>
|
||||
#include <spa/monitor/monitor.h>
|
||||
#include <spa/param/buffers.h>
|
||||
#include <spa/param/meta.h>
|
||||
#include <spa/param/io.h>
|
||||
#include <spa/param/param.h>
|
||||
#include <spa/node/io.h>
|
||||
|
||||
#include <pipewire/map.h>
|
||||
|
|
@ -47,8 +45,11 @@ enum {
|
|||
PW_ID_INTERFACE_Module,
|
||||
PW_ID_INTERFACE_ClientNode,
|
||||
|
||||
PW_ID_IO_BASE = PW_ID_FIRST + SPA_ID_IO_BASE,
|
||||
PW_ID_IO_ClientNodePosition,
|
||||
};
|
||||
|
||||
enum {
|
||||
PW_IO_BASE = PW_ID_FIRST,
|
||||
PW_IO_ClientNodePosition,
|
||||
};
|
||||
|
||||
#define PW_TYPE_BASE "PipeWire:"
|
||||
|
|
|
|||
|
|
@ -1101,9 +1101,9 @@ static bool do_node_params(struct data *data, const char *cmd, char *args, char
|
|||
return false;
|
||||
}
|
||||
if (n == 2)
|
||||
param_id = SPA_ID_PARAM_List;
|
||||
param_id = SPA_PARAM_List;
|
||||
else
|
||||
param_id = SPA_ID_PARAM_List;
|
||||
param_id = SPA_PARAM_List;
|
||||
|
||||
id = atoi(a[0]);
|
||||
global = pw_map_lookup(&rd->globals, id);
|
||||
|
|
@ -1135,9 +1135,9 @@ static bool do_port_params(struct data *data, const char *cmd, char *args, char
|
|||
return false;
|
||||
}
|
||||
if (n == 2)
|
||||
param_id = SPA_ID_PARAM_List;
|
||||
param_id = SPA_PARAM_List;
|
||||
else
|
||||
param_id = SPA_ID_PARAM_List;
|
||||
param_id = SPA_PARAM_List;
|
||||
|
||||
id = atoi(a[0]);
|
||||
global = pw_map_lookup(&rd->globals, id);
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ static void node_event_info(void *object, struct pw_node_info *info)
|
|||
|
||||
if (info->change_mask & PW_NODE_CHANGE_MASK_ENUM_PARAMS) {
|
||||
pw_node_proxy_enum_params((struct pw_node_proxy*)data->proxy,
|
||||
SPA_ID_PARAM_List, 0, 0, NULL);
|
||||
SPA_PARAM_List, 0, 0, NULL);
|
||||
add_pending(data);
|
||||
}
|
||||
if (data->pending_seq == SPA_ID_INVALID)
|
||||
|
|
@ -310,7 +310,7 @@ static void port_event_info(void *object, struct pw_port_info *info)
|
|||
|
||||
if (info->change_mask & PW_PORT_CHANGE_MASK_ENUM_PARAMS) {
|
||||
pw_port_proxy_enum_params((struct pw_port_proxy*)data->proxy,
|
||||
SPA_ID_PARAM_EnumFormat, 0, 0, NULL);
|
||||
SPA_PARAM_EnumFormat, 0, 0, NULL);
|
||||
add_pending(data);
|
||||
}
|
||||
if (data->pending_seq == SPA_ID_INVALID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue