Loading...
Searching...
No Matches
format-utils.h
Go to the documentation of this file.
/* Simple Plugin API */
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#ifndef SPA_PARAM_FORMAT_UTILS_H
#define SPA_PARAM_FORMAT_UTILS_H
#include <spa/pod/parser.h>
#include <spa/param/format.h>
#ifdef __cplusplus
extern "C" {
#endif
#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,
SPA_TYPE_OBJECT_Format, NULL,
SPA_FORMAT_mediaType, SPA_POD_Id(media_type),
SPA_FORMAT_mediaSubtype, SPA_POD_Id(media_subtype));
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* SPA_PARAM_FORMAT_UTILS_H */
SPA_API_FORMAT_UTILS
#define SPA_API_FORMAT_UTILS
Definition format-utils.h:32
spa_format_parse
SPA_API_FORMAT_UTILS int spa_format_parse(const struct spa_pod *format, uint32_t *media_type, uint32_t *media_subtype)
Definition format-utils.h:37
SPA_FORMAT_mediaType
@ SPA_FORMAT_mediaType
media type (Id enum spa_media_type)
Definition format.h:99
SPA_FORMAT_mediaSubtype
@ SPA_FORMAT_mediaSubtype
media subtype (Id enum spa_media_subtype)
Definition format.h:100
SPA_POD_Id
#define SPA_POD_Id(val)
Definition vararg.h:53
spa_pod_parse_object
#define spa_pod_parse_object(pod, type, id,...)
Definition parser.h:935
SPA_TYPE_OBJECT_Format
@ SPA_TYPE_OBJECT_Format
Definition type.h:87
format.h
spa/param/format.h
parser.h
spa/pod/parser.h
spa_pod
Definition pod.h:57