mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-18 07:00:06 -05:00
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:
parent
58451d626c
commit
caaeaff223
151 changed files with 1353 additions and 964 deletions
72
spa/include/spa/param/audio/format-utils.h
Normal file
72
spa/include/spa/param/audio/format-utils.h
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/* 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_AUDIO_FORMAT_UTILS_H__
|
||||
#define __SPA_PARAM_AUDIO_FORMAT_UTILS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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;
|
||||
uint32_t flags;
|
||||
uint32_t layout;
|
||||
uint32_t rate;
|
||||
uint32_t channels;
|
||||
uint32_t channel_mask;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_format_audio_map(struct spa_type_map *map, struct spa_type_format_audio *type)
|
||||
{
|
||||
if (type->format == 0) {
|
||||
type->format = spa_type_map_get_id(map, SPA_TYPE_FORMAT_AUDIO__format);
|
||||
type->flags = spa_type_map_get_id(map, SPA_TYPE_FORMAT_AUDIO__flags);
|
||||
type->layout = spa_type_map_get_id(map, SPA_TYPE_FORMAT_AUDIO__layout);
|
||||
type->rate = spa_type_map_get_id(map, SPA_TYPE_FORMAT_AUDIO__rate);
|
||||
type->channels = spa_type_map_get_id(map, SPA_TYPE_FORMAT_AUDIO__channels);
|
||||
type->channel_mask = spa_type_map_get_id(map, SPA_TYPE_FORMAT_AUDIO__channelMask);
|
||||
}
|
||||
}
|
||||
|
||||
static inline int
|
||||
spa_format_audio_raw_parse(const struct spa_pod_object *format,
|
||||
struct spa_audio_info_raw *info, struct spa_type_format_audio *type)
|
||||
{
|
||||
struct spa_pod_parser prs;
|
||||
spa_pod_parser_pod(&prs, &format->pod);
|
||||
return spa_pod_parser_get(&prs,
|
||||
":",type->format, "I", &info->format,
|
||||
":",type->rate, "i", &info->rate,
|
||||
":",type->channels, "i", &info->channels,
|
||||
":",type->flags, "?i", &info->flags,
|
||||
":",type->layout, "?i", &info->layout,
|
||||
":",type->channel_mask, "?i", &info->channel_mask, NULL);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_AUDIO_FORMAT_UTILS */
|
||||
52
spa/include/spa/param/audio/format.h
Normal file
52
spa/include/spa/param/audio/format.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/* 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_AUDIO_FORMAT_H__
|
||||
#define __SPA_PARAM_AUDIO_FORMAT_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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 ":"
|
||||
|
||||
#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"
|
||||
|
||||
struct spa_audio_info {
|
||||
uint32_t media_type;
|
||||
uint32_t media_subtype;
|
||||
union {
|
||||
struct spa_audio_info_raw raw;
|
||||
} info;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_AUDIO_FORMAT_H */
|
||||
119
spa/include/spa/param/audio/raw-utils.h
Normal file
119
spa/include/spa/param/audio/raw-utils.h
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
/* 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_AUDIO_RAW_UTILS_H__
|
||||
#define __SPA_AUDIO_RAW_UTILS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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"
|
||||
#define _SPA_TYPE_AUDIO_FORMAT_OE(fmt) SPA_TYPE_AUDIO_FORMAT_BASE fmt "LE"
|
||||
#elif __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define _SPA_TYPE_AUDIO_FORMAT_NE(fmt) SPA_TYPE_AUDIO_FORMAT_BASE fmt "LE"
|
||||
#define _SPA_TYPE_AUDIO_FORMAT_OE(fmt) SPA_TYPE_AUDIO_FORMAT_BASE fmt "BE"
|
||||
#endif
|
||||
|
||||
struct spa_type_audio_format {
|
||||
uint32_t UNKNOWN;
|
||||
uint32_t ENCODED;
|
||||
uint32_t S8;
|
||||
uint32_t U8;
|
||||
uint32_t S16;
|
||||
uint32_t U16;
|
||||
uint32_t S24_32;
|
||||
uint32_t U24_32;
|
||||
uint32_t S32;
|
||||
uint32_t U32;
|
||||
uint32_t S24;
|
||||
uint32_t U24;
|
||||
uint32_t S20;
|
||||
uint32_t U20;
|
||||
uint32_t S18;
|
||||
uint32_t U18;
|
||||
uint32_t F32;
|
||||
uint32_t F64;
|
||||
uint32_t S16_OE;
|
||||
uint32_t U16_OE;
|
||||
uint32_t S24_32_OE;
|
||||
uint32_t U24_32_OE;
|
||||
uint32_t S32_OE;
|
||||
uint32_t U32_OE;
|
||||
uint32_t S24_OE;
|
||||
uint32_t U24_OE;
|
||||
uint32_t S20_OE;
|
||||
uint32_t U20_OE;
|
||||
uint32_t S18_OE;
|
||||
uint32_t U18_OE;
|
||||
uint32_t F32_OE;
|
||||
uint32_t F64_OE;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_audio_format_map(struct spa_type_map *map, struct spa_type_audio_format *type)
|
||||
{
|
||||
if (type->ENCODED == 0) {
|
||||
type->UNKNOWN = 0;
|
||||
type->ENCODED = spa_type_map_get_id(map, SPA_TYPE_AUDIO_FORMAT__ENCODED);
|
||||
|
||||
type->S8 = spa_type_map_get_id(map, SPA_TYPE_AUDIO_FORMAT__S8);
|
||||
type->U8 = spa_type_map_get_id(map, SPA_TYPE_AUDIO_FORMAT__U8);
|
||||
|
||||
type->S16 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("S16"));
|
||||
type->U16 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("U16"));
|
||||
type->S24_32 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("S24_32"));
|
||||
type->U24_32 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("U24_32"));
|
||||
type->S32 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("S32"));
|
||||
type->U32 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("U32"));
|
||||
type->S24 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("S24"));
|
||||
type->U24 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("U24"));
|
||||
type->S20 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("S20"));
|
||||
type->U20 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("U20"));
|
||||
type->S18 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("S18"));
|
||||
type->U18 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("U18"));
|
||||
type->F32 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("F32"));
|
||||
type->F64 = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_NE("F64"));
|
||||
|
||||
type->S16_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("S16"));
|
||||
type->U16_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("U16"));
|
||||
type->S24_32_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("S24_32"));
|
||||
type->U24_32_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("U24_32"));
|
||||
type->S32_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("S32"));
|
||||
type->U32_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("U32"));
|
||||
type->S24_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("S24"));
|
||||
type->U24_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("U24"));
|
||||
type->S20_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("S20"));
|
||||
type->U20_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("U20"));
|
||||
type->S18_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("S18"));
|
||||
type->U18_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("U18"));
|
||||
type->F32_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("F32"));
|
||||
type->F64_OE = spa_type_map_get_id(map, _SPA_TYPE_AUDIO_FORMAT_OE("F64"));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_AUDIO_RAW_UTILS_H__ */
|
||||
112
spa/include/spa/param/audio/raw.h
Normal file
112
spa/include/spa/param/audio/raw.h
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
/* 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_AUDIO_RAW_H__
|
||||
#define __SPA_AUDIO_RAW_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <endian.h>
|
||||
|
||||
#define SPA_TYPE__AudioFormat SPA_TYPE_ENUM_BASE "AudioFormat"
|
||||
#define SPA_TYPE_AUDIO_FORMAT_BASE SPA_TYPE__AudioFormat ":"
|
||||
|
||||
#define SPA_TYPE_AUDIO_FORMAT__UNKNOWN SPA_TYPE_AUDIO_FORMAT_BASE "UNKNOWN"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__ENCODED SPA_TYPE_AUDIO_FORMAT_BASE "ENCODED"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S8 SPA_TYPE_AUDIO_FORMAT_BASE "S8"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U8 SPA_TYPE_AUDIO_FORMAT_BASE "U8"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S16LE SPA_TYPE_AUDIO_FORMAT_BASE "S16LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S16BE SPA_TYPE_AUDIO_FORMAT_BASE "S16BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U16LE SPA_TYPE_AUDIO_FORMAT_BASE "U16LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U16BE SPA_TYPE_AUDIO_FORMAT_BASE "U16BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S24_32LE SPA_TYPE_AUDIO_FORMAT_BASE "S24_32LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S24_32BE SPA_TYPE_AUDIO_FORMAT_BASE "S24_32BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U24_32LE SPA_TYPE_AUDIO_FORMAT_BASE "U24_32LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U24_32BE SPA_TYPE_AUDIO_FORMAT_BASE "U24_32BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S32LE SPA_TYPE_AUDIO_FORMAT_BASE "S32LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S32BE SPA_TYPE_AUDIO_FORMAT_BASE "S32BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U32LE SPA_TYPE_AUDIO_FORMAT_BASE "U32LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U32BE SPA_TYPE_AUDIO_FORMAT_BASE "U32BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S24LE SPA_TYPE_AUDIO_FORMAT_BASE "S24LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S24BE SPA_TYPE_AUDIO_FORMAT_BASE "S24BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U24LE SPA_TYPE_AUDIO_FORMAT_BASE "U24LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U24BE SPA_TYPE_AUDIO_FORMAT_BASE "U24BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S20LE SPA_TYPE_AUDIO_FORMAT_BASE "S20LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S20BE SPA_TYPE_AUDIO_FORMAT_BASE "S20BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U20LE SPA_TYPE_AUDIO_FORMAT_BASE "U20LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U20BE SPA_TYPE_AUDIO_FORMAT_BASE "U20BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S18LE SPA_TYPE_AUDIO_FORMAT_BASE "S18LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__S18BE SPA_TYPE_AUDIO_FORMAT_BASE "S18BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U18LE SPA_TYPE_AUDIO_FORMAT_BASE "U18LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__U18BE SPA_TYPE_AUDIO_FORMAT_BASE "U18BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__F32LE SPA_TYPE_AUDIO_FORMAT_BASE "F32LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__F32BE SPA_TYPE_AUDIO_FORMAT_BASE "F32BE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__F64LE SPA_TYPE_AUDIO_FORMAT_BASE "F64LE"
|
||||
#define SPA_TYPE_AUDIO_FORMAT__F64BE SPA_TYPE_AUDIO_FORMAT_BASE "F64BE"
|
||||
|
||||
/**
|
||||
* spa_audio_flags:
|
||||
* @SPA_AUDIO_FLAG_NONE: no valid flag
|
||||
* @SPA_AUDIO_FLAG_UNPOSITIONED: the position array explicitly
|
||||
* contains unpositioned channels.
|
||||
*
|
||||
* Extra audio flags
|
||||
*/
|
||||
enum spa_audio_flags {
|
||||
SPA_AUDIO_FLAG_NONE = 0,
|
||||
SPA_AUDIO_FLAG_UNPOSITIONED = (1 << 0)
|
||||
};
|
||||
|
||||
/**
|
||||
* spa_audio_layout:
|
||||
* @SPA_AUDIO_LAYOUT_INTERLEAVED: interleaved audio
|
||||
* @SPA_AUDIO_LAYOUT_NON_INTERLEAVED: non-interleaved audio
|
||||
*
|
||||
* Layout of the audio samples for the different channels.
|
||||
*/
|
||||
enum spa_audio_layout {
|
||||
SPA_AUDIO_LAYOUT_INTERLEAVED = 0,
|
||||
SPA_AUDIO_LAYOUT_NON_INTERLEAVED
|
||||
};
|
||||
|
||||
/**
|
||||
* spa_audio_info_raw:
|
||||
* @format: the format
|
||||
* @flags: extra flags
|
||||
* @layout: the sample layout
|
||||
* @rate: the sample rate
|
||||
* @channels: the number of channels
|
||||
* @channel_mask: the channel mask
|
||||
*/
|
||||
struct spa_audio_info_raw {
|
||||
uint32_t format;
|
||||
enum spa_audio_flags flags;
|
||||
enum spa_audio_layout layout;
|
||||
uint32_t rate;
|
||||
uint32_t channels;
|
||||
uint32_t channel_mask;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_AUDIO_RAW_H__ */
|
||||
64
spa/include/spa/param/buffers.h
Normal file
64
spa/include/spa/param/buffers.h
Normal 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__ */
|
||||
145
spa/include/spa/param/format-utils.h
Normal file
145
spa/include/spa/param/format-utils.h
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
/* 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_FORMAT_UTILS_H__
|
||||
#define __SPA_PARAM_FORMAT_UTILS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdarg.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;
|
||||
uint32_t video;
|
||||
uint32_t image;
|
||||
uint32_t binary;
|
||||
uint32_t stream;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_media_type_map(struct spa_type_map *map, struct spa_type_media_type *type)
|
||||
{
|
||||
if (type->audio == 0) {
|
||||
type->audio = spa_type_map_get_id(map, SPA_TYPE_MEDIA_TYPE__audio);
|
||||
type->video = spa_type_map_get_id(map, SPA_TYPE_MEDIA_TYPE__video);
|
||||
type->image = spa_type_map_get_id(map, SPA_TYPE_MEDIA_TYPE__image);
|
||||
type->binary = spa_type_map_get_id(map, SPA_TYPE_MEDIA_TYPE__binary);
|
||||
type->stream = spa_type_map_get_id(map, SPA_TYPE_MEDIA_TYPE__stream);
|
||||
}
|
||||
}
|
||||
|
||||
struct spa_type_media_subtype {
|
||||
uint32_t raw;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_media_subtype_map(struct spa_type_map *map, struct spa_type_media_subtype *type)
|
||||
{
|
||||
if (type->raw == 0) {
|
||||
type->raw = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__raw);
|
||||
}
|
||||
}
|
||||
|
||||
struct spa_type_media_subtype_video {
|
||||
uint32_t h264;
|
||||
uint32_t mjpg;
|
||||
uint32_t dv;
|
||||
uint32_t mpegts;
|
||||
uint32_t h263;
|
||||
uint32_t mpeg1;
|
||||
uint32_t mpeg2;
|
||||
uint32_t mpeg4;
|
||||
uint32_t xvid;
|
||||
uint32_t vc1;
|
||||
uint32_t vp8;
|
||||
uint32_t vp9;
|
||||
uint32_t jpeg;
|
||||
uint32_t bayer;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_media_subtype_video_map(struct spa_type_map *map,
|
||||
struct spa_type_media_subtype_video *type)
|
||||
{
|
||||
if (type->h264 == 0) {
|
||||
type->h264 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__h264);
|
||||
type->mjpg = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__mjpg);
|
||||
type->dv = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__dv);
|
||||
type->mpegts = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__mpegts);
|
||||
type->h263 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__h263);
|
||||
type->mpeg1 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__mpeg1);
|
||||
type->mpeg2 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__mpeg2);
|
||||
type->mpeg4 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__mpeg4);
|
||||
type->xvid = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__xvid);
|
||||
type->vc1 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__vc1);
|
||||
type->vp8 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__vp8);
|
||||
type->vp9 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__vp9);
|
||||
type->jpeg = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__jpeg);
|
||||
type->bayer = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__bayer);
|
||||
}
|
||||
}
|
||||
|
||||
struct spa_type_media_subtype_audio {
|
||||
uint32_t mp3;
|
||||
uint32_t aac;
|
||||
uint32_t vorbis;
|
||||
uint32_t wma;
|
||||
uint32_t ra;
|
||||
uint32_t sbc;
|
||||
uint32_t adpcm;
|
||||
uint32_t g723;
|
||||
uint32_t g726;
|
||||
uint32_t g729;
|
||||
uint32_t amr;
|
||||
uint32_t gsm;
|
||||
uint32_t midi;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_media_subtype_audio_map(struct spa_type_map *map,
|
||||
struct spa_type_media_subtype_audio *type)
|
||||
{
|
||||
if (type->mp3 == 0) {
|
||||
type->mp3 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__mp3);
|
||||
type->aac = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__aac);
|
||||
type->vorbis = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__vorbis);
|
||||
type->wma = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__wma);
|
||||
type->ra = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__ra);
|
||||
type->sbc = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__sbc);
|
||||
type->adpcm = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__adpcm);
|
||||
type->g723 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__g723);
|
||||
type->g726 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__g726);
|
||||
type->g729 = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__g729);
|
||||
type->amr = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__amr);
|
||||
type->gsm = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__gsm);
|
||||
type->midi = spa_type_map_get_id(map, SPA_TYPE_MEDIA_SUBTYPE__midi);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __PARAM_SPA_FORMAT_UTILS_H__ */
|
||||
82
spa/include/spa/param/format.h
Normal file
82
spa/include/spa/param/format.h
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/* 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_FORMAT_H__
|
||||
#define __SPA_PARAM_FORMAT_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/param/param.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 ":"
|
||||
|
||||
#define SPA_TYPE_MEDIA_TYPE__audio SPA_TYPE_MEDIA_TYPE_BASE "audio"
|
||||
#define SPA_TYPE_MEDIA_TYPE__video SPA_TYPE_MEDIA_TYPE_BASE "video"
|
||||
#define SPA_TYPE_MEDIA_TYPE__image SPA_TYPE_MEDIA_TYPE_BASE "image"
|
||||
#define SPA_TYPE_MEDIA_TYPE__binary SPA_TYPE_MEDIA_TYPE_BASE "binary"
|
||||
#define SPA_TYPE_MEDIA_TYPE__stream SPA_TYPE_MEDIA_TYPE_BASE "stream"
|
||||
|
||||
#define SPA_TYPE__MediaSubtype SPA_TYPE_ENUM_BASE "MediaSubtype"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE_BASE SPA_TYPE__MediaSubtype ":"
|
||||
|
||||
/* generic subtypes */
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__raw SPA_TYPE_MEDIA_SUBTYPE_BASE "raw"
|
||||
|
||||
/* video subtypes */
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__h264 SPA_TYPE_MEDIA_SUBTYPE_BASE "h264"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__mjpg SPA_TYPE_MEDIA_SUBTYPE_BASE "mjpg"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__dv SPA_TYPE_MEDIA_SUBTYPE_BASE "dv"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__mpegts SPA_TYPE_MEDIA_SUBTYPE_BASE "mpegts"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__h263 SPA_TYPE_MEDIA_SUBTYPE_BASE "h263"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__mpeg1 SPA_TYPE_MEDIA_SUBTYPE_BASE "mpeg1"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__mpeg2 SPA_TYPE_MEDIA_SUBTYPE_BASE "mpeg2"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__mpeg4 SPA_TYPE_MEDIA_SUBTYPE_BASE "mpeg4"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__xvid SPA_TYPE_MEDIA_SUBTYPE_BASE "xvid"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__vc1 SPA_TYPE_MEDIA_SUBTYPE_BASE "vc1"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__vp8 SPA_TYPE_MEDIA_SUBTYPE_BASE "vp8"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__vp9 SPA_TYPE_MEDIA_SUBTYPE_BASE "vp9"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__jpeg SPA_TYPE_MEDIA_SUBTYPE_BASE "jpeg"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__bayer SPA_TYPE_MEDIA_SUBTYPE_BASE "bayer"
|
||||
|
||||
/* audio subtypes */
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__mp3 SPA_TYPE_MEDIA_SUBTYPE_BASE "mp3"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__aac SPA_TYPE_MEDIA_SUBTYPE_BASE "aac"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__vorbis SPA_TYPE_MEDIA_SUBTYPE_BASE "vorbis"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__wma SPA_TYPE_MEDIA_SUBTYPE_BASE "wma"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__ra SPA_TYPE_MEDIA_SUBTYPE_BASE "ra"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__sbc SPA_TYPE_MEDIA_SUBTYPE_BASE "sbc"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__adpcm SPA_TYPE_MEDIA_SUBTYPE_BASE "adpcm"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__g723 SPA_TYPE_MEDIA_SUBTYPE_BASE "g723"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__g726 SPA_TYPE_MEDIA_SUBTYPE_BASE "g726"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__g729 SPA_TYPE_MEDIA_SUBTYPE_BASE "g729"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__amr SPA_TYPE_MEDIA_SUBTYPE_BASE "amr"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__gsm SPA_TYPE_MEDIA_SUBTYPE_BASE "gsm"
|
||||
#define SPA_TYPE_MEDIA_SUBTYPE__midi SPA_TYPE_MEDIA_SUBTYPE_BASE "midi"
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_FORMAT_H__ */
|
||||
80
spa/include/spa/param/meta.h
Normal file
80
spa/include/spa/param/meta.h
Normal 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__ */
|
||||
93
spa/include/spa/param/param.h
Normal file
93
spa/include/spa/param/param.h
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
/* 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_PARAM_H__
|
||||
#define __SPA_PARAM_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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"
|
||||
#define SPA_TYPE_PARAM_BASE SPA_TYPE__Param ":"
|
||||
|
||||
/* base for parameter object enumerations */
|
||||
#define SPA_TYPE__ParamId SPA_TYPE_ENUM_BASE "ParamId"
|
||||
#define SPA_TYPE_PARAM_ID_BASE SPA_TYPE__ParamId ":"
|
||||
|
||||
/** List of supported parameters */
|
||||
#define SPA_TYPE_PARAM_ID__List SPA_TYPE_PARAM_ID_BASE "List"
|
||||
|
||||
/* 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"
|
||||
|
||||
/** Property parameter id, deals with SPA_TYPE__Props */
|
||||
#define SPA_TYPE_PARAM_ID__Props SPA_TYPE_PARAM_ID_BASE "Props"
|
||||
|
||||
/** The available formats */
|
||||
#define SPA_TYPE_PARAM_ID__EnumFormat SPA_TYPE_PARAM_ID_BASE "EnumFormat"
|
||||
|
||||
/** The current format */
|
||||
#define SPA_TYPE_PARAM_ID__Format SPA_TYPE_PARAM_ID_BASE "Format"
|
||||
|
||||
/** The supported buffer sizes */
|
||||
#define SPA_TYPE_PARAM_ID__Buffers SPA_TYPE_PARAM_ID_BASE "Buffers"
|
||||
|
||||
/** The supported metadata */
|
||||
#define SPA_TYPE_PARAM_ID__Meta SPA_TYPE_PARAM_ID_BASE "Meta"
|
||||
|
||||
struct spa_type_param {
|
||||
uint32_t idList; /**< id of the list param */
|
||||
uint32_t List; /**< list object type */
|
||||
uint32_t listId; /**< id in the list object */
|
||||
uint32_t idProps; /**< id to enumerate properties */
|
||||
uint32_t idEnumFormat; /**< id to enumerate formats */
|
||||
uint32_t idFormat; /**< id to get/set format parameter */
|
||||
uint32_t idBuffers; /**< id to enumerate buffer requirements */
|
||||
uint32_t idMeta; /**< id to enumerate supported metadata */
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_param_map(struct spa_type_map *map,
|
||||
struct spa_type_param *type)
|
||||
{
|
||||
if (type->idList == 0) {
|
||||
type->idList = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID__List);
|
||||
type->List = spa_type_map_get_id(map, SPA_TYPE_PARAM__List);
|
||||
type->listId = spa_type_map_get_id(map, SPA_TYPE_PARAM_LIST__id);
|
||||
type->idProps = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID__Props);
|
||||
type->idEnumFormat = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID__EnumFormat);
|
||||
type->idFormat = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID__Format);
|
||||
type->idBuffers = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID__Buffers);
|
||||
type->idMeta = spa_type_map_get_id(map, SPA_TYPE_PARAM_ID__Meta);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_H__ */
|
||||
54
spa/include/spa/param/props.h
Normal file
54
spa/include/spa/param/props.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/* 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_H__
|
||||
#define __SPA_PARAM_PROPS_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 ":"
|
||||
|
||||
/** 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"
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_PROPS_H__ */
|
||||
73
spa/include/spa/param/video-padding.h
Normal file
73
spa/include/spa/param/video-padding.h
Normal 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__ */
|
||||
58
spa/include/spa/param/video/chroma.h
Normal file
58
spa/include/spa/param/video/chroma.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/* 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_VIDEO_CHROMA_H__
|
||||
#define __SPA_VIDEO_CHROMA_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* spa_video_chroma_site:
|
||||
* @SPA_VIDEO_CHROMA_SITE_UNKNOWN: unknown cositing
|
||||
* @SPA_VIDEO_CHROMA_SITE_NONE: no cositing
|
||||
* @SPA_VIDEO_CHROMA_SITE_H_COSITED: chroma is horizontally cosited
|
||||
* @SPA_VIDEO_CHROMA_SITE_V_COSITED: chroma is vertically cosited
|
||||
* @SPA_VIDEO_CHROMA_SITE_ALT_LINE: choma samples are sited on alternate lines
|
||||
* @SPA_VIDEO_CHROMA_SITE_COSITED: chroma samples cosited with luma samples
|
||||
* @SPA_VIDEO_CHROMA_SITE_JPEG: jpeg style cositing, also for mpeg1 and mjpeg
|
||||
* @SPA_VIDEO_CHROMA_SITE_MPEG2: mpeg2 style cositing
|
||||
* @SPA_VIDEO_CHROMA_SITE_DV: DV style cositing
|
||||
*
|
||||
* Various Chroma sitings.
|
||||
*/
|
||||
enum spa_video_chroma_site {
|
||||
SPA_VIDEO_CHROMA_SITE_UNKNOWN = 0,
|
||||
SPA_VIDEO_CHROMA_SITE_NONE = (1 << 0),
|
||||
SPA_VIDEO_CHROMA_SITE_H_COSITED = (1 << 1),
|
||||
SPA_VIDEO_CHROMA_SITE_V_COSITED = (1 << 2),
|
||||
SPA_VIDEO_CHROMA_SITE_ALT_LINE = (1 << 3),
|
||||
/* some common chroma cositing */
|
||||
SPA_VIDEO_CHROMA_SITE_COSITED = (SPA_VIDEO_CHROMA_SITE_H_COSITED | SPA_VIDEO_CHROMA_SITE_V_COSITED),
|
||||
SPA_VIDEO_CHROMA_SITE_JPEG = (SPA_VIDEO_CHROMA_SITE_NONE),
|
||||
SPA_VIDEO_CHROMA_SITE_MPEG2 = (SPA_VIDEO_CHROMA_SITE_H_COSITED),
|
||||
SPA_VIDEO_CHROMA_SITE_DV = (SPA_VIDEO_CHROMA_SITE_COSITED | SPA_VIDEO_CHROMA_SITE_ALT_LINE),
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_VIDEO_CHROMA_H__ */
|
||||
157
spa/include/spa/param/video/color.h
Normal file
157
spa/include/spa/param/video/color.h
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
/* 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_VIDEO_COLOR_H__
|
||||
#define __SPA_VIDEO_COLOR_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* spa_video_color_range:
|
||||
* @SPA_VIDEO_COLOR_RANGE_UNKNOWN: unknown range
|
||||
* @SPA_VIDEO_COLOR_RANGE_0_255: [0..255] for 8 bit components
|
||||
* @SPA_VIDEO_COLOR_RANGE_16_235: [16..235] for 8 bit components. Chroma has
|
||||
* [16..240] range.
|
||||
*
|
||||
* Possible color range values. These constants are defined for 8 bit color
|
||||
* values and can be scaled for other bit depths.
|
||||
*/
|
||||
enum spa_video_color_range {
|
||||
SPA_VIDEO_COLOR_RANGE_UNKNOWN = 0,
|
||||
SPA_VIDEO_COLOR_RANGE_0_255,
|
||||
SPA_VIDEO_COLOR_RANGE_16_235
|
||||
};
|
||||
|
||||
/**
|
||||
* spa_video_color_matrix:
|
||||
* @SPA_VIDEO_COLOR_MATRIX_UNKNOWN: unknown matrix
|
||||
* @SPA_VIDEO_COLOR_MATRIX_RGB: identity matrix
|
||||
* @SPA_VIDEO_COLOR_MATRIX_FCC: FCC color matrix
|
||||
* @SPA_VIDEO_COLOR_MATRIX_BT709: ITU-R BT.709 color matrix
|
||||
* @SPA_VIDEO_COLOR_MATRIX_BT601: ITU-R BT.601 color matrix
|
||||
* @SPA_VIDEO_COLOR_MATRIX_SMPTE240M: SMPTE 240M color matrix
|
||||
* @SPA_VIDEO_COLOR_MATRIX_BT2020: ITU-R BT.2020 color matrix. Since: 1.6.
|
||||
*
|
||||
* The color matrix is used to convert between Y'PbPr and
|
||||
* non-linear RGB (R'G'B')
|
||||
*/
|
||||
enum spa_video_color_matrix {
|
||||
SPA_VIDEO_COLOR_MATRIX_UNKNOWN = 0,
|
||||
SPA_VIDEO_COLOR_MATRIX_RGB,
|
||||
SPA_VIDEO_COLOR_MATRIX_FCC,
|
||||
SPA_VIDEO_COLOR_MATRIX_BT709,
|
||||
SPA_VIDEO_COLOR_MATRIX_BT601,
|
||||
SPA_VIDEO_COLOR_MATRIX_SMPTE240M,
|
||||
SPA_VIDEO_COLOR_MATRIX_BT2020
|
||||
};
|
||||
|
||||
/**
|
||||
* spa_video_transfer_function:
|
||||
* @SPA_VIDEO_TRANSFER_UNKNOWN: unknown transfer function
|
||||
* @SPA_VIDEO_TRANSFER_GAMMA10: linear RGB, gamma 1.0 curve
|
||||
* @SPA_VIDEO_TRANSFER_GAMMA18: Gamma 1.8 curve
|
||||
* @SPA_VIDEO_TRANSFER_GAMMA20: Gamma 2.0 curve
|
||||
* @SPA_VIDEO_TRANSFER_GAMMA22: Gamma 2.2 curve
|
||||
* @SPA_VIDEO_TRANSFER_BT709: Gamma 2.2 curve with a linear segment in the lower
|
||||
* range
|
||||
* @SPA_VIDEO_TRANSFER_SMPTE240M: Gamma 2.2 curve with a linear segment in the
|
||||
* lower range
|
||||
* @SPA_VIDEO_TRANSFER_SRGB: Gamma 2.4 curve with a linear segment in the lower
|
||||
* range
|
||||
* @SPA_VIDEO_TRANSFER_GAMMA28: Gamma 2.8 curve
|
||||
* @SPA_VIDEO_TRANSFER_LOG100: Logarithmic transfer characteristic
|
||||
* 100:1 range
|
||||
* @SPA_VIDEO_TRANSFER_LOG316: Logarithmic transfer characteristic
|
||||
* 316.22777:1 range
|
||||
* @SPA_VIDEO_TRANSFER_BT2020_12: Gamma 2.2 curve with a linear segment in the lower
|
||||
* range. Used for BT.2020 with 12 bits per
|
||||
* component. Since: 1.6.
|
||||
* @SPA_VIDEO_TRANSFER_ADOBERGB: Gamma 2.19921875. Since: 1.8
|
||||
*
|
||||
* The video transfer function defines the formula for converting between
|
||||
* non-linear RGB (R'G'B') and linear RGB
|
||||
*/
|
||||
enum spa_video_transfer_function {
|
||||
SPA_VIDEO_TRANSFER_UNKNOWN = 0,
|
||||
SPA_VIDEO_TRANSFER_GAMMA10,
|
||||
SPA_VIDEO_TRANSFER_GAMMA18,
|
||||
SPA_VIDEO_TRANSFER_GAMMA20,
|
||||
SPA_VIDEO_TRANSFER_GAMMA22,
|
||||
SPA_VIDEO_TRANSFER_BT709,
|
||||
SPA_VIDEO_TRANSFER_SMPTE240M,
|
||||
SPA_VIDEO_TRANSFER_SRGB,
|
||||
SPA_VIDEO_TRANSFER_GAMMA28,
|
||||
SPA_VIDEO_TRANSFER_LOG100,
|
||||
SPA_VIDEO_TRANSFER_LOG316,
|
||||
SPA_VIDEO_TRANSFER_BT2020_12,
|
||||
SPA_VIDEO_TRANSFER_ADOBERGB
|
||||
};
|
||||
|
||||
/**
|
||||
* spa_video_color_primaries:
|
||||
* @SPA_VIDEO_COLOR_PRIMARIES_UNKNOWN: unknown color primaries
|
||||
* @SPA_VIDEO_COLOR_PRIMARIES_BT709: BT709 primaries
|
||||
* @SPA_VIDEO_COLOR_PRIMARIES_BT470M: BT470M primaries
|
||||
* @SPA_VIDEO_COLOR_PRIMARIES_BT470BG: BT470BG primaries
|
||||
* @SPA_VIDEO_COLOR_PRIMARIES_SMPTE170M: SMPTE170M primaries
|
||||
* @SPA_VIDEO_COLOR_PRIMARIES_SMPTE240M: SMPTE240M primaries
|
||||
* @SPA_VIDEO_COLOR_PRIMARIES_FILM: Generic film
|
||||
* @SPA_VIDEO_COLOR_PRIMARIES_BT2020: BT2020 primaries. Since: 1.6.
|
||||
* @SPA_VIDEO_COLOR_PRIMARIES_ADOBERGB: Adobe RGB primaries. Since: 1.8
|
||||
*
|
||||
* The color primaries define the how to transform linear RGB values to and from
|
||||
* the CIE XYZ colorspace.
|
||||
*/
|
||||
enum spa_video_color_primaries {
|
||||
SPA_VIDEO_COLOR_PRIMARIES_UNKNOWN = 0,
|
||||
SPA_VIDEO_COLOR_PRIMARIES_BT709,
|
||||
SPA_VIDEO_COLOR_PRIMARIES_BT470M,
|
||||
SPA_VIDEO_COLOR_PRIMARIES_BT470BG,
|
||||
SPA_VIDEO_COLOR_PRIMARIES_SMPTE170M,
|
||||
SPA_VIDEO_COLOR_PRIMARIES_SMPTE240M,
|
||||
SPA_VIDEO_COLOR_PRIMARIES_FILM,
|
||||
SPA_VIDEO_COLOR_PRIMARIES_BT2020,
|
||||
SPA_VIDEO_COLOR_PRIMARIES_ADOBERGB
|
||||
};
|
||||
|
||||
/**
|
||||
* spa_video_colorimetry:
|
||||
* @range: the color range. This is the valid range for the samples.
|
||||
* It is used to convert the samples to Y'PbPr values.
|
||||
* @matrix: the color matrix. Used to convert between Y'PbPr and
|
||||
* non-linear RGB (R'G'B')
|
||||
* @transfer: the transfer function. used to convert between R'G'B' and RGB
|
||||
* @primaries: color primaries. used to convert between R'G'B' and CIE XYZ
|
||||
*
|
||||
* Structure describing the color info.
|
||||
*/
|
||||
struct spa_video_colorimetry {
|
||||
enum spa_video_color_range range;
|
||||
enum spa_video_color_matrix matrix;
|
||||
enum spa_video_transfer_function transfer;
|
||||
enum spa_video_color_primaries primaries;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_VIDEO_COLOR_H__ */
|
||||
64
spa/include/spa/param/video/encoded.h
Normal file
64
spa/include/spa/param/video/encoded.h
Normal 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_VIDEO_ENCODED_H__
|
||||
#define __SPA_VIDEO_ENCODED_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct spa_video_info_h264;
|
||||
struct spa_video_info_mjpg;
|
||||
|
||||
#include <spa/param/format.h>
|
||||
#include <spa/param/video/format.h>
|
||||
|
||||
enum spa_h264_stream_format {
|
||||
SPA_H264_STREAM_FORMAT_UNKNOWN = 0,
|
||||
SPA_H264_STREAM_FORMAT_AVC,
|
||||
SPA_H264_STREAM_FORMAT_AVC3,
|
||||
SPA_H264_STREAM_FORMAT_BYTESTREAM
|
||||
};
|
||||
|
||||
enum spa_h264_alignment {
|
||||
SPA_H264_ALIGNMENT_UNKNOWN = 0,
|
||||
SPA_H264_ALIGNMENT_AU,
|
||||
SPA_H264_ALIGNMENT_NAL
|
||||
};
|
||||
|
||||
struct spa_video_info_h264 {
|
||||
struct spa_rectangle size;
|
||||
struct spa_fraction framerate;
|
||||
struct spa_fraction max_framerate;
|
||||
enum spa_h264_stream_format stream_format;
|
||||
enum spa_h264_alignment alignment;
|
||||
};
|
||||
|
||||
struct spa_video_info_mjpg {
|
||||
struct spa_rectangle size;
|
||||
struct spa_fraction framerate;
|
||||
struct spa_fraction max_framerate;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_VIDEO_ENCODED_H__ */
|
||||
131
spa/include/spa/param/video/format-utils.h
Normal file
131
spa/include/spa/param/video/format-utils.h
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
/* 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_FORMAT_UTILS_H__
|
||||
#define __SPA_PARAM_VIDEO_FORMAT_UTILS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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;
|
||||
uint32_t size;
|
||||
uint32_t framerate;
|
||||
uint32_t max_framerate;
|
||||
uint32_t views;
|
||||
uint32_t interlace_mode;
|
||||
uint32_t pixel_aspect_ratio;
|
||||
uint32_t multiview_mode;
|
||||
uint32_t multiview_flags;
|
||||
uint32_t chroma_site;
|
||||
uint32_t color_range;
|
||||
uint32_t color_matrix;
|
||||
uint32_t transfer_function;
|
||||
uint32_t color_primaries;
|
||||
uint32_t profile;
|
||||
uint32_t level;
|
||||
uint32_t stream_format;
|
||||
uint32_t alignment;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_format_video_map(struct spa_type_map *map, struct spa_type_format_video *type)
|
||||
{
|
||||
if (type->format == 0) {
|
||||
type->format = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__format);
|
||||
type->size = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__size);
|
||||
type->framerate = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__framerate);
|
||||
type->max_framerate = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__maxFramerate);
|
||||
type->views = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__views);
|
||||
type->interlace_mode = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__interlaceMode);
|
||||
type->pixel_aspect_ratio = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__pixelAspectRatio);
|
||||
type->multiview_mode = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__multiviewMode);
|
||||
type->multiview_flags = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__multiviewFlags);
|
||||
type->chroma_site = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__chromaSite);
|
||||
type->color_range = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__colorRange);
|
||||
type->color_matrix = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__colorMatrix);
|
||||
type->transfer_function = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__transferFunction);
|
||||
type->color_primaries = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__colorPrimaries);
|
||||
type->profile = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__profile);
|
||||
type->level = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__level);
|
||||
type->stream_format = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__streamFormat);
|
||||
type->alignment = spa_type_map_get_id(map, SPA_TYPE_FORMAT_VIDEO__alignment);
|
||||
}
|
||||
}
|
||||
|
||||
static inline int
|
||||
spa_format_video_raw_parse(const struct spa_pod_object *format,
|
||||
struct spa_video_info_raw *info, struct spa_type_format_video *type)
|
||||
{
|
||||
struct spa_pod_parser prs;
|
||||
spa_pod_parser_pod(&prs, &format->pod);
|
||||
return spa_pod_parser_get(&prs,
|
||||
":",type->format, "I", &info->format,
|
||||
":",type->size, "R", &info->size,
|
||||
":",type->framerate, "F", &info->framerate,
|
||||
":",type->max_framerate, "?F", &info->max_framerate,
|
||||
":",type->views, "?i", &info->views,
|
||||
":",type->interlace_mode, "?i", &info->interlace_mode,
|
||||
":",type->pixel_aspect_ratio, "?F", &info->pixel_aspect_ratio,
|
||||
":",type->multiview_mode, "?i", &info->multiview_mode,
|
||||
":",type->multiview_flags, "?i", &info->multiview_flags,
|
||||
":",type->chroma_site, "?i", &info->chroma_site,
|
||||
":",type->color_range, "?i", &info->color_range,
|
||||
":",type->color_matrix, "?i", &info->color_matrix,
|
||||
":",type->transfer_function, "?i", &info->transfer_function,
|
||||
":",type->color_primaries, "?i", &info->color_primaries, NULL);
|
||||
}
|
||||
|
||||
static inline int
|
||||
spa_format_video_h264_parse(const struct spa_pod_object *format,
|
||||
struct spa_video_info_h264 *info, struct spa_type_format_video *type)
|
||||
{
|
||||
struct spa_pod_parser prs;
|
||||
spa_pod_parser_pod(&prs, &format->pod);
|
||||
return spa_pod_parser_get(&prs,
|
||||
":",type->size, "?R", &info->size,
|
||||
":",type->framerate, "?F", &info->framerate,
|
||||
":",type->max_framerate, "?F", &info->max_framerate,
|
||||
":",type->stream_format, "?i", &info->stream_format,
|
||||
":",type->alignment, "?i", &info->alignment, NULL);
|
||||
}
|
||||
|
||||
static inline int
|
||||
spa_format_video_mjpg_parse(const struct spa_pod_object *format,
|
||||
struct spa_video_info_mjpg *info, struct spa_type_format_video *type)
|
||||
{
|
||||
struct spa_pod_parser prs;
|
||||
spa_pod_parser_pod(&prs, &format->pod);
|
||||
return spa_pod_parser_get(&prs,
|
||||
":",type->size, "?R", &info->size,
|
||||
":",type->framerate, "?F", &info->framerate,
|
||||
":",type->max_framerate, "?F", &info->max_framerate, NULL);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_VIDEO_FORMAT_UTILS */
|
||||
67
spa/include/spa/param/video/format.h
Normal file
67
spa/include/spa/param/video/format.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
/* 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_FORMAT_H__
|
||||
#define __SPA_PARAM_VIDEO_FORMAT_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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 ":"
|
||||
|
||||
#define SPA_TYPE_FORMAT_VIDEO__format SPA_TYPE_FORMAT_VIDEO_BASE "format"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__size SPA_TYPE_FORMAT_VIDEO_BASE "size"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__framerate SPA_TYPE_FORMAT_VIDEO_BASE "framerate"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__maxFramerate SPA_TYPE_FORMAT_VIDEO_BASE "max-framerate"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__views SPA_TYPE_FORMAT_VIDEO_BASE "views"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__interlaceMode SPA_TYPE_FORMAT_VIDEO_BASE "interlace-mode"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__pixelAspectRatio SPA_TYPE_FORMAT_VIDEO_BASE "pixel-aspect-ratio"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__multiviewMode SPA_TYPE_FORMAT_VIDEO_BASE "multiview-mode"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__multiviewFlags SPA_TYPE_FORMAT_VIDEO_BASE "multiview-flags"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__chromaSite SPA_TYPE_FORMAT_VIDEO_BASE "chroma-site"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__colorRange SPA_TYPE_FORMAT_VIDEO_BASE "color-range"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__colorMatrix SPA_TYPE_FORMAT_VIDEO_BASE "color-matrix"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__transferFunction SPA_TYPE_FORMAT_VIDEO_BASE "transfer-function"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__colorPrimaries SPA_TYPE_FORMAT_VIDEO_BASE "color-primaries"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__profile SPA_TYPE_FORMAT_VIDEO_BASE "profile"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__level SPA_TYPE_FORMAT_VIDEO_BASE "level"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__streamFormat SPA_TYPE_FORMAT_VIDEO_BASE "stream-format"
|
||||
#define SPA_TYPE_FORMAT_VIDEO__alignment SPA_TYPE_FORMAT_VIDEO_BASE "alignment"
|
||||
|
||||
struct spa_video_info {
|
||||
uint32_t media_type;
|
||||
uint32_t media_subtype;
|
||||
union {
|
||||
struct spa_video_info_raw raw;
|
||||
struct spa_video_info_h264 h264;
|
||||
struct spa_video_info_mjpg mjpg;
|
||||
} info;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_PARAM_VIDEO_FORMAT */
|
||||
135
spa/include/spa/param/video/multiview.h
Normal file
135
spa/include/spa/param/video/multiview.h
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
/* 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_VIDEO_MULTIVIEW_H__
|
||||
#define __SPA_VIDEO_MULTIVIEW_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* spa_video_multiview_mode:
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_NONE: A special value indicating
|
||||
* no multiview information. Used in spa_video_info and other places to
|
||||
* indicate that no specific multiview handling has been requested or
|
||||
* provided. This value is never carried on caps.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_MONO: All frames are monoscopic.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_LEFT: All frames represent a left-eye view.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_RIGHT: All frames represent a right-eye view.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE: Left and right eye views are
|
||||
* provided in the left and right half of the frame respectively.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE_QUINCUNX: Left and right eye
|
||||
* views are provided in the left and right half of the frame, but
|
||||
* have been sampled using quincunx method, with half-pixel offset
|
||||
* between the 2 views.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_COLUMN_INTERLEAVED: Alternating vertical
|
||||
* columns of pixels represent the left and right eye view respectively.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_ROW_INTERLEAVED: Alternating horizontal
|
||||
* rows of pixels represent the left and right eye view respectively.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_TOP_BOTTOM: The top half of the frame
|
||||
* contains the left eye, and the bottom half the right eye.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_CHECKERBOARD: Pixels are arranged with
|
||||
* alternating pixels representing left and right eye views in a
|
||||
* checkerboard fashion.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME: Left and right eye views
|
||||
* are provided in separate frames alternately.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_MULTIVIEW_FRAME_BY_FRAME: Multiple
|
||||
* independent views are provided in separate frames in sequence.
|
||||
* This method only applies to raw video buffers at the moment.
|
||||
* Specific view identification is via the #spa_video_multiview_meta
|
||||
* on raw video buffers.
|
||||
* @SPA_VIDEO_MULTIVIEW_MODE_SEPARATED: Multiple views are
|
||||
* provided as separate #spa_data framebuffers attached to each
|
||||
* #spa_buffer, described by the #spa_video_multiview_meta
|
||||
*
|
||||
* All possible stereoscopic 3D and multiview representations.
|
||||
* In conjunction with #soa_video_multiview_flags, describes how
|
||||
* multiview content is being transported in the stream.
|
||||
*/
|
||||
enum spa_video_multiview_mode {
|
||||
SPA_VIDEO_MULTIVIEW_MODE_NONE = -1,
|
||||
SPA_VIDEO_MULTIVIEW_MODE_MONO = 0,
|
||||
/* Single view modes */
|
||||
SPA_VIDEO_MULTIVIEW_MODE_LEFT,
|
||||
SPA_VIDEO_MULTIVIEW_MODE_RIGHT,
|
||||
/* Stereo view modes */
|
||||
SPA_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE,
|
||||
SPA_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE_QUINCUNX,
|
||||
SPA_VIDEO_MULTIVIEW_MODE_COLUMN_INTERLEAVED,
|
||||
SPA_VIDEO_MULTIVIEW_MODE_ROW_INTERLEAVED,
|
||||
SPA_VIDEO_MULTIVIEW_MODE_TOP_BOTTOM,
|
||||
SPA_VIDEO_MULTIVIEW_MODE_CHECKERBOARD,
|
||||
/* Padding for new frame packing modes */
|
||||
|
||||
SPA_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME = 32,
|
||||
/* Multivew mode(s) */
|
||||
SPA_VIDEO_MULTIVIEW_MODE_MULTIVIEW_FRAME_BY_FRAME,
|
||||
SPA_VIDEO_MULTIVIEW_MODE_SEPARATED
|
||||
/* future expansion for annotated modes */
|
||||
};
|
||||
|
||||
/**
|
||||
* spa_video_multiview_flags:
|
||||
* @SPA_VIDEO_MULTIVIEW_FLAGS_NONE: No flags
|
||||
* @SPA_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST: For stereo streams, the
|
||||
* normal arrangement of left and right views is reversed.
|
||||
* @SPA_VIDEO_MULTIVIEW_FLAGS_LEFT_FLIPPED: The left view is vertically
|
||||
* mirrored.
|
||||
* @SPA_VIDEO_MULTIVIEW_FLAGS_LEFT_FLOPPED: The left view is horizontally
|
||||
* mirrored.
|
||||
* @SPA_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLIPPED: The right view is
|
||||
* vertically mirrored.
|
||||
* @SPA_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLOPPED: The right view is
|
||||
* horizontally mirrored.
|
||||
* @SPA_VIDEO_MULTIVIEW_FLAGS_HALF_ASPECT: For frame-packed
|
||||
* multiview modes, indicates that the individual
|
||||
* views have been encoded with half the true width or height
|
||||
* and should be scaled back up for display. This flag
|
||||
* is used for overriding input layout interpretation
|
||||
* by adjusting pixel-aspect-ratio.
|
||||
* For side-by-side, column interleaved or checkerboard packings, the
|
||||
* pixel width will be doubled. For row interleaved and top-bottom
|
||||
* encodings, pixel height will be doubled.
|
||||
* @SPA_VIDEO_MULTIVIEW_FLAGS_MIXED_MONO: The video stream contains both
|
||||
* mono and multiview portions, signalled on each buffer by the
|
||||
* absence or presence of the @SPA_VIDEO_BUFFER_FLAG_MULTIPLE_VIEW
|
||||
* buffer flag.
|
||||
*
|
||||
* spa_video_multiview_flags are used to indicate extra properties of a
|
||||
* stereo/multiview stream beyond the frame layout and buffer mapping
|
||||
* that is conveyed in the #spa_video_multiview_mode.
|
||||
*/
|
||||
enum spa_video_multiview_flags {
|
||||
SPA_VIDEO_MULTIVIEW_FLAGS_NONE = 0,
|
||||
SPA_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST = (1 << 0),
|
||||
SPA_VIDEO_MULTIVIEW_FLAGS_LEFT_FLIPPED = (1 << 1),
|
||||
SPA_VIDEO_MULTIVIEW_FLAGS_LEFT_FLOPPED = (1 << 2),
|
||||
SPA_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLIPPED = (1 << 3),
|
||||
SPA_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLOPPED = (1 << 4),
|
||||
SPA_VIDEO_MULTIVIEW_FLAGS_HALF_ASPECT = (1 << 14),
|
||||
SPA_VIDEO_MULTIVIEW_FLAGS_MIXED_MONO = (1 << 15)
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_VIDEO_MULTIVIEW_H__ */
|
||||
200
spa/include/spa/param/video/raw-utils.h
Normal file
200
spa/include/spa/param/video/raw-utils.h
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
/* 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_VIDEO_RAW_UTILS_H__
|
||||
#define __SPA_VIDEO_RAW_UTILS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <spa/support/type-map.h>
|
||||
#include <spa/param/video/raw.h>
|
||||
|
||||
struct spa_type_video_format {
|
||||
uint32_t UNKNOWN;
|
||||
uint32_t ENCODED;
|
||||
uint32_t I420;
|
||||
uint32_t YV12;
|
||||
uint32_t YUY2;
|
||||
uint32_t UYVY;
|
||||
uint32_t AYUV;
|
||||
uint32_t RGBx;
|
||||
uint32_t BGRx;
|
||||
uint32_t xRGB;
|
||||
uint32_t xBGR;
|
||||
uint32_t RGBA;
|
||||
uint32_t BGRA;
|
||||
uint32_t ARGB;
|
||||
uint32_t ABGR;
|
||||
uint32_t RGB;
|
||||
uint32_t BGR;
|
||||
uint32_t Y41B;
|
||||
uint32_t Y42B;
|
||||
uint32_t YVYU;
|
||||
uint32_t Y444;
|
||||
uint32_t v210;
|
||||
uint32_t v216;
|
||||
uint32_t NV12;
|
||||
uint32_t NV21;
|
||||
uint32_t GRAY8;
|
||||
uint32_t GRAY16_BE;
|
||||
uint32_t GRAY16_LE;
|
||||
uint32_t v308;
|
||||
uint32_t RGB16;
|
||||
uint32_t BGR16;
|
||||
uint32_t RGB15;
|
||||
uint32_t BGR15;
|
||||
uint32_t UYVP;
|
||||
uint32_t A420;
|
||||
uint32_t RGB8P;
|
||||
uint32_t YUV9;
|
||||
uint32_t YVU9;
|
||||
uint32_t IYU1;
|
||||
uint32_t ARGB64;
|
||||
uint32_t AYUV64;
|
||||
uint32_t r210;
|
||||
uint32_t I420_10BE;
|
||||
uint32_t I420_10LE;
|
||||
uint32_t I422_10BE;
|
||||
uint32_t I422_10LE;
|
||||
uint32_t Y444_10BE;
|
||||
uint32_t Y444_10LE;
|
||||
uint32_t GBR;
|
||||
uint32_t GBR_10BE;
|
||||
uint32_t GBR_10LE;
|
||||
uint32_t NV16;
|
||||
uint32_t NV24;
|
||||
uint32_t NV12_64Z32;
|
||||
uint32_t A420_10BE;
|
||||
uint32_t A420_10LE;
|
||||
uint32_t A422_10BE;
|
||||
uint32_t A422_10LE;
|
||||
uint32_t A444_10BE;
|
||||
uint32_t A444_10LE;
|
||||
uint32_t NV61;
|
||||
uint32_t P010_10BE;
|
||||
uint32_t P010_10LE;
|
||||
uint32_t IYU2;
|
||||
uint32_t VYUY;
|
||||
uint32_t GBRA;
|
||||
uint32_t GBRA_10BE;
|
||||
uint32_t GBRA_10LE;
|
||||
uint32_t GBR_12BE;
|
||||
uint32_t GBR_12LE;
|
||||
uint32_t GBRA_12BE;
|
||||
uint32_t GBRA_12LE;
|
||||
uint32_t I420_12BE;
|
||||
uint32_t I420_12LE;
|
||||
uint32_t I422_12BE;
|
||||
uint32_t I422_12LE;
|
||||
uint32_t Y444_12BE;
|
||||
uint32_t Y444_12LE;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_video_format_map(struct spa_type_map *map, struct spa_type_video_format *type)
|
||||
{
|
||||
if (type->ENCODED == 0) {
|
||||
type->UNKNOWN = 0;
|
||||
type->ENCODED = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__ENCODED);
|
||||
type->I420 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__I420);
|
||||
type->YV12 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__YV12);
|
||||
type->YUY2 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__YUY2);
|
||||
type->UYVY = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__UYVY);
|
||||
type->AYUV = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__AYUV);
|
||||
type->RGBx = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__RGBx);
|
||||
type->BGRx = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__BGRx);
|
||||
type->xRGB = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__xRGB);
|
||||
type->xBGR = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__xBGR);
|
||||
type->RGBA = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__RGBA);
|
||||
type->BGRA = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__BGRA);
|
||||
type->ARGB = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__ARGB);
|
||||
type->ABGR = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__ABGR);
|
||||
type->RGB = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__RGB);
|
||||
type->BGR = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__BGR);
|
||||
type->Y41B = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__Y41B);
|
||||
type->Y42B = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__Y42B);
|
||||
type->YVYU = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__YVYU);
|
||||
type->Y444 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__Y444);
|
||||
type->v210 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__v210);
|
||||
type->v216 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__v216);
|
||||
type->NV12 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__NV12);
|
||||
type->NV21 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__NV21);
|
||||
type->GRAY8 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GRAY8);
|
||||
type->GRAY16_BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GRAY16_BE);
|
||||
type->GRAY16_LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GRAY16_LE);
|
||||
type->v308 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__v308);
|
||||
type->RGB16 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__RGB16);
|
||||
type->BGR16 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__BGR16);
|
||||
type->RGB15 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__RGB15);
|
||||
type->BGR15 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__BGR15);
|
||||
type->UYVP = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__UYVP);
|
||||
type->A420 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__A420);
|
||||
type->RGB8P = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__RGB8P);
|
||||
type->YUV9 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__YUV9);
|
||||
type->YVU9 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__YVU9);
|
||||
type->IYU1 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__IYU1);
|
||||
type->ARGB64 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__ARGB64);
|
||||
type->AYUV64 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__AYUV64);
|
||||
type->r210 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__r210);
|
||||
type->I420_10BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__I420_10BE);
|
||||
type->I420_10LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__I420_10LE);
|
||||
type->I422_10BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__I422_10BE);
|
||||
type->I422_10LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__I422_10LE);
|
||||
type->Y444_10BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__Y444_10BE);
|
||||
type->Y444_10LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__Y444_10LE);
|
||||
type->GBR = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GBR);
|
||||
type->GBR_10BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GBR_10BE);
|
||||
type->GBR_10LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GBR_10LE);
|
||||
type->NV16 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__NV16);
|
||||
type->NV24 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__NV24);
|
||||
type->NV12_64Z32 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__NV12_64Z32);
|
||||
type->A420_10BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__A420_10BE);
|
||||
type->A420_10LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__A420_10LE);
|
||||
type->A422_10BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__A422_10BE);
|
||||
type->A422_10LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__A422_10LE);
|
||||
type->A444_10BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__A444_10BE);
|
||||
type->A444_10LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__A444_10LE);
|
||||
type->NV61 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__NV61);
|
||||
type->P010_10BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__P010_10BE);
|
||||
type->P010_10LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__P010_10LE);
|
||||
type->IYU2 = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__IYU2);
|
||||
type->VYUY = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__VYUY);
|
||||
type->GBRA = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GBRA);
|
||||
type->GBRA_10BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GBRA_10BE);
|
||||
type->GBRA_10LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GBRA_10LE);
|
||||
type->GBR_12BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GBR_12BE);
|
||||
type->GBR_12LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GBR_12LE);
|
||||
type->GBRA_12BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GBRA_12BE);
|
||||
type->GBRA_12LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__GBRA_12LE);
|
||||
type->I420_12BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__I420_12BE);
|
||||
type->I420_12LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__I420_12LE);
|
||||
type->I422_12BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__I422_12BE);
|
||||
type->I422_12LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__I422_12LE);
|
||||
type->Y444_12BE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__Y444_12BE);
|
||||
type->Y444_12LE = spa_type_map_get_id(map, SPA_TYPE_VIDEO_FORMAT__Y444_12LE);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_VIDEO_RAW_UTILS_H__ */
|
||||
197
spa/include/spa/param/video/raw.h
Normal file
197
spa/include/spa/param/video/raw.h
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
/* 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_VIDEO_RAW_H__
|
||||
#define __SPA_VIDEO_RAW_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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
|
||||
|
||||
#define SPA_TYPE__VideoFormat SPA_TYPE_ENUM_BASE "VideoFormat"
|
||||
#define SPA_TYPE_VIDEO_FORMAT_BASE SPA_TYPE__VideoFormat ":"
|
||||
|
||||
#define SPA_TYPE_VIDEO_FORMAT__ENCODED SPA_TYPE_VIDEO_FORMAT_BASE "encoded"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__I420 SPA_TYPE_VIDEO_FORMAT_BASE "I420"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__YV12 SPA_TYPE_VIDEO_FORMAT_BASE "YV12"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__YUY2 SPA_TYPE_VIDEO_FORMAT_BASE "YUY2"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__UYVY SPA_TYPE_VIDEO_FORMAT_BASE "UYVY"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__AYUV SPA_TYPE_VIDEO_FORMAT_BASE "AYUV"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__RGBx SPA_TYPE_VIDEO_FORMAT_BASE "RGBx"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__BGRx SPA_TYPE_VIDEO_FORMAT_BASE "BGRx"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__xRGB SPA_TYPE_VIDEO_FORMAT_BASE "xRGB"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__xBGR SPA_TYPE_VIDEO_FORMAT_BASE "xBGR"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__RGBA SPA_TYPE_VIDEO_FORMAT_BASE "RGBA"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__BGRA SPA_TYPE_VIDEO_FORMAT_BASE "BGRA"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__ARGB SPA_TYPE_VIDEO_FORMAT_BASE "ARGB"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__ABGR SPA_TYPE_VIDEO_FORMAT_BASE "ABGR"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__RGB SPA_TYPE_VIDEO_FORMAT_BASE "RGB"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__BGR SPA_TYPE_VIDEO_FORMAT_BASE "BGR"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__Y41B SPA_TYPE_VIDEO_FORMAT_BASE "Y41B"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__Y42B SPA_TYPE_VIDEO_FORMAT_BASE "Y42B"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__YVYU SPA_TYPE_VIDEO_FORMAT_BASE "YVYU"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__Y444 SPA_TYPE_VIDEO_FORMAT_BASE "Y444"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__v210 SPA_TYPE_VIDEO_FORMAT_BASE "v210"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__v216 SPA_TYPE_VIDEO_FORMAT_BASE "v216"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__NV12 SPA_TYPE_VIDEO_FORMAT_BASE "NV12"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__NV21 SPA_TYPE_VIDEO_FORMAT_BASE "NV21"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GRAY8 SPA_TYPE_VIDEO_FORMAT_BASE "GRAY8"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GRAY16_BE SPA_TYPE_VIDEO_FORMAT_BASE "GRAY16_BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GRAY16_LE SPA_TYPE_VIDEO_FORMAT_BASE "GRAY16_LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__v308 SPA_TYPE_VIDEO_FORMAT_BASE "v308"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__RGB16 SPA_TYPE_VIDEO_FORMAT_BASE "RGB16"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__BGR16 SPA_TYPE_VIDEO_FORMAT_BASE "BGR16"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__RGB15 SPA_TYPE_VIDEO_FORMAT_BASE "RGB15"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__BGR15 SPA_TYPE_VIDEO_FORMAT_BASE "BGR15"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__UYVP SPA_TYPE_VIDEO_FORMAT_BASE "UYVP"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__A420 SPA_TYPE_VIDEO_FORMAT_BASE "A420"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__RGB8P SPA_TYPE_VIDEO_FORMAT_BASE "RGB8P"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__YUV9 SPA_TYPE_VIDEO_FORMAT_BASE "YUV9"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__YVU9 SPA_TYPE_VIDEO_FORMAT_BASE "YVU9"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__IYU1 SPA_TYPE_VIDEO_FORMAT_BASE "IYU1"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__ARGB64 SPA_TYPE_VIDEO_FORMAT_BASE "ARGB64"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__AYUV64 SPA_TYPE_VIDEO_FORMAT_BASE "AYUV64"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__r210 SPA_TYPE_VIDEO_FORMAT_BASE "r210"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__I420_10BE SPA_TYPE_VIDEO_FORMAT_BASE "I420_10BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__I420_10LE SPA_TYPE_VIDEO_FORMAT_BASE "I420_10LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__I422_10BE SPA_TYPE_VIDEO_FORMAT_BASE "I422_10BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__I422_10LE SPA_TYPE_VIDEO_FORMAT_BASE "I422_10LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__Y444_10BE SPA_TYPE_VIDEO_FORMAT_BASE "Y444_10BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__Y444_10LE SPA_TYPE_VIDEO_FORMAT_BASE "Y444_10LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GBR SPA_TYPE_VIDEO_FORMAT_BASE "GBR"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GBR_10BE SPA_TYPE_VIDEO_FORMAT_BASE "GBR_10BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GBR_10LE SPA_TYPE_VIDEO_FORMAT_BASE "GBR_10LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__NV16 SPA_TYPE_VIDEO_FORMAT_BASE "NV16"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__NV24 SPA_TYPE_VIDEO_FORMAT_BASE "NV24"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__NV12_64Z32 SPA_TYPE_VIDEO_FORMAT_BASE "NV12_64Z32"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__A420_10BE SPA_TYPE_VIDEO_FORMAT_BASE "A420_10BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__A420_10LE SPA_TYPE_VIDEO_FORMAT_BASE "A420_10LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__A422_10BE SPA_TYPE_VIDEO_FORMAT_BASE "A422_10BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__A422_10LE SPA_TYPE_VIDEO_FORMAT_BASE "A422_10LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__A444_10BE SPA_TYPE_VIDEO_FORMAT_BASE "A444_10BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__A444_10LE SPA_TYPE_VIDEO_FORMAT_BASE "A444_10LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__NV61 SPA_TYPE_VIDEO_FORMAT_BASE "NV61"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__P010_10BE SPA_TYPE_VIDEO_FORMAT_BASE "P010_10BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__P010_10LE SPA_TYPE_VIDEO_FORMAT_BASE "P010_10LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__IYU2 SPA_TYPE_VIDEO_FORMAT_BASE "IYU2"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__VYUY SPA_TYPE_VIDEO_FORMAT_BASE "VYUY"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GBRA SPA_TYPE_VIDEO_FORMAT_BASE "GBRA"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GBRA_10BE SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_10BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GBRA_10LE SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_10LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GBR_12BE SPA_TYPE_VIDEO_FORMAT_BASE "GBR_12BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GBR_12LE SPA_TYPE_VIDEO_FORMAT_BASE "GBR_12LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GBRA_12BE SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_12BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__GBRA_12LE SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_12LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__I420_12BE SPA_TYPE_VIDEO_FORMAT_BASE "I420_12BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__I420_12LE SPA_TYPE_VIDEO_FORMAT_BASE "I420_12LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__I422_12BE SPA_TYPE_VIDEO_FORMAT_BASE "I422_12BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__I422_12LE SPA_TYPE_VIDEO_FORMAT_BASE "I422_12LE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__Y444_12BE SPA_TYPE_VIDEO_FORMAT_BASE "Y444_12BE"
|
||||
#define SPA_TYPE_VIDEO_FORMAT__Y444_12LE SPA_TYPE_VIDEO_FORMAT_BASE "Y444_12LE"
|
||||
|
||||
/**
|
||||
* spa_video_flags:
|
||||
* @SPA_VIDEO_FLAG_NONE: no flags
|
||||
* @SPA_VIDEO_FLAG_VARIABLE_FPS: a variable fps is selected, fps_n and fps_d
|
||||
* denote the maximum fps of the video
|
||||
* @SPA_VIDEO_FLAG_PREMULTIPLIED_ALPHA: Each color has been scaled by the alpha
|
||||
* value.
|
||||
*
|
||||
* Extra video flags
|
||||
*/
|
||||
enum spa_video_flags {
|
||||
SPA_VIDEO_FLAG_NONE = 0,
|
||||
SPA_VIDEO_FLAG_VARIABLE_FPS = (1 << 0),
|
||||
SPA_VIDEO_FLAG_PREMULTIPLIED_ALPHA = (1 << 1)
|
||||
};
|
||||
|
||||
/**
|
||||
* spa_video_interlace_mode:
|
||||
* @SPA_VIDEO_INTERLACE_MODE_PROGRESSIVE: all frames are progressive
|
||||
* @SPA_VIDEO_INTERLACE_MODE_INTERLEAVED: 2 fields are interleaved in one video
|
||||
* frame. Extra buffer flags describe the field order.
|
||||
* @SPA_VIDEO_INTERLACE_MODE_MIXED: frames contains both interlaced and
|
||||
* progressive video, the buffer flags describe the frame and fields.
|
||||
* @SPA_VIDEO_INTERLACE_MODE_FIELDS: 2 fields are stored in one buffer, use the
|
||||
* frame ID to get access to the required field. For multiview (the
|
||||
* 'views' property > 1) the fields of view N can be found at frame ID
|
||||
* (N * 2) and (N * 2) + 1.
|
||||
* Each field has only half the amount of lines as noted in the
|
||||
* height property. This mode requires multiple spa_data
|
||||
* to describe the fields.
|
||||
*
|
||||
* The possible values of the #spa_video_interlace_mode describing the interlace
|
||||
* mode of the stream.
|
||||
*/
|
||||
enum spa_video_interlace_mode {
|
||||
SPA_VIDEO_INTERLACE_MODE_PROGRESSIVE = 0,
|
||||
SPA_VIDEO_INTERLACE_MODE_INTERLEAVED,
|
||||
SPA_VIDEO_INTERLACE_MODE_MIXED,
|
||||
SPA_VIDEO_INTERLACE_MODE_FIELDS
|
||||
};
|
||||
|
||||
/**
|
||||
* spa_video_info_raw:
|
||||
* @format: the format
|
||||
* @size: the frame size of the video
|
||||
* @framerate: the framerate of the video 0/1 means variable rate
|
||||
* @max_framerate: the maximum framerate of the video. This is only valid when
|
||||
* @framerate is 0/1
|
||||
* @views: the number of views in this video
|
||||
* @interlace_mode: the interlace mode
|
||||
* @pixel_aspect_ratio: The pixel aspect ratio
|
||||
* @multiview_mode: multiview mode
|
||||
* @multiview_flags: multiview flags
|
||||
* @chroma_site: the chroma siting
|
||||
* @color_range: the color range. This is the valid range for the samples.
|
||||
* It is used to convert the samples to Y'PbPr values.
|
||||
* @color_matrix: the color matrix. Used to convert between Y'PbPr and
|
||||
* non-linear RGB (R'G'B')
|
||||
* @transfer_function: the transfer function. used to convert between R'G'B' and RGB
|
||||
* @color_primaries: color primaries. used to convert between R'G'B' and CIE XYZ
|
||||
*/
|
||||
struct spa_video_info_raw {
|
||||
uint32_t format;
|
||||
struct spa_rectangle size;
|
||||
struct spa_fraction framerate;
|
||||
struct spa_fraction max_framerate;
|
||||
uint32_t views;
|
||||
enum spa_video_interlace_mode interlace_mode;
|
||||
struct spa_fraction pixel_aspect_ratio;
|
||||
enum spa_video_multiview_mode multiview_mode;
|
||||
enum spa_video_multiview_flags multiview_flags;
|
||||
enum spa_video_chroma_site chroma_site;
|
||||
enum spa_video_color_range color_range;
|
||||
enum spa_video_color_matrix color_matrix;
|
||||
enum spa_video_transfer_function transfer_function;
|
||||
enum spa_video_color_primaries color_primaries;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __SPA_VIDEO_RAW_H__ */
|
||||
Loading…
Add table
Add a link
Reference in a new issue