upipe/uref.h header reference
Upipe uref structure handling More
Header inclusion [link]
Members [link]
Types [link]
- enum uref_date_type
- enum uref_mgr_command
Functions [link]
- struct uref * uref_alloc(struct uref_mgr *mgr)
- struct uref * uref_alloc_control(struct uref_mgr *mgr)
- void uref_attach_ubuf(struct uref *uref, struct ubuf *ubuf)
- const char * uref_date_type_str(int dt)
- struct ubuf * uref_detach_ubuf(struct uref *uref)
- struct uref * uref_dup(struct uref *uref)
- struct uref * uref_fork(struct uref *uref, struct ubuf *ubuf)
- void uref_free(struct uref *uref)
- void uref_init(struct uref *uref)
- void uref_mgr_release(struct uref_mgr *mgr)
- struct uref_mgr * uref_mgr_use(struct uref_mgr *mgr)
- int uref_mgr_vacuum(struct uref_mgr *mgr)
- struct uref * uref_sibling_alloc(struct uref *uref)
- struct uref * uref_sibling_alloc_control(struct uref *uref)
Macros [link]
Description [link]
This file defines the API to manipulate references to buffers and attributes.
Members detail [link]
#define UREF_FLAG_BLOCK_END [link]
This macro is declared in upipe/uref.h source file, line 85.
the block is an ending point
#define UREF_FLAG_BLOCK_START [link]
This macro is declared in upipe/uref.h source file, line 83.
the block is a starting point
#define UREF_FLAG_CLOCK_REF [link]
This macro is declared in upipe/uref.h source file, line 87.
the block contains a clock reference
#define UREF_FLAG_DATE_ORIG [link]
This macro is declared in upipe/uref.h source file, line 94.
position of the bitfield for the type of orig date
#define UREF_FLAG_DATE_PROG [link]
This macro is declared in upipe/uref.h source file, line 92.
position of the bitfield for the type of prog date
#define UREF_FLAG_DATE_SYS [link]
This macro is declared in upipe/uref.h source file, line 90.
position of the bitfield for the type of sys date
#define UREF_FLAG_FLOW_DISC [link]
This macro is declared in upipe/uref.h source file, line 79.
there is a discontinuity in the flow
#define UREF_FLAG_FLOW_END [link]
This macro is declared in upipe/uref.h source file, line 77.
the upstream pipe has disconnected
#define UREF_FLAG_FLOW_RANDOM [link]
This macro is declared in upipe/uref.h source file, line 81.
the current uref is a random access point
#define _UPIPE_UREF_H_ [link]
This macro is declared in upipe/uref.h source file, line 32.
[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 declared in upipe/uref.h source file, line 204.
This function allocates and initializes a new uref.
Parameter list:
- mgr: management structure for this buffer pool
The return value is allocated uref or NULL in case of allocation failure
This function is declared in upipe/uref.h source file, line 231.
This function returns a new uref with extra attributes space. This is typically useful for control messages.
Parameter list:
- mgr: management structure for this uref pool
The return value is allocated uref or NULL in case of allocation failure
This function is declared in upipe/uref.h source file, line 319.
This function attaches a ubuf to a given uref. The ubuf pointer may no longer be used by the module afterwards.
Parameter list:
- uref: pointer to uref structure
- ubuf: pointer to ubuf structure to attach to uref
enum uref_date_type [link]
This enum is declared in upipe/uref.h source file, line 50.
This enum defines the type of the date.
| Identifier | Value | Description |
|---|---|---|
| UREF_DATE_NONE | 0 | no date is defined |
| UREF_DATE_CR | 1 | clock ref is defined, DTS and PTS are derived |
| UREF_DATE_DTS | 2 | DTS is defined, CR and PTS are derived |
| UREF_DATE_PTS | 3 | PTS is defined, CR and DTS are derived |
const char * uref_date_type_str(int dt) [link]
This function is declared in upipe/uref.h source file, line 67.
This function return the date type string
Parameter list:
- dt: the uref date type
The return value is a string
This function is declared in upipe/uref.h source file, line 333.
This function detaches a ubuf from a uref. The returned ubuf must be freed or re-attached at some point, otherwise it will leak.
Parameter list:
- uref: pointer to uref structure
The return value is pointer to detached ubuf structure
This function is declared in upipe/uref.h source file, line 297.
This function duplicates a uref.
Parameter list:
- uref: source structure to duplicate
The return value is duplicated uref or NULL in case of allocation failure
This function is declared in upipe/uref.h source file, line 345.
This function duplicates a uref and attaches a new ubuf to the copy.
Parameter list:
- uref: source structure to duplicate
The return value is duplicated uref or NULL in case of allocation failure
This function is declared in upipe/uref.h source file, line 171.
This function frees a uref and other sub-structures.
Parameter list:
- uref: structure to free
This function is declared in upipe/uref.h source file, line 184.
This function initializes a new uref.
Parameter list:
- uref: allocated uref
[link]
This struct is declared in upipe/uprobe_uref_mgr.h source file, line 42.
| Field | Description |
|---|---|
| struct urefcount * refcount; | pointer to refcount management structure |
| size_t control_attr_size; | minimum size of a control uref |
| struct udict_mgr * udict_mgr; | udict manager |
| struct uref *(*uref_alloc)(struct uref_mgr *) ; | function to allocate a uref |
| void (*uref_free)(struct uref *) ; | function to free a uref |
| int (*uref_mgr_control)(struct uref_mgr *, int va_list ) ; | control function for standard or local manager commands - all parameters belong to the caller |
enum uref_mgr_command [link]
This enum is declared in upipe/uref.h source file, line 137.
This enum defines standard commands which uref managers may implement.
| Identifier | Value | Description |
|---|---|---|
| UREF_MGR_VACUUM | 0 | release all buffers kept in pools (void) |
| UREF_MGR_CONTROL_LOCAL | 0x8000 | non-standard manager commands implemented by a module type can start from there (first arg = signature) |
This function is declared in upipe/uref.h source file, line 372.
This function decrements the reference count of a uref manager or frees it.
Parameter list:
- mgr: pointer to uref manager
This function is declared in upipe/uref.h source file, line 360.
This function increments the reference count of a uref manager.
Parameter list:
- mgr: pointer to uref manager
The return value is same pointer to uref manager
This function is declared in upipe/uref.h source file, line 420.
This function instructs an existing uref manager to release all structures currently kept in pools. It is intended as a debug tool only.
Parameter list:
- mgr: pointer to uref manager
The return value is an error code
This function is declared in upipe/uref.h source file, line 220.
This function allocates and initializes a new uref, allocated with a manager from an existing uref.
Parameter list:
- uref: existing uref
The return value is allocated uref or NULL in case of allocation failure
This function is declared in upipe/uref.h source file, line 253.
This function returns a new uref with extra attributes space, allocated with a manager from an existing uref. This is typically useful for control messages.
Parameter list:
- uref: existing uref
The return value is allocated uref or NULL in case of allocation failure
#define UREF_FLAG_DATE_ORIG_SHIFT [link]
This macro is for internal use only.
This macro is declared in upipe/uref.h source file, line 101.
This macro is the number of bits to shift to get orig date type.
#define UREF_FLAG_DATE_PROG_SHIFT [link]
This macro is for internal use only.
This macro is declared in upipe/uref.h source file, line 99.
This macro is the number of bits to shift to get prog date type.
#define UREF_FLAG_DATE_SYS_SHIFT [link]
This macro is for internal use only.
This macro is declared in upipe/uref.h source file, line 97.
This macro is the number of bits to shift to get sys date type.
This function is for internal use only.
This function is declared in upipe/uref.h source file, line 263.
This function duplicates a uref without duplicating the ubuf.
Parameter list:
- uref: source structure to duplicate
The return value is duplicated uref or NULL in case of allocation failure
This function is for internal use only.
This function is declared in UBASE_FROM_TO function like macro expansion, line 19 in upipe/uref.h source file, line 134.
This function returns a pointer to uchain.
Parameter list:
- sub: pointer to struct uchain
The return value is pointer to struct uref
This function is for internal use only.
This function is declared in upipe/uref.h source file, line 404.
This function sends a control command to the uref manager. Note that all arguments are owned by the caller.
Parameter list:
- mgr: pointer to uref manager
- command: control manager 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/uref.h source file, line 387.
This function sends a control command to the uref manager. Note that all arguments are owned by the caller.
Parameter list:
- mgr: pointer to uref 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/uref.h source file, line 134.
This function returns a pointer to uchain.
Parameter list:
- uref: pointer to struct uref
The return value is pointer to struct uchain