avcpp 3.1.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
Loading...
Searching...
No Matches
ffmpeg.h File Reference

FFmpeg types re-exported for the public API and small value wrappers.

#include <iostream>
#include "avcompat.h"
#include <libavutil/avutil.h>
#include <libavutil/parseutils.h>
#include <libavutil/mathematics.h>
#include <libavutil/opt.h>
#include <libavutil/pixdesc.h>
#include <libavutil/bswap.h>
#include <libswscale/swscale.h>
#include <libswresample/swresample.h>

Go to the source code of this file.

Classes

struct  FFWrapperPtr< T >
 Base for wrappers that own a pointer to an FFmpeg object. More...
struct  FFWrapperRef< T >
 Base for wrappers that hold a small FFmpeg structure by value. More...
struct  PixSampleFmtWrapper< WrapperClass, T, NoneValue >
 Strongly typed enum-like wrapper over an FFmpeg pixel or sample format. More...

Macros

#define RAW_GET(field, def)
 Read an AVCodecContext-style field through a possibly empty raw pointer.
#define RAW_SET(field, val)
 Write an AVCodecContext-style field when the raw pointer is set.
#define RAW_GET2(cond, field, def)
 Read a field when the pointer is set and a condition holds.
#define RAW_SET2(cond, field, val)
 Write a field when the pointer is set and a condition holds.
#define IF_GET(ptr, field, def)
 Read a field through an explicit pointer, or return a default.
#define IF_SET(ptr, field, val)
 Write a field through an explicit pointer when it is not null.
#define IF_GET2(cond, ptr, field, def)
 Read a field through a pointer when it is not null and a condition holds.
#define IF_SET2(cond, ptr, field, val)
 Write a field through a pointer when it is not null and a condition holds.

Macro Definition Documentation

◆ IF_GET

#define IF_GET ( ptr,
field,
def )
Value:
((ptr) ? ptr->field : def)
Parameters
ptrthe pointer to test
fieldthe field to read
defthe value to return when the pointer is null

◆ IF_GET2

#define IF_GET2 ( cond,
ptr,
field,
def )
Value:
(ptr && (cond) ? ptr->field : def)
Parameters
condextra condition
ptrthe pointer to test
fieldthe field to read
defthe value to return otherwise

◆ IF_SET

#define IF_SET ( ptr,
field,
val )
Value:
(if(ptr) ptr->field = (val))
Parameters
ptrthe pointer to test
fieldthe field to write
valthe value to store

◆ IF_SET2

#define IF_SET2 ( cond,
ptr,
field,
val )
Value:
(if(ptr && (cond)) ptr->field = (val))
Parameters
condextra condition
ptrthe pointer to test
fieldthe field to write
valthe value to store

◆ RAW_GET

#define RAW_GET ( field,
def )
Value:
(m_raw ? m_raw->field : (def))
Parameters
fieldthe field to read
defthe value to return when the pointer is empty

◆ RAW_GET2

#define RAW_GET2 ( cond,
field,
def )
Value:
(m_raw && (cond) ? m_raw->field : def)
Parameters
condextra condition, usually isValid()
fieldthe field to read
defthe value to return otherwise

◆ RAW_SET

#define RAW_SET ( field,
val )
Value:
if(m_raw) m_raw->field = (val)
Parameters
fieldthe field to write
valthe value to store

◆ RAW_SET2

#define RAW_SET2 ( cond,
field,
val )
Value:
if(m_raw && (cond)) m_raw->field = (val)
Parameters
condextra condition, usually !isOpened()
fieldthe field to write
valthe value to store