VLC 4.0.0-dev
|
Data Structures | |
struct | picture_pool_t |
Macros | |
#define | POOL_MAX (CHAR_BIT * sizeof (unsigned long long)) |
Functions | |
static void | picture_pool_Destroy (picture_pool_t *pool) |
void | picture_pool_Release (picture_pool_t *pool) |
Releases a pool created by picture_pool_New() or picture_pool_NewFromFormat(). More... | |
static void | picture_pool_ReleaseClone (picture_t *clone) |
static picture_t * | picture_pool_ClonePicture (picture_pool_t *pool, unsigned offset) |
picture_pool_t * | picture_pool_New (unsigned count, picture_t *const *tab) |
Creates a pool of preallocated pictures. More... | |
picture_pool_t * | picture_pool_NewFromFormat (const video_format_t *fmt, unsigned count) |
Allocates pictures from the heap and creates a picture pool with them. More... | |
picture_pool_t * | picture_pool_Reserve (picture_pool_t *master, unsigned count) |
Reserves pictures from a pool and creates a new pool with those. More... | |
picture_t * | picture_pool_Get (picture_pool_t *pool) |
Obtains a picture from a pool if any is immediately available. More... | |
picture_t * | picture_pool_Wait (picture_pool_t *pool) |
Obtains a picture from a pool. More... | |
unsigned | picture_pool_GetSize (const picture_pool_t *pool) |
#define POOL_MAX (CHAR_BIT * sizeof (unsigned long long)) |
|
static |
References picture_pool_t::picture, picture_HasChainedPics(), picture_InternalClone(), picture_pool_ReleaseClone(), picture_pool_t::refs, and vlc_atomic_rc_inc().
Referenced by picture_pool_Get(), and picture_pool_Wait().
|
static |
References aligned_free, picture_pool_t::refs, and vlc_atomic_rc_dec().
Referenced by picture_pool_Release(), and picture_pool_ReleaseClone().
picture_t * picture_pool_Get | ( | picture_pool_t * | pool | ) |
Obtains a picture from a pool if any is immediately available.
The picture must be released with picture_Release().
References picture_pool_t::available, ctz, picture_pool_t::lock, picture_pool_ClonePicture(), picture_pool_t::refs, vlc_atomic_rc_get(), vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by picture_pool_Reserve(), PrerenderPicture(), VideoBufferNew(), and VoutVideoFilterInteractiveNewPicture().
unsigned picture_pool_GetSize | ( | const picture_pool_t * | pool | ) |
References picture_pool_t::picture_count.
Referenced by vout_OpenWrapper().
picture_pool_t * picture_pool_New | ( | unsigned | count, |
picture_t *const * | tab | ||
) |
Creates a pool of preallocated pictures.
Free pictures can be allocated from the pool, and are returned to the pool when they are no longer referenced.
This avoids allocating and deallocationg pictures repeatedly, and ensures that memory consumption remains within limits.
To obtain a picture from the pool, use picture_pool_Get(). To increase and decrease the reference count, use picture_Hold() and picture_Release() respectively.
count | number of pictures in the array |
tab | array of pictures |
References aligned_alloc(), picture_pool_t::available, count, picture_pool_t::lock, picture_pool_t::picture, picture_pool_t::picture_count, POOL_MAX, picture_pool_t::refs, unlikely, vlc_atomic_rc_init(), vlc_cond_init(), vlc_mutex_init(), and picture_pool_t::wait.
Referenced by picture_pool_NewFromFormat(), and picture_pool_Reserve().
picture_pool_t * picture_pool_NewFromFormat | ( | const video_format_t * | fmt, |
unsigned | count | ||
) |
Allocates pictures from the heap and creates a picture pool with them.
This is a convenience wrapper for picture_NewFromFormat() and picture_pool_New().
fmt | video format of pictures to allocate from the heap |
count | number of pictures to allocate |
References count, picture_NewFromFormat(), picture_pool_New(), picture_Release(), POOL_MAX, unlikely, and vlc_assert_unreachable.
Referenced by ModuleThread_UpdateVideoFormat(), vout_GetPool(), and vout_OpenWrapper().
void picture_pool_Release | ( | picture_pool_t * | pool | ) |
Releases a pool created by picture_pool_New() or picture_pool_NewFromFormat().
References picture_pool_t::picture, picture_pool_t::picture_count, picture_pool_Destroy(), and picture_Release().
Referenced by CreateVoutIfNeeded(), DeleteDecoder(), vout_CloseWrapper(), vout_display_Delete(), vout_display_Reset(), and vout_OpenWrapper().
|
static |
References picture_priv_t::gc, picture_priv_t::opaque, picture_pool_Destroy(), picture_Release(), POOL_MAX, vlc_cond_signal(), vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by picture_pool_ClonePicture().
picture_pool_t * picture_pool_Reserve | ( | picture_pool_t * | master, |
unsigned | count | ||
) |
Reserves pictures from a pool and creates a new pool with those.
When the new pool is released, pictures are returned to the master pool. If the master pool was already released, pictures will be destroyed.
count | number of picture to reserve |
References count, picture_pool_Get(), picture_pool_New(), picture_Release(), POOL_MAX, unlikely, and vlc_assert_unreachable.
Referenced by vout_OpenWrapper().
picture_t * picture_pool_Wait | ( | picture_pool_t * | pool | ) |
Obtains a picture from a pool.
The picture must be released with picture_Release().
References picture_pool_t::available, ctz, picture_pool_t::lock, picture_pool_ClonePicture(), picture_pool_t::refs, vlc_atomic_rc_get(), vlc_cond_wait(), vlc_mutex_lock(), vlc_mutex_unlock(), and picture_pool_t::wait.
Referenced by ModuleThread_NewVideoBuffer().