mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-01-01 11:08:43 -05:00
spa: don't use typedef for struct and enum
This commit is contained in:
parent
83964cec87
commit
11f23a3ffa
163 changed files with 6510 additions and 8264 deletions
|
|
@ -28,17 +28,17 @@ extern "C" {
|
|||
#include <spa/audio/format.h>
|
||||
#include <spa/audio/raw-utils.h>
|
||||
|
||||
typedef struct {
|
||||
struct spa_type_format_audio {
|
||||
uint32_t format;
|
||||
uint32_t flags;
|
||||
uint32_t layout;
|
||||
uint32_t rate;
|
||||
uint32_t channels;
|
||||
uint32_t channel_mask;
|
||||
} SpaTypeFormatAudio;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_format_audio_map (SpaTypeMap *map, SpaTypeFormatAudio *type)
|
||||
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);
|
||||
|
|
@ -51,9 +51,9 @@ spa_type_format_audio_map (SpaTypeMap *map, SpaTypeFormatAudio *type)
|
|||
}
|
||||
|
||||
static inline bool
|
||||
spa_format_audio_raw_parse (const SpaFormat *format,
|
||||
SpaAudioInfoRaw *info,
|
||||
SpaTypeFormatAudio *type)
|
||||
spa_format_audio_raw_parse (const struct spa_format *format,
|
||||
struct spa_audio_info_raw *info,
|
||||
struct spa_type_format_audio *type)
|
||||
{
|
||||
spa_format_query (format,
|
||||
type->format, SPA_POD_TYPE_ID, &info->format,
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ extern "C" {
|
|||
#include <spa/format.h>
|
||||
#include <spa/audio/raw.h>
|
||||
|
||||
typedef struct _SpaAudioInfo SpaAudioInfo;
|
||||
|
||||
#define SPA_TYPE_FORMAT__Audio SPA_TYPE_FORMAT_BASE "Audio"
|
||||
#define SPA_TYPE_FORMAT_AUDIO_BASE SPA_TYPE_FORMAT__Audio ":"
|
||||
|
||||
|
|
@ -39,11 +37,11 @@ typedef struct _SpaAudioInfo SpaAudioInfo;
|
|||
#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 _SpaAudioInfo {
|
||||
struct spa_audio_info {
|
||||
uint32_t media_type;
|
||||
uint32_t media_subtype;
|
||||
union {
|
||||
SpaAudioInfoRaw raw;
|
||||
struct spa_audio_info_raw raw;
|
||||
} info;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ extern "C" {
|
|||
#define _SPA_TYPE_AUDIO_FORMAT_OE(fmt) SPA_TYPE_AUDIO_FORMAT_BASE fmt "BE"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
struct spa_type_audio_format {
|
||||
uint32_t UNKNOWN;
|
||||
uint32_t ENCODED;
|
||||
uint32_t S8;
|
||||
|
|
@ -68,10 +68,10 @@ typedef struct {
|
|||
uint32_t U18_OE;
|
||||
uint32_t F32_OE;
|
||||
uint32_t F64_OE;
|
||||
} SpaTypeAudioFormat;
|
||||
};
|
||||
|
||||
static inline void
|
||||
spa_type_audio_format_map (SpaTypeMap *map, SpaTypeAudioFormat *type)
|
||||
spa_type_audio_format_map (struct spa_type_map *map, struct spa_type_audio_format *type)
|
||||
{
|
||||
if (type->ENCODED == 0) {
|
||||
type->UNKNOWN = 0;
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _SpaAudioInfoRaw SpaAudioInfoRaw;
|
||||
|
||||
#include <endian.h>
|
||||
|
||||
#define SPA_TYPE__AudioFormat SPA_TYPE_ENUM_BASE "AudioFormat"
|
||||
|
|
@ -65,32 +63,32 @@ typedef struct _SpaAudioInfoRaw SpaAudioInfoRaw;
|
|||
#define SPA_TYPE_AUDIO_FORMAT__F64BE SPA_TYPE_AUDIO_FORMAT_BASE "F64BE"
|
||||
|
||||
/**
|
||||
* SpaAudioFlags:
|
||||
* spa_audio_flags:
|
||||
* @SPA_AUDIO_FLAG_NONE: no valid flag
|
||||
* @SPA_AUDIO_FLAG_UNPOSITIONED: the position array explicitly
|
||||
* contains unpositioned channels.
|
||||
*
|
||||
* Extra audio flags
|
||||
*/
|
||||
typedef enum {
|
||||
enum spa_audio_flags {
|
||||
SPA_AUDIO_FLAG_NONE = 0,
|
||||
SPA_AUDIO_FLAG_UNPOSITIONED = (1 << 0)
|
||||
} SpaAudioFlags;
|
||||
};
|
||||
|
||||
/**
|
||||
* SpaAudioLayout:
|
||||
* 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.
|
||||
*/
|
||||
typedef enum {
|
||||
enum spa_audio_layout {
|
||||
SPA_AUDIO_LAYOUT_INTERLEAVED = 0,
|
||||
SPA_AUDIO_LAYOUT_NON_INTERLEAVED
|
||||
} SpaAudioLayout;
|
||||
};
|
||||
|
||||
/**
|
||||
* SpaAudioInfoRaw:
|
||||
* spa_audio_info_raw:
|
||||
* @format: the format
|
||||
* @flags: extra flags
|
||||
* @layout: the sample layout
|
||||
|
|
@ -98,13 +96,13 @@ typedef enum {
|
|||
* @channels: the number of channels
|
||||
* @channel_mask: the channel mask
|
||||
*/
|
||||
struct _SpaAudioInfoRaw {
|
||||
uint32_t format;
|
||||
SpaAudioFlags flags;
|
||||
SpaAudioLayout layout;
|
||||
uint32_t rate;
|
||||
uint32_t channels;
|
||||
uint32_t 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue