upipe/uref.h header reference

Upipe uref structure handling More

Header inclusion  

Members  

Types  

Functions  

Macros  

Description  

This file defines the API to manipulate references to buffers and attributes.

Members detail  

#define UREF_FLAG_BLOCK_END  

This macro is declared in upipe/uref.h source file, line 66.

the block is an ending point

#define UREF_FLAG_BLOCK_START  

This macro is declared in upipe/uref.h source file, line 64.

the block is a starting point

#define UREF_FLAG_CLOCK_REF  

This macro is declared in upipe/uref.h source file, line 68.

the block contains a clock reference

#define UREF_FLAG_DATE_ORIG  

This macro is declared in upipe/uref.h source file, line 75.

position of the bitfield for the type of orig date

#define UREF_FLAG_DATE_PROG  

This macro is declared in upipe/uref.h source file, line 73.

position of the bitfield for the type of prog date

#define UREF_FLAG_DATE_SYS  

This macro is declared in upipe/uref.h source file, line 71.

position of the bitfield for the type of sys date

#define UREF_FLAG_FLOW_DISC  

This macro is declared in upipe/uref.h source file, line 62.

there is a discontinuity in the flow

#define UREF_FLAG_FLOW_END  

This macro is declared in upipe/uref.h source file, line 60.

the upstream pipe has disconnected

#define _UPIPE_UREF_H_  

This macro is declared in upipe/uref.h source file, line 32.

struct uref  

This struct is declared in upipe/uref.h source file, line 86.

This struct stores references to a ubuf wth attributes.

FieldDescription
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

struct uref * uref_alloc(struct uref_mgr *mgr)  

This function is declared in upipe/uref.h source file, line 187.

This function allocates and initializes a new uref.

Parameters list:

  • mgr: management structure for this buffer pool

The return value is allocated uref or NULL in case of allocation failure

struct uref * uref_alloc_control(struct uref_mgr *mgr)  

This function is declared in upipe/uref.h source file, line 214.

This function returns a new uref with extra attributes space. This is typically useful for control messages.

Parameters list:

  • mgr: management structure for this uref pool

The return value is allocated uref or NULL in case of allocation failure

void uref_attach_ubuf(struct uref *uref, struct ubuf *ubuf)  

This function is declared in upipe/uref.h source file, line 301.

This function attaches a ubuf to a given uref. The ubuf pointer may no longer be used by the module afterwards.

Parameters list:

  • uref: pointer to uref structure
  • ubuf: pointer to ubuf structure to attach to uref

enum uref_date_type  

This enum is declared in upipe/uref.h source file, line 49.

This enum defines the type of the date.

IdentifierValueDescription
UREF_DATE_NONE0no date is defined
UREF_DATE_CR1clock ref is defined, DTS and PTS are derived
UREF_DATE_DTS2DTS is defined, CR and PTS are derived
UREF_DATE_PTS3PTS is defined, CR and DTS are derived

struct ubuf * uref_detach_ubuf(struct uref *uref)  

This function is declared in upipe/uref.h source file, line 315.

This function detaches a ubuf from a uref. The returned ubuf must be freed or re-attached at some point, otherwise it will leak.

Parameters list:

  • uref: pointer to uref structure

The return value is pointer to detached ubuf structure

struct uref * uref_dup(struct uref *uref)  

This function is declared in upipe/uref.h source file, line 279.

This function duplicates a uref.

Parameters list:

  • uref: source structure to duplicate

The return value is duplicated uref or NULL in case of allocation failure

void uref_free(struct uref *uref)  

This function is declared in upipe/uref.h source file, line 152.

This function frees a uref and other sub-structures.

Parameters list:

  • uref: structure to free

void uref_init(struct uref *uref)  

This function is declared in upipe/uref.h source file, line 167.

This function initializes a new uref.

Parameters list:

  • uref: allocated uref

struct uref_mgr  

This struct is declared in upipe/uref.h source file, line 129.

This struct stores common management parameters for a uref pool.

FieldDescription
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  

This enum is declared in upipe/uref.h source file, line 118.

This enum defines standard commands which uref managers may implement.

IdentifierValueDescription
UREF_MGR_VACUUM0release all buffers kept in pools (void)
UREF_MGR_CONTROL_LOCAL0non-standard manager commands implemented by a module type can start from there (first arg = signature)

void uref_mgr_release(struct uref_mgr *mgr)  

This function is declared in upipe/uref.h source file, line 339.

This function decrements the reference count of a uref manager or frees it.

Parameters list:

  • mgr: pointer to uref manager

struct uref_mgr * uref_mgr_use(struct uref_mgr *mgr)  

This function is declared in upipe/uref.h source file, line 327.

This function increments the reference count of a uref manager.

Parameters list:

  • mgr: pointer to uref manager

The return value is same pointer to uref manager

int uref_mgr_vacuum(struct uref_mgr *mgr)  

This function is declared in upipe/uref.h source file, line 387.

This function instructs an existing uref manager to release all structures currently kept in pools. It is inteded as a debug tool only.

Parameters list:

  • mgr: pointer to uref manager

The return value is an error code

struct uref * uref_sibling_alloc(struct uref *uref)  

This function is declared in upipe/uref.h source file, line 203.

This function allocates and initializes a new uref, allocated with a manager from an existing uref.

Parameters list:

  • uref: existing uref

The return value is allocated uref or NULL in case of allocation failure

struct uref * uref_sibling_alloc_control(struct uref *uref)  

This function is declared in upipe/uref.h source file, line 236.

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.

Parameters list:

  • uref: existing uref

The return value is allocated uref or NULL in case of allocation failure

#define UREF_FLAG_DATE_ORIG_SHIFT  

This macro is for internal use only.

This macro is declared in upipe/uref.h source file, line 82.

This macro is the number of bits to shift to get orig date type.

#define UREF_FLAG_DATE_PROG_SHIFT  

This macro is for internal use only.

This macro is declared in upipe/uref.h source file, line 80.

This macro is the number of bits to shift to get prog date type.

#define UREF_FLAG_DATE_SYS_SHIFT  

This macro is for internal use only.

This macro is declared in upipe/uref.h source file, line 78.

This macro is the number of bits to shift to get sys date type.

struct uref * uref_dup_inner(struct uref *uref)  

This function is for internal use only.

This function is declared in upipe/uref.h source file, line 246.

This function duplicates a uref without duplicating the ubuf.

Parameters list:

  • uref: source structure to duplicate

The return value is duplicated uref or NULL in case of allocation failure

struct uref * uref_from_uchain(struct uchain *sub)  

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 115.

This function returns a pointer to uchain.

Parameters list:

  • sub: pointer to struct uchain

The return value is pointer to struct uref

int uref_mgr_control(struct uref_mgr *mgr, int command, ...)  

This function is for internal use only.

This function is declared in upipe/uref.h source file, line 371.

This function sends a control command to the uref manager. Note that all arguments are owned by the caller.

Parameters 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

int uref_mgr_control_va(struct uref_mgr *mgr, int command, va_list args)  

This function is for internal use only.

This function is declared in upipe/uref.h source file, line 354.

This function sends a control command to the uref manager. Note that all arguments are owned by the caller.

Parameters 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

struct uchain * uref_to_uchain(struct uref *s)  

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 115.

This function returns a pointer to uchain.

Parameters list:

  • uref: pointer to struct uref

The return value is pointer to struct uchain

Valid XHTML 1.0 StrictGenerated by cmassiot on Thu Nov 6 12:15:41 2014 using MkDoc