15#include <libavcodec/avcodec.h>
16#include <libavfilter/buffersink.h>
17#include <libavfilter/buffersrc.h>
18#include <libavutil/opt.h>
21#include <vdr/thread.h>
53#if LIBAVFILTER_BUILD >= AV_VERSION_INT(10, 6, 100)
87#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(7,16,100)
131 par->hw_frames_ctx = frame->hw_frames_ctx;
135 par->sample_aspect_ratio =
sar;
137 LOGDEBUG2(
L_CODEC,
"video filter: %s: filter=\"%s\" fmt %d, hw ctx %p, tb %d/%d, wxh %dx%d, sar %d/%d",
139 par->format,
par->hw_frames_ctx,
par->time_base.num,
par->time_base.den,
140 par->width,
par->height,
par->sample_aspect_ratio.num,
par->sample_aspect_ratio.den);
154 snprintf(
args,
sizeof(
args),
"video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
206 LOGDEBUG(
"video filter: thread started");
238 }
else if (
ret < 0) {
256 LOGDEBUG(
"video filter: thread stopped");
275 LOGDEBUG(
"video filter: stopping thread");
T * Pop(void)
Pop an element from the back of the queue.
bool IsEmpty(void)
Check if the queue is empty.
bool IsFull(void)
Check if the queue is full.
bool Push(T *element)
Push an element to the front of the queue.
cQueue< cDrmBuffer > * m_pDrmBufferQueue
pointer to renderer's DRM buffer queue
int m_numFramesToFilter
number of frames to be filtered
AVFilterGraph * m_pFilterGraph
filter graph
cQueue< AVFrame > m_frames
queue for frames to be filtered
AVFilterContext * m_pBuffersinkCtx
buffer sink context
std::function< void(AVFrame *)> m_frameOutput
function to output the frame
bool m_filterBug
flag for a ffmpeg bug
AVFilterContext * m_pBuffersrcCtx
buffer src context
void SetFilterOutputPixFormat(AVPixelFormat)
Setup the filter output pixel format.
cVideoFilter(cVideoRender *, cQueue< cDrmBuffer > *, const char *, std::function< void(AVFrame *)>)
void InitAndStart(const AVCodecContext *, AVFrame *, bool)
Init and start the video filter thread.
void Stop(void)
Stops the filter thread and does a cleanup.
void Action(void)
Main filter thread loop.
void PushFrame(AVFrame *)
Puts a frame in the buffer to be filtered.
#define LOGDEBUG2
log to LOG_DEBUG and add a prefix
#define LOGDEBUG
log to LOG_DEBUG
#define LOGERROR
log to LOG_ERR
#define LOGWARNING
log to LOG_WARN
#define LOGFATAL
log to LOG_ERR and abort
static bool isInterlacedFrame(AVFrame *frame)
Check, if this is an interlaced frame.
Deinterlace and Scaling Filters Header File.
Video Renderer (Display) Header File.