mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-26 08:56:49 -05:00
Meta: rework ringbuffer meta
ringbuffer: remove size and mask from the ringbuffer, we have that elsewhere in the user of the ringbuffer. Remove the buffer data offset and size fields and replace with a ringbuffer. We then have a ringbuffer in all buffer data, which simplifies things. We can now remove the ringbuffer metadata.
This commit is contained in:
parent
49d8f6792e
commit
2923b623b3
27 changed files with 199 additions and 374 deletions
|
|
@ -25,6 +25,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <spa/utils/ringbuffer.h>
|
||||
#include <spa/buffer/meta.h>
|
||||
#include <spa/support/type-map.h>
|
||||
|
||||
|
|
@ -64,9 +65,8 @@ static inline void spa_type_data_map(struct spa_type_map *map, struct spa_type_d
|
|||
|
||||
/** Chunk of memory */
|
||||
struct spa_chunk {
|
||||
uint32_t offset; /**< offset of valid data */
|
||||
uint32_t size; /**< size of valid data */
|
||||
int32_t stride; /**< stride of valid data */
|
||||
struct spa_ringbuffer area; /**< ringbuffer with valid memory */
|
||||
int32_t stride; /**< stride of ringbuffer increment */
|
||||
};
|
||||
|
||||
/** Data for a buffer */
|
||||
|
|
|
|||
|
|
@ -38,14 +38,12 @@ extern "C" {
|
|||
#define SPA_TYPE_META__Header SPA_TYPE_META_BASE "Header"
|
||||
#define SPA_TYPE_META__Pointer SPA_TYPE_META_BASE "Pointer"
|
||||
#define SPA_TYPE_META__VideoCrop SPA_TYPE_META_BASE "VideoCrop"
|
||||
#define SPA_TYPE_META__Ringbuffer SPA_TYPE_META_BASE "Ringbuffer"
|
||||
#define SPA_TYPE_META__Shared SPA_TYPE_META_BASE "Shared"
|
||||
|
||||
struct spa_type_meta {
|
||||
uint32_t Header;
|
||||
uint32_t Pointer;
|
||||
uint32_t VideoCrop;
|
||||
uint32_t Ringbuffer;
|
||||
uint32_t Shared;
|
||||
};
|
||||
|
||||
|
|
@ -55,7 +53,6 @@ static inline void spa_type_meta_map(struct spa_type_map *map, struct spa_type_m
|
|||
type->Header = spa_type_map_get_id(map, SPA_TYPE_META__Header);
|
||||
type->Pointer = spa_type_map_get_id(map, SPA_TYPE_META__Pointer);
|
||||
type->VideoCrop = spa_type_map_get_id(map, SPA_TYPE_META__VideoCrop);
|
||||
type->Ringbuffer = spa_type_map_get_id(map, SPA_TYPE_META__Ringbuffer);
|
||||
type->Shared = spa_type_map_get_id(map, SPA_TYPE_META__Shared);
|
||||
}
|
||||
}
|
||||
|
|
@ -87,11 +84,6 @@ struct spa_meta_video_crop {
|
|||
int32_t width, height; /**< width and height */
|
||||
};
|
||||
|
||||
/** Ringbuffer metadata */
|
||||
struct spa_meta_ringbuffer {
|
||||
struct spa_ringbuffer ringbuffer; /**< the ringbuffer */
|
||||
};
|
||||
|
||||
/** Describes the shared memory of a buffer is stored */
|
||||
struct spa_meta_shared {
|
||||
int32_t flags; /**< flags */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue