avcpp  2.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
Classes | Public Member Functions | List of all members
av::BufferRefView Class Reference

Non-owning view for the nested AVBufferRef. More...

#include <buffer.h>

Inheritance diagram for av::BufferRefView:
Inheritance graph
[legend]
Collaboration diagram for av::BufferRefView:
Collaboration graph
[legend]

Classes

struct  iam_sure_what_i_do_tag
 Tag to confirm usage of the Low Level functionality. More...
 

Public Member Functions

 BufferRefView ()=default
 Construct null buffer. More...
 
 BufferRefView (BufferRef &ref)
 
 BufferRefView (const BufferRef &ref)
 
AVBufferRef * makeRef (iam_sure_what_i_do_tag) const noexcept
 Make an reference of the exsting buffer. More...
 
BufferRef ref ()
 Create reference to the view data, refCount() will be increased. More...
 
BufferRef clone (int flags=0) const noexcept
 Make deep copy of the existing buffer. More...
 
int refCount () const noexcept
 Report current reference counter of the buffer. More...
 
bool isWritable () const noexcept
 Report writable flag. More...
 
std::size_t size () const noexcept
 Nested buffer size. More...
 
const uint8_t * data () const noexcept
 Pointer to the data block start. More...
 
const uint8_t * constData () const noexcept
 Force request const data. More...
 
uint8_t * data (OptionalErrorCode ec=throws())
 Pointer to the data block start. More...
 
- Public Member Functions inherited from FFWrapperPtr< AVBufferRef >
 FFWrapperPtr ()=default
 
 FFWrapperPtr (AVBufferRef *raw)
 
const AVBufferRef * raw () const
 
AVBufferRef * raw ()
 
void reset (AVBufferRef *raw=nullptr)
 
bool isNull () const
 
void _log (int level, const char *fmt) const
 
void _log (int level, const char *fmt, const Args &... args) const
 

Additional Inherited Members

- Protected Attributes inherited from FFWrapperPtr< AVBufferRef >
AVBufferRef * m_raw
 

Detailed Description

Non-owning view for the nested AVBufferRef.

Constructor & Destructor Documentation

◆ BufferRefView() [1/3]

av::BufferRefView::BufferRefView ( )
default

Construct null buffer.

◆ BufferRefView() [2/3]

av::BufferRefView::BufferRefView ( BufferRef ref)
explicit

◆ BufferRefView() [3/3]

av::BufferRefView::BufferRefView ( const BufferRef ref)
explicit

Member Function Documentation

◆ clone()

BufferRef av::BufferRefView::clone ( int  flags = 0) const
noexcept

Make deep copy of the existing buffer.

Data will be copied into new buffer and owning taken.

Parameters
flagsAV_BUFFER_FLAG_*
Returns

◆ constData()

const uint8_t * av::BufferRefView::constData ( ) const
noexcept

Force request const data.

Returns

◆ data() [1/2]

const uint8_t * av::BufferRefView::data ( ) const
noexcept

Pointer to the data block start.

Returns

◆ data() [2/2]

uint8_t * av::BufferRefView::data ( OptionalErrorCode  ec = throws())

Pointer to the data block start.

Note, write access possible only to the buffer when isWritable()==true. If buffer can't be written error code will reported or exception reised.

Parameters
ec
Returns

◆ isWritable()

bool av::BufferRefView::isWritable ( ) const
noexcept

Report writable flag.

Always false if refCount() == 0 or > 1. Otherwise controls by the AV_BUFFER_FLAG_READONLY.

Returns

◆ makeRef()

AVBufferRef * av::BufferRefView::makeRef ( iam_sure_what_i_do_tag  ) const
noexcept

Make an reference of the exsting buffer.

Useful to pass to the low-level API.

Returns
new reference on success (data kept uncopied) or nullptr if control block allocation fails.

◆ ref()

BufferRef av::BufferRefView::ref ( )

Create reference to the view data, refCount() will be increased.

Returns

◆ refCount()

int av::BufferRefView::refCount ( ) const
noexcept

Report current reference counter of the buffer.

For the refCount() > 1 isWritable() always return false.

Returns

◆ size()

std::size_t av::BufferRefView::size ( ) const
noexcept

Nested buffer size.

Returns

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