make static inline -> SPA_API_IMPL

So that we can export the symbols as well.
This commit is contained in:
Wim Taymans 2024-11-20 11:48:08 +01:00
parent 84bd4b7ea9
commit 90b0e45037
91 changed files with 563 additions and 552 deletions

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_aac_parse(const struct spa_pod *format, struct spa_audio_info_aac *info)
{
int res;
@ -33,7 +33,7 @@ spa_format_audio_aac_parse(const struct spa_pod *format, struct spa_audio_info_a
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_aac_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_aac *info)
{

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_alac_parse(const struct spa_pod *format, struct spa_audio_info_alac *info)
{
int res;
@ -30,7 +30,7 @@ spa_format_audio_alac_parse(const struct spa_pod *format, struct spa_audio_info_
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_alac_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_alac *info)
{

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_amr_parse(const struct spa_pod *format, struct spa_audio_info_amr *info)
{
int res;
@ -31,7 +31,7 @@ spa_format_audio_amr_parse(const struct spa_pod *format, struct spa_audio_info_a
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_amr_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_amr *info)
{

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_ape_parse(const struct spa_pod *format, struct spa_audio_info_ape *info)
{
int res;
@ -30,7 +30,7 @@ spa_format_audio_ape_parse(const struct spa_pod *format, struct spa_audio_info_a
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_ape_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_ape *info)
{

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/format-utils.h>
#include <spa/param/audio/format.h>
static inline int
SPA_API_IMPL int
spa_format_audio_dsd_parse(const struct spa_pod *format, struct spa_audio_info_dsd *info)
{
struct spa_pod *position = NULL;
@ -39,7 +39,7 @@ spa_format_audio_dsd_parse(const struct spa_pod *format, struct spa_audio_info_d
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_dsd_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_dsd *info)
{

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_dsp_parse(const struct spa_pod *format, struct spa_audio_info_dsp *info)
{
int res;
@ -29,7 +29,7 @@ spa_format_audio_dsp_parse(const struct spa_pod *format, struct spa_audio_info_d
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_dsp_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_dsp *info)
{

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_flac_parse(const struct spa_pod *format, struct spa_audio_info_flac *info)
{
int res;
@ -30,7 +30,7 @@ spa_format_audio_flac_parse(const struct spa_pod *format, struct spa_audio_info_
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_flac_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_flac *info)
{

View file

@ -34,7 +34,7 @@ extern "C" {
* \{
*/
static inline int
SPA_API_IMPL int
spa_format_audio_parse(const struct spa_pod *format, struct spa_audio_info *info)
{
int res;
@ -76,7 +76,7 @@ spa_format_audio_parse(const struct spa_pod *format, struct spa_audio_info *info
return -ENOTSUP;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info *info)
{

View file

@ -33,11 +33,11 @@ static const struct spa_type_info spa_type_audio_iec958_codec[] = {
{ 0, 0, NULL, NULL },
};
static inline uint32_t spa_type_audio_iec958_codec_from_short_name(const char *name)
SPA_API_IMPL 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);
}
static inline const char * spa_type_audio_iec958_codec_to_short_name(uint32_t type)
SPA_API_IMPL 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");
}

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_iec958_parse(const struct spa_pod *format, struct spa_audio_info_iec958 *info)
{
int res;
@ -30,7 +30,7 @@ spa_format_audio_iec958_parse(const struct spa_pod *format, struct spa_audio_inf
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_iec958_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_iec958 *info)
{

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_mp3_parse(const struct spa_pod *format, struct spa_audio_info_mp3 *info)
{
int res;
@ -30,7 +30,7 @@ spa_format_audio_mp3_parse(const struct spa_pod *format, struct spa_audio_info_m
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_mp3_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_mp3 *info)
{

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_ra_parse(const struct spa_pod *format, struct spa_audio_info_ra *info)
{
int res;
@ -30,7 +30,7 @@ spa_format_audio_ra_parse(const struct spa_pod *format, struct spa_audio_info_ra
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_ra_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_ra *info)
{

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/raw.h>
#include <spa/param/audio/raw-types.h>
static inline int
SPA_API_IMPL int
spa_audio_parse_position(const char *str, size_t len,
uint32_t *position, uint32_t *n_channels)
{
@ -38,7 +38,7 @@ spa_audio_parse_position(const char *str, size_t len,
return channels;
}
static inline int
SPA_API_IMPL 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 +60,7 @@ spa_audio_info_raw_update(struct spa_audio_info_raw *info, const char *key, cons
return 0;
}
static inline int SPA_SENTINEL
SPA_API_IMPL 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, ...)

View file

@ -129,11 +129,11 @@ static const struct spa_type_info spa_type_audio_format[] = {
{ 0, 0, NULL, NULL },
};
static inline uint32_t spa_type_audio_format_from_short_name(const char *name)
SPA_API_IMPL 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);
}
static inline const char * spa_type_audio_format_to_short_name(uint32_t type)
SPA_API_IMPL 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 +257,11 @@ static const struct spa_type_info spa_type_audio_channel[] = {
{ 0, 0, NULL, NULL },
};
static inline uint32_t spa_type_audio_channel_from_short_name(const char *name)
SPA_API_IMPL 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);
}
static inline const char * spa_type_audio_channel_to_short_name(uint32_t type)
SPA_API_IMPL const char * spa_type_audio_channel_to_short_name(uint32_t type)
{
return spa_type_to_short_name(type, spa_type_audio_channel, "UNK");
}

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_raw_parse(const struct spa_pod *format, struct spa_audio_info_raw *info)
{
struct spa_pod *position = NULL;
@ -38,7 +38,7 @@ spa_format_audio_raw_parse(const struct spa_pod *format, struct spa_audio_info_r
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_raw_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_raw *info)
{

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_vorbis_parse(const struct spa_pod *format, struct spa_audio_info_vorbis *info)
{
int res;
@ -30,7 +30,7 @@ spa_format_audio_vorbis_parse(const struct spa_pod *format, struct spa_audio_inf
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_vorbis_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_vorbis *info)
{

View file

@ -19,7 +19,7 @@ extern "C" {
#include <spa/param/audio/format.h>
#include <spa/param/format-utils.h>
static inline int
SPA_API_IMPL int
spa_format_audio_wma_parse(const struct spa_pod *format, struct spa_audio_info_wma *info)
{
int res;
@ -33,7 +33,7 @@ spa_format_audio_wma_parse(const struct spa_pod *format, struct spa_audio_info_w
return res;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_audio_wma_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_audio_info_wma *info)
{

View file

@ -18,7 +18,7 @@ extern "C" {
#include <spa/pod/parser.h>
#include <spa/param/format.h>
static inline int
SPA_API_IMPL int
spa_format_parse(const struct spa_pod *format, uint32_t *media_type, uint32_t *media_subtype)
{
return spa_pod_parse_object(format,

View file

@ -20,7 +20,7 @@ extern "C" {
#include <spa/pod/parser.h>
#include <spa/param/latency.h>
static inline int
SPA_API_IMPL 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 +33,7 @@ spa_latency_info_compare(const struct spa_latency_info *a, const struct spa_late
return 1;
}
static inline void
SPA_API_IMPL void
spa_latency_info_combine_start(struct spa_latency_info *info, enum spa_direction direction)
{
*info = SPA_LATENCY_INFO(direction,
@ -44,7 +44,7 @@ spa_latency_info_combine_start(struct spa_latency_info *info, enum spa_direction
.min_ns = INT64_MAX,
.max_ns = INT64_MIN);
}
static inline void
SPA_API_IMPL void
spa_latency_info_combine_finish(struct spa_latency_info *info)
{
if (info->min_quantum == FLT_MAX)
@ -61,7 +61,7 @@ spa_latency_info_combine_finish(struct spa_latency_info *info)
info->max_ns = 0;
}
static inline int
SPA_API_IMPL int
spa_latency_info_combine(struct spa_latency_info *info, const struct spa_latency_info *other)
{
if (info->direction != other->direction)
@ -81,7 +81,7 @@ spa_latency_info_combine(struct spa_latency_info *info, const struct spa_latency
return 0;
}
static inline int
SPA_API_IMPL int
spa_latency_parse(const struct spa_pod *latency, struct spa_latency_info *info)
{
int res;
@ -100,7 +100,7 @@ spa_latency_parse(const struct spa_pod *latency, struct spa_latency_info *info)
return 0;
}
static inline struct spa_pod *
SPA_API_IMPL 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 +114,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));
}
static inline int
SPA_API_IMPL int
spa_process_latency_parse(const struct spa_pod *latency, struct spa_process_latency_info *info)
{
int res;
@ -128,7 +128,7 @@ spa_process_latency_parse(const struct spa_pod *latency, struct spa_process_late
return 0;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_process_latency_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_process_latency_info *info)
{
@ -139,7 +139,7 @@ spa_process_latency_build(struct spa_pod_builder *builder, uint32_t id,
SPA_PARAM_PROCESS_LATENCY_ns, SPA_POD_Long(info->ns));
}
static inline int
SPA_API_IMPL int
spa_process_latency_info_add(const struct spa_process_latency_info *process,
struct spa_latency_info *info)
{
@ -152,7 +152,7 @@ spa_process_latency_info_add(const struct spa_process_latency_info *process,
return 0;
}
static inline int
SPA_API_IMPL int
spa_process_latency_info_compare(const struct spa_process_latency_info *a,
const struct spa_process_latency_info *b)
{

View file

@ -21,14 +21,14 @@ extern "C" {
#include <spa/pod/parser.h>
#include <spa/param/tag.h>
static inline int
SPA_API_IMPL 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;
}
static inline int
SPA_API_IMPL int
spa_tag_parse(const struct spa_pod *tag, struct spa_tag_info *info, void **state)
{
int res;
@ -57,7 +57,7 @@ spa_tag_parse(const struct spa_pod *tag, struct spa_tag_info *info, void **state
return 0;
}
static inline int
SPA_API_IMPL 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 +90,7 @@ spa_tag_info_parse(const struct spa_tag_info *info, struct spa_dict *dict, struc
return 0;
}
static inline void
SPA_API_IMPL void
spa_tag_build_start(struct spa_pod_builder *builder, struct spa_pod_frame *f,
uint32_t id, enum spa_direction direction)
{
@ -100,7 +100,7 @@ spa_tag_build_start(struct spa_pod_builder *builder, struct spa_pod_frame *f,
0);
}
static inline void
SPA_API_IMPL void
spa_tag_build_add_info(struct spa_pod_builder *builder, const struct spa_pod *info)
{
spa_pod_builder_add(builder,
@ -108,7 +108,7 @@ spa_tag_build_add_info(struct spa_pod_builder *builder, const struct spa_pod *in
0);
}
static inline void
SPA_API_IMPL void
spa_tag_build_add_dict(struct spa_pod_builder *builder, const struct spa_dict *dict)
{
uint32_t i, n_items;
@ -126,7 +126,7 @@ spa_tag_build_add_dict(struct spa_pod_builder *builder, const struct spa_dict *d
spa_pod_builder_pop(builder, &f);
}
static inline struct spa_pod *
SPA_API_IMPL 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);

View file

@ -18,7 +18,7 @@ extern "C" {
#include <spa/pod/builder.h>
#include <spa/param/video/dsp.h>
static inline int
SPA_API_IMPL int
spa_format_video_dsp_parse(const struct spa_pod *format,
struct spa_video_info_dsp *info)
{
@ -36,7 +36,7 @@ spa_format_video_dsp_parse(const struct spa_pod *format,
SPA_FORMAT_VIDEO_modifier, SPA_POD_OPT_Long(&info->modifier));
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_video_dsp_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_video_info_dsp *info)
{

View file

@ -16,7 +16,7 @@ extern "C" {
#include <spa/param/video/h264-utils.h>
#include <spa/param/video/mjpg-utils.h>
static inline int
SPA_API_IMPL int
spa_format_video_parse(const struct spa_pod *format, struct spa_video_info *info)
{
int res;
@ -40,7 +40,7 @@ spa_format_video_parse(const struct spa_pod *format, struct spa_video_info *info
return -ENOTSUP;
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_video_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_video_info *info)
{

View file

@ -18,7 +18,7 @@ extern "C" {
#include <spa/pod/builder.h>
#include <spa/param/video/h264.h>
static inline int
SPA_API_IMPL int
spa_format_video_h264_parse(const struct spa_pod *format,
struct spa_video_info_h264 *info)
{
@ -31,7 +31,7 @@ spa_format_video_h264_parse(const struct spa_pod *format,
SPA_FORMAT_VIDEO_H264_alignment, SPA_POD_OPT_Id(&info->alignment));
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_video_h264_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_video_info_h264 *info)
{

View file

@ -18,7 +18,7 @@ extern "C" {
#include <spa/pod/builder.h>
#include <spa/param/video/mjpg.h>
static inline int
SPA_API_IMPL int
spa_format_video_mjpg_parse(const struct spa_pod *format,
struct spa_video_info_mjpg *info)
{
@ -29,7 +29,7 @@ spa_format_video_mjpg_parse(const struct spa_pod *format,
SPA_FORMAT_VIDEO_maxFramerate, SPA_POD_OPT_Fraction(&info->max_framerate));
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_video_mjpg_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_video_info_mjpg *info)
{

View file

@ -111,11 +111,11 @@ static const struct spa_type_info spa_type_video_format[] = {
{ 0, 0, NULL, NULL },
};
static inline uint32_t spa_type_video_format_from_short_name(const char *name)
SPA_API_IMPL 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);
}
static inline const char * spa_type_video_format_to_short_name(uint32_t type)
SPA_API_IMPL const char * spa_type_video_format_to_short_name(uint32_t type)
{
return spa_type_to_short_name(type, spa_type_video_format, "UNKNOWN");
}

View file

@ -18,7 +18,7 @@ extern "C" {
#include <spa/pod/builder.h>
#include <spa/param/video/raw.h>
static inline int
SPA_API_IMPL int
spa_format_video_raw_parse(const struct spa_pod *format,
struct spa_video_info_raw *info)
{
@ -49,7 +49,7 @@ spa_format_video_raw_parse(const struct spa_pod *format,
SPA_FORMAT_VIDEO_colorPrimaries, SPA_POD_OPT_Id(&info->color_primaries));
}
static inline struct spa_pod *
SPA_API_IMPL struct spa_pod *
spa_format_video_raw_build(struct spa_pod_builder *builder, uint32_t id,
const struct spa_video_info_raw *info)
{