Audacity 3.2.0
Classes | Public Types | Public Member Functions | Private Attributes | Friends | List of all members
AVAllocator< T > Class Template Reference

#include <FFmpegFunctions.h>

Inheritance diagram for AVAllocator< T >:
[legend]
Collaboration diagram for AVAllocator< T >:
[legend]

Classes

struct  rebind
 

Public Types

typedef size_t size_type
 
typedef T * pointer
 
typedef const T * const_pointer
 

Public Member Functions

pointer allocate (size_type n) noexcept
 
void deallocate (pointer p, size_type) noexcept
 
 AVAllocator ()
 
 AVAllocator (const AVAllocator &a)
 
template<class U >
 AVAllocator (const AVAllocator< U > &a)
 

Private Attributes

std::shared_ptr< FFmpegFunctionsmFFmpeg
 

Friends

template<class U >
class AVAllocator
 

Detailed Description

template<typename T>
class AVAllocator< T >

Definition at line 41 of file FFmpegFunctions.h.

Member Typedef Documentation

◆ const_pointer

template<typename T >
typedef const T* AVAllocator< T >::const_pointer

Definition at line 46 of file FFmpegFunctions.h.

◆ pointer

template<typename T >
typedef T* AVAllocator< T >::pointer

Definition at line 45 of file FFmpegFunctions.h.

◆ size_type

template<typename T >
typedef size_t AVAllocator< T >::size_type

Definition at line 44 of file FFmpegFunctions.h.

Constructor & Destructor Documentation

◆ AVAllocator() [1/3]

template<typename T >
AVAllocator< T >::AVAllocator

Definition at line 168 of file FFmpegFunctions.h.

170{
171}
std::shared_ptr< FFmpegFunctions > mFFmpeg
static std::shared_ptr< FFmpegFunctions > Load(bool fromUserPathOnly=false)

◆ AVAllocator() [2/3]

template<typename T >
AVAllocator< T >::AVAllocator ( const AVAllocator< T > &  a)
inline

Definition at line 59 of file FFmpegFunctions.h.

60 : std::allocator<T>(a)
61 , mFFmpeg(a.mFFmpeg)
62 {
63 }

◆ AVAllocator() [3/3]

template<typename T >
template<class U >
AVAllocator< T >::AVAllocator ( const AVAllocator< U > &  a)
inline

Definition at line 66 of file FFmpegFunctions.h.

67 : std::allocator<T>(a)
68 , mFFmpeg(a.mFFmpeg)
69 {
70 }

Member Function Documentation

◆ allocate()

template<typename T >
AVAllocator< T >::pointer AVAllocator< T >::allocate ( size_type  n)
noexcept

Definition at line 148 of file FFmpegFunctions.h.

149{
150 if (mFFmpeg)
151 return static_cast<pointer>(mFFmpeg->av_malloc(n * sizeof(T)));
152 else
153 return static_cast<pointer>(::malloc(n * sizeof(T)));
154}

◆ deallocate()

template<typename T >
void AVAllocator< T >::deallocate ( pointer  p,
size_type   
)
noexcept

Definition at line 157 of file FFmpegFunctions.h.

160{
161 if (mFFmpeg)
162 mFFmpeg->av_free(p);
163 else
164 ::free(p);
165}
void free(void *ptr)
Definition: VectorOps.h:34

References staffpad::vo::free().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ AVAllocator

template<typename T >
template<class U >
friend class AVAllocator
friend

Definition at line 73 of file FFmpegFunctions.h.

Member Data Documentation

◆ mFFmpeg

template<typename T >
std::shared_ptr<FFmpegFunctions> AVAllocator< T >::mFFmpeg
private

Definition at line 75 of file FFmpegFunctions.h.


The documentation for this class was generated from the following file: