mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-21 05:33:49 -04:00
add per type API defines
This commit is contained in:
parent
b03f2f7afa
commit
31802d4994
85 changed files with 1137 additions and 509 deletions
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_AAC_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_AAC_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_AAC_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_AAC_UTILS int
|
||||
spa_format_audio_aac_parse(const struct spa_pod *format, struct spa_audio_info_aac *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -33,7 +41,7 @@ spa_format_audio_aac_parse(const struct spa_pod *format, struct spa_audio_info_a
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_AAC_UTILS struct spa_pod *
|
||||
spa_format_audio_aac_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_aac *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,16 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_ALAC_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_ALAC_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_ALAC_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
SPA_API_AUDIO_ALAC_UTILS int
|
||||
spa_format_audio_alac_parse(const struct spa_pod *format, struct spa_audio_info_alac *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -30,7 +39,7 @@ spa_format_audio_alac_parse(const struct spa_pod *format, struct spa_audio_info_
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_ALAC_UTILS struct spa_pod *
|
||||
spa_format_audio_alac_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_alac *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,16 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_AMR_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_AMR_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_AMR_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
SPA_API_AUDIO_AMR_UTILS int
|
||||
spa_format_audio_amr_parse(const struct spa_pod *format, struct spa_audio_info_amr *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -31,7 +40,7 @@ spa_format_audio_amr_parse(const struct spa_pod *format, struct spa_audio_info_a
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_AMR_UTILS struct spa_pod *
|
||||
spa_format_audio_amr_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_amr *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_APE_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_APE_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_APE_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_APE_UTILS int
|
||||
spa_format_audio_ape_parse(const struct spa_pod *format, struct spa_audio_info_ape *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -30,7 +38,7 @@ spa_format_audio_ape_parse(const struct spa_pod *format, struct spa_audio_info_a
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_APE_UTILS struct spa_pod *
|
||||
spa_format_audio_ape_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_ape *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/format-utils.h>
|
||||
#include <spa/param/audio/format.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_DSD_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_DSD_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_DSD_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_DSD_UTILS int
|
||||
spa_format_audio_dsd_parse(const struct spa_pod *format, struct spa_audio_info_dsd *info)
|
||||
{
|
||||
struct spa_pod *position = NULL;
|
||||
|
|
@ -39,7 +47,7 @@ spa_format_audio_dsd_parse(const struct spa_pod *format, struct spa_audio_info_d
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_DSD_UTILS struct spa_pod *
|
||||
spa_format_audio_dsd_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_dsd *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_DSP_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_DSP_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_DSP_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_DSP_UTILS int
|
||||
spa_format_audio_dsp_parse(const struct spa_pod *format, struct spa_audio_info_dsp *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -29,7 +37,7 @@ spa_format_audio_dsp_parse(const struct spa_pod *format, struct spa_audio_info_d
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_DSP_UTILS struct spa_pod *
|
||||
spa_format_audio_dsp_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_dsp *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_FLAC_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_FLAC_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_FLAC_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_FLAC_UTILS int
|
||||
spa_format_audio_flac_parse(const struct spa_pod *format, struct spa_audio_info_flac *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -30,7 +38,7 @@ spa_format_audio_flac_parse(const struct spa_pod *format, struct spa_audio_info_
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_FLAC_UTILS struct spa_pod *
|
||||
spa_format_audio_flac_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_flac *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,15 @@ extern "C" {
|
|||
* \{
|
||||
*/
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_FORMAT_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_FORMAT_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_FORMAT_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_FORMAT_UTILS int
|
||||
spa_format_audio_parse(const struct spa_pod *format, struct spa_audio_info *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -76,7 +84,7 @@ spa_format_audio_parse(const struct spa_pod *format, struct spa_audio_info *info
|
|||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_FORMAT_UTILS struct spa_pod *
|
||||
spa_format_audio_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,6 +17,14 @@ extern "C" {
|
|||
* \{
|
||||
*/
|
||||
|
||||
#ifndef SPA_API_AUDIO_IEC958_TYPES
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_IEC958_TYPES SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_IEC958_TYPES static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define SPA_TYPE_INFO_AudioIEC958Codec SPA_TYPE_INFO_ENUM_BASE "AudioIEC958Codec"
|
||||
#define SPA_TYPE_INFO_AUDIO_IEC958_CODEC_BASE SPA_TYPE_INFO_AudioIEC958Codec ":"
|
||||
|
||||
|
|
@ -33,11 +41,11 @@ static const struct spa_type_info spa_type_audio_iec958_codec[] = {
|
|||
{ 0, 0, NULL, NULL },
|
||||
};
|
||||
|
||||
SPA_API_IMPL uint32_t spa_type_audio_iec958_codec_from_short_name(const char *name)
|
||||
SPA_API_AUDIO_IEC958_TYPES uint32_t spa_type_audio_iec958_codec_from_short_name(const char *name)
|
||||
{
|
||||
return spa_type_from_short_name(name, spa_type_audio_iec958_codec, SPA_AUDIO_IEC958_CODEC_UNKNOWN);
|
||||
}
|
||||
SPA_API_IMPL const char * spa_type_audio_iec958_codec_to_short_name(uint32_t type)
|
||||
SPA_API_AUDIO_IEC958_TYPES const char * spa_type_audio_iec958_codec_to_short_name(uint32_t type)
|
||||
{
|
||||
return spa_type_to_short_name(type, spa_type_audio_iec958_codec, "UNKNOWN");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_IEC958_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_IEC958_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_IEC958_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_IEC958_UTILS int
|
||||
spa_format_audio_iec958_parse(const struct spa_pod *format, struct spa_audio_info_iec958 *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -30,7 +38,7 @@ spa_format_audio_iec958_parse(const struct spa_pod *format, struct spa_audio_inf
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_IEC958_UTILS struct spa_pod *
|
||||
spa_format_audio_iec958_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_iec958 *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_MP3_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_MP3_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_MP3_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_MP3_UTILS int
|
||||
spa_format_audio_mp3_parse(const struct spa_pod *format, struct spa_audio_info_mp3 *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -30,7 +38,7 @@ spa_format_audio_mp3_parse(const struct spa_pod *format, struct spa_audio_info_m
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_MP3_UTILS struct spa_pod *
|
||||
spa_format_audio_mp3_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_mp3 *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_RA_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_RA_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_RA_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_RA_UTILS int
|
||||
spa_format_audio_ra_parse(const struct spa_pod *format, struct spa_audio_info_ra *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -30,7 +38,7 @@ spa_format_audio_ra_parse(const struct spa_pod *format, struct spa_audio_info_ra
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_RA_UTILS struct spa_pod *
|
||||
spa_format_audio_ra_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_ra *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/audio/raw.h>
|
||||
#include <spa/param/audio/raw-types.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_RAW_JSON
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_RAW_JSON SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_RAW_JSON static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_RAW_JSON int
|
||||
spa_audio_parse_position(const char *str, size_t len,
|
||||
uint32_t *position, uint32_t *n_channels)
|
||||
{
|
||||
|
|
@ -38,7 +46,7 @@ spa_audio_parse_position(const char *str, size_t len,
|
|||
return channels;
|
||||
}
|
||||
|
||||
SPA_API_IMPL int
|
||||
SPA_API_AUDIO_RAW_JSON int
|
||||
spa_audio_info_raw_update(struct spa_audio_info_raw *info, const char *key, const char *val, bool force)
|
||||
{
|
||||
uint32_t v;
|
||||
|
|
@ -60,7 +68,7 @@ spa_audio_info_raw_update(struct spa_audio_info_raw *info, const char *key, cons
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_API_IMPL int SPA_SENTINEL
|
||||
SPA_API_AUDIO_RAW_JSON int SPA_SENTINEL
|
||||
spa_audio_info_raw_init_dict_keys(struct spa_audio_info_raw *info,
|
||||
const struct spa_dict *defaults,
|
||||
const struct spa_dict *dict, ...)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,14 @@ extern "C" {
|
|||
#include <spa/utils/string.h>
|
||||
#include <spa/param/audio/raw.h>
|
||||
|
||||
#ifndef SPA_API_AUDIO_RAW_TYPES
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_RAW_TYPES SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_RAW_TYPES static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define SPA_TYPE_INFO_AudioFormat SPA_TYPE_INFO_ENUM_BASE "AudioFormat"
|
||||
#define SPA_TYPE_INFO_AUDIO_FORMAT_BASE SPA_TYPE_INFO_AudioFormat ":"
|
||||
|
||||
|
|
@ -129,11 +137,11 @@ static const struct spa_type_info spa_type_audio_format[] = {
|
|||
{ 0, 0, NULL, NULL },
|
||||
};
|
||||
|
||||
SPA_API_IMPL uint32_t spa_type_audio_format_from_short_name(const char *name)
|
||||
SPA_API_AUDIO_RAW_TYPES uint32_t spa_type_audio_format_from_short_name(const char *name)
|
||||
{
|
||||
return spa_type_from_short_name(name, spa_type_audio_format, SPA_AUDIO_FORMAT_UNKNOWN);
|
||||
}
|
||||
SPA_API_IMPL const char * spa_type_audio_format_to_short_name(uint32_t type)
|
||||
SPA_API_AUDIO_RAW_TYPES const char * spa_type_audio_format_to_short_name(uint32_t type)
|
||||
{
|
||||
return spa_type_to_short_name(type, spa_type_audio_format, "UNKNOWN");
|
||||
}
|
||||
|
|
@ -257,11 +265,11 @@ static const struct spa_type_info spa_type_audio_channel[] = {
|
|||
{ 0, 0, NULL, NULL },
|
||||
};
|
||||
|
||||
SPA_API_IMPL uint32_t spa_type_audio_channel_from_short_name(const char *name)
|
||||
SPA_API_AUDIO_RAW_TYPES uint32_t spa_type_audio_channel_from_short_name(const char *name)
|
||||
{
|
||||
return spa_type_from_short_name(name, spa_type_audio_channel, SPA_AUDIO_CHANNEL_UNKNOWN);
|
||||
}
|
||||
SPA_API_IMPL const char * spa_type_audio_channel_to_short_name(uint32_t type)
|
||||
SPA_API_AUDIO_RAW_TYPES const char * spa_type_audio_channel_to_short_name(uint32_t type)
|
||||
{
|
||||
return spa_type_to_short_name(type, spa_type_audio_channel, "UNK");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_RAW_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_RAW_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_RAW_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_RAW_UTILS int
|
||||
spa_format_audio_raw_parse(const struct spa_pod *format, struct spa_audio_info_raw *info)
|
||||
{
|
||||
struct spa_pod *position = NULL;
|
||||
|
|
@ -38,7 +46,7 @@ spa_format_audio_raw_parse(const struct spa_pod *format, struct spa_audio_info_r
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_RAW_UTILS struct spa_pod *
|
||||
spa_format_audio_raw_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_raw *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_VORBIS_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_VORBIS_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_VORBIS_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_VORBIS_UTILS int
|
||||
spa_format_audio_vorbis_parse(const struct spa_pod *format, struct spa_audio_info_vorbis *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -30,7 +38,7 @@ spa_format_audio_vorbis_parse(const struct spa_pod *format, struct spa_audio_inf
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_VORBIS_UTILS struct spa_pod *
|
||||
spa_format_audio_vorbis_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_vorbis *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,15 @@ extern "C" {
|
|||
#include <spa/param/audio/format.h>
|
||||
#include <spa/param/format-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_AUDIO_WMA_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_AUDIO_WMA_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_AUDIO_WMA_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_AUDIO_WMA_UTILS int
|
||||
spa_format_audio_wma_parse(const struct spa_pod *format, struct spa_audio_info_wma *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -33,7 +41,7 @@ spa_format_audio_wma_parse(const struct spa_pod *format, struct spa_audio_info_w
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_AUDIO_WMA_UTILS struct spa_pod *
|
||||
spa_format_audio_wma_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_audio_info_wma *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,15 @@ extern "C" {
|
|||
#include <spa/pod/parser.h>
|
||||
#include <spa/param/format.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_FORMAT_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_FORMAT_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_FORMAT_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_FORMAT_UTILS int
|
||||
spa_format_parse(const struct spa_pod *format, uint32_t *media_type, uint32_t *media_subtype)
|
||||
{
|
||||
return spa_pod_parse_object(format,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,15 @@ extern "C" {
|
|||
#include <spa/pod/parser.h>
|
||||
#include <spa/param/latency.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_LATENCY_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_LATENCY_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_LATENCY_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_LATENCY_UTILS int
|
||||
spa_latency_info_compare(const struct spa_latency_info *a, const struct spa_latency_info *b)
|
||||
{
|
||||
if (a->min_quantum == b->min_quantum &&
|
||||
|
|
@ -33,7 +41,7 @@ spa_latency_info_compare(const struct spa_latency_info *a, const struct spa_late
|
|||
return 1;
|
||||
}
|
||||
|
||||
SPA_API_IMPL void
|
||||
SPA_API_LATENCY_UTILS void
|
||||
spa_latency_info_combine_start(struct spa_latency_info *info, enum spa_direction direction)
|
||||
{
|
||||
*info = SPA_LATENCY_INFO(direction,
|
||||
|
|
@ -44,7 +52,7 @@ spa_latency_info_combine_start(struct spa_latency_info *info, enum spa_direction
|
|||
.min_ns = INT64_MAX,
|
||||
.max_ns = INT64_MIN);
|
||||
}
|
||||
SPA_API_IMPL void
|
||||
SPA_API_LATENCY_UTILS void
|
||||
spa_latency_info_combine_finish(struct spa_latency_info *info)
|
||||
{
|
||||
if (info->min_quantum == FLT_MAX)
|
||||
|
|
@ -61,7 +69,7 @@ spa_latency_info_combine_finish(struct spa_latency_info *info)
|
|||
info->max_ns = 0;
|
||||
}
|
||||
|
||||
SPA_API_IMPL int
|
||||
SPA_API_LATENCY_UTILS int
|
||||
spa_latency_info_combine(struct spa_latency_info *info, const struct spa_latency_info *other)
|
||||
{
|
||||
if (info->direction != other->direction)
|
||||
|
|
@ -81,7 +89,7 @@ spa_latency_info_combine(struct spa_latency_info *info, const struct spa_latency
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_API_IMPL int
|
||||
SPA_API_LATENCY_UTILS int
|
||||
spa_latency_parse(const struct spa_pod *latency, struct spa_latency_info *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -100,7 +108,7 @@ spa_latency_parse(const struct spa_pod *latency, struct spa_latency_info *info)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_LATENCY_UTILS struct spa_pod *
|
||||
spa_latency_build(struct spa_pod_builder *builder, uint32_t id, const struct spa_latency_info *info)
|
||||
{
|
||||
return (struct spa_pod *)spa_pod_builder_add_object(builder,
|
||||
|
|
@ -114,7 +122,7 @@ spa_latency_build(struct spa_pod_builder *builder, uint32_t id, const struct spa
|
|||
SPA_PARAM_LATENCY_maxNs, SPA_POD_Long(info->max_ns));
|
||||
}
|
||||
|
||||
SPA_API_IMPL int
|
||||
SPA_API_LATENCY_UTILS int
|
||||
spa_process_latency_parse(const struct spa_pod *latency, struct spa_process_latency_info *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -128,7 +136,7 @@ spa_process_latency_parse(const struct spa_pod *latency, struct spa_process_late
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_LATENCY_UTILS struct spa_pod *
|
||||
spa_process_latency_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_process_latency_info *info)
|
||||
{
|
||||
|
|
@ -139,7 +147,7 @@ spa_process_latency_build(struct spa_pod_builder *builder, uint32_t id,
|
|||
SPA_PARAM_PROCESS_LATENCY_ns, SPA_POD_Long(info->ns));
|
||||
}
|
||||
|
||||
SPA_API_IMPL int
|
||||
SPA_API_LATENCY_UTILS int
|
||||
spa_process_latency_info_add(const struct spa_process_latency_info *process,
|
||||
struct spa_latency_info *info)
|
||||
{
|
||||
|
|
@ -152,7 +160,7 @@ spa_process_latency_info_add(const struct spa_process_latency_info *process,
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_API_IMPL int
|
||||
SPA_API_LATENCY_UTILS int
|
||||
spa_process_latency_info_compare(const struct spa_process_latency_info *a,
|
||||
const struct spa_process_latency_info *b)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,14 +21,22 @@ extern "C" {
|
|||
#include <spa/pod/parser.h>
|
||||
#include <spa/param/tag.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_TAG_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_TAG_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_TAG_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_TAG_UTILS int
|
||||
spa_tag_compare(const struct spa_pod *a, const struct spa_pod *b)
|
||||
{
|
||||
return ((a == b) || (a && b && SPA_POD_SIZE(a) == SPA_POD_SIZE(b) &&
|
||||
memcmp(a, b, SPA_POD_SIZE(b)) == 0)) ? 0 : 1;
|
||||
}
|
||||
|
||||
SPA_API_IMPL int
|
||||
SPA_API_TAG_UTILS int
|
||||
spa_tag_parse(const struct spa_pod *tag, struct spa_tag_info *info, void **state)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -57,7 +65,7 @@ spa_tag_parse(const struct spa_pod *tag, struct spa_tag_info *info, void **state
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_API_IMPL int
|
||||
SPA_API_TAG_UTILS int
|
||||
spa_tag_info_parse(const struct spa_tag_info *info, struct spa_dict *dict, struct spa_dict_item *items)
|
||||
{
|
||||
struct spa_pod_parser prs;
|
||||
|
|
@ -90,7 +98,7 @@ spa_tag_info_parse(const struct spa_tag_info *info, struct spa_dict *dict, struc
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_API_IMPL void
|
||||
SPA_API_TAG_UTILS void
|
||||
spa_tag_build_start(struct spa_pod_builder *builder, struct spa_pod_frame *f,
|
||||
uint32_t id, enum spa_direction direction)
|
||||
{
|
||||
|
|
@ -100,7 +108,7 @@ spa_tag_build_start(struct spa_pod_builder *builder, struct spa_pod_frame *f,
|
|||
0);
|
||||
}
|
||||
|
||||
SPA_API_IMPL void
|
||||
SPA_API_TAG_UTILS void
|
||||
spa_tag_build_add_info(struct spa_pod_builder *builder, const struct spa_pod *info)
|
||||
{
|
||||
spa_pod_builder_add(builder,
|
||||
|
|
@ -108,7 +116,7 @@ spa_tag_build_add_info(struct spa_pod_builder *builder, const struct spa_pod *in
|
|||
0);
|
||||
}
|
||||
|
||||
SPA_API_IMPL void
|
||||
SPA_API_TAG_UTILS void
|
||||
spa_tag_build_add_dict(struct spa_pod_builder *builder, const struct spa_dict *dict)
|
||||
{
|
||||
uint32_t i, n_items;
|
||||
|
|
@ -126,7 +134,7 @@ spa_tag_build_add_dict(struct spa_pod_builder *builder, const struct spa_dict *d
|
|||
spa_pod_builder_pop(builder, &f);
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_TAG_UTILS struct spa_pod *
|
||||
spa_tag_build_end(struct spa_pod_builder *builder, struct spa_pod_frame *f)
|
||||
{
|
||||
return (struct spa_pod*)spa_pod_builder_pop(builder, f);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,15 @@ extern "C" {
|
|||
#include <spa/pod/builder.h>
|
||||
#include <spa/param/video/dsp.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_VIDEO_DSP_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_VIDEO_DSP_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_VIDEO_DSP_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_VIDEO_DSP_UTILS int
|
||||
spa_format_video_dsp_parse(const struct spa_pod *format,
|
||||
struct spa_video_info_dsp *info)
|
||||
{
|
||||
|
|
@ -36,7 +44,7 @@ spa_format_video_dsp_parse(const struct spa_pod *format,
|
|||
SPA_FORMAT_VIDEO_modifier, SPA_POD_OPT_Long(&info->modifier));
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_VIDEO_DSP_UTILS struct spa_pod *
|
||||
spa_format_video_dsp_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_video_info_dsp *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,15 @@ extern "C" {
|
|||
#include <spa/param/video/h264-utils.h>
|
||||
#include <spa/param/video/mjpg-utils.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_VIDEO_FORMAT_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_VIDEO_FORMAT_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_VIDEO_FORMAT_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_VIDEO_FORMAT_UTILS int
|
||||
spa_format_video_parse(const struct spa_pod *format, struct spa_video_info *info)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -40,7 +48,7 @@ spa_format_video_parse(const struct spa_pod *format, struct spa_video_info *info
|
|||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_VIDEO_FORMAT_UTILS struct spa_pod *
|
||||
spa_format_video_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_video_info *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,15 @@ extern "C" {
|
|||
#include <spa/pod/builder.h>
|
||||
#include <spa/param/video/h264.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_VIDEO_H264_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_VIDEO_H264_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_VIDEO_H264_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_VIDEO_H264_UTILS int
|
||||
spa_format_video_h264_parse(const struct spa_pod *format,
|
||||
struct spa_video_info_h264 *info)
|
||||
{
|
||||
|
|
@ -31,7 +39,7 @@ spa_format_video_h264_parse(const struct spa_pod *format,
|
|||
SPA_FORMAT_VIDEO_H264_alignment, SPA_POD_OPT_Id(&info->alignment));
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_VIDEO_H264_UTILS struct spa_pod *
|
||||
spa_format_video_h264_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_video_info_h264 *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,15 @@ extern "C" {
|
|||
#include <spa/pod/builder.h>
|
||||
#include <spa/param/video/mjpg.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_VIDEO_MJPG_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_VIDEO_MJPG_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_VIDEO_MJPG_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_VIDEO_MJPG_UTILS int
|
||||
spa_format_video_mjpg_parse(const struct spa_pod *format,
|
||||
struct spa_video_info_mjpg *info)
|
||||
{
|
||||
|
|
@ -29,7 +37,7 @@ spa_format_video_mjpg_parse(const struct spa_pod *format,
|
|||
SPA_FORMAT_VIDEO_maxFramerate, SPA_POD_OPT_Fraction(&info->max_framerate));
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_VIDEO_MJPG_UTILS struct spa_pod *
|
||||
spa_format_video_mjpg_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_video_info_mjpg *info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,6 +16,14 @@ extern "C" {
|
|||
#include <spa/utils/type.h>
|
||||
#include <spa/param/video/raw.h>
|
||||
|
||||
#ifndef SPA_API_VIDEO_RAW_TYPES
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_VIDEO_RAW_TYPES SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_VIDEO_RAW_TYPES static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define SPA_TYPE_INFO_VideoFormat SPA_TYPE_INFO_ENUM_BASE "VideoFormat"
|
||||
#define SPA_TYPE_INFO_VIDEO_FORMAT_BASE SPA_TYPE_INFO_VideoFormat ":"
|
||||
|
||||
|
|
@ -111,11 +119,11 @@ static const struct spa_type_info spa_type_video_format[] = {
|
|||
{ 0, 0, NULL, NULL },
|
||||
};
|
||||
|
||||
SPA_API_IMPL uint32_t spa_type_video_format_from_short_name(const char *name)
|
||||
SPA_API_VIDEO_RAW_TYPES uint32_t spa_type_video_format_from_short_name(const char *name)
|
||||
{
|
||||
return spa_type_from_short_name(name, spa_type_video_format, SPA_VIDEO_FORMAT_UNKNOWN);
|
||||
}
|
||||
SPA_API_IMPL const char * spa_type_video_format_to_short_name(uint32_t type)
|
||||
SPA_API_VIDEO_RAW_TYPES const char * spa_type_video_format_to_short_name(uint32_t type)
|
||||
{
|
||||
return spa_type_to_short_name(type, spa_type_video_format, "UNKNOWN");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,15 @@ extern "C" {
|
|||
#include <spa/pod/builder.h>
|
||||
#include <spa/param/video/raw.h>
|
||||
|
||||
SPA_API_IMPL int
|
||||
#ifndef SPA_API_VIDEO_RAW_UTILS
|
||||
#ifdef SPA_API_IMPL
|
||||
#define SPA_API_VIDEO_RAW_UTILS SPA_API_IMPL
|
||||
#else
|
||||
#define SPA_API_VIDEO_RAW_UTILS static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SPA_API_VIDEO_RAW_UTILS int
|
||||
spa_format_video_raw_parse(const struct spa_pod *format,
|
||||
struct spa_video_info_raw *info)
|
||||
{
|
||||
|
|
@ -49,7 +57,7 @@ spa_format_video_raw_parse(const struct spa_pod *format,
|
|||
SPA_FORMAT_VIDEO_colorPrimaries, SPA_POD_OPT_Id(&info->color_primaries));
|
||||
}
|
||||
|
||||
SPA_API_IMPL struct spa_pod *
|
||||
SPA_API_VIDEO_RAW_UTILS struct spa_pod *
|
||||
spa_format_video_raw_build(struct spa_pod_builder *builder, uint32_t id,
|
||||
const struct spa_video_info_raw *info)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue