MythTV  master
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Private Member Functions | List of all members
MythVideoFrame Class Reference

#include <mythframe.h>

Collaboration diagram for MythVideoFrame:
Collaboration graph
[legend]

Public Member Functions

 MythVideoFrame ()=default
 
 MythVideoFrame (VideoFrameType Type, int Width, int Height, const VideoFrameTypes *RenderFormats=nullptr)
 
 MythVideoFrame (VideoFrameType Type, uint8_t *Buffer, size_t BufferSize, int Width, int Height, const VideoFrameTypes *RenderFormats=nullptr, int Alignment=MYTH_WIDTH_ALIGNMENT)
 
 ~MythVideoFrame ()
 
void Init (VideoFrameType Type, int Width, int Height, const VideoFrameTypes *RenderFormats=nullptr)
 
void Init (VideoFrameType Type, uint8_t *Buffer, size_t BufferSize, int Width, int Height, const VideoFrameTypes *RenderFormats=nullptr, int Alignment=MYTH_WIDTH_ALIGNMENT)
 
void ClearMetadata ()
 
void ClearBufferToBlank ()
 
bool CopyFrame (MythVideoFrame *From)
 
MythDeintType GetSingleRateOption (MythDeintType Type, MythDeintType Override=DEINT_NONE) const
 
MythDeintType GetDoubleRateOption (MythDeintType Type, MythDeintType Override=DEINT_NONE) const
 

Static Public Member Functions

static void CopyPlane (uint8_t *To, int ToPitch, const uint8_t *From, int FromPitch, int PlaneWidth, int PlaneHeight)
 
static QString FormatDescription (VideoFrameType Type)
 
static uint8_t * GetAlignedBuffer (size_t Size)
 
static uint8_t * CreateBuffer (VideoFrameType Type, int Width, int Height)
 
static size_t GetBufferSize (VideoFrameType Type, int Width, int Height, int Aligned=MYTH_WIDTH_ALIGNMENT)
 
static QString DeinterlacerPref (MythDeintType Deint)
 
static QString DeinterlacerName (MythDeintType Deint, bool DoubleRate, VideoFrameType Format=FMT_NONE)
 
static MythDeintType ParseDeinterlacer (const QString &Deinterlacer)
 
static int BitsPerPixel (VideoFrameType Type)
 
static uint GetNumPlanes (VideoFrameType Type)
 
static int GetHeightForPlane (VideoFrameType Type, int Height, uint Plane)
 
static int GetPitchForPlane (VideoFrameType Type, int Width, uint Plane)
 
static int GetWidthForPlane (VideoFrameType Type, int Width, uint Plane)
 
static int ColorDepth (int Format)
 
static bool HardwareFormat (VideoFrameType Type)
 
static bool HardwareFramesFormat (VideoFrameType Type)
 
static bool FormatIs420 (VideoFrameType Type)
 
static bool FormatIs422 (VideoFrameType Type)
 
static bool FormatIs444 (VideoFrameType Type)
 
static bool FormatIsNV12 (VideoFrameType Type)
 
static bool PackedFormat (VideoFrameType Type)
 
static bool YUVFormat (VideoFrameType Type)
 
static bool FormatIsRGB (VideoFrameType Type)
 

Public Attributes

VideoFrameType m_type { FMT_NONE }
 
uint8_t * m_buffer { nullptr }
 
int m_width { 0 }
 
int m_height { 0 }
 
int m_bitsPerPixel { 0 }
 
size_t m_bufferSize { 0 }
 
float m_aspect { -1.0F }
 
double m_frameRate { -1.0 }
 
long long m_frameNumber { 0 }
 
uint64_t m_frameCounter { 0 }
 
std::chrono::milliseconds m_timecode { 0ms }
 
std::chrono::milliseconds m_displayTimecode { 0ms }
 
std::array< uint8_t *, 4 > m_priv { nullptr }
 
int m_interlaced { 0 }
 
bool m_topFieldFirst { true }
 
bool m_interlacedReverse { false }
 
bool m_newGOP { false }
 
bool m_repeatPic { false }
 
bool m_forceKey { false }
 
bool m_dummy { false }
 
bool m_pauseFrame { false }
 
FramePitches m_pitches { 0 }
 
FrameOffsets m_offsets { 0 }
 
int m_pixFmt { 0 }
 
int m_swPixFmt { 0 }
 
bool m_directRendering { true }
 
const VideoFrameTypesm_renderFormats { &kDefaultRenderFormats }
 
int m_colorspace { 1 }
 
int m_colorrange { 1 }
 
int m_colorprimaries { 1 }
 
int m_colortransfer { 1 }
 
int m_chromalocation { 1 }
 
bool m_colorshifted { false }
 
bool m_alreadyDeinterlaced { false }
 
int m_rotation { 0 }
 
uint m_stereo3D { 0 }
 
MythHDRVideoPtr m_hdrMetadata { nullptr }
 
MythDeintType m_deinterlaceSingle { DEINT_NONE }
 
MythDeintType m_deinterlaceDouble { DEINT_NONE }
 
MythDeintType m_deinterlaceAllowed { DEINT_NONE }
 
MythDeintType m_deinterlaceInuse { DEINT_NONE }
 
bool m_deinterlaceInuse2x { false }
 
bool m_displayed { false }
 
QRect m_srcRect
 
QRect m_dstRect
 

Static Public Attributes

static const VideoFrameTypes kDefaultRenderFormats { FMT_YV12 }
 

Static Private Member Functions

static MythDeintType GetDeinterlacer (MythDeintType Option)
 

Detailed Description

Definition at line 88 of file mythframe.h.

Constructor & Destructor Documentation

◆ MythVideoFrame() [1/3]

MythVideoFrame::MythVideoFrame ( )
default

◆ MythVideoFrame() [2/3]

MythVideoFrame::MythVideoFrame ( VideoFrameType  Type,
int  Width,
int  Height,
const VideoFrameTypes RenderFormats = nullptr 
)

Definition at line 30 of file mythframe.cpp.

◆ MythVideoFrame() [3/3]

MythVideoFrame::MythVideoFrame ( VideoFrameType  Type,
uint8_t *  Buffer,
size_t  BufferSize,
int  Width,
int  Height,
const VideoFrameTypes RenderFormats = nullptr,
int  Alignment = MYTH_WIDTH_ALIGNMENT 
)

Definition at line 35 of file mythframe.cpp.

◆ ~MythVideoFrame()

MythVideoFrame::~MythVideoFrame ( )

Definition at line 22 of file mythframe.cpp.

Member Function Documentation

◆ Init() [1/2]

void MythVideoFrame::Init ( VideoFrameType  Type,
int  Width,
int  Height,
const VideoFrameTypes RenderFormats = nullptr 
)

Definition at line 42 of file mythframe.cpp.

Referenced by MythVideoFrame(), and Transcode::TranscodeFile().

◆ Init() [2/2]

void MythVideoFrame::Init ( VideoFrameType  Type,
uint8_t *  Buffer,
size_t  BufferSize,
int  Width,
int  Height,
const VideoFrameTypes RenderFormats = nullptr,
int  Alignment = MYTH_WIDTH_ALIGNMENT 
)

Definition at line 56 of file mythframe.cpp.

◆ ClearMetadata()

void MythVideoFrame::ClearMetadata ( )

Definition at line 149 of file mythframe.cpp.

Referenced by AvFormatDecoder::GenerateDummyVideoFrames(), and Init().

◆ ClearBufferToBlank()

void MythVideoFrame::ClearBufferToBlank ( )

Definition at line 205 of file mythframe.cpp.

Referenced by AvFormatDecoder::GenerateDummyVideoFrames().

◆ CopyFrame()

bool MythVideoFrame::CopyFrame ( MythVideoFrame From)

Definition at line 275 of file mythframe.cpp.

◆ GetSingleRateOption()

MythDeintType MythVideoFrame::GetSingleRateOption ( MythDeintType  Type,
MythDeintType  Override = DEINT_NONE 
) const

Definition at line 441 of file mythframe.cpp.

◆ GetDoubleRateOption()

MythDeintType MythVideoFrame::GetDoubleRateOption ( MythDeintType  Type,
MythDeintType  Override = DEINT_NONE 
) const

Definition at line 449 of file mythframe.cpp.

Referenced by VideoPerformanceTest::Test().

◆ CopyPlane()

void MythVideoFrame::CopyPlane ( uint8_t *  To,
int  ToPitch,
const uint8_t *  From,
int  FromPitch,
int  PlaneWidth,
int  PlaneHeight 
)
static

◆ FormatDescription()

QString MythVideoFrame::FormatDescription ( VideoFrameType  Type)
static

◆ GetAlignedBuffer()

uint8_t * MythVideoFrame::GetAlignedBuffer ( size_t  Size)
static

◆ CreateBuffer()

uint8_t * MythVideoFrame::CreateBuffer ( VideoFrameType  Type,
int  Width,
int  Height 
)
static

Definition at line 435 of file mythframe.cpp.

Referenced by MythPreviewPlayer::GetScreenGrabAtFrame().

◆ GetBufferSize()

size_t MythVideoFrame::GetBufferSize ( VideoFrameType  Type,
int  Width,
int  Height,
int  Aligned = MYTH_WIDTH_ALIGNMENT 
)
static

◆ DeinterlacerPref()

QString MythVideoFrame::DeinterlacerPref ( MythDeintType  Deint)
static

Definition at line 530 of file mythframe.cpp.

Referenced by MythVideoOutput::SetDeinterlacing().

◆ DeinterlacerName()

QString MythVideoFrame::DeinterlacerName ( MythDeintType  Deint,
bool  DoubleRate,
VideoFrameType  Format = FMT_NONE 
)
static

◆ ParseDeinterlacer()

MythDeintType MythVideoFrame::ParseDeinterlacer ( const QString &  Deinterlacer)
static

◆ BitsPerPixel()

static int MythVideoFrame::BitsPerPixel ( VideoFrameType  Type)
inlinestatic

Definition at line 170 of file mythframe.h.

Referenced by GetBufferSize(), GetPitchForPlane(), and Init().

◆ GetNumPlanes()

static uint MythVideoFrame::GetNumPlanes ( VideoFrameType  Type)
inlinestatic

◆ GetHeightForPlane()

static int MythVideoFrame::GetHeightForPlane ( VideoFrameType  Type,
int  Height,
uint  Plane 
)
inlinestatic

◆ GetPitchForPlane()

static int MythVideoFrame::GetPitchForPlane ( VideoFrameType  Type,
int  Width,
uint  Plane 
)
inlinestatic

◆ GetWidthForPlane()

static int MythVideoFrame::GetWidthForPlane ( VideoFrameType  Type,
int  Width,
uint  Plane 
)
inlinestatic

Definition at line 354 of file mythframe.h.

Referenced by MythMMALInterop::Acquire(), and MythDeinterlacer::Blend().

◆ ColorDepth()

static int MythVideoFrame::ColorDepth ( int  Format)
inlinestatic

◆ HardwareFormat()

static bool MythVideoFrame::HardwareFormat ( VideoFrameType  Type)
inlinestatic

◆ HardwareFramesFormat()

static bool MythVideoFrame::HardwareFramesFormat ( VideoFrameType  Type)
inlinestatic

Definition at line 433 of file mythframe.h.

Referenced by ReleaseDecoderResources(), and MythOpenGLVideo::RenderFrame().

◆ FormatIs420()

static bool MythVideoFrame::FormatIs420 ( VideoFrameType  Type)
inlinestatic

◆ FormatIs422()

static bool MythVideoFrame::FormatIs422 ( VideoFrameType  Type)
inlinestatic

◆ FormatIs444()

static bool MythVideoFrame::FormatIs444 ( VideoFrameType  Type)
inlinestatic

◆ FormatIsNV12()

static bool MythVideoFrame::FormatIsNV12 ( VideoFrameType  Type)
inlinestatic

◆ PackedFormat()

static bool MythVideoFrame::PackedFormat ( VideoFrameType  Type)
inlinestatic

Definition at line 461 of file mythframe.h.

Referenced by ClearBufferToBlank().

◆ YUVFormat()

static bool MythVideoFrame::YUVFormat ( VideoFrameType  Type)
inlinestatic

◆ FormatIsRGB()

static bool MythVideoFrame::FormatIsRGB ( VideoFrameType  Type)
inlinestatic

Definition at line 472 of file mythframe.h.

Referenced by MythOpenGLVideo::RenderFrame().

◆ GetDeinterlacer()

MythDeintType MythVideoFrame::GetDeinterlacer ( MythDeintType  Option)
staticprivate

Definition at line 457 of file mythframe.cpp.

Referenced by DeinterlacerName(), GetDoubleRateOption(), and GetSingleRateOption().

Member Data Documentation

◆ kDefaultRenderFormats

const VideoFrameTypes MythVideoFrame::kDefaultRenderFormats { FMT_YV12 }
inlinestatic

Definition at line 91 of file mythframe.h.

Referenced by Init(), and MythVideoFrame().

◆ m_type

VideoFrameType MythVideoFrame::m_type { FMT_NONE }

◆ m_buffer

uint8_t* MythVideoFrame::m_buffer { nullptr }

◆ m_width

int MythVideoFrame::m_width { 0 }

◆ m_height

int MythVideoFrame::m_height { 0 }

◆ m_bitsPerPixel

int MythVideoFrame::m_bitsPerPixel { 0 }

Definition at line 123 of file mythframe.h.

Referenced by CopyFrame(), and Init().

◆ m_bufferSize

size_t MythVideoFrame::m_bufferSize { 0 }

◆ m_aspect

float MythVideoFrame::m_aspect { -1.0F }

◆ m_frameRate

double MythVideoFrame::m_frameRate { -1.0 }

Definition at line 128 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and MythCCExtractorPlayer::OnGotNewFrame().

◆ m_frameNumber

long long MythVideoFrame::m_frameNumber { 0 }

◆ m_frameCounter

uint64_t MythVideoFrame::m_frameCounter { 0 }

◆ m_timecode

std::chrono::milliseconds MythVideoFrame::m_timecode { 0ms }

◆ m_displayTimecode

std::chrono::milliseconds MythVideoFrame::m_displayTimecode { 0ms }

◆ m_priv

std::array<uint8_t*,4> MythVideoFrame::m_priv { nullptr }

Definition at line 133 of file mythframe.h.

Referenced by ClearMetadata(), MythCodecContext::GetBuffer(), and Init().

◆ m_interlaced

int MythVideoFrame::m_interlaced { 0 }

◆ m_topFieldFirst

bool MythVideoFrame::m_topFieldFirst { true }

Definition at line 135 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_interlacedReverse

bool MythVideoFrame::m_interlacedReverse { false }

Definition at line 136 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_newGOP

bool MythVideoFrame::m_newGOP { false }

Definition at line 137 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_repeatPic

bool MythVideoFrame::m_repeatPic { false }

Definition at line 138 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and MythCCExtractorPlayer::OnGotNewFrame().

◆ m_forceKey

bool MythVideoFrame::m_forceKey { false }

◆ m_dummy

bool MythVideoFrame::m_dummy { false }

◆ m_pauseFrame

bool MythVideoFrame::m_pauseFrame { false }

Definition at line 141 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_pitches

FramePitches MythVideoFrame::m_pitches { 0 }

◆ m_offsets

FrameOffsets MythVideoFrame::m_offsets { 0 }

◆ m_pixFmt

int MythVideoFrame::m_pixFmt { 0 }

◆ m_swPixFmt

int MythVideoFrame::m_swPixFmt { 0 }

◆ m_directRendering

bool MythVideoFrame::m_directRendering { true }

Definition at line 146 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_renderFormats

const VideoFrameTypes* MythVideoFrame::m_renderFormats { &kDefaultRenderFormats }

Definition at line 147 of file mythframe.h.

Referenced by Init().

◆ m_colorspace

int MythVideoFrame::m_colorspace { 1 }

Definition at line 148 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_colorrange

int MythVideoFrame::m_colorrange { 1 }

Definition at line 149 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_colorprimaries

int MythVideoFrame::m_colorprimaries { 1 }

Definition at line 150 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_colortransfer

int MythVideoFrame::m_colortransfer { 1 }

Definition at line 151 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_chromalocation

int MythVideoFrame::m_chromalocation { 1 }

Definition at line 152 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_colorshifted

bool MythVideoFrame::m_colorshifted { false }

Definition at line 153 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), get_avf_buffer(), and MythCodecContext::GetBuffer().

◆ m_alreadyDeinterlaced

bool MythVideoFrame::m_alreadyDeinterlaced { false }

◆ m_rotation

int MythVideoFrame::m_rotation { 0 }

Definition at line 155 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_stereo3D

uint MythVideoFrame::m_stereo3D { 0 }

Definition at line 156 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_hdrMetadata

MythHDRVideoPtr MythVideoFrame::m_hdrMetadata { nullptr }

Definition at line 157 of file mythframe.h.

Referenced by ClearMetadata(), and CopyFrame().

◆ m_deinterlaceSingle

MythDeintType MythVideoFrame::m_deinterlaceSingle { DEINT_NONE }

◆ m_deinterlaceDouble

MythDeintType MythVideoFrame::m_deinterlaceDouble { DEINT_NONE }

◆ m_deinterlaceAllowed

MythDeintType MythVideoFrame::m_deinterlaceAllowed { DEINT_NONE }

◆ m_deinterlaceInuse

MythDeintType MythVideoFrame::m_deinterlaceInuse { DEINT_NONE }

Definition at line 161 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_deinterlaceInuse2x

bool MythVideoFrame::m_deinterlaceInuse2x { false }

Definition at line 162 of file mythframe.h.

Referenced by ClearMetadata(), CopyFrame(), and AvFormatDecoder::ProcessVideoFrame().

◆ m_displayed

bool MythVideoFrame::m_displayed { false }

Definition at line 166 of file mythframe.h.

◆ m_srcRect

QRect MythVideoFrame::m_srcRect

Definition at line 167 of file mythframe.h.

◆ m_dstRect

QRect MythVideoFrame::m_dstRect

Definition at line 168 of file mythframe.h.


The documentation for this class was generated from the following files: