avcpp  2.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
Classes | Namespaces | Macros | Functions | Variables
avutils.h File Reference
#include <string>
#include <vector>
#include <deque>
#include <memory>
#include <mutex>
#include <sstream>
#include <algorithm>
#include <functional>
#include "ffmpeg.h"
#include "avtime.h"
#include <libavfilter/avfilter.h>
#include <libavcodec/avcodec.h>
Include dependency graph for avutils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  av::noncopyable
 
struct  av::EmptyDeleter
 
struct  av::v1::AvDeleter
 
struct  av::v2::SmartDeleter
 
class  av::ScopedValue< T, V >
 Functor to take next element in list/array. More...
 
class  av::ScopeOutAction
 The ScopeOutAction class - guard-type class that allows points callback that will be called at the scope out. More...
 
struct  av::EqualComparator< T >
 

Namespaces

 av
 
 av::v1
 The AvDeleter struct Unified delete functor for variois FFMPEG/libavformat/libavcodec and so on resource allocators.
 
 av::v2
 

Macros

#define USE_CODECPAR   ((LIBAVCODEC_VERSION_MAJOR) >= 59)
 
#define API_NEW_CHANNEL_LAYOUT   ((LIBAVUTIL_VERSION_MAJOR > 57) || (LIBAVUTIL_VERSION_MAJOR == 57 && (LIBAVUTIL_VERSION_MINOR >= 24)))
 
#define API_FRAME_NUM   ((LIBAVCODEC_VERSION_MAJOR > 60) || (LIBAVCODEC_VERSION_MAJOR == 60 && LIBAVCODEC_VERSION_MINOR >= 2))
 
#define API_AVFORMAT_URL   ((LIBAVFORMAT_VERSION_MAJOR > 58) || (LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR >= 7))
 
#define API_FRAME_KEY   ((LIBAVUTIL_VERSION_MAJOR > 58) || (LIBAVUTIL_VERSION_MAJOR == 58 && LIBAVUTIL_VERSION_MINOR >= 29))
 
#define API_AVCODEC_CLOSE   (LIBAVCODEC_VERSION_MAJOR < 61)
 
#define FF_DISABLE_DEPRECATION_WARNINGS
 
#define FF_ENABLE_DEPRECATION_WARNINGS
 
#define setFFmpegLoggingLevel   set_logging_level
 

Functions

template<typename R , typename T >
av::lexical_cast (const T &v)
 
void av::set_logging_level (int32_t level)
 This method can be used to turn up or down FFmpeg's logging level. More...
 
void av::set_logging_level (const std::string &level)
 Like. More...
 
void av::dumpBinaryBuffer (uint8_t *buffer, int buffer_size, int width=16)
 dump_binary_buffer Dump binary buffer to std out in HEX view More...
 
string av::error2string (int error)
 C++ verstion of the av_err2str() More...
 
template<typename T >
std::unique_ptr< T, void(*)(void *)> av::malloc (size_t size)
 
template<typename T >
std::unique_ptr< T, void(*)(void *)> av::mallocz (size_t size)
 
template<typename T >
std::unique_ptr< T, void(*)(void *)> av::memdup (const void *p, size_t size)
 
template<typename T , typename L , typename C >
av::guessValue (const T &value, const L *list, C endListComparator)
 Select more approptiate value from given value list. More...
 
template<typename T , typename Container >
void av::array_to_container (const T *array, std::size_t nelements, Container &container)
 
template<typename T , typename Container , typename Callable >
void av::array_to_container (const T *array, std::size_t nelements, Container &container, Callable convert)
 
template<typename T , typename Container , typename Compare >
void av::array_to_container (const T *array, Container &container, Compare isEnd)
 
template<typename T , typename Container , typename Compare , typename Callable >
void av::array_to_container (const T *array, Container &container, Compare isEnd, Callable convert)
 

Variables

constexpr auto av::NoPts = static_cast<int64_t>(AV_NOPTS_VALUE)
 
constexpr auto av::TimeBase = static_cast<int>(AV_TIME_BASE)
 
constexpr auto av::TimeBaseQ = AVRational{1, AV_TIME_BASE}
 

Macro Definition Documentation

◆ API_AVCODEC_CLOSE

#define API_AVCODEC_CLOSE   (LIBAVCODEC_VERSION_MAJOR < 61)

◆ API_AVFORMAT_URL

#define API_AVFORMAT_URL   ((LIBAVFORMAT_VERSION_MAJOR > 58) || (LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR >= 7))

◆ API_FRAME_KEY

#define API_FRAME_KEY   ((LIBAVUTIL_VERSION_MAJOR > 58) || (LIBAVUTIL_VERSION_MAJOR == 58 && LIBAVUTIL_VERSION_MINOR >= 29))

◆ API_FRAME_NUM

#define API_FRAME_NUM   ((LIBAVCODEC_VERSION_MAJOR > 60) || (LIBAVCODEC_VERSION_MAJOR == 60 && LIBAVCODEC_VERSION_MINOR >= 2))

◆ API_NEW_CHANNEL_LAYOUT

#define API_NEW_CHANNEL_LAYOUT   ((LIBAVUTIL_VERSION_MAJOR > 57) || (LIBAVUTIL_VERSION_MAJOR == 57 && (LIBAVUTIL_VERSION_MINOR >= 24)))

◆ FF_DISABLE_DEPRECATION_WARNINGS

#define FF_DISABLE_DEPRECATION_WARNINGS

◆ FF_ENABLE_DEPRECATION_WARNINGS

#define FF_ENABLE_DEPRECATION_WARNINGS

◆ setFFmpegLoggingLevel

#define setFFmpegLoggingLevel   set_logging_level

◆ USE_CODECPAR

#define USE_CODECPAR   ((LIBAVCODEC_VERSION_MAJOR) >= 59)