upipe/ubuf.h header reference

Upipe buffer handling More

Header inclusion [link] 

Members [link] 

Types [link] 

Functions [link] 

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.

FieldDescription
struct uchain uchain;structure for double-linked lists
struct ubuf_mgr * mgr;pointer to the entity responsible for the management

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.

IdentifierValueDescription
UBUF_DUP0duplicate a given ubuf (struct ubuf **)
UBUF_SINGLE1returns UBASE_ERR_NONE if the memory area's refcount is 1 (void)
UBUF_SIZE_PICTURE2size picture ubuf (size_t *, size_t *, uint8_t *)
UBUF_SIZE_PICTURE_PLANE3size a plane of a picture ubuf (const char *, size_t *, uint8_t *, uint8_t *, uint8_t *)
UBUF_SIZE_SOUND4size sound ubuf (size_t *, uint8_t *)
UBUF_MAP_BLOCK5map block ubuf (const uint8_t **)
UBUF_READ_PICTURE_PLANE6read a plane of a picture ubuf (const char *, int, int, int, int, const uint8_t **)
UBUF_WRITE_PICTURE_PLANE7write a plane of a picture ubuf (const char *, int, int, int, int, uint8_t **)
UBUF_READ_SOUND_PLANE8read a plane of a sound ubuf (const char *, int, int, const uint8_t **)
UBUF_WRITE_SOUND_PLANE9write a plane of a sound ubuf (const char *, int, int, uint8_t **)
UBUF_UNMAP_BLOCK10unmap block ubuf (void)
UBUF_UNMAP_PICTURE_PLANE11unmap a plane of a picture ubuf (const char *, int, int, int, int)
UBUF_UNMAP_SOUND_PLANE12unmap a plane of a picture ubuf (const char *, int, int)
UBUF_SPLICE_BLOCK13duplicates and resize block ubuf (struct ubuf **, int)
UBUF_RESIZE_PICTURE14resize picture ubuf (int, int, int, int)
UBUF_RESIZE_SOUND15resize picture ubuf (int, int, int, int)
UBUF_ITERATE_PICTURE_PLANE16iterate on picture plane chroma (const char **)
UBUF_ITERATE_SOUND_PLANE17iterate on sound plane channel (const char **)
UBUF_PICTURE_SPLIT_FIELDS18split an interlaced picture into its two fields
UBUF_CONTROL_LOCAL0x8000non-standard commands implemented by a ubuf manager can start from there

struct ubuf * ubuf_dup(struct ubuf *ubuf) [link] 

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

void ubuf_free(struct ubuf *ubuf) [link] 

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.

FieldDescription
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

int ubuf_mgr_check(struct ubuf_mgr *mgr, struct uref *flow_format) [link] 

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.

IdentifierValueDescription
UBUF_MGR_CHECK0check if the given flow format can be allocated with the manager (struct uref *)
UBUF_MGR_VACUUM1release all buffers kept in pools (void)
UBUF_MGR_CONTROL_LOCAL0x8000non-standard commands implemented by a ubuf manager can start from there

void ubuf_mgr_release(struct ubuf_mgr *mgr) [link] 

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

struct ubuf_mgr * ubuf_mgr_use(struct ubuf_mgr *mgr) [link] 

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

int ubuf_mgr_vacuum(struct ubuf_mgr *mgr) [link] 

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.

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 ubuf * ubuf_alloc(struct ubuf_mgr *mgr, uint32_t signature, ...) [link] 

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

int ubuf_control(struct ubuf *ubuf, int command, ...) [link] 

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

int ubuf_control_va(struct ubuf *ubuf, int command, va_list args) [link] 

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

struct ubuf * ubuf_from_uchain(struct uchain *sub) [link] 

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

int ubuf_mgr_control(struct ubuf_mgr *mgr, int command, ...) [link] 

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

int ubuf_mgr_control_va(struct ubuf_mgr *mgr, int command, va_list args) [link] 

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

struct uchain * ubuf_to_uchain(struct ubuf *s) [link] 

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

Valid XHTML 1.0 StrictGenerated by cmassiot on Sun Dec 14 18:31:17 2025 using MkDoc