upipe/ubuf.h header reference
Upipe buffer handling More
Header inclusion
Members
Types
- struct ubuf
- enum ubuf_command
- struct ubuf_mgr
- enum ubuf_mgr_command
Functions
- struct ubuf * ubuf_dup(struct ubuf *ubuf)
- void ubuf_free(struct ubuf *ubuf)
- void ubuf_mgr_release(struct ubuf_mgr *mgr)
- struct ubuf_mgr * ubuf_mgr_use(struct ubuf_mgr *mgr)
- int ubuf_mgr_vacuum(struct ubuf_mgr *mgr)
Description
This file defines the API to access buffers and buffer managers.
Members detail
This macro is declared in upipe/ubuf.h source file, line 32.
This struct is declared in upipe/ubuf.h source file, line 51.
This struct is allocated by a manager and eventually points to a buffer containing data.
This enum is declared in upipe/ubuf.h source file, line 61.
This enum defines standard commands which ubuf managers may implement.
Identifier | Value | Description |
---|---|---|
UBUF_DUP | 0 | duplicate a given ubuf (struct ubuf **) |
UBUF_SINGLE | 1 | returns UBASE_ERR_NONE if the memory area's refcount is 1 (void) |
UBUF_SIZE_PICTURE | 2 | size picture ubuf (size_t *, size_t *, uint8_t *) |
UBUF_SIZE_PICTURE_PLANE | 3 | size a plane of a picture ubuf (const char *, size_t *, uint8_t *, uint8_t *, uint8_t *) |
UBUF_SIZE_SOUND | 4 | size sound ubuf (size_t *, uint8_t *) |
UBUF_MAP_BLOCK | 5 | map block ubuf (const uint8_t **) |
UBUF_READ_PICTURE_PLANE | 6 | read a plane of a picture ubuf (const char *, int, int, int, int, const uint8_t **) |
UBUF_WRITE_PICTURE_PLANE | 7 | write a plane of a picture ubuf (const char *, int, int, int, int, uint8_t **) |
UBUF_READ_SOUND_PLANE | 8 | read a plane of a sound ubuf (const char *, int, int, const uint8_t **) |
UBUF_WRITE_SOUND_PLANE | 9 | write a plane of a sound ubuf (const char *, int, int, uint8_t **) |
UBUF_UNMAP_BLOCK | 10 | unmap block ubuf (void) |
UBUF_UNMAP_PICTURE_PLANE | 11 | unmap a plane of a picture ubuf (const char *, int, int, int, int) |
UBUF_UNMAP_SOUND_PLANE | 12 | unmap a plane of a picture ubuf (const char *, int, int) |
UBUF_SPLICE_BLOCK | 13 | duplicates and resize block ubuf (struct ubuf **, int) |
UBUF_RESIZE_PICTURE | 14 | resize picture ubuf (int, int, int, int) |
UBUF_RESIZE_SOUND | 15 | resize picture ubuf (int, int, int, int) |
UBUF_ITERATE_PICTURE_PLANE | 16 | iterate on picture plane chroma (const char **) |
UBUF_ITERATE_SOUND_PLANE | 17 | iterate on sound plane channel (const char **) |
UBUF_CONTROL_LOCAL | 0 | non-standard commands implemented by a ubuf manager can start from there |
This function is declared in upipe/ubuf.h source file, line 223.
This function duplicates a given ubuf (it is very likely that the manager doesn't actually duplicate data but just create references and increment reference counts).
Parameters list:
- ubuf: pointer to ubuf
The return value is duplicated ubuf
void ubuf_free(struct ubuf *ubuf)
This function is declared in upipe/ubuf.h source file, line 235.
This function frees a ubuf.
Parameters list:
- ubuf: pointer to ubuf
This struct is declared in upipe/ubuf.h source file, line 144.
This struct stores common management parameters for a ubuf pool.
Field | Description |
---|---|
struct urefcount *refcount; | pointer to refcount management structure |
uint32_t signature; | signature of the API (block, pic, sound, other) |
struct ubuf *(*ubuf_alloc)(struct ubuf_mgr *, uint32_t signature, va_list ) ; | function to allocate a new ubuf, with optional arguments depending on the ubuf manager |
int (*ubuf_control)(struct ubuf *, int , va_list ) ; | control function for standard or local commands |
void (*ubuf_free)(struct ubuf *) ; | function to free a ubuf |
int (*ubuf_mgr_control)(struct ubuf_mgr *, int , va_list ) ; | manager control function for standard or local commands |
This enum is declared in upipe/ubuf.h source file, line 133.
This enum defines standard manger commands which ubuf managers may implement.
Identifier | Value | Description |
---|---|---|
UBUF_MGR_VACUUM | 0 | release all buffers kept in pools (void) |
UBUF_MGR_CONTROL_LOCAL | 0 | non-standard commands implemented by a ubuf manager can start from there |
void ubuf_mgr_release(struct ubuf_mgr *mgr)
This function is declared in upipe/ubuf.h source file, line 258.
This function decrements the reference count of a ubuf manager or frees it.
Parameters list:
- mgr: pointer to ubuf manager
This function is declared in upipe/ubuf.h source file, line 246.
This function increments the reference count of a ubuf manager.
Parameters list:
- mgr: pointer to ubuf manager
The return value is same pointer to ubuf manager
int ubuf_mgr_vacuum(struct ubuf_mgr *mgr)
This function is declared in upipe/ubuf.h source file, line 306.
This function instructs an existing ubuf manager to release all structures currently kept in pools. It is intended as a debug tool only.
Parameters list:
- mgr: pointer to ubuf manager
The return value is an error code
This function is for internal use only.
This function is declared in upipe/ubuf.h source file, line 172.
This function returns a new ubuf. Optional ubuf manager arguments can be passed at the end.
Parameters list:
- mgr: management structure for this ubuf type
- signature: sentinel defining the type of buffer to allocate, followed by optional arguments to the ubuf manager
The return value is pointer to ubuf or NULL in case of failure
int ubuf_control(struct ubuf *ubuf, int command, ...)
This function is for internal use only.
This function is declared in upipe/ubuf.h source file, line 206.
This function sends a control command to the ubuf.
Parameters list:
- ubuf: pointer to ubuf
- command: control command to send, followed by optional read or write parameters
The return value is an error code
int ubuf_control_va(struct ubuf *ubuf, int command, va_list args)
This function is for internal use only.
This function is declared in upipe/ubuf.h source file, line 190.
This function sends a control command to the ubuf.
Parameters list:
- ubuf: pointer to ubuf
- command: control command to send
- args: optional read or write parameters
The return value is an error code
This function is for internal use only.
This function is declared in UBASE_FROM_TO function like macro expansion, line 19 in upipe/ubuf.h source file, line 58.
This function returns a pointer to uchain.
Parameters list:
- sub: pointer to struct uchain
The return value is pointer to struct ubuf
int ubuf_mgr_control(struct ubuf_mgr *mgr, int command, ...)
This function is for internal use only.
This function is declared in upipe/ubuf.h source file, line 290.
This function sends a control command to the ubuf manager. Note that all arguments are owned by the caller.
Parameters list:
- mgr: pointer to ubuf manager
- command: manager control command to send, followed by optional read or write parameters
The return value is an error code
int ubuf_mgr_control_va(struct ubuf_mgr *mgr, int command, va_list args)
This function is for internal use only.
This function is declared in upipe/ubuf.h source file, line 273.
This function sends a control command to the ubuf manager. Note that all arguments are owned by the caller.
Parameters list:
- mgr: pointer to upipe manager
- command: manager control command to send
- args: optional read or write parameters
The return value is an error code
This function is for internal use only.
This function is declared in UBASE_FROM_TO function like macro expansion, line 9 in upipe/ubuf.h source file, line 58.
This function returns a pointer to uchain.
Parameters list:
- ubuf: pointer to struct ubuf
The return value is pointer to struct uchain