mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-29 11:08:40 -05:00
spa: reorganize params
Split files into separate files. Move type annotations to a matching -types.h files. Move helpers to matching -utils.h files. Add helpers to parse generic audio and video info.
This commit is contained in:
parent
4e9c3b26d9
commit
00ae289a14
41 changed files with 2768 additions and 1337 deletions
89
spa/include/spa/param/latency.h
Normal file
89
spa/include/spa/param/latency.h
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
/* Simple Plugin API
|
||||
*
|
||||
* Copyright © 2023 Wim Taymans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef SPA_PARAM_LATENY_H
|
||||
#define SPA_PARAM_LATENY_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \addtogroup spa_param
|
||||
* \{
|
||||
*/
|
||||
|
||||
#include <spa/param/param.h>
|
||||
|
||||
/** properties for SPA_TYPE_OBJECT_ParamLatency */
|
||||
enum spa_param_latency {
|
||||
SPA_PARAM_LATENCY_START,
|
||||
SPA_PARAM_LATENCY_direction, /**< direction, input/output (Id enum spa_direction) */
|
||||
SPA_PARAM_LATENCY_minQuantum, /**< min latency relative to quantum (Float) */
|
||||
SPA_PARAM_LATENCY_maxQuantum, /**< max latency relative to quantum (Float) */
|
||||
SPA_PARAM_LATENCY_minRate, /**< min latency (Int) relative to rate */
|
||||
SPA_PARAM_LATENCY_maxRate, /**< max latency (Int) relative to rate */
|
||||
SPA_PARAM_LATENCY_minNs, /**< min latency (Long) in nanoseconds */
|
||||
SPA_PARAM_LATENCY_maxNs, /**< max latency (Long) in nanoseconds */
|
||||
};
|
||||
|
||||
/** helper structure for managing latency objects */
|
||||
struct spa_latency_info {
|
||||
enum spa_direction direction;
|
||||
float min_quantum;
|
||||
float max_quantum;
|
||||
uint32_t min_rate;
|
||||
uint32_t max_rate;
|
||||
uint64_t min_ns;
|
||||
uint64_t max_ns;
|
||||
};
|
||||
|
||||
#define SPA_LATENCY_INFO(dir,...) ((struct spa_latency_info) { .direction = (dir), ## __VA_ARGS__ })
|
||||
|
||||
/** properties for SPA_TYPE_OBJECT_ParamProcessLatency */
|
||||
enum spa_param_process_latency {
|
||||
SPA_PARAM_PROCESS_LATENCY_START,
|
||||
SPA_PARAM_PROCESS_LATENCY_quantum, /**< latency relative to quantum (Float) */
|
||||
SPA_PARAM_PROCESS_LATENCY_rate, /**< latency (Int) relative to rate */
|
||||
SPA_PARAM_PROCESS_LATENCY_ns, /**< latency (Long) in nanoseconds */
|
||||
};
|
||||
|
||||
/** Helper structure for managing process latency objects */
|
||||
struct spa_process_latency_info {
|
||||
float quantum;
|
||||
uint32_t rate;
|
||||
uint64_t ns;
|
||||
};
|
||||
|
||||
#define SPA_PROCESS_LATENCY_INFO_INIT(...) ((struct spa_process_latency_info) { __VA_ARGS__ })
|
||||
|
||||
/**
|
||||
* \}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* SPA_PARAM_LATENY_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue