5#include "libmythbase/mythconfig.h"
17#include "libavutil/imgutils.h"
25#ifdef PGM_CONVERT_GREYSCALE
26 av_freep(
reinterpret_cast<void*
>(&
m_pgm.data[0]));
35#ifdef PGM_CONVERT_GREYSCALE
47#ifdef PGM_CONVERT_GREYSCALE
51 LOG(VB_COMMFLAG, LOG_ERR, QString(
"PGMConverter::MythPlayerInited "
52 "av_image_alloc m_pgm (%1x%2) failed")
59 LOG(VB_COMMFLAG, LOG_INFO, QString(
"PGMConverter::MythPlayerInited "
60 "using true greyscale conversion"));
62 LOG(VB_COMMFLAG, LOG_INFO, QString(
"PGMConverter::MythPlayerInited "
71 int *pwidth,
int *pheight)
77 LOG(VB_COMMFLAG, LOG_ERR,
"PGMConverter::getImage no buf");
81#ifdef PGM_CONVERT_GREYSCALE
82 auto start = nowAsDuration<std::chrono::microseconds>();
85 auto end = nowAsDuration<std::chrono::microseconds>();
88 if (av_image_fill_arrays(
m_pgm.data,
m_pgm.linesize,
91 LOG(VB_COMMFLAG, LOG_ERR,
92 QString(
"PGMConverter::getImage error at frame %1 (%2x%3)")
109#ifdef PGM_CONVERT_GREYSCALE
112 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)