16#include "libavutil/imgutils.h"
24#ifdef PGM_CONVERT_GREYSCALE
25 av_freep(
reinterpret_cast<void*
>(&
m_pgm.data[0]));
34#ifdef PGM_CONVERT_GREYSCALE
46#ifdef PGM_CONVERT_GREYSCALE
50 LOG(VB_COMMFLAG, LOG_ERR, QString(
"PGMConverter::MythPlayerInited "
51 "av_image_alloc m_pgm (%1x%2) failed")
58 LOG(VB_COMMFLAG, LOG_INFO, QString(
"PGMConverter::MythPlayerInited "
59 "using true greyscale conversion"));
61 LOG(VB_COMMFLAG, LOG_INFO, QString(
"PGMConverter::MythPlayerInited "
70 int *pwidth,
int *pheight)
76 LOG(VB_COMMFLAG, LOG_ERR,
"PGMConverter::getImage no buf");
80#ifdef PGM_CONVERT_GREYSCALE
81 auto start = nowAsDuration<std::chrono::microseconds>();
84 auto end = nowAsDuration<std::chrono::microseconds>();
87 if (av_image_fill_arrays(
m_pgm.data,
m_pgm.linesize,
90 LOG(VB_COMMFLAG, LOG_ERR,
91 QString(
"PGMConverter::getImage error at frame %1 (%2x%3)")
108#ifdef PGM_CONVERT_GREYSCALE
111 LOG(VB_COMMFLAG, LOG_INFO, QString(
"PGM Time: convert=%1s")
int Copy(AVFrame *To, const MythVideoFrame *From, unsigned char *Buffer, AVPixelFormat Fmt=AV_PIX_FMT_YUV420P)
Initialise AVFrame and copy contents of VideoFrame frame into it, performing any required conversion.
QSize GetVideoBufferSize(void) const
int MythPlayerInited(const MythPlayer *player)
const AVFrame * getImage(const MythVideoFrame *frame, long long frameno, int *pwidth, int *pheight)
std::chrono::microseconds m_convertTime
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QString strftimeval(std::chrono::microseconds usecs)