28#include <libavutil/frame.h>
40static inline void glCheckError(
const char *stmt,
const char *fname,
int line) {
41 GLint err = glGetError();
42 if (err != GL_NO_ERROR)
43 LOGERROR(
"GL Error (0x%08x): %s failed at %s:%i", err, stmt, fname, line);
46static inline void eglCheckError(
const char *stmt,
const char *fname,
int line) {
47 EGLint err = eglGetError();
48 if (err != EGL_SUCCESS)
49 LOGERROR(
"EGL ERROR (0x%08x): %s failed at %s:%i", err, stmt, fname, line);
52#define GL_CHECK(stmt) do { \
54 glCheckError(#stmt, __FILE__, __LINE__); \
57#define EGL_CHECK(stmt) do { \
59 eglCheckError(#stmt, __FILE__, __LINE__); \
69#define AV_NOPTS_VALUE INT64_C(0x8000000000000000)
72#define VIDEO_SURFACES_MAX 3
83#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(58,7,100)
84 return frame->interlaced_frame;
86 return frame->flags & AV_FRAME_FLAG_INTERLACED;
95static inline const char* av_err2string(
int errnum)
97 static char str[3][AV_ERROR_MAX_STRING_SIZE];
98 char buf[AV_ERROR_MAX_STRING_SIZE];
102 av_make_error_string(buf, AV_ERROR_MAX_STRING_SIZE, errnum);
103 snprintf(str[idx],
sizeof(str[idx]),
"%s", buf);
107#define av_err2str(err) av_err2string(err)
121 static char buf[3][20];
125 return "--:--:--.---";
131 snprintf(buf[idx],
sizeof(buf[idx]),
"%2d:%02d:%02d.%03d",
132 (
int)(ts / (3600000)), (
int)((ts / (60000)) % 60),
133 (
int)((ts / (1000)) % 60), (
int)(ts % 1000));
141static inline uint32_t
ReadBytes(
const uint8_t *data,
int count)
145 for (
int i = 0; i < count; i++) {
Logger class header file.
static uint32_t ReadBytes(const uint8_t *data, int count)
Return count amount of bytes from data.
static bool isInterlacedFrame(AVFrame *frame)
Check, if this is an interlaced frame.
static const char * Timestamp2String(int64_t ts, uint8_t divisor)
Workaround for av_err2str() not working with C++.