upipe/ubuf_pic_mem.h header reference

Upipe ubuf manager for picture formats with umem storage More

Header inclusion [link] 

Members [link] 

Types [link] 

Functions [link] 

  • int ubuf_pic_mem_get_shared(struct ubuf *ubuf, const char *chroma, struct ubuf_mem_shared **shared_p, size_t *offset_p, size_t *size_p)
  • int ubuf_pic_mem_mgr_add_plane(struct ubuf_mgr *mgr, const char *chroma, uint8_t hsub, uint8_t vsub, uint8_t macropixel_size)
  • struct ubuf_mgr * ubuf_pic_mem_mgr_alloc(uint16_t ubuf_pool_depth, uint16_t shared_pool_depth, struct umem_mgr *umem_mgr, uint8_t macropixel, int hprepend, int happend, int vprepend, int vappend, int align, int align_hmoffset)
  • struct ubuf_mgr * ubuf_pic_mem_mgr_alloc_fourcc(uint16_t ubuf_pool_depth, uint16_t shared_pool_depth, struct umem_mgr *umem_mgr, const char *fcc, int hmprepend, int hmappend, int vprepend, int vappend, int align, int align_hmoffset)

Macro [link] 

Description [link] 

Upipe ubuf manager for picture formats with umem storage

Members detail [link] 

#define UBUF_PIC_MEM_SIGNATURE [link] 

This macro is declared in upipe/ubuf_pic_mem.h source file, line 45.

This macro is a simple signature to make sure the ubuf_control internal API is used properly.

#define _UPIPE_UBUF_PIC_MEM_H_ [link] 

This macro is declared in upipe/ubuf_pic_mem.h source file, line 31.

[link] 

This struct is declared in upipe/ubuf_sound_mem.h source file, line 50.

This header is the low-level shared structure with reference counting, pointing to the actual data.

FieldDescription
uatomic_uint32_t refcount;number of blocks pointing to the memory area
struct upool * pool;pointer to origin pool
struct umem umem;umem structure pointing to buffer

enum ubuf_pic_mem_command [link] 

This enum is declared in upipe/ubuf_pic_mem.h source file, line 54.

This enum extends ubuf_command with specific commands for pic mem manager.

IdentifierValueDescription
UBUF_PIC_MEM_SENTINEL0x8000
UBUF_PIC_MEM_GET_SHARED1returns the shared substructure (const char *, struct ubuf_mem_shared **, size_t *, size_t *)

int ubuf_pic_mem_get_shared(struct ubuf *ubuf, const char *chroma, struct ubuf_mem_shared **shared_p, size_t *offset_p, size_t *size_p) [link] 

This function is declared in upipe/ubuf_pic_mem.h source file, line 75.

This function returns the underlying shared buffer. The reference counter is not incremented.

Parameter list:

  • ubuf: pointer to ubuf
  • chroma: chroma type (see chroma reference)
  • shared_p: filled in with a pointer to the underlying shared buffer
  • offset_p: filled in with the offset in the shared buffer for the plane
  • size_p: filled in with the size of the plane

The return value is an error code

int ubuf_pic_mem_mgr_add_plane(struct ubuf_mgr *mgr, const char *chroma, uint8_t hsub, uint8_t vsub, uint8_t macropixel_size) [link] 

This function is declared in upipe/ubuf_pic_mem.h source file, line 123.

This function adds a new plane to a ubuf manager for picture formats using umem. It may only be called on initializing the manager, before any ubuf is allocated.

Parameter list:

  • mgr: pointer to a ubuf_mgr structure
  • chroma: chroma type (see chroma reference)
  • hsub: horizontal subsamping
  • vsub: vertical subsamping
  • macropixel_size: size of a macropixel in octets

The return value is an error code

struct ubuf_mgr * ubuf_pic_mem_mgr_alloc(uint16_t ubuf_pool_depth, uint16_t shared_pool_depth, struct umem_mgr *umem_mgr, uint8_t macropixel, int hprepend, int happend, int vprepend, int vappend, int align, int align_hmoffset) [link] 

This function is declared in upipe/ubuf_pic_mem.h source file, line 108.

This function allocates a new instance of the ubuf manager for picture formats using umem.

Parameter list:

  • ubuf_pool_depth: maximum number of ubuf structures in the pool
  • shared_pool_depth: maximum number of shared structures in the pool
  • umem_mgr: memory allocator to use for buffers
  • macropixel: number of pixels in a macropixel (typically 1)
  • hprepend: extra pixels added before each line (if set to -1, a default sensible value is used)
  • happend: extra pixels added after each line (if set to -1, a default sensible value is used)
  • vprepend: extra lines added before buffer (if set to -1, a default sensible value is used)
  • vappend: extra lines added after buffer (if set to -1, a default sensible value is used)
  • align: alignment in octets (if set to 0, no line will be voluntarily aligned)
  • align_hmoffset: horizontal offset of the aligned macropixel in a line (may be negative)

The return value is pointer to manager, or NULL in case of error

struct ubuf_mgr * ubuf_pic_mem_mgr_alloc_fourcc(uint16_t ubuf_pool_depth, uint16_t shared_pool_depth, struct umem_mgr *umem_mgr, const char *fcc, int hmprepend, int hmappend, int vprepend, int vappend, int align, int align_hmoffset) [link] 

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

This function allocates a new instance of the ubuf manager for picture formats using umem, from a fourcc image format.

Parameter list:

  • ubuf_pool_depth: maximum number of ubuf structures in the pool
  • shared_pool_depth: maximum number of shared structures in the pool
  • umem_mgr: memory allocator to use for buffers
  • fcc: fourcc to use to create the manager
  • hmprepend: extra macropixels added before each line (if set to -1, a default sensible value is used)
  • hmappend: extra macropixels added after each line (if set to -1, a default sensible value is used)
  • vprepend: extra lines added before buffer (if set to -1, a default sensible value is used)
  • vappend: extra lines added after buffer (if set to -1, a default sensible value is used)
  • align: alignment in octets (if set to 0, no line will be voluntarily aligned)
  • align_hmoffset: horizontal offset of the aligned macropixel in a line (may be negative)

The return value is pointer to manager, or NULL in case of error

[link] 

This struct is declared in upipe/uprobe_ubuf_mem_pool.h source file, line 43.

FieldDescription
struct urefcount * refcount;pointer to refcount management structure
bool (*umem_alloc)(struct umem_mgr *, struct umem *, size_t ) ;function to allocate a new memory block
bool (*umem_realloc)(struct umem *, size_t ) ;function to resize umem
void (*umem_free)(struct umem *) ;function to free a umem
void (*umem_mgr_vacuum)(struct umem_mgr *) ;function to release all buffers kept in pools
Valid XHTML 1.0 StrictGenerated by cmassiot on Sun Dec 14 18:31:17 2025 using MkDoc