Reorganise SPA tree

Reorganise the SPA includes to make it more extensible later
Simplify the naming of the buffer and meta params
This commit is contained in:
Wim Taymans 2017-11-10 13:36:14 +01:00
parent 58451d626c
commit caaeaff223
151 changed files with 1353 additions and 964 deletions

View file

@ -24,9 +24,9 @@
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/meta.h>
#include <spa/type-map.h>
#include <spa/utils/defs.h>
#include <spa/buffer/meta.h>
#include <spa/support/type-map.h>
/** \page page_buffer Buffers
*

View file

@ -24,9 +24,9 @@
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/ringbuffer.h>
#include <spa/type-map.h>
#include <spa/utils/defs.h>
#include <spa/utils/ringbuffer.h>
#include <spa/support/type-map.h>
/** \page page_meta Metadata
*

View file

@ -39,9 +39,8 @@ enum spa_clock_state {
SPA_CLOCK_STATE_RUNNING,
};
#include <spa/defs.h>
#include <spa/plugin.h>
#include <spa/pod-builder.h>
#include <spa/utils/defs.h>
#include <spa/pod/builder.h>
/**
* spa_clock:

View file

@ -24,7 +24,7 @@
extern "C" {
#endif
#include <spa/graph.h>
#include <spa/graph/graph.h>
#define SPA_GRAPH_STATE_IN 0
#define SPA_GRAPH_STATE_OUT 1

View file

@ -24,7 +24,7 @@
extern "C" {
#endif
#include <spa/graph.h>
#include <spa/graph/graph.h>
static inline int spa_graph_scheduler_default(struct spa_graph_node *node)
{

View file

@ -24,7 +24,7 @@
extern "C" {
#endif
#include <spa/graph.h>
#include <spa/graph/graph.h>
static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *node)
{

View file

@ -0,0 +1,212 @@
/* Simple Plugin API
* Copyright (C) 2017 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_GRAPH_SCHEDULER_H__
#define __SPA_GRAPH_SCHEDULER_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/graph/graph.h>
struct spa_graph_data {
struct spa_graph *graph;
};
static inline void spa_graph_data_init(struct spa_graph_data *data,
struct spa_graph *graph)
{
data->graph = graph;
}
static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *node);
static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *node);
static inline void check_input(struct spa_graph_node *node)
{
struct spa_graph_port *p;
node->ready[SPA_DIRECTION_INPUT] = 0;
spa_list_for_each(p, &node->ports[SPA_DIRECTION_INPUT], link) {
struct spa_graph_port *pport;
struct spa_graph_node *pnode;
if ((pport = p->peer) == NULL)
continue;
pnode = pport->node;
debug("node %p input peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
pnode->ready[SPA_DIRECTION_OUTPUT]++;
if (pport->io->status == SPA_RESULT_OK)
node->ready[SPA_DIRECTION_INPUT]++;
debug("node %p input peer %p out %d %d\n", node, pnode,
pnode->required[SPA_DIRECTION_OUTPUT],
pnode->ready[SPA_DIRECTION_OUTPUT]);
}
}
static inline void check_output(struct spa_graph_node *node)
{
struct spa_graph_port *p;
node->ready[SPA_DIRECTION_OUTPUT] = 0;
node->required[SPA_DIRECTION_OUTPUT] = 0;
spa_list_for_each(p, &node->ports[SPA_DIRECTION_OUTPUT], link) {
struct spa_graph_port *pport;
struct spa_graph_node *pnode;
if ((pport = p->peer) == NULL)
continue;
pnode = pport->node;
debug("node %p output peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
if (pport->io->status == SPA_RESULT_HAVE_BUFFER) {
pnode->ready[SPA_DIRECTION_INPUT]++;
node->required[SPA_DIRECTION_OUTPUT]++;
}
debug("node %p output peer %p out %d %d\n", node, pnode,
pnode->required[SPA_DIRECTION_INPUT],
pnode->ready[SPA_DIRECTION_INPUT]);
}
}
static inline void spa_graph_impl_activate(void *data, struct spa_graph_node *node)
{
int res;
debug("node %p activate %d\n", node, node->state);
if (node->state == SPA_RESULT_NEED_BUFFER) {
res = spa_node_process_input(node->implementation);
debug("node %p process in %d\n", node, res);
}
else if (node->state == SPA_RESULT_HAVE_BUFFER) {
res = spa_node_process_output(node->implementation);
debug("node %p process out %d\n", node, res);
}
else
return;
if (res == SPA_RESULT_NEED_BUFFER || (res == SPA_RESULT_OK && node->state == SPA_RESULT_NEED_BUFFER)) {
check_input(node);
}
else if (res == SPA_RESULT_HAVE_BUFFER) {
check_output(node);
}
node->state = res;
debug("node %p activate end %d\n", node, res);
}
static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *node)
{
struct spa_graph_port *p;
debug("node %p start pull\n", node);
node->state = SPA_RESULT_NEED_BUFFER;
node->ready[SPA_DIRECTION_INPUT] = 0;
spa_list_for_each(p, &node->ports[SPA_DIRECTION_INPUT], link) {
struct spa_graph_port *pport;
struct spa_graph_node *pnode;
uint32_t prequired;
if ((pport = p->peer) == NULL)
continue;
pnode = pport->node;
prequired = pnode->required[SPA_DIRECTION_OUTPUT];
debug("node %p pull peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
pnode->ready[SPA_DIRECTION_OUTPUT]++;
if (pport->io->status == SPA_RESULT_OK)
node->ready[SPA_DIRECTION_INPUT]++;
debug("node %p pull peer %p out %d %d\n", node, pnode, prequired, pnode->ready[SPA_DIRECTION_OUTPUT]);
if (prequired > 0 && pnode->ready[SPA_DIRECTION_OUTPUT] >= prequired) {
pnode->state = SPA_RESULT_HAVE_BUFFER;
spa_graph_impl_activate(data, pnode);
}
}
debug("node %p end pull\n", node);
return SPA_RESULT_OK;
}
static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *node)
{
struct spa_graph_port *p;
uint32_t required;
debug("node %p start push\n", node);
node->state = SPA_RESULT_HAVE_BUFFER;
node->ready[SPA_DIRECTION_OUTPUT] = 0;
node->required[SPA_DIRECTION_OUTPUT] = 0;
spa_list_for_each(p, &node->ports[SPA_DIRECTION_OUTPUT], link) {
struct spa_graph_port *pport;
struct spa_graph_node *pnode;
uint32_t prequired;
if ((pport = p->peer) == NULL)
continue;
pnode = pport->node;
prequired = pnode->required[SPA_DIRECTION_INPUT];
debug("node %p push peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
if (pport->io->status == SPA_RESULT_HAVE_BUFFER) {
pnode->ready[SPA_DIRECTION_INPUT]++;
node->required[SPA_DIRECTION_OUTPUT]++;
}
debug("node %p push peer %p in %d %d\n", node, pnode, prequired, pnode->ready[SPA_DIRECTION_INPUT]);
if (prequired > 0 && pnode->ready[SPA_DIRECTION_INPUT] >= prequired) {
pnode->state = SPA_RESULT_NEED_BUFFER;
spa_graph_impl_activate(data, pnode);
}
}
required = node->required[SPA_DIRECTION_OUTPUT];
if (required > 0 && node->ready[SPA_DIRECTION_OUTPUT] >= required) {
}
debug("node %p end push\n", node);
return SPA_RESULT_OK;
}
static const struct spa_graph_callbacks spa_graph_impl_default = {
SPA_VERSION_GRAPH_CALLBACKS,
.need_input = spa_graph_impl_need_input,
.have_output = spa_graph_impl_have_output,
};
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __SPA_GRAPH_SCHEDULER_H__ */

View file

@ -0,0 +1,158 @@
/* Simple Plugin API
* Copyright (C) 2017 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_GRAPH_SCHEDULER_H__
#define __SPA_GRAPH_SCHEDULER_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/graph/graph.h>
struct spa_graph_data {
struct spa_graph *graph;
};
static inline void spa_graph_data_init(struct spa_graph_data *data,
struct spa_graph *graph)
{
data->graph = graph;
}
static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *node);
static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *node);
static inline void spa_graph_impl_activate(void *data, struct spa_graph_node *node, bool recurse)
{
int res = node->state;
debug("node %p activate %d\n", node, node->state);
if (node->state == SPA_RESULT_NEED_BUFFER) {
res = spa_node_process_input(node->implementation);
debug("node %p process in %d\n", node, res);
}
else if (node->state == SPA_RESULT_HAVE_BUFFER) {
res = spa_node_process_output(node->implementation);
debug("node %p process out %d\n", node, res);
}
if (recurse && (res == SPA_RESULT_NEED_BUFFER || res == SPA_RESULT_OK))
spa_graph_impl_need_input(data, node);
else if (recurse && (res == SPA_RESULT_HAVE_BUFFER))
spa_graph_impl_have_output(data, node);
else
node->state = res;
debug("node %p activate end %d\n", node, node->state);
}
static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *node)
{
struct spa_graph_port *p;
uint32_t required;
debug("node %p start pull\n", node);
node->state = SPA_RESULT_NEED_BUFFER;
node->ready[SPA_DIRECTION_INPUT] = 0;
required = node->required[SPA_DIRECTION_INPUT];
spa_list_for_each(p, &node->ports[SPA_DIRECTION_INPUT], link) {
struct spa_graph_port *pport;
struct spa_graph_node *pnode;
uint32_t prequired;
if ((pport = p->peer) == NULL)
continue;
pnode = pport->node;
prequired = pnode->required[SPA_DIRECTION_OUTPUT];
debug("node %p pull peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
if (pport->io->status == SPA_RESULT_NEED_BUFFER)
pnode->ready[SPA_DIRECTION_OUTPUT]++;
else if (pport->io->status == SPA_RESULT_OK)
node->ready[SPA_DIRECTION_INPUT]++;
debug("node %p pull peer %p out %d %d\n", node, pnode, prequired, pnode->ready[SPA_DIRECTION_OUTPUT]);
if (prequired > 0 && pnode->ready[SPA_DIRECTION_OUTPUT] >= prequired) {
if (pnode->state == SPA_RESULT_NEED_BUFFER)
pnode->state = SPA_RESULT_HAVE_BUFFER;
spa_graph_impl_activate(data, pnode, true);
}
}
if (required > 0 && node->ready[SPA_DIRECTION_INPUT] >= required)
spa_graph_impl_activate(data, node, false);
debug("node %p end pull\n", node);
return SPA_RESULT_OK;
}
static inline int spa_graph_impl_have_output(void *data, struct spa_graph_node *node)
{
struct spa_graph_port *p;
debug("node %p start push\n", node);
node->state = SPA_RESULT_HAVE_BUFFER;
node->ready[SPA_DIRECTION_OUTPUT] = 0;
node->required[SPA_DIRECTION_OUTPUT] = 0;
spa_list_for_each(p, &node->ports[SPA_DIRECTION_OUTPUT], link) {
struct spa_graph_port *pport;
struct spa_graph_node *pnode;
uint32_t prequired;
if ((pport = p->peer) == NULL)
continue;
pnode = pport->node;
prequired = pnode->required[SPA_DIRECTION_INPUT];
debug("node %p push peer %p io %d %d\n", node, pnode, pport->io->status, pport->io->buffer_id);
if (pport->io->status == SPA_RESULT_HAVE_BUFFER) {
pnode->ready[SPA_DIRECTION_INPUT]++;
node->required[SPA_DIRECTION_OUTPUT]++;
}
debug("node %p push peer %p in %d %d\n", node, pnode, prequired, pnode->ready[SPA_DIRECTION_INPUT]);
if (prequired > 0 && pnode->ready[SPA_DIRECTION_INPUT] >= prequired)
spa_graph_impl_activate(data, pnode, true);
}
required = node->required[SPA_DIRECTION_OUTPUT];
if (required > 0 && node->ready[SPA_DIRECTION_OUTPUT] >= required)
spa_graph_impl_activate(data, node, false);
debug("node %p end push\n", node);
return SPA_RESULT_OK;
}
static const struct spa_graph_callbacks spa_graph_impl_default = {
SPA_VERSION_GRAPH_CALLBACKS,
.need_input = spa_graph_impl_need_input,
.have_output = spa_graph_impl_have_output,
};
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __SPA_GRAPH_SCHEDULER_H__ */

View file

@ -24,7 +24,7 @@
extern "C" {
#endif
#include <spa/graph.h>
#include <spa/graph/graph.h>
struct spa_graph_data {
struct spa_graph *graph;

View file

@ -24,9 +24,9 @@
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/list.h>
#include <spa/node.h>
#include <spa/utils/defs.h>
#include <spa/utils/list.h>
#include <spa/node/node.h>
#ifndef spa_debug
#define spa_debug(...)

View file

@ -1,57 +1,60 @@
spa_headers = [
'buffer.h',
'clock.h',
'command.h',
'command-node.h',
'defs.h',
'dict.h',
'event.h',
'event-node.h',
'format.h',
'format-utils.h',
'hook.h',
'list.h',
'log.h',
'loop.h',
'meta.h',
'monitor.h',
'node.h',
'param.h',
'param-alloc.h',
'plugin.h',
'pod.h',
'pod-builder.h',
'pod-iter.h',
'pod-parser.h',
'pod-utils.h',
'props.h',
'ringbuffer.h',
'type.h',
'type-map.h',
'buffer/buffer.h',
'buffer/meta.h',
'clock/clock.h',
'graph/graph.h',
'monitor/monitor.h',
'node/command.h',
'node/event.h',
'node/node.h',
'param/param.h',
'param/props.h',
'param/buffers.h',
'param/meta.h',
'param/format.h',
'param/format-utils.h',
'pod/pod.h',
'pod/builder.h',
'pod/command.h',
'pod/event.h',
'pod/iter.h',
'pod/parser.h',
'support/log.h',
'support/log-impl.h',
'support/loop.h',
'support/plugin.h',
'support/type-map.h',
'support/type-map-impl.h',
'utils/defs.h',
'utils/dict.h',
'utils/hook.h',
'utils/list.h',
'utils/ringbuffer.h',
'utils/type.h',
]
install_headers(spa_headers, subdir : 'spa')
spa_audio_headers = [
'audio/format.h',
'audio/format-utils.h',
'audio/raw.h',
'audio/raw-utils.h',
'param/audio/format.h',
'param/audio/format-utils.h',
'param/audio/raw.h',
'param/audio/raw-utils.h',
]
install_headers(spa_audio_headers,
subdir : 'spa/audio')
subdir : 'spa/param/audio')
spa_video_headers = [
'video/chroma.h',
'video/color.h',
'video/encoded.h',
'video/format.h',
'video/format-utils.h',
'video/multiview.h',
'video/raw.h',
'video/raw-utils.h',
'param/video/chroma.h',
'param/video/color.h',
'param/video/encoded.h',
'param/video/format.h',
'param/video/format-utils.h',
'param/video/multiview.h',
'param/video/raw.h',
'param/video/raw-utils.h',
]
install_headers(spa_video_headers,
subdir : 'spa/video')
subdir : 'spa/param/video')

View file

@ -28,9 +28,9 @@ struct spa_monitor;
#define SPA_TYPE__Monitor SPA_TYPE_INTERFACE_BASE "Monitor"
#define SPA_TYPE_MONITOR_BASE SPA_TYPE__Monitor ":"
#include <spa/defs.h>
#include <spa/dict.h>
#include <spa/event.h>
#include <spa/utils/defs.h>
#include <spa/utils/dict.h>
#include <spa/pod/event.h>
#define SPA_TYPE_EVENT__Monitor SPA_TYPE_EVENT_BASE "Monitor"
#define SPA_TYPE_EVENT_MONITOR_BASE SPA_TYPE_EVENT__Monitor ":"

View file

@ -24,8 +24,8 @@
extern "C" {
#endif
#include <spa/type-map.h>
#include <spa/command.h>
#include <spa/support/type-map.h>
#include <spa/pod/command.h>
#define SPA_TYPE_COMMAND__Node SPA_TYPE_COMMAND_BASE "Node"
#define SPA_TYPE_COMMAND_NODE_BASE SPA_TYPE_COMMAND__Node ":"

View file

@ -24,10 +24,10 @@
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/event.h>
#include <spa/type-map.h>
#include <spa/node.h>
#include <spa/utils/defs.h>
#include <spa/pod/event.h>
#include <spa/support/type-map.h>
#include <spa/node/node.h>
#define SPA_TYPE_EVENT__Node SPA_TYPE_EVENT_BASE "Node"
#define SPA_TYPE_EVENT_NODE_BASE SPA_TYPE_EVENT__Node ":"

View file

@ -29,15 +29,14 @@ extern "C" {
struct spa_node;
#include <spa/defs.h>
#include <spa/plugin.h>
#include <spa/props.h>
#include <spa/pod-builder.h>
#include <spa/param.h>
#include <spa/event-node.h>
#include <spa/command-node.h>
#include <spa/buffer.h>
#include <spa/format.h>
#include <spa/utils/defs.h>
#include <spa/support/plugin.h>
#include <spa/pod/builder.h>
#include <spa/buffer/buffer.h>
#include <spa/node/event.h>
#include <spa/node/command.h>
/** A range */
struct spa_range {

View file

@ -1,150 +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_ALLOC_H__
#define __SPA_PARAM_ALLOC_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/param.h>
#include <spa/type-map.h>
#define SPA_TYPE__ParamAlloc SPA_TYPE_PARAM_BASE "Alloc"
#define SPA_TYPE_PARAM_ALLOC_BASE SPA_TYPE__ParamAlloc ":"
#define SPA_TYPE_PARAM_ALLOC__Buffers SPA_TYPE_PARAM_ALLOC_BASE "Buffers"
#define SPA_TYPE_PARAM_ALLOC_BUFFERS_BASE SPA_TYPE_PARAM_ALLOC__Buffers ":"
#define SPA_TYPE_PARAM_ALLOC_BUFFERS__size SPA_TYPE_PARAM_ALLOC_BUFFERS_BASE "size"
#define SPA_TYPE_PARAM_ALLOC_BUFFERS__stride SPA_TYPE_PARAM_ALLOC_BUFFERS_BASE "stride"
#define SPA_TYPE_PARAM_ALLOC_BUFFERS__buffers SPA_TYPE_PARAM_ALLOC_BUFFERS_BASE "buffers"
#define SPA_TYPE_PARAM_ALLOC_BUFFERS__align SPA_TYPE_PARAM_ALLOC_BUFFERS_BASE "align"
struct spa_type_param_alloc_buffers {
uint32_t Buffers;
uint32_t size;
uint32_t stride;
uint32_t buffers;
uint32_t align;
};
static inline void
spa_type_param_alloc_buffers_map(struct spa_type_map *map,
struct spa_type_param_alloc_buffers *type)
{
if (type->Buffers == 0) {
type->Buffers = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC__Buffers);
type->size = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_BUFFERS__size);
type->stride = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_BUFFERS__stride);
type->buffers = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_BUFFERS__buffers);
type->align = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_BUFFERS__align);
}
}
#define SPA_TYPE_PARAM_ALLOC__MetaEnable SPA_TYPE_PARAM_ALLOC_BASE "MetaEnable"
#define SPA_TYPE_PARAM_ALLOC_META_ENABLE_BASE SPA_TYPE_PARAM_ALLOC__MetaEnable ":"
#define SPA_TYPE_PARAM_ALLOC_META_ENABLE__type SPA_TYPE_PARAM_ALLOC_META_ENABLE_BASE "type"
#define SPA_TYPE_PARAM_ALLOC_META_ENABLE__size SPA_TYPE_PARAM_ALLOC_META_ENABLE_BASE "size"
#define SPA_TYPE_PARAM_ALLOC_META_ENABLE__ringbufferSize SPA_TYPE_PARAM_ALLOC_META_ENABLE_BASE "ringbufferSize"
#define SPA_TYPE_PARAM_ALLOC_META_ENABLE__ringbufferMinAvail SPA_TYPE_PARAM_ALLOC_META_ENABLE_BASE "ringbufferMinAvail"
#define SPA_TYPE_PARAM_ALLOC_META_ENABLE__ringbufferStride SPA_TYPE_PARAM_ALLOC_META_ENABLE_BASE "ringbufferStride"
#define SPA_TYPE_PARAM_ALLOC_META_ENABLE__ringbufferBlocks SPA_TYPE_PARAM_ALLOC_META_ENABLE_BASE "ringbufferBlocks"
#define SPA_TYPE_PARAM_ALLOC_META_ENABLE__ringbufferAlign SPA_TYPE_PARAM_ALLOC_META_ENABLE_BASE "ringbufferAlign"
struct spa_type_param_alloc_meta_enable {
uint32_t MetaEnable;
uint32_t type;
uint32_t size;
uint32_t ringbufferSize;
uint32_t ringbufferMinAvail;
uint32_t ringbufferStride;
uint32_t ringbufferBlocks;
uint32_t ringbufferAlign;
};
static inline void
spa_type_param_alloc_meta_enable_map(struct spa_type_map *map,
struct spa_type_param_alloc_meta_enable *type)
{
if (type->MetaEnable == 0) {
int i;
#define OFF(n) offsetof(struct spa_type_param_alloc_meta_enable, n)
static struct { off_t offset; const char *type; } tab[] = {
{ OFF(MetaEnable), SPA_TYPE_PARAM_ALLOC__MetaEnable },
{ OFF(type), SPA_TYPE_PARAM_ALLOC_META_ENABLE__type },
{ OFF(size), SPA_TYPE_PARAM_ALLOC_META_ENABLE__size },
{ OFF(ringbufferSize), SPA_TYPE_PARAM_ALLOC_META_ENABLE__ringbufferSize },
{ OFF(ringbufferMinAvail), SPA_TYPE_PARAM_ALLOC_META_ENABLE__ringbufferMinAvail },
{ OFF(ringbufferStride), SPA_TYPE_PARAM_ALLOC_META_ENABLE__ringbufferStride },
{ OFF(ringbufferBlocks), SPA_TYPE_PARAM_ALLOC_META_ENABLE__ringbufferBlocks },
{ OFF(ringbufferAlign), SPA_TYPE_PARAM_ALLOC_META_ENABLE__ringbufferAlign },
};
#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);
}
}
#define SPA_TYPE_PARAM_ALLOC__VideoPadding SPA_TYPE_PARAM_ALLOC_BASE "VideoPadding"
#define SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING_BASE SPA_TYPE_PARAM_ALLOC__VideoPadding ":"
#define SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__top SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING_BASE "top"
#define SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__bottom SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING_BASE "bottom"
#define SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__left SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING_BASE "left"
#define SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__right SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING_BASE "right"
#define SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__strideAlign0 SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING_BASE "strideAlign0"
#define SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__strideAlign1 SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING_BASE "strideAlign1"
#define SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__strideAlign2 SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING_BASE "strideAlign2"
#define SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__strideAlign3 SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING_BASE "strideAlign3"
struct spa_type_param_alloc_video_padding {
uint32_t VideoPadding;
uint32_t top;
uint32_t bottom;
uint32_t left;
uint32_t right;
uint32_t strideAlign[4];
};
static inline void
spa_type_param_alloc_video_padding_map(struct spa_type_map *map,
struct spa_type_param_alloc_video_padding *type)
{
if (type->VideoPadding == 0) {
type->VideoPadding = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC__VideoPadding);
type->top = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__top);
type->bottom = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__bottom);
type->left = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__left);
type->right = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__right);
type->strideAlign[0] = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__strideAlign0);
type->strideAlign[1] = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__strideAlign1);
type->strideAlign[2] = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__strideAlign2);
type->strideAlign[3] = spa_type_map_get_id(map, SPA_TYPE_PARAM_ALLOC_VIDEO_PADDING__strideAlign3);
}
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __SPA_PARAM_ALLOC_H__ */

