upipe/ubuf.h header reference
Upipe buffer handling More
Header inclusion [link]
Members [link]
Types [link]
- struct ubuf
- enum ubuf_command
- enum ubuf_mgr_command
Functions [link]
- struct ubuf * ubuf_dup(struct ubuf *ubuf)
- void ubuf_free(struct ubuf *ubuf)
- int ubuf_mgr_check(struct ubuf_mgr *mgr, struct uref *flow_format)
- 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 [link]
This file defines the API to access buffers and buffer managers.
Members detail [link]
#define _UPIPE_UBUF_H_ [link]
This macro is declared in upipe/ubuf.h source file, line 32.
struct ubuf [link]
This struct is declared in upipe/ubuf.h source file, line 53.
This struct is allocated by a manager and eventually points to a buffer containing data.
enum ubuf_command [link]
This enum is declared in upipe/ubuf.h source file, line 63.
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_PICTURE_SPLIT_FIELDS | 18 | split an interlaced picture into its two fields |
| UBUF_CONTROL_LOCAL | 0x8000 | non-standard commands implemented by a ubuf manager can start from there |
This function is declared in upipe/ubuf.h source file, line 230.
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).
Parameter list:
- ubuf: pointer to ubuf
The return value is duplicated ubuf
This function is declared in upipe/ubuf.h source file, line 242.
This function frees a ubuf.
Parameter list:
- ubuf: pointer to ubuf
struct ubuf_mgr [link]
This struct is declared in upipe/ubuf_mem.h source file, line 42.
| 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 signatureva_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 function is declared in upipe/ubuf.h source file, line 315.
This function checks if the given flow format can be allocated with the ubuf manager.
Parameter list:
- mgr: pointer to ubuf manager
- flow_format: flow format to check
The return value is an error code
enum ubuf_mgr_command [link]
This enum is declared in upipe/ubuf.h source file, line 137.
This enum defines standard manager commands which ubuf managers may implement.
| Identifier | Value | Description |
|---|---|---|
| UBUF_MGR_CHECK | 0 | check if the given flow format can be allocated with the manager (struct uref *) |
| UBUF_MGR_VACUUM | 1 | release all buffers kept in pools (void) |
| UBUF_MGR_CONTROL_LOCAL | 0x8000 | non-standard commands implemented by a ubuf manager can start from there |
This function is declared in upipe/ubuf.h source file, line 266.
This function decrements the reference count of a ubuf manager or frees it.
Parameter list:
- mgr: pointer to ubuf manager
This function is declared in upipe/ubuf.h source file, line 254.
This function increments the reference count of a ubuf manager.
Parameter list:
- mgr: pointer to ubuf manager
The return value is same pointer to ubuf manager
This function is declared in upipe/ubuf.h source file, line 326.
This function instructs an existing ubuf manager to release all structures currently kept in pools. It is intended as a debug tool only.
Parameter list:
- mgr: pointer to ubuf manager
The return value is an error code
struct uref [link]
This struct is declared in upipe/ubuf_mem.h source file, line 46.
| Field | Description |
|---|---|
| struct uchain uchain; | structure for double-linked lists |
| struct uref_mgr * mgr; | pointer to the entity responsible for the management |
| struct ubuf * ubuf; | pointer to ubuf |
| struct udict * udict; | pointer to udict |
| uint64_t flags; | void flags |
| uint64_t date_sys; | date in system time |
| uint64_t date_prog; | date in program time |
| uint64_t date_orig; | original date |
| uint64_t dts_pts_delay; | duration between DTS and PTS |
| uint64_t cr_dts_delay; | duration between CR and DTS |
| uint64_t rap_cr_delay; | duration between RAP and CR |
| uint64_t priv; | private for local pipe user |
This function is for internal use only.
This function is declared in upipe/ubuf.h source file, line 179.
This function returns a new ubuf. Optional ubuf manager arguments can be passed at the end.
Parameter 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
This function is for internal use only.
This function is declared in upipe/ubuf.h source file, line 213.
This function sends a control command to the ubuf.
Parameter list:
- ubuf: pointer to ubuf
- command: control command to send, followed by optional read or write parameters
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 197.
This function sends a control command to the ubuf.
Parameter 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 60.
This function returns a pointer to uchain.
Parameter list:
- sub: pointer to struct uchain
The return value is pointer to struct ubuf
This function is for internal use only.
This function is declared in upipe/ubuf.h source file, line 298.
This function sends a control command to the ubuf manager. Note that all arguments are owned by the caller.
Parameter 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
This function is for internal use only.
This function is declared in upipe/ubuf.h source file, line 281.
This function sends a control command to the ubuf manager. Note that all arguments are owned by the caller.
Parameter 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 60.
This function returns a pointer to uchain.
Parameter list:
- ubuf: pointer to struct ubuf
The return value is pointer to struct uchain