upipe/ubuf_sound_common.h header reference
Upipe useful common definitions for sound managers More
Header inclusion
Members
Types
- struct ubuf_sound_common
- struct ubuf_sound_common_mgr
- struct ubuf_sound_common_mgr_plane
- struct ubuf_sound_common_plane
Functions
- void ubuf_sound_common_clean(struct ubuf *ubuf)
- int ubuf_sound_common_dup(struct ubuf *ubuf, struct ubuf *new_ubuf)
- void ubuf_sound_common_init(struct ubuf *ubuf, size_t size)
- int ubuf_sound_common_mgr_add_plane(struct ubuf_mgr *mgr, const char *channel)
- void ubuf_sound_common_mgr_clean(struct ubuf_mgr *mgr)
- void ubuf_sound_common_mgr_init(struct ubuf_mgr *mgr, uint8_t sample_size)
- void ubuf_sound_common_plane_clean(struct ubuf *ubuf, uint8_t plane)
- int ubuf_sound_common_plane_dup(struct ubuf *ubuf, struct ubuf *new_ubuf, uint8_t plane)
- void ubuf_sound_common_plane_init(struct ubuf *ubuf, uint8_t plane, uint8_t *buffer)
- int ubuf_sound_common_plane_iterate(struct ubuf *ubuf, const char **channel_p)
- int ubuf_sound_common_plane_map(struct ubuf *ubuf, const char *channel, int offset, int size, uint8_t **buffer_p)
- int ubuf_sound_common_resize(struct ubuf *ubuf, int offset, int new_size)
- int ubuf_sound_common_size(struct ubuf *ubuf, size_t *size_p, uint8_t *sample_size_p)
- size_t ubuf_sound_common_sizeof(struct ubuf_mgr *mgr)
Description
Upipe useful common definitions for sound managers
Members detail
This macro is declared in upipe/ubuf_sound_common.h source file, line 31.
This struct is declared in upipe/ubuf_sound_common.h source file, line 57.
This struct is a proposed common section of sound ubuf, allowing to window data. In an opaque area you would typically store a pointer to shared buffer space.
Since it features a flexible array member, it must be placed at the end of another structure.
Field | Description |
---|---|
size_t size; | requested number of samples |
struct ubuf ubuf; | common structure |
struct ubuf_sound_common_plane planes[]; | planes buffers |
This function is declared in upipe/ubuf_sound_common.h source file, line 140.
This function cleans up the common fields of a sound ubuf (currently no-op).
Parameter list:
- ubuf: pointer to ubuf
This function is declared in upipe/ubuf_sound_common.h source file, line 174.
This function duplicates the content of the common structure for sound ubuf.
Parameter list:
- ubuf: pointer to ubuf
- new_ubuf: pointer to ubuf to overwrite
The return value is an error code
This function is declared in upipe/ubuf_sound_common.h source file, line 129.
This function initializes the common fields of a sound ubuf.
Parameter list:
- ubuf: pointer to ubuf
- size: number of samples
This struct is declared in upipe/ubuf_sound_common.h source file, line 77.
This struct is a super-set of the ubuf_mgr structure with additional local members, common to sound managers.
Field | Description |
---|---|
uint8_t sample_size; | number of octets per plane in a sample |
uint8_t nb_planes; | number of planes to allocate |
struct ubuf_sound_common_mgr_plane ** planes; | planes description |
struct ubuf_mgr mgr; | common management structure |
This function is declared in upipe/ubuf_sound_common.h source file, line 261.
This function adds a new plane to a ubuf manager for sound formats.
Parameter list:
- mgr: pointer to a ubuf_mgr structure contained in a ubuf_sound_common_mgr
- channel: channel type (see channel reference)
The return value is an error code
This function is declared in upipe/ubuf_sound_common.h source file, line 244.
This function frees memory allocated by ubuf_sound_common_mgr_init and ubuf_sound_common_mgr_add_plane.
Parameter list:
- mgr: pointer to a ubuf_mgr structure contained in a ubuf_sound_common_mgr
This function is declared in upipe/ubuf_sound_common.h source file, line 252.
This function allocates a new instance of the ubuf manager for sound formats.
Parameter list:
- mgr: pointer to a ubuf_mgr structure contained in a ubuf_sound_common_mgr
- sample_size: size in octets of a sample
This struct is declared in upipe/ubuf_sound_common.h source file, line 70.
This struct is a sub-structure of struct ubuf_sound_common_mgr, describing the allocation of individual planes.
Field | Description |
---|---|
char * channel; | channel type |
This struct is declared in upipe/ubuf_sound_common.h source file, line 46.
This struct is a sub-structure of struct ubuf_sound_common, pointing to the buffer space of individual planes. It is only needed to allocate and init it if you plan to use ubuf_sound_common_plane_map.
Field | Description |
---|---|
uint8_t * buffer; | pointer to buffer space |
This function is declared in upipe/ubuf_sound_common.h source file, line 165.
This function cleans up a plane sub-structure of a sound ubuf (currently no-op).
Parameter list:
- ubuf: pointer to ubuf
- plane: index of the plane
This function is declared in upipe/ubuf_sound_common.h source file, line 186.
This function duplicates the content of the plane sub-structure for sound ubuf. It is only necessary to call this function if you plan to use ubuf_sound_common_plane_map.
Parameter list:
- ubuf: pointer to ubuf
- new_ubuf: pointer to ubuf to overwrite
- plane: index of the plane
The return value is an error code
This function is declared in upipe/ubuf_sound_common.h source file, line 153.
This function initializes a plane sub-structure of a sound ubuf. It is only necessary to call this function if you plan to use ubuf_sound_common_plane_map.
Parameter list:
- ubuf: pointer to ubuf
- plane: index of the plane
- buffer: pointer to memory buffer
This function is declared in upipe/ubuf_sound_common.h source file, line 209.
This function iterates on sound planes channel types. Start by initializing *channel_p to NULL. If *channel_p is NULL after running this function, there are no more planes in this sound. Otherwise the string pointed to by *channel_p remains valid until the ubuf sound manager is deallocated.
Parameter list:
- ubuf: pointer to ubuf
- channel_p: reference written with channel type of the next plane
The return value is an error code
int ubuf_sound_common_plane_map(struct ubuf *ubuf, const char *channel, int offset, int size, uint8_t **buffer_p)
This function is declared in upipe/ubuf_sound_common.h source file, line 225.
This function returns a pointer to the buffer space of a plane.
To use this function, struct ubuf_sound_common_plane must be allocated and correctly filled in.
Parameter list:
- ubuf: pointer to ubuf
- channel: channel type (see channel reference)
- offset: offset of the sound area wanted in the whole sound, negative values start from the end of lines, in samples
- size: number of samples wanted, or -1 for until the end of the buffer
- buffer_p: reference written with a pointer to buffer space if not NULL
The return value is an error code
This function is declared in upipe/ubuf_sound_common.h source file, line 236.
This function shrinks a sound ubuf.
Parameter list:
- ubuf: pointer to ubuf
- offset: offset of the buffer space wanted in the whole block, in samples, negative values start from the end
- new_size: final size of the buffer, in samples (if set to -1, keep same end)
The return value is an error code
This function is declared in upipe/ubuf_sound_common.h source file, line 198.
This function returns the sizes of the sound ubuf.
Parameter list:
- ubuf: pointer to ubuf
- size_p: reference written with the number of samples of the sound if not NULL
- sample_size_p: reference written with the number of octets in a sample of a plane if not NULL
The return value is an error code
This function is declared in upipe/ubuf_sound_common.h source file, line 117.
This function returns the number of extra octets needed when allocating a sound ubuf. It is only necessary to allocate them if you plan to use ubuf_sound_common_plane_map.
Parameter list:
- mgr: description structure of the ubuf manager
The return value is number of extra octets needed
struct ubuf_sound_common * ubuf_sound_common_from_ubuf(struct ubuf *sub)
This function is for internal use only.
This function is declared in UBASE_FROM_TO function like macro expansion, line 19 in upipe/ubuf_sound_common.h source file, line 89.
This function returns a pointer to ubuf.
Parameter list:
- sub: pointer to struct ubuf
The return value is pointer to struct ubuf_sound_common
struct ubuf_sound_common_mgr * ubuf_sound_common_mgr_from_ubuf_mgr(struct ubuf_mgr *sub)
This function is for internal use only.
This function is declared in UBASE_FROM_TO function like macro expansion, line 19 in upipe/ubuf_sound_common.h source file, line 90.
This function returns a pointer to ubuf_mgr.
Parameter list:
- sub: pointer to struct ubuf_mgr
The return value is pointer to struct ubuf_sound_common_mgr
struct ubuf_mgr * ubuf_sound_common_mgr_to_ubuf_mgr(struct ubuf_sound_common_mgr *s)
This function is for internal use only.
This function is declared in UBASE_FROM_TO function like macro expansion, line 9 in upipe/ubuf_sound_common.h source file, line 90.
This function returns a pointer to ubuf_mgr.
Parameter list:
- ubuf_sound_common_mgr: pointer to struct ubuf_sound_common_mgr
The return value is pointer to struct ubuf_mgr
This function is for internal use only.
This function is declared in upipe/ubuf_sound_common.h source file, line 100.
This function returns the plane number corresponding to a channel.
Parameter list:
- mgr: common management structure
- channel: channel type
The return value is number of the plane, or -1 if not found
struct ubuf * ubuf_sound_common_to_ubuf(struct ubuf_sound_common *s)
This function is for internal use only.
This function is declared in UBASE_FROM_TO function like macro expansion, line 9 in upipe/ubuf_sound_common.h source file, line 89.
This function returns a pointer to ubuf.
Parameter list:
- ubuf_sound_common: pointer to struct ubuf_sound_common
The return value is pointer to struct ubuf