upipe/ubuf.h header reference

Upipe buffer handling More

Header inclusion  

Members  

Types  

Functions  

Description  

This file defines the API to access buffers and buffer managers.

Members detail  

#define _UPIPE_UBUF_H_  

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

struct ubuf  

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.

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

enum ubuf_command  

This enum is declared in upipe/ubuf.h source file, line 61.

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_CONTROL_LOCAL0non-standard commands implemented by a ubuf manager can start from there

struct ubuf * ubuf_dup(struct ubuf *ubuf)  

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

struct ubuf_mgr  

This struct is declared in upipe/ubuf.h source file, line 144.

This struct stores common management parameters for a ubuf pool.

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

enum ubuf_mgr_command  

This enum is declared in upipe/ubuf.h source file, line 133.

This enum defines standard manger commands which ubuf managers may implement.

IdentifierValueDescription
UBUF_MGR_VACUUM0release all buffers kept in pools (void)
UBUF_MGR_CONTROL_LOCAL0non-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

struct ubuf_mgr * ubuf_mgr_use(struct ubuf_mgr *mgr)  

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

struct ubuf * ubuf_alloc(struct ubuf_mgr *mgr, uint32_t signature, ...)  

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

struct ubuf * ubuf_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/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

struct uchain * ubuf_to_uchain(struct ubuf *s)  

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

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