View file

@ -17,16 +17,16 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __SPA_AUDIO_FORMAT_UTILS_H__
#define __SPA_AUDIO_FORMAT_UTILS_H__
#ifndef __SPA_PARAM_AUDIO_FORMAT_UTILS_H__
#define __SPA_PARAM_AUDIO_FORMAT_UTILS_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/format-utils.h>
#include <spa/audio/format.h>
#include <spa/audio/raw-utils.h>
#include <spa/param/format-utils.h>
#include <spa/param/audio/format.h>
#include <spa/param/audio/raw-utils.h>
struct spa_type_format_audio {
uint32_t format;
@ -69,4 +69,4 @@ spa_format_audio_raw_parse(const struct spa_pod_object *format,
} /* extern "C" */
#endif
#endif /* __SPA_AUDIO_FORMAT_UTILS */
#endif /* __SPA_PARAM_AUDIO_FORMAT_UTILS */

View file

@ -17,15 +17,15 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __SPA_AUDIO_FORMAT_H__
#define __SPA_AUDIO_FORMAT_H__
#ifndef __SPA_PARAM_AUDIO_FORMAT_H__
#define __SPA_PARAM_AUDIO_FORMAT_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/format.h>
#include <spa/audio/raw.h>
#include <spa/param/format.h>
#include <spa/param/audio/raw.h>
#define SPA_TYPE_FORMAT__Audio SPA_TYPE_FORMAT_BASE "Audio"
#define SPA_TYPE_FORMAT_AUDIO_BASE SPA_TYPE_FORMAT__Audio ":"
@ -49,4 +49,4 @@ struct spa_audio_info {
} /* extern "C" */
#endif
#endif /* __SPA_AUDIO_FORMAT */
#endif /* __SPA_PARAM_AUDIO_FORMAT_H */

View file

@ -24,8 +24,8 @@
extern "C" {
#endif
#include <spa/type-map.h>
#include <spa/audio/raw.h>
#include <spa/support/type-map.h>
#include <spa/param/audio/raw.h>
#if __BYTE_ORDER == __BIG_ENDIAN
#define _SPA_TYPE_AUDIO_FORMAT_NE(fmt) SPA_TYPE_AUDIO_FORMAT_BASE fmt "BE"

View file

@ -0,0 +1,64 @@
/* 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>
#include <spa/param/param.h>
#include <spa/support/type-map.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__size SPA_TYPE_PARAM_BUFFERS_BASE "size"
#define SPA_TYPE_PARAM_BUFFERS__stride SPA_TYPE_PARAM_BUFFERS_BASE "stride"
#define SPA_TYPE_PARAM_BUFFERS__buffers SPA_TYPE_PARAM_BUFFERS_BASE "buffers"
#define SPA_TYPE_PARAM_BUFFERS__align SPA_TYPE_PARAM_BUFFERS_BASE "align"
struct spa_type_param_buffers {
uint32_t Buffers;
uint32_t size;
uint32_t stride;
uint32_t buffers;
uint32_t align;
};
static inline void
spa_type_param_buffers_map(struct spa_type_map *map,
struct spa_type_param_buffers *type)
{
if (type->Buffers == 0) {
type->Buffers = spa_type_map_get_id(map, SPA_TYPE_PARAM__Buffers);
type->size = spa_type_map_get_id(map, SPA_TYPE_PARAM_BUFFERS__size);
type->stride = spa_type_map_get_id(map, SPA_TYPE_PARAM_BUFFERS__stride);
type->buffers = spa_type_map_get_id(map, SPA_TYPE_PARAM_BUFFERS__buffers);
type->align = spa_type_map_get_id(map, SPA_TYPE_PARAM_BUFFERS__align);
}
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __SPA_PARAM_BUFFERS_H__ */

View file

@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __SPA_FORMAT_UTILS_H__
#define __SPA_FORMAT_UTILS_H__
#ifndef __SPA_PARAM_FORMAT_UTILS_H__
#define __SPA_PARAM_FORMAT_UTILS_H__
#ifdef __cplusplus
extern "C" {
@ -26,9 +26,9 @@ extern "C" {
#include <stdarg.h>
#include <spa/format.h>
#include <spa/pod-parser.h>
#include <spa/type-map.h>
#include <spa/param/format.h>
#include <spa/pod/parser.h>
#include <spa/support/type-map.h>
struct spa_type_media_type {
uint32_t audio;
@ -142,4 +142,4 @@ spa_type_media_subtype_audio_map(struct spa_type_map *map,
} /* extern "C" */
#endif
#endif /* __SPA_FORMAT_UTILS_H__ */
#endif /* __PARAM_SPA_FORMAT_UTILS_H__ */

View file

@ -17,18 +17,17 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __SPA_FORMAT_H__
#define __SPA_FORMAT_H__
#ifndef __SPA_PARAM_FORMAT_H__
#define __SPA_PARAM_FORMAT_H__
#ifdef __cplusplus
extern "C" {
#endif
#define SPA_TYPE__Format SPA_TYPE_POD_OBJECT_BASE "Format"
#define SPA_TYPE_FORMAT_BASE SPA_TYPE__Format ":"
#include <spa/param/param.h>
#include <spa/defs.h>
#include <spa/pod.h>
#define SPA_TYPE__Format SPA_TYPE_PARAM_BASE "Format"
#define SPA_TYPE_FORMAT_BASE SPA_TYPE__Format ":"
#define SPA_TYPE__MediaType SPA_TYPE_ENUM_BASE "MediaType"
#define SPA_TYPE_MEDIA_TYPE_BASE SPA_TYPE__MediaType ":"
@ -80,4 +79,4 @@ extern "C" {
} /* extern "C" */
#endif
#endif /* __SPA_FORMAT_H__ */
#endif /* __SPA_PARAM_FORMAT_H__ */

View file

@ -0,0 +1,80 @@
/* 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>
#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"
#define SPA_TYPE_PARAM_META__ringbufferSize SPA_TYPE_PARAM_META_BASE "ringbufferSize"
#define SPA_TYPE_PARAM_META__ringbufferMinAvail SPA_TYPE_PARAM_META_BASE "ringbufferMinAvail"
#define SPA_TYPE_PARAM_META__ringbufferStride SPA_TYPE_PARAM_META_BASE "ringbufferStride"
#define SPA_TYPE_PARAM_META__ringbufferBlocks SPA_TYPE_PARAM_META_BASE "ringbufferBlocks"
#define SPA_TYPE_PARAM_META__ringbufferAlign SPA_TYPE_PARAM_META_BASE "ringbufferAlign"
struct spa_type_param_meta {
uint32_t Meta;
uint32_t type;
uint32_t size;
uint32_t ringbufferSize;
uint32_t ringbufferMinAvail;
uint32_t ringbufferStride;
uint32_t ringbufferBlocks;
uint32_t ringbufferAlign;
};
static inline void
spa_type_param_meta_map(struct spa_type_map *map,
struct spa_type_param_meta *type)
{
if (type->Meta == 0) {
int 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 },
{ OFF(ringbufferSize), SPA_TYPE_PARAM_META__ringbufferSize },
{ OFF(ringbufferMinAvail), SPA_TYPE_PARAM_META__ringbufferMinAvail },
{ OFF(ringbufferStride), SPA_TYPE_PARAM_META__ringbufferStride },
{ OFF(ringbufferBlocks), SPA_TYPE_PARAM_META__ringbufferBlocks },
{ OFF(ringbufferAlign), SPA_TYPE_PARAM_META__ringbufferAlign },
};
#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__ */

View file

@ -24,9 +24,9 @@
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/pod-utils.h>
#include <spa/type-map.h>
#include <spa/utils/defs.h>
#include <spa/pod/pod.h>
#include <spa/support/type-map.h>
/* base for parameter objects */
#define SPA_TYPE__Param SPA_TYPE_POD_OBJECT_BASE "Param"

View file

@ -17,17 +17,16 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __SPA_PROPS_H__
#define __SPA_PROPS_H__
#ifndef __SPA_PARAM_PROPS_H__
#define __SPA_PARAM_PROPS_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/pod.h>
#include <spa/param.h>
#include <spa/param/param.h>
#define SPA_TYPE__Props SPA_TYPE_POD_OBJECT_BASE "Props"
#define SPA_TYPE__Props SPA_TYPE_PARAM_BASE "Props"
#define SPA_TYPE_PROPS_BASE SPA_TYPE__Props ":"
/** Common property ids */
@ -52,4 +51,4 @@ extern "C" {
} /* extern "C" */
#endif
#endif /* __SPA_PROPS_H__ */
#endif /* __SPA_PARAM_PROPS_H__ */

View file

@ -0,0 +1,73 @@
/* 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_VIDEO_PADDING_H__
#define __SPA_PARAM_VIDEO_PADDING_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/utils/defs.h>
#include <spa/param/param.h>
#include <spa/support/type-map.h>
#define SPA_TYPE_PARAM__VideoPadding SPA_TYPE_PARAM_BASE "VideoPadding"
#define SPA_TYPE_PARAM_VIDEO_PADDING_BASE SPA_TYPE_PARAM__VideoPadding ":"
#define SPA_TYPE_PARAM_VIDEO_PADDING__top SPA_TYPE_PARAM_VIDEO_PADDING_BASE "top"
#define SPA_TYPE_PARAM_VIDEO_PADDING__bottom SPA_TYPE_PARAM_VIDEO_PADDING_BASE "bottom"
#define SPA_TYPE_PARAM_VIDEO_PADDING__left SPA_TYPE_PARAM_VIDEO_PADDING_BASE "left"
#define SPA_TYPE_PARAM_VIDEO_PADDING__right SPA_TYPE_PARAM_VIDEO_PADDING_BASE "right"
#define SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign0 SPA_TYPE_PARAM_VIDEO_PADDING_BASE "strideAlign0"
#define SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign1 SPA_TYPE_PARAM_VIDEO_PADDING_BASE "strideAlign1"
#define SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign2 SPA_TYPE_PARAM_VIDEO_PADDING_BASE "strideAlign2"
#define SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign3 SPA_TYPE_PARAM_VIDEO_PADDING_BASE "strideAlign3"
struct spa_type_param_video_padding {
uint32_t VideoPadding;
uint32_t top;
uint32_t bottom;
uint32_t left;
uint32_t right;
uint32_t strideAlign[4];
};
static inline void
spa_type_param_video_padding_map(struct spa_type_map *map,
struct spa_type_param_video_padding *type)
{
if (type->VideoPadding == 0) {
type->VideoPadding = spa_type_map_get_id(map, SPA_TYPE_PARAM__VideoPadding);
type->top = spa_type_map_get_id(map, SPA_TYPE_PARAM_VIDEO_PADDING__top);
type->bottom = spa_type_map_get_id(map, SPA_TYPE_PARAM_VIDEO_PADDING__bottom);
type->left = spa_type_map_get_id(map, SPA_TYPE_PARAM_VIDEO_PADDING__left);
type->right = spa_type_map_get_id(map, SPA_TYPE_PARAM_VIDEO_PADDING__right);
type->strideAlign[0] = spa_type_map_get_id(map, SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign0);
type->strideAlign[1] = spa_type_map_get_id(map, SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign1);
type->strideAlign[2] = spa_type_map_get_id(map, SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign2);
type->strideAlign[3] = spa_type_map_get_id(map, SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign3);
}
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __SPA_PARAM_VIDEO_PADDING_H__ */

View file

@ -27,8 +27,8 @@ extern "C" {
struct spa_video_info_h264;
struct spa_video_info_mjpg;
#include <spa/format.h>
#include <spa/video/format.h>
#include <spa/param/format.h>
#include <spa/param/video/format.h>
enum spa_h264_stream_format {
SPA_H264_STREAM_FORMAT_UNKNOWN = 0,

View file

@ -17,16 +17,17 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __SPA_VIDEO_FORMAT_UTILS_H__
#define __SPA_VIDEO_FORMAT_UTILS_H__
#ifndef __SPA_PARAM_VIDEO_FORMAT_UTILS_H__
#define __SPA_PARAM_VIDEO_FORMAT_UTILS_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/format-utils.h>
#include <spa/video/format.h>
#include <spa/video/raw-utils.h>
#include <spa/param/param.h>
#include <spa/param/format-utils.h>
#include <spa/param/video/format.h>
#include <spa/param/video/raw-utils.h>
struct spa_type_format_video {
uint32_t format;
@ -127,4 +128,4 @@ spa_format_video_mjpg_parse(const struct spa_pod_object *format,
} /* extern "C" */
#endif
#endif /* __SPA_VIDEO_FORMAT_UTILS */
#endif /* __SPA_PARAM_VIDEO_FORMAT_UTILS */

View file

@ -17,16 +17,16 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __SPA_VIDEO_FORMAT_H__
#define __SPA_VIDEO_FORMAT_H__
#ifndef __SPA_PARAM_VIDEO_FORMAT_H__
#define __SPA_PARAM_VIDEO_FORMAT_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/format-utils.h>
#include <spa/video/raw.h>
#include <spa/video/encoded.h>
#include <spa/param/format-utils.h>
#include <spa/param/video/raw.h>
#include <spa/param/video/encoded.h>
#define SPA_TYPE_FORMAT__Video SPA_TYPE_FORMAT_BASE "Video"
#define SPA_TYPE_FORMAT_VIDEO_BASE SPA_TYPE_FORMAT__Video ":"
@ -64,4 +64,4 @@ struct spa_video_info {
} /* extern "C" */
#endif
#endif /* __SPA_VIDEO_FORMAT */
#endif /* __SPA_PARAM_VIDEO_FORMAT */

View file

@ -24,8 +24,8 @@
extern "C" {
#endif
#include <spa/type-map.h>
#include <spa/video/raw.h>
#include <spa/support/type-map.h>
#include <spa/param/video/raw.h>
struct spa_type_video_format {
uint32_t UNKNOWN;

View file

@ -24,10 +24,9 @@
extern "C" {
#endif
#include <spa/props.h>
#include <spa/video/chroma.h>
#include <spa/video/color.h>
#include <spa/video/multiview.h>
#include <spa/param/video/chroma.h>
#include <spa/param/video/color.h>
#include <spa/param/video/multiview.h>
#define SPA_VIDEO_MAX_PLANES 4
#define SPA_VIDEO_MAX_COMPONENTS 4

View file

@ -1,65 +0,0 @@
/* Simple Plugin API
* Copyright (C) 2017 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_POD_ITER_H__
#define __SPA_POD_ITER_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
#include <spa/defs.h>
#include <spa/pod-utils.h>
struct spa_pod_iter {
const void *data;
uint32_t size;
uint32_t offset;
};
static inline void spa_pod_iter_init(struct spa_pod_iter *iter, const void *data, uint32_t size, uint32_t offset)
{
iter->data = data;
iter->size = size;
iter->offset = offset;
}
static inline struct spa_pod *spa_pod_iter_current(struct spa_pod_iter *iter)
{
if (iter->offset + 8 <= iter->size) {
struct spa_pod *pod = SPA_MEMBER(iter->data, iter->offset, struct spa_pod);
if (SPA_POD_SIZE(pod) <= iter->size)
return pod;
}
return NULL;
}
static inline void spa_pod_iter_advance(struct spa_pod_iter *iter, struct spa_pod *current)
{
if (current)
iter->offset += SPA_ROUND_UP_N(SPA_POD_SIZE(current), 8);
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __SPA_POD_H__ */

View file

@ -25,7 +25,8 @@ extern "C" {
#endif
#include <stdarg.h>
#include <spa/pod-utils.h>
#include <spa/pod/pod.h>
struct spa_pod_frame {
struct spa_pod pod;

View file

@ -24,8 +24,8 @@
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/pod.h>
#include <spa/utils/defs.h>
#include <spa/pod/pod.h>
#define SPA_TYPE__Command SPA_TYPE_POD_OBJECT_BASE "Command"
#define SPA_TYPE_COMMAND_BASE SPA_TYPE__Command ":"

View file

@ -24,8 +24,7 @@
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/pod.h>
#include <spa/pod/pod.h>
#define SPA_TYPE__Event SPA_TYPE_POD_OBJECT_BASE "Event"
#define SPA_TYPE_EVENT_BASE SPA_TYPE__Event ":"

View file

@ -17,37 +17,47 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __SPA_POD_UTILS_H__
#define __SPA_POD_UTILS_H__
#ifndef __SPA_POD_ITER_H__
#define __SPA_POD_ITER_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
#include <spa/pod.h>
#define SPA_POD_BODY_SIZE(pod) (((struct spa_pod*)(pod))->size)
#define SPA_POD_TYPE(pod) (((struct spa_pod*)(pod))->type)
#define SPA_POD_SIZE(pod) (sizeof(struct spa_pod) + SPA_POD_BODY_SIZE(pod))
#define SPA_POD_CONTENTS_SIZE(type,pod) (SPA_POD_SIZE(pod)-sizeof(type))
#include <spa/pod/pod.h>
#define SPA_POD_CONTENTS(type,pod) SPA_MEMBER((pod),sizeof(type),void)
#define SPA_POD_CONTENTS_CONST(type,pod) SPA_MEMBER((pod),sizeof(type),const void)
#define SPA_POD_BODY(pod) SPA_MEMBER((pod),sizeof(struct spa_pod),void)
#define SPA_POD_BODY_CONST(pod) SPA_MEMBER((pod),sizeof(struct spa_pod),const void)
struct spa_pod_iter {
const void *data;
uint32_t size;
uint32_t offset;
};
#define SPA_POD_VALUE(type,pod) (((type*)pod)->value)
#define SPA_POD_PROP_N_VALUES(prop) (((prop)->pod.size - sizeof(struct spa_pod_prop_body)) / (prop)->body.value.size)
static inline bool spa_pod_is_object_type(struct spa_pod *pod, uint32_t type)
static inline void spa_pod_iter_init(struct spa_pod_iter *iter, const void *data, uint32_t size, uint32_t offset)
{
return (pod->type == SPA_POD_TYPE_OBJECT
&& ((struct spa_pod_object *) pod)->body.type == type);
iter->data = data;
iter->size = size;
iter->offset = offset;
}
static inline bool spa_pod_is_iter(const void *pod, uint32_t size, const struct spa_pod *iter)
static inline struct spa_pod *spa_pod_iter_current(struct spa_pod_iter *iter)
{
if (iter->offset + 8 <= iter->size) {
struct spa_pod *pod = SPA_MEMBER(iter->data, iter->offset, struct spa_pod);
if (SPA_POD_SIZE(pod) <= iter->size)
return pod;
}
return NULL;
}
static inline void spa_pod_iter_advance(struct spa_pod_iter *iter, struct spa_pod *current)
{
if (current)
iter->offset += SPA_ROUND_UP_N(SPA_POD_SIZE(current), 8);
}
static inline bool spa_pod_is_inside(const void *pod, uint32_t size, const struct spa_pod *iter)
{
return iter < SPA_MEMBER(pod, size, struct spa_pod);
}
@ -64,22 +74,21 @@ static inline struct spa_pod *spa_pod_next(const struct spa_pod *iter)
#define SPA_POD_FOREACH(pod, size, iter) \
for ((iter) = (pod); \
spa_pod_is_iter(pod, size, iter); \
spa_pod_is_inside(pod, size, iter); \
(iter) = spa_pod_next(iter))
#define SPA_POD_FOREACH_SAFE(pod, size, iter, tmp) \
for ((iter) = (pod), (tmp) = spa_pod_next(iter); \
spa_pod_is_iter(pod, size, iter); \
spa_pod_is_inside(pod, size, iter); \
(iter) = (tmp), \
(tmp) = spa_pod_next(iter))
#define SPA_POD_CONTENTS_FOREACH(pod, offset, iter) \
SPA_POD_FOREACH(SPA_MEMBER((pod), (offset), struct spa_pod),SPA_POD_SIZE (pod)-(offset),iter)
#define SPA_POD_OBJECT_BODY_FOREACH(body, size, iter) \
for ((iter) = SPA_MEMBER((body), sizeof(struct spa_pod_object_body), struct spa_pod); \
spa_pod_is_iter(body, size, iter); \
spa_pod_is_inside(body, size, iter); \
(iter) = spa_pod_next(iter))
#define SPA_POD_OBJECT_FOREACH(obj, iter) \
@ -115,16 +124,6 @@ static inline struct spa_pod_prop *spa_pod_struct_find_prop(const struct spa_pod
return spa_pod_contents_find_prop(&obj->pod, sizeof(struct spa_pod_struct), key);
}
#include <spa/pod-parser.h>
#define spa_pod_object_parse(object,...) \
({ \
struct spa_pod_parser __p; \
const struct spa_pod_object *__obj = object; \
spa_pod_parser_pod(&__p, &__obj->pod); \
spa_pod_parser_get(&__p, "<", ##__VA_ARGS__, NULL); \
})
static inline int spa_pod_object_fixate(struct spa_pod_object *obj)
{
struct spa_pod *res;
@ -139,4 +138,4 @@ static inline int spa_pod_object_fixate(struct spa_pod_object *obj)
} /* extern "C" */
#endif
#endif /* __SPA_POD_UTILS_H__ */
#endif /* __SPA_POD_H__ */

View file

@ -25,7 +25,8 @@ extern "C" {
#endif
#include <stdarg.h>
#include <spa/pod-iter.h>
#include <spa/pod/iter.h>
struct spa_pod_parser {
int depth;
@ -309,6 +310,14 @@ static inline int spa_pod_parser_get(struct spa_pod_parser *parser,
return res;
}
#define spa_pod_object_parse(object,...) \
({ \
struct spa_pod_parser __p; \
const struct spa_pod_object *__obj = object; \
spa_pod_parser_pod(&__p, &__obj->pod); \
spa_pod_parser_get(&__p, "<", ##__VA_ARGS__, NULL); \
})
#ifdef __cplusplus
} /* extern "C" */
#endif

View file

@ -26,7 +26,7 @@ extern "C" {
#include <stdarg.h>
#include <spa/defs.h>
#include <spa/utils/defs.h>
#define SPA_TYPE__POD SPA_TYPE_BASE "POD"
#define SPA_TYPE_POD_BASE SPA_TYPE__POD ":"
@ -76,11 +76,23 @@ enum spa_pod_type {
SPA_POD_TYPE_CUSTOM_START = 64,
};
#define SPA_POD_BODY_SIZE(pod) (((struct spa_pod*)(pod))->size)
#define SPA_POD_TYPE(pod) (((struct spa_pod*)(pod))->type)
#define SPA_POD_SIZE(pod) (sizeof(struct spa_pod) + SPA_POD_BODY_SIZE(pod))
#define SPA_POD_CONTENTS_SIZE(type,pod) (SPA_POD_SIZE(pod)-sizeof(type))
#define SPA_POD_CONTENTS(type,pod) SPA_MEMBER((pod),sizeof(type),void)
#define SPA_POD_CONTENTS_CONST(type,pod) SPA_MEMBER((pod),sizeof(type),const void)
#define SPA_POD_BODY(pod) SPA_MEMBER((pod),sizeof(struct spa_pod),void)
#define SPA_POD_BODY_CONST(pod) SPA_MEMBER((pod),sizeof(struct spa_pod),const void)
struct spa_pod {
uint32_t size;
uint32_t type; /* one of spa_pod_type */
};
#define SPA_POD_VALUE(type,pod) (((type*)pod)->value)
struct spa_pod_bool {
struct spa_pod pod;
int32_t value;
@ -165,6 +177,12 @@ struct spa_pod_object {
struct spa_pod_object_body body;
};
static inline bool spa_pod_is_object_type(struct spa_pod *pod, uint32_t type)
{
return (pod->type == SPA_POD_TYPE_OBJECT
&& ((struct spa_pod_object *) pod)->body.type == type);
}
struct spa_pod_pointer_body {
uint32_t type;
void *value;
@ -180,6 +198,8 @@ struct spa_pod_fd {
int value;
};
#define SPA_POD_PROP_N_VALUES(prop) (((prop)->pod.size - sizeof(struct spa_pod_prop_body)) / (prop)->body.value.size)
struct spa_pod_prop_body {
uint32_t key;
#define SPA_POD_PROP_RANGE_NONE 0

View file

@ -24,7 +24,7 @@
extern "C" {
#endif
#include <spa/log.h>
#include <spa/support/log.h>
static inline void spa_log_impl_logv(struct spa_log *log,
enum spa_log_level level,

View file

@ -29,9 +29,7 @@ extern "C" {
#include <stdarg.h>
#include <spa/defs.h>
#include <spa/plugin.h>
#include <spa/loop.h>
#include <spa/utils/defs.h>
enum spa_log_level {
SPA_LOG_LEVEL_NONE = 0,

View file

@ -36,9 +36,8 @@ struct spa_loop_utils;
#define SPA_TYPE_LOOP__MainLoop SPA_TYPE_LOOP_BASE "MainLoop"
#define SPA_TYPE_LOOP__DataLoop SPA_TYPE_LOOP_BASE "DataLoop"
#include <spa/defs.h>
#include <spa/list.h>
#include <spa/hook.h>
#include <spa/utils/defs.h>
#include <spa/utils/hook.h>
enum spa_io {
SPA_IO_IN = (1 << 0),

View file

@ -24,8 +24,8 @@
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/dict.h>
#include <spa/utils/defs.h>
#include <spa/utils/dict.h>
#define SPA_TYPE__Handle SPA_TYPE_INTERFACE_BASE "Handle"
#define SPA_TYPE__HandleFactory SPA_TYPE_INTERFACE_BASE "HandleFactory"

View file

@ -24,7 +24,7 @@
extern "C" {
#endif
#include <spa/type-map.h>
#include <spa/support/type-map.h>
static inline uint32_t
spa_type_map_impl_get_id (struct spa_type_map *map, const char *type)

View file

@ -24,9 +24,8 @@
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/plugin.h>
#include <spa/type.h>
#include <spa/utils/defs.h>
#include <spa/utils/type.h>
#define SPA_TYPE__TypeMap SPA_TYPE_INTERFACE_BASE "TypeMap"

View file

@ -29,7 +29,7 @@ extern "C" {
#include <string.h>
#include <spa/defs.h>
#include <spa/utils/defs.h>
struct spa_dict_item {
const char *key;

View file

@ -24,7 +24,7 @@
extern "C" {
#endif
#include <spa/list.h>
#include <spa/utils/list.h>
/** \class spa_hook
*

View file

@ -24,8 +24,6 @@
extern "C" {
#endif
#include <spa/defs.h>
struct spa_list {
struct spa_list *next;
struct spa_list *prev;

View file

@ -30,7 +30,7 @@ struct spa_ringbuffer;
#include <string.h>
#include <spa/defs.h>
#include <spa/utils/defs.h>
/**
* spa_ringbuffer:

View file

@ -24,7 +24,7 @@
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/utils/defs.h>
#define SPA_TYPE_BASE "Spa:"

View file

@ -22,8 +22,10 @@
#include <errno.h>
#include <sys/eventfd.h>
#include <spa/format-utils.h>
#include <spa/loop.h>
#include <spa/support/loop.h>
#include <spa/pod/parser.h>
#include <lib/pod.h>
#include "debug.h"

View file

@ -24,14 +24,8 @@
extern "C" {
#endif
#include <spa/defs.h>
#include <spa/node.h>
#include <spa/buffer.h>
#include <spa/pod.h>
#include <spa/props.h>
#include <spa/format.h>
#include <spa/dict.h>
#include <spa/log.h>
#include <spa/node/node.h>
#include <spa/pod/pod.h>
void spa_debug_set_type_map(const struct spa_type_map *map);

View file

@ -22,8 +22,9 @@
#include <stdio.h>
#include <string.h>
#include <spa/props.h>
#include <spa/pod-builder.h>
#include <spa/param/props.h>
#include <spa/pod/iter.h>
#include <spa/pod/builder.h>
static int compare_value(enum spa_pod_type type, const void *r1, const void *r2)
{
@ -380,7 +381,7 @@ int pod_filter(struct spa_pod_builder *b,
}
if (do_advance) {
pf = spa_pod_next(pf);
if (!spa_pod_is_iter(filter, filter_size, pf))
if (!spa_pod_is_inside(filter, filter_size, pf))
pf = NULL;
}
@ -482,7 +483,7 @@ int pod_compare(const struct spa_pod *pod1,
}
if (do_advance) {
p2 = spa_pod_next(p2);
if (!spa_pod_is_iter(pod2, pod2_size, p2))
if (!spa_pod_is_inside(pod2, pod2_size, p2))
p2 = NULL;
}
if (do_recurse) {

View file

@ -24,8 +24,8 @@
extern "C" {
#endif
#include <spa/props.h>
#include <spa/pod-builder.h>
#include <spa/param/props.h>
#include <spa/pod/builder.h>
int spa_pod_filter(struct spa_pod_builder *b,
const struct spa_pod *pod,

View file

@ -27,10 +27,11 @@
#include <libudev.h>
#include <asoundlib.h>
#include <spa/log.h>
#include <spa/type-map.h>
#include <spa/loop.h>
#include <spa/monitor.h>
#include <spa/support/log.h>
#include <spa/support/type-map.h>
#include <spa/support/loop.h>
#include <spa/monitor/monitor.h>
#include <lib/debug.h>
#define NAME "alsa-monitor"

View file

@ -21,8 +21,9 @@
#include <asoundlib.h>
#include <spa/node.h>
#include <spa/audio/format.h>
#include <spa/node/node.h>
#include <spa/param/audio/format.h>
#include <lib/pod.h>
#define NAME "alsa-sink"
@ -331,14 +332,14 @@ impl_node_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
param = spa_pod_builder_object(builder,
id, t->param_alloc_buffers.Buffers,
":", t->param_alloc_buffers.size, "iru", this->props.min_latency * this->frame_size,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "iru", this->props.min_latency * this->frame_size,
2, this->props.min_latency * this->frame_size,
INT32_MAX,
":", t->param_alloc_buffers.stride, "i", 0,
":", t->param_alloc_buffers.buffers, "ir", 2,
":", t->param_buffers.stride, "i", 0,
":", t->param_buffers.buffers, "ir", 2,
2, 2, MAX_BUFFERS,
":", t->param_alloc_buffers.align, "i", 16);
":", t->param_buffers.align, "i", 16);
}
else if (id == t->param.idMeta) {
if (!this->have_format)
@ -347,22 +348,22 @@ impl_node_port_enum_params(struct spa_node *node,
switch (*index) {
case 0:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Header,
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
break;
case 1:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Ringbuffer,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_ringbuffer),
":", t->param_alloc_meta_enable.ringbufferSize, "iru",
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Ringbuffer,
":", t->param_meta.size, "i", sizeof(struct spa_meta_ringbuffer),
":", t->param_meta.ringbufferSize, "iru",
this->props.max_latency * this->frame_size,
2, this->props.min_latency * this->frame_size,
this->period_frames * this->frame_size,
":", t->param_alloc_meta_enable.ringbufferStride, "i", 0,
":", t->param_alloc_meta_enable.ringbufferBlocks, "i", 1,
":", t->param_alloc_meta_enable.ringbufferAlign, "i", 16);
":", t->param_meta.ringbufferStride, "i", 0,
":", t->param_meta.ringbufferBlocks, "i", 1,
":", t->param_meta.ringbufferAlign, "i", 16);
break;
default:
return SPA_RESULT_ENUM_END;

View file

@ -21,9 +21,9 @@
#include <asoundlib.h>
#include <spa/node.h>
#include <spa/list.h>
#include <spa/audio/format.h>
#include <spa/node/node.h>
#include <spa/utils/list.h>
#include <spa/param/audio/format.h>
#include <lib/pod.h>
@ -373,12 +373,12 @@ impl_node_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
param = spa_pod_builder_object(builder,
id, t->param_alloc_buffers.Buffers,
":", t->param_alloc_buffers.size, "i", this->props.min_latency * this->frame_size,
":", t->param_alloc_buffers.stride, "i", 0,
":", t->param_alloc_buffers.buffers, "ir", 2,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "i", this->props.min_latency * this->frame_size,
":", t->param_buffers.stride, "i", 0,
":", t->param_buffers.buffers, "ir", 2,
2, 1, 32,
":", t->param_alloc_buffers.align, "i", 16);
":", t->param_buffers.align, "i", 16);
}
else if (id == t->param.idMeta) {
if (!this->have_format)
@ -387,9 +387,9 @@ impl_node_port_enum_params(struct spa_node *node,
switch (*index) {
case 0:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Header,
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
break;
default:
return SPA_RESULT_ENUM_END;

View file

@ -28,15 +28,17 @@ extern "C" {
#include <asoundlib.h>
#include <spa/type-map.h>
#include <spa/clock.h>
#include <spa/log.h>
#include <spa/list.h>
#include <spa/node.h>
#include <spa/param-alloc.h>
#include <spa/loop.h>
#include <spa/ringbuffer.h>
#include <spa/audio/format-utils.h>
#include <spa/support/type-map.h>
#include <spa/support/loop.h>
#include <spa/support/log.h>
#include <spa/utils/list.h>
#include <spa/utils/ringbuffer.h>
#include <spa/clock/clock.h>
#include <spa/node/node.h>
#include <spa/param/buffers.h>
#include <spa/param/meta.h>
#include <spa/param/audio/format-utils.h>
struct props {
char device[64];
@ -72,12 +74,12 @@ struct type {
struct spa_type_media_type media_type;
struct spa_type_media_subtype media_subtype;
struct spa_type_media_subtype_audio media_subtype_audio;
struct spa_type_format_audio format_audio;
struct spa_type_audio_format audio_format;
struct spa_type_event_node event_node;
struct spa_type_command_node command_node;
struct spa_type_param_alloc_buffers param_alloc_buffers;
struct spa_type_param_alloc_meta_enable param_alloc_meta_enable;
struct spa_type_format_audio format_audio;
struct spa_type_param_buffers param_buffers;
struct spa_type_param_meta param_meta;
};
static inline void init_type(struct type *type, struct spa_type_map *map)
@ -98,12 +100,12 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
spa_type_media_type_map(map, &type->media_type);
spa_type_media_subtype_map(map, &type->media_subtype);
spa_type_media_subtype_audio_map(map, &type->media_subtype_audio);
spa_type_format_audio_map(map, &type->format_audio);
spa_type_audio_format_map(map, &type->audio_format);
spa_type_event_node_map(map, &type->event_node);
spa_type_command_node_map(map, &type->command_node);
spa_type_param_alloc_buffers_map(map, &type->param_alloc_buffers);
spa_type_param_alloc_meta_enable_map(map, &type->param_alloc_meta_enable);
spa_type_format_audio_map(map, &type->format_audio);
spa_type_param_buffers_map(map, &type->param_buffers);
spa_type_param_meta_map(map, &type->param_meta);
}
struct state {

View file

@ -17,8 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
#include <spa/plugin.h>
#include <spa/node.h>
#include <spa/support/plugin.h>
extern const struct spa_handle_factory spa_alsa_source_factory;
extern const struct spa_handle_factory spa_alsa_sink_factory;

View file

@ -20,12 +20,13 @@
#include <string.h>
#include <stdio.h>
#include <spa/log.h>
#include <spa/list.h>
#include <spa/type-map.h>
#include <spa/node.h>
#include <spa/audio/format-utils.h>
#include <spa/param-alloc.h>
#include <spa/support/log.h>
#include <spa/support/type-map.h>
#include <spa/utils/list.h>
#include <spa/node/node.h>
#include <spa/param/audio/format-utils.h>
#include <spa/param/buffers.h>
#include <spa/param/meta.h>
#include <lib/pod.h>
@ -76,8 +77,8 @@ struct type {
struct spa_type_command_node command_node;
struct spa_type_meta meta;
struct spa_type_data data;
struct spa_type_param_alloc_buffers param_alloc_buffers;
struct spa_type_param_alloc_meta_enable param_alloc_meta_enable;
struct spa_type_param_buffers param_buffers;
struct spa_type_param_meta param_meta;
};
static inline void init_type(struct type *type, struct spa_type_map *map)
@ -92,8 +93,8 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
spa_type_command_node_map(map, &type->command_node);
spa_type_meta_map(map, &type->meta);
spa_type_data_map(map, &type->data);
spa_type_param_alloc_buffers_map(map, &type->param_alloc_buffers);
spa_type_param_alloc_meta_enable_map(map, &type->param_alloc_meta_enable);
spa_type_param_buffers_map(map, &type->param_buffers);
spa_type_param_meta_map(map, &type->param_meta);
}
struct impl {
@ -430,14 +431,14 @@ impl_node_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
param = spa_pod_builder_object(builder,
id, t->param_alloc_buffers.Buffers,
":", t->param_alloc_buffers.size, "iru", 1024 * this->bpf,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "iru", 1024 * this->bpf,
2, 16 * this->bpf,
INT32_MAX / this->bpf,
":", t->param_alloc_buffers.stride, "i", 0,
":", t->param_alloc_buffers.buffers, "iru", 2,
":", t->param_buffers.stride, "i", 0,
":", t->param_buffers.buffers, "iru", 2,
2, 2, MAX_BUFFERS,
":", t->param_alloc_buffers.align, "i", 16);
":", t->param_buffers.align, "i", 16);
}
else if (id == t->param.idMeta) {
if (!port->have_format)
@ -446,20 +447,20 @@ impl_node_port_enum_params(struct spa_node *node,
switch (*index) {
case 0:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Header,
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
break;
case 1:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Ringbuffer,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_ringbuffer),
":", t->param_alloc_meta_enable.ringbufferSize, "iru", 1024 * this->bpf,
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Ringbuffer,
":", t->param_meta.size, "i", sizeof(struct spa_meta_ringbuffer),
":", t->param_meta.ringbufferSize, "iru", 1024 * this->bpf,
2, 16 * this->bpf, INT32_MAX / this->bpf,
":", t->param_alloc_meta_enable.ringbufferStride, "i", 0,
":", t->param_alloc_meta_enable.ringbufferBlocks, "i", 1,
":", t->param_alloc_meta_enable.ringbufferAlign, "i", 16);
":", t->param_meta.ringbufferStride, "i", 0,
":", t->param_meta.ringbufferBlocks, "i", 1,
":", t->param_meta.ringbufferAlign, "i", 16);
break;
default:
return SPA_RESULT_ENUM_END;

View file

@ -19,7 +19,8 @@
#include <string.h>
#include <stdio.h>
#include <spa/defs.h>
#include <spa/utils/defs.h>
typedef void (*mix_func_t) (void *dst, const void *src, int n_bytes);
typedef void (*mix_scale_func_t) (void *dst, const void *src, const void *scale, int n_bytes);

View file

@ -17,8 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
#include <spa/plugin.h>
#include <spa/node.h>
#include <spa/support/plugin.h>
extern const struct spa_handle_factory spa_audiomixer_factory;

View file

@ -23,14 +23,15 @@
#include <stdio.h>
#include <sys/timerfd.h>
#include <spa/type-map.h>
#include <spa/clock.h>
#include <spa/log.h>
#include <spa/loop.h>
#include <spa/node.h>
#include <spa/param-alloc.h>
#include <spa/list.h>
#include <spa/audio/format-utils.h>
#include <spa/support/type-map.h>
#include <spa/support/log.h>
#include <spa/support/loop.h>
#include <spa/utils/list.h>
#include <spa/clock/clock.h>
#include <spa/node/node.h>
#include <spa/param/audio/format-utils.h>
#include <spa/param/buffers.h>
#include <spa/param/meta.h>
#include <lib/pod.h>
@ -60,8 +61,8 @@ struct type {
struct spa_type_audio_format audio_format;
struct spa_type_event_node event_node;
struct spa_type_command_node command_node;
struct spa_type_param_alloc_buffers param_alloc_buffers;
struct spa_type_param_alloc_meta_enable param_alloc_meta_enable;
struct spa_type_param_buffers param_buffers;
struct spa_type_param_meta param_meta;
};
static inline void init_type(struct type *type, struct spa_type_map *map)
@ -85,8 +86,8 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
spa_type_audio_format_map(map, &type->audio_format);
spa_type_event_node_map(map, &type->event_node);
spa_type_command_node_map(map, &type->command_node);
spa_type_param_alloc_buffers_map(map, &type->param_alloc_buffers);
spa_type_param_alloc_meta_enable_map(map, &type->param_alloc_meta_enable);
spa_type_param_buffers_map(map, &type->param_buffers);
spa_type_param_meta_map(map, &type->param_meta);
}
struct props {
@ -621,14 +622,14 @@ impl_node_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
param = spa_pod_builder_object(builder,
id, t->param_alloc_buffers.Buffers,
":", t->param_alloc_buffers.size, "iru", 1024 * this->bpf,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "iru", 1024 * this->bpf,
2, 16 * this->bpf,
INT32_MAX / this->bpf,
":", t->param_alloc_buffers.stride, "i", 0,
":", t->param_alloc_buffers.buffers, "iru", 2,
":", t->param_buffers.stride, "i", 0,
":", t->param_buffers.buffers, "iru", 2,
2, 1, 32,
":", t->param_alloc_buffers.align, "i", 16);
":", t->param_buffers.align, "i", 16);
}
else if (id == t->param.idMeta) {
if (!this->have_format)
@ -637,20 +638,20 @@ impl_node_port_enum_params(struct spa_node *node,
switch (*index) {
case 0:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Header,
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
break;
case 1:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Ringbuffer,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_ringbuffer),
":", t->param_alloc_meta_enable.ringbufferSize, "ir", 5512 * this->bpf,
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Ringbuffer,
":", t->param_meta.size, "i", sizeof(struct spa_meta_ringbuffer),
":", t->param_meta.ringbufferSize, "ir", 5512 * this->bpf,
2, 16 * this->bpf, INT32_MAX / this->bpf,
":", t->param_alloc_meta_enable.ringbufferStride, "i", 0,
":", t->param_alloc_meta_enable.ringbufferBlocks, "i", 1,
":", t->param_alloc_meta_enable.ringbufferAlign, "i", 16);
":", t->param_meta.ringbufferStride, "i", 0,
":", t->param_meta.ringbufferBlocks, "i", 1,
":", t->param_meta.ringbufferAlign, "i", 16);
break;
default:
return SPA_RESULT_ENUM_END;

View file

@ -17,8 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
#include <spa/plugin.h>
#include <spa/node.h>
#include <spa/support/plugin.h>
extern const struct spa_handle_factory spa_audiotestsrc_factory;

View file

@ -22,10 +22,11 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <spa/type-map.h>
#include <spa/log.h>
#include <spa/node.h>
#include <spa/video/format-utils.h>
#include <spa/support/type-map.h>
#include <spa/support/log.h>
#include <spa/node/node.h>
#include <spa/param/video/format-utils.h>
#include <lib/pod.h>
#define IS_VALID_PORT(this,d,id) ((id) == 0)

View file

@ -22,10 +22,10 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <spa/log.h>
#include <spa/type-map.h>
#include <spa/node.h>
#include <spa/video/format-utils.h>
#include <spa/support/log.h>
#include <spa/support/type-map.h>
#include <spa/node/node.h>
#include <spa/param/video/format-utils.h>
#include <lib/pod.h>

View file

@ -19,8 +19,8 @@
#include <stdio.h>
#include <spa/plugin.h>
#include <spa/node.h>
#include <spa/support/plugin.h>
#include <spa/node/node.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>

View file

@ -24,14 +24,11 @@
#include <stdio.h>
#include <sys/eventfd.h>
#include <spa/type-map.h>
#include <spa/clock.h>
#include <spa/log.h>
#include <spa/loop.h>
#include <spa/node.h>
#include <spa/param-alloc.h>
#include <spa/list.h>
#include <lib/pod.h>
#include <spa/support/type-map.h>
#include <spa/support/log.h>
#include <spa/support/loop.h>
#include <spa/support/plugin.h>
#include <spa/utils/ringbuffer.h>
#define NAME "logger"

View file

@ -29,11 +29,12 @@
#include <sys/signalfd.h>
#include <pthread.h>
#include <spa/loop.h>
#include <spa/list.h>
#include <spa/log.h>
#include <spa/type-map.h>
#include <spa/ringbuffer.h>
#include <spa/support/loop.h>
#include <spa/support/log.h>
#include <spa/support/type-map.h>
#include <spa/support/plugin.h>
#include <spa/utils/list.h>
#include <spa/utils/ringbuffer.h>
#define NAME "loop"

View file

@ -24,13 +24,8 @@
#include <stdio.h>
#include <sys/eventfd.h>
#include <spa/type-map.h>
#include <spa/clock.h>
#include <spa/log.h>
#include <spa/loop.h>
#include <spa/node.h>
#include <spa/param-alloc.h>
#include <spa/list.h>
#include <spa/support/type-map.h>
#include <spa/support/plugin.h>
#define NAME "mapper"

View file

@ -19,8 +19,7 @@
#include <stdio.h>
#include <spa/plugin.h>
#include <spa/node.h>
#include <spa/support/plugin.h>
#define MAX_FACTORIES 16

View file

@ -23,13 +23,17 @@
#include <stdio.h>
#include <sys/timerfd.h>
#include <spa/type-map.h>
#include <spa/clock.h>
#include <spa/log.h>
#include <spa/loop.h>
#include <spa/node.h>
#include <spa/param-alloc.h>
#include <spa/list.h>
#include <spa/support/type-map.h>
#include <spa/support/log.h>
#include <spa/support/loop.h>
#include <spa/utils/list.h>
#include <spa/clock/clock.h>
#include <spa/node/node.h>
#include <spa/param/buffers.h>
#include <spa/param/meta.h>
#include <spa/param/format.h>
#include <spa/pod/parser.h>
#include <lib/pod.h>
#define NAME "fakesink"
@ -45,8 +49,8 @@ struct type {
struct spa_type_data data;
struct spa_type_event_node event_node;
struct spa_type_command_node command_node;
struct spa_type_param_alloc_buffers param_alloc_buffers;
struct spa_type_param_alloc_meta_enable param_alloc_meta_enable;
struct spa_type_param_buffers param_buffers;
struct spa_type_param_meta param_meta;
};
static inline void init_type(struct type *type, struct spa_type_map *map)
@ -61,8 +65,8 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
spa_type_data_map(map, &type->data);
spa_type_event_node_map(map, &type->event_node);
spa_type_command_node_map(map, &type->command_node);
spa_type_param_alloc_buffers_map(map, &type->param_alloc_buffers);
spa_type_param_alloc_meta_enable_map(map, &type->param_alloc_meta_enable);
spa_type_param_buffers_map(map, &type->param_buffers);
spa_type_param_meta_map(map, &type->param_meta);
}
struct props {
@ -506,20 +510,20 @@ impl_node_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
param = spa_pod_builder_object(builder,
id, t->param_alloc_buffers.Buffers,
":", t->param_alloc_buffers.size, "i", 128,
":", t->param_alloc_buffers.stride, "i", 1,
":", t->param_alloc_buffers.buffers, "ir", 2,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "i", 128,
":", t->param_buffers.stride, "i", 1,
":", t->param_buffers.buffers, "ir", 2,
2, 1, 32,
":", t->param_alloc_buffers.align, "i", 16);
":", t->param_buffers.align, "i", 16);
}
else if (id == t->param.idMeta) {
switch (*index) {
case 0:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Header,
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
break;
default:
return SPA_RESULT_ENUM_END;

View file

@ -23,13 +23,16 @@
#include <stdio.h>
#include <sys/timerfd.h>
#include <spa/type-map.h>
#include <spa/clock.h>
#include <spa/log.h>
#include <spa/loop.h>
#include <spa/node.h>
#include <spa/param-alloc.h>
#include <spa/list.h>
#include <spa/support/type-map.h>
#include <spa/support/log.h>
#include <spa/support/loop.h>
#include <spa/utils/list.h>
#include <spa/clock/clock.h>
#include <spa/node/node.h>
#include <spa/param/buffers.h>
#include <spa/param/meta.h>
#include <spa/param/format.h>
#include <spa/pod/parser.h>
#include <lib/pod.h>
@ -47,8 +50,8 @@ struct type {
struct spa_type_data data;
struct spa_type_event_node event_node;
struct spa_type_command_node command_node;
struct spa_type_param_alloc_buffers param_alloc_buffers;
struct spa_type_param_alloc_meta_enable param_alloc_meta_enable;
struct spa_type_param_buffers param_buffers;
struct spa_type_param_meta param_meta;
};
static inline void init_type(struct type *type, struct spa_type_map *map)
@ -64,8 +67,8 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
spa_type_data_map(map, &type->data);
spa_type_event_node_map(map, &type->event_node);
spa_type_command_node_map(map, &type->command_node);
spa_type_param_alloc_buffers_map(map, &type->param_alloc_buffers);
spa_type_param_alloc_meta_enable_map(map, &type->param_alloc_meta_enable);
spa_type_param_buffers_map(map, &type->param_buffers);
spa_type_param_meta_map(map, &type->param_meta);
}
struct props {
@ -521,20 +524,20 @@ impl_node_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
param = spa_pod_builder_object(builder,
id, t->param_alloc_buffers.Buffers,
":", t->param_alloc_buffers.size, "i", 128,
":", t->param_alloc_buffers.stride, "i", 1,
":", t->param_alloc_buffers.buffers, "ir", 32,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "i", 128,
":", t->param_buffers.stride, "i", 1,
":", t->param_buffers.buffers, "ir", 32,
2, 2, 32,
":", t->param_alloc_buffers.align, "i", 16);
":", t->param_buffers.align, "i", 16);
}
else if (id == t->param.idMeta) {
switch (*index) {
case 0:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Header,
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
break;
default:
return SPA_RESULT_ENUM_END;

View file

@ -17,8 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
#include <spa/plugin.h>
#include <spa/node.h>
#include <spa/support/plugin.h>
extern const struct spa_handle_factory spa_fakesrc_factory;
extern const struct spa_handle_factory spa_fakesink_factory;

View file

@ -25,10 +25,11 @@
#include <libudev.h>
#include <spa/log.h>
#include <spa/type-map.h>
#include <spa/loop.h>
#include <spa/monitor.h>
#include <spa/support/log.h>
#include <spa/support/type-map.h>
#include <spa/support/loop.h>
#include <spa/monitor/monitor.h>
#include <lib/debug.h>
#define NAME "v4l2-monitor"

View file

@ -24,14 +24,15 @@
#include <linux/videodev2.h>
#include <spa/node.h>
#include <spa/video/format-utils.h>
#include <spa/clock.h>
#include <spa/list.h>
#include <spa/log.h>
#include <spa/loop.h>
#include <spa/param-alloc.h>
#include <spa/type-map.h>
#include <spa/support/type-map.h>
#include <spa/support/log.h>
#include <spa/support/loop.h>
#include <spa/utils/list.h>
#include <spa/clock/clock.h>
#include <spa/node/node.h>
#include <spa/param/video/format-utils.h>
#include <spa/param/buffers.h>
#include <spa/param/meta.h>
#include <lib/debug.h>
#include <lib/pod.h>
@ -77,8 +78,8 @@ struct type {
struct spa_type_video_format video_format;
struct spa_type_event_node event_node;
struct spa_type_command_node command_node;
struct spa_type_param_alloc_buffers param_alloc_buffers;
struct spa_type_param_alloc_meta_enable param_alloc_meta_enable;
struct spa_type_param_buffers param_buffers;
struct spa_type_param_meta param_meta;
struct spa_type_meta meta;
struct spa_type_data data;
};
@ -100,8 +101,8 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
spa_type_video_format_map(map, &type->video_format);
spa_type_event_node_map(map, &type->event_node);
spa_type_command_node_map(map, &type->command_node);
spa_type_param_alloc_buffers_map(map, &type->param_alloc_buffers);
spa_type_param_alloc_meta_enable_map(map, &type->param_alloc_meta_enable);
spa_type_param_buffers_map(map, &type->param_buffers);
spa_type_param_meta_map(map, &type->param_meta);
spa_type_meta_map(map, &type->meta);
spa_type_data_map(map, &type->data);
}
@ -564,20 +565,20 @@ static int impl_node_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
param = spa_pod_builder_object(builder,
id, t->param_alloc_buffers.Buffers,
":", t->param_alloc_buffers.size, "i", port->fmt.fmt.pix.sizeimage,
":", t->param_alloc_buffers.stride, "i", port->fmt.fmt.pix.bytesperline,
":", t->param_alloc_buffers.buffers, "iru", MAX_BUFFERS,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "i", port->fmt.fmt.pix.sizeimage,
":", t->param_buffers.stride, "i", port->fmt.fmt.pix.bytesperline,
":", t->param_buffers.buffers, "iru", MAX_BUFFERS,
2, 2, MAX_BUFFERS,
":", t->param_alloc_buffers.align, "i", 16);
":", t->param_buffers.align, "i", 16);
}
else if (id == t->param.idMeta) {
switch (*index) {
case 0:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Header,
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
break;
default:
return SPA_RESULT_ENUM_END;

View file

@ -17,8 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
#include <spa/plugin.h>
#include <spa/node.h>
#include <spa/support/plugin.h>
extern const struct spa_handle_factory spa_v4l2_source_factory;
extern const struct spa_handle_factory spa_v4l2_monitor_factory;

View file

@ -17,8 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
#include <spa/plugin.h>
#include <spa/node.h>
#include <spa/support/plugin.h>
extern const struct spa_handle_factory spa_videotestsrc_factory;

View file

@ -24,14 +24,15 @@
#include <stdio.h>
#include <sys/timerfd.h>
#include <spa/type-map.h>
#include <spa/clock.h>
#include <spa/log.h>
#include <spa/loop.h>
#include <spa/node.h>
#include <spa/param-alloc.h>
#include <spa/list.h>
#include <spa/video/format-utils.h>
#include <spa/support/type-map.h>
#include <spa/support/log.h>
#include <spa/support/loop.h>
#include <spa/utils/list.h>
#include <spa/clock/clock.h>
#include <spa/node/node.h>
#include <spa/param/video/format-utils.h>
#include <spa/param/buffers.h>
#include <spa/param/meta.h>
#include <lib/pod.h>
@ -58,8 +59,8 @@ struct type {
struct spa_type_video_format video_format;
struct spa_type_event_node event_node;
struct spa_type_command_node command_node;
struct spa_type_param_alloc_buffers param_alloc_buffers;
struct spa_type_param_alloc_meta_enable param_alloc_meta_enable;
struct spa_type_param_buffers param_buffers;
struct spa_type_param_meta param_meta;
};
static inline void init_type(struct type *type, struct spa_type_map *map)
@ -81,8 +82,8 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
spa_type_video_format_map(map, &type->video_format);
spa_type_event_node_map(map, &type->event_node);
spa_type_command_node_map(map, &type->command_node);
spa_type_param_alloc_buffers_map(map, &type->param_alloc_buffers);
spa_type_param_alloc_meta_enable_map(map, &type->param_alloc_meta_enable);
spa_type_param_buffers_map(map, &type->param_buffers);
spa_type_param_meta_map(map, &type->param_meta);
}
struct props {
@ -567,12 +568,12 @@ impl_node_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
param = spa_pod_builder_object(builder,
id, t->param_alloc_buffers.Buffers,
":", t->param_alloc_buffers.size, "i", this->stride * raw_info->size.height,
":", t->param_alloc_buffers.stride, "i", this->stride,
":", t->param_alloc_buffers.buffers, "ir", 2,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "i", this->stride * raw_info->size.height,
":", t->param_buffers.stride, "i", this->stride,
":", t->param_buffers.buffers, "ir", 2,
2, 1, 32,
":", t->param_alloc_buffers.align, "i", 16);
":", t->param_buffers.align, "i", 16);
}
else if (id == t->param.idMeta) {
if (!this->have_format)
@ -581,9 +582,9 @@ impl_node_port_enum_params(struct spa_node *node,
switch (*index) {
case 0:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Header,
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
break;
default:

View file

@ -17,8 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
#include <spa/plugin.h>
#include <spa/node.h>
#include <spa/support/plugin.h>
extern const struct spa_handle_factory spa_volume_factory;

View file

@ -20,12 +20,13 @@
#include <string.h>
#include <stddef.h>
#include <spa/log.h>
#include <spa/type-map.h>
#include <spa/node.h>
#include <spa/list.h>
#include <spa/audio/format-utils.h>
#include <spa/param-alloc.h>
#include <spa/support/log.h>
#include <spa/support/type-map.h>
#include <spa/utils/list.h>
#include <spa/node/node.h>
#include <spa/param/audio/format-utils.h>
#include <spa/param/buffers.h>
#include <spa/param/meta.h>
#include <lib/pod.h>
@ -74,8 +75,8 @@ struct type {
struct spa_type_audio_format audio_format;
struct spa_type_event_node event_node;
struct spa_type_command_node command_node;
struct spa_type_param_alloc_buffers param_alloc_buffers;
struct spa_type_param_alloc_meta_enable param_alloc_meta_enable;
struct spa_type_param_buffers param_buffers;
struct spa_type_param_meta param_meta;
};
static inline void init_type(struct type *type, struct spa_type_map *map)
@ -94,8 +95,8 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
spa_type_audio_format_map(map, &type->audio_format);
spa_type_event_node_map(map, &type->event_node);
spa_type_command_node_map(map, &type->command_node);
spa_type_param_alloc_buffers_map(map, &type->param_alloc_buffers);
spa_type_param_alloc_meta_enable_map(map, &type->param_alloc_meta_enable);
spa_type_param_buffers_map(map, &type->param_buffers);
spa_type_param_meta_map(map, &type->param_meta);
}
struct impl {
@ -435,22 +436,22 @@ impl_node_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
param = spa_pod_builder_object(builder,
id, t->param_alloc_buffers.Buffers,
":", t->param_alloc_buffers.size, "iru", 1024 * this->bpf,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "iru", 1024 * this->bpf,
2, 16 * this->bpf,
INT32_MAX / this->bpf,
":", t->param_alloc_buffers.stride, "i", 0,
":", t->param_alloc_buffers.buffers, "iru", 2,
":", t->param_buffers.stride, "i", 0,
":", t->param_buffers.buffers, "iru", 2,
2, 1, MAX_BUFFERS,
":", t->param_alloc_buffers.align, "i", 16);
":", t->param_buffers.align, "i", 16);
}
else if (id == t->param.idMeta) {
switch (*index) {
case 0:
param = spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Header,
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
break;
default:
return SPA_RESULT_ENUM_END;

View file

@ -4,7 +4,7 @@
#include <stdio.h>
#include <sched.h>
#include <spa/ringbuffer.h>
#include <spa/utils/ringbuffer.h>
#define ARRAY_SIZE 64
#define MAX_VALUE 0x10000

View file

@ -26,22 +26,22 @@
#include <pthread.h>
#include <poll.h>
#include <spa/node.h>
#include <spa/log.h>
#include <spa/log-impl.h>
#include <spa/loop.h>
#include <spa/type-map.h>
#include <spa/type-map-impl.h>
#include <spa/audio/format-utils.h>
#include <spa/format-utils.h>
#include <spa/support/log-impl.h>
#include <spa/support/loop.h>
#include <spa/support/type-map-impl.h>
#include <spa/node/node.h>
#include <spa/param/param.h>
#include <spa/param/props.h>
#include <spa/param/audio/format-utils.h>
#include <spa/param/format-utils.h>
static SPA_TYPE_MAP_IMPL(default_map, 4096);
static SPA_LOG_IMPL(default_log);
#define spa_debug(f,...) spa_log_trace(&default_log.log, f, __VA_ARGS__)
#include <spa/graph.h>
#include <spa/graph-scheduler6.h>
#include <spa/graph/graph.h>
#include <spa/graph/graph-scheduler6.h>
#include <lib/debug.h>

View file

@ -26,16 +26,16 @@
#include <pthread.h>
#include <poll.h>
#include <spa/node.h>
#include <spa/log.h>
#include <spa/log-impl.h>
#include <spa/loop.h>
#include <spa/type-map.h>
#include <spa/type-map-impl.h>
#include <spa/audio/format-utils.h>
#include <spa/format-utils.h>
#include <spa/graph.h>
#include <spa/graph-scheduler1.h>
#include <spa/support/log-impl.h>
#include <spa/support/loop.h>
#include <spa/support/type-map-impl.h>
#include <spa/node/node.h>
#include <spa/param/param.h>
#include <spa/param/props.h>
#include <spa/param/audio/format-utils.h>
#include <spa/param/format-utils.h>
#include <spa/graph/graph.h>
#include <spa/graph/graph-scheduler1.h>
static SPA_TYPE_MAP_IMPL(default_map, 4096);
static SPA_LOG_IMPL(default_log);

View file

@ -26,14 +26,16 @@
#include <pthread.h>
#include <poll.h>
#include <spa/node.h>
#include <spa/log.h>
#include <spa/log-impl.h>
#include <spa/loop.h>
#include <spa/type-map.h>
#include <spa/type-map-impl.h>
#include <spa/audio/format-utils.h>
#include <spa/format-utils.h>
#include <spa/support/log.h>
#include <spa/support/log-impl.h>
#include <spa/support/loop.h>
#include <spa/support/type-map.h>
#include <spa/support/type-map-impl.h>
#include <spa/node/node.h>
#include <spa/param/param.h>
#include <spa/param/props.h>
#include <spa/param/audio/format-utils.h>
#include <spa/param/format-utils.h>
#define USE_GRAPH
@ -42,8 +44,8 @@ static SPA_LOG_IMPL(default_log);
#define spa_debug(...) spa_log_trace(&default_log.log,__VA_ARGS__)
#include <spa/graph.h>
#include <spa/graph-scheduler1.h>
#include <spa/graph/graph.h>
#include <spa/graph/graph-scheduler1.h>
struct type {
uint32_t node;

View file

@ -26,14 +26,16 @@
#include <pthread.h>
#include <poll.h>
#include <spa/node.h>
#include <spa/log-impl.h>
#include <spa/loop.h>
#include <spa/type-map-impl.h>
#include <spa/audio/format-utils.h>
#include <spa/format-utils.h>
#include <spa/graph.h>
#include <spa/graph-scheduler1.h>
#include <spa/support/log-impl.h>
#include <spa/support/loop.h>
#include <spa/support/type-map-impl.h>
#include <spa/node/node.h>
#include <spa/param/param.h>
#include <spa/param/props.h>
#include <spa/param/audio/format-utils.h>
#include <spa/param/format-utils.h>
#include <spa/graph/graph.h>
#include <spa/graph/graph-scheduler1.h>
#define MODE_SYNC_PUSH (1<<0)
#define MODE_SYNC_PULL (1<<1)

View file

@ -23,12 +23,12 @@
#include <unistd.h>
#include <errno.h>
#include <spa/type-map.h>
#include <spa/type-map-impl.h>
#include <spa/log.h>
#include <spa/node.h>
#include <spa/loop.h>
#include <spa/video/format-utils.h>
#include <spa/support/log-impl.h>
#include <spa/support/type-map-impl.h>
#include <spa/pod/pod.h>
#include <spa/pod/builder.h>
#include <spa/pod/parser.h>
#include <spa/param/video/format-utils.h>
#include <lib/debug.h>

View file

@ -23,14 +23,12 @@
#include <unistd.h>
#include <errno.h>
#include <spa/pod.h>
#include <spa/pod-builder.h>
#include <spa/pod-parser.h>
#include <spa/type-map-impl.h>
#include <spa/log-impl.h>
#include <spa/video/format.h>
#include <spa/support/log-impl.h>
#include <spa/support/type-map-impl.h>
#include <spa/pod/pod.h>
#include <spa/pod/builder.h>
#include <spa/pod/parser.h>
#include <spa/param/video/format.h>
#include <lib/debug.h>

View file

@ -23,9 +23,10 @@
#include <unistd.h>
#include <errno.h>
#include <spa/log.h>
#include <spa/support/log.h>
#include <spa/pod/iter.h>
#include <lib/debug.h>
#include <spa/pod-iter.h>
#if 0
/*

View file

@ -23,10 +23,9 @@
#include <unistd.h>
#include <errno.h>
#include <spa/log.h>
#include <lib/debug.h>
#include <spa/pod/parser.h>
#include <spa/pod-parser.h>
#include <lib/debug.h>
int main(int argc, char *argv[])
{

View file

@ -26,12 +26,14 @@
#include <pthread.h>
#include <poll.h>
#include <spa/node.h>
#include <spa/log-impl.h>
#include <spa/loop.h>
#include <spa/type-map-impl.h>
#include <spa/audio/format-utils.h>
#include <spa/format-utils.h>
#include <spa/support/log-impl.h>
#include <spa/support/loop.h>
#include <spa/support/type-map-impl.h>
#include <spa/node/node.h>
#include <spa/param/param.h>
#include <spa/param/props.h>
#include <spa/param/audio/format-utils.h>
#include <spa/param/format-utils.h>
#include <lib/debug.h>

View file

@ -28,11 +28,14 @@
#include <SDL2/SDL.h>
#include <spa/type-map-impl.h>
#include <spa/log-impl.h>
#include <spa/node.h>
#include <spa/loop.h>
#include <spa/video/format-utils.h>
#include <spa/support/log-impl.h>
#include <spa/support/loop.h>
#include <spa/support/type-map-impl.h>
#include <spa/node/node.h>
#include <spa/param/param.h>
#include <spa/param/props.h>
#include <spa/param/video/format-utils.h>
#include <spa/param/format-utils.h>
#include <lib/debug.h>

View file

@ -23,11 +23,14 @@
#include <unistd.h>
#include <dlfcn.h>
#include <spa/type-map-impl.h>
#include <spa/clock.h>
#include <spa/log-impl.h>
#include <spa/node.h>
#include <spa/loop.h>
#include <spa/support/type-map-impl.h>
#include <spa/support/log-impl.h>
#include <spa/support/loop.h>
#include <spa/clock/clock.h>
#include <spa/node/node.h>
#include <spa/pod/parser.h>
#include <spa/param/param.h>
#include <spa/param/format.h>
#include <lib/debug.h>

View file

@ -25,10 +25,10 @@
#include <errno.h>
#include <poll.h>
#include <spa/log-impl.h>
#include <spa/type-map-impl.h>
#include <spa/monitor.h>
#include <spa/loop.h>
#include <spa/support/log-impl.h>
#include <spa/support/type-map-impl.h>
#include <spa/support/loop.h>
#include <spa/monitor/monitor.h>
#include <lib/debug.h>

View file

@ -22,10 +22,10 @@
#include <SDL2/SDL.h>
#include <spa/type-map.h>
#include <spa/format-utils.h>
#include <spa/video/format-utils.h>
#include <spa/props.h>
#include <spa/support/type-map.h>
#include <spa/param/format-utils.h>
#include <spa/param/video/format-utils.h>
#include <spa/param/props.h>
#include <spa/lib/debug.h>
#include <pipewire/pipewire.h>
@ -347,21 +347,21 @@ static int impl_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
spa_pod_builder_object(builder,
id, t->param_alloc_buffers.Buffers,
":", t->param_alloc_buffers.size, "i", d->stride * d->format.size.height,
":", t->param_alloc_buffers.stride, "i", d->stride,
":", t->param_alloc_buffers.buffers, "iru", 32,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "i", d->stride * d->format.size.height,
":", t->param_buffers.stride, "i", d->stride,
":", t->param_buffers.buffers, "iru", 32,
2, 2, 32,
":", t->param_alloc_buffers.align, "i", 16);
":", t->param_buffers.align, "i", 16);
}
else if (id == t->param.idMeta) {
if (*index != 0)
return SPA_RESULT_ENUM_END;
spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Header,
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
}
else
return SPA_RESULT_UNKNOWN_PARAM;

View file

@ -21,10 +21,10 @@
#include <math.h>
#include <sys/mman.h>
#include <spa/type-map.h>
#include <spa/format-utils.h>
#include <spa/audio/format-utils.h>
#include <spa/props.h>
#include <spa/support/type-map.h>
#include <spa/param/format-utils.h>
#include <spa/param/audio/format-utils.h>
#include <spa/param/props.h>
#include <spa/lib/debug.h>
#include <pipewire/pipewire.h>
@ -236,32 +236,32 @@ static int impl_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
spa_pod_builder_object(builder,
id, t->param_alloc_buffers.Buffers,
":", t->param_alloc_buffers.size, "iru", 1024,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "iru", 1024,
2, 32, 4096,
":", t->param_alloc_buffers.stride, "i", 0,
":", t->param_alloc_buffers.buffers, "iru", 2,
":", t->param_buffers.stride, "i", 0,
":", t->param_buffers.buffers, "iru", 2,
2, 2, 32,
":", t->param_alloc_buffers.align, "i", 16);
":", t->param_buffers.align, "i", 16);
}
else if (id == t->param.idMeta) {
switch (*index) {
case 0:
spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Header,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_header));
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Header,
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
break;
case 1:
spa_pod_builder_object(builder,
id, t->param_alloc_meta_enable.MetaEnable,
":", t->param_alloc_meta_enable.type, "I", t->meta.Ringbuffer,
":", t->param_alloc_meta_enable.size, "i", sizeof(struct spa_meta_ringbuffer),
":", t->param_alloc_meta_enable.ringbufferSize, "ir", 1024 * 4,
id, t->param_meta.Meta,
":", t->param_meta.type, "I", t->meta.Ringbuffer,
":", t->param_meta.size, "i", sizeof(struct spa_meta_ringbuffer),
":", t->param_meta.ringbufferSize, "ir", 1024 * 4,
2, 16 * 4, INT32_MAX / 4,
":", t->param_alloc_meta_enable.ringbufferStride, "i", 0,
":", t->param_alloc_meta_enable.ringbufferBlocks, "i", 1,
":", t->param_alloc_meta_enable.ringbufferAlign, "i", 16);
":", t->param_meta.ringbufferStride, "i", 0,
":", t->param_meta.ringbufferBlocks, "i", 1,
":", t->param_meta.ringbufferAlign, "i", 16);
break;
default:
return SPA_RESULT_ENUM_END;

Some files were not shown because too many files have changed in this diff Show more