MythTV  master
Public Member Functions | Static Public Member Functions | 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)
 
 MythVideoFrame (VideoFrameType Type, uint8_t *Buffer, size_t BufferSize, int Width, int Height, int Alignment=MYTH_WIDTH_ALIGNMENT)
 
 ~MythVideoFrame ()
 
void Init (VideoFrameType Type, int Width, int Height)
 
void Init (VideoFrameType Type, uint8_t *Buffer, size_t BufferSize, int Width, int Height, 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 GetWidthForPlan (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)
 

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 }
 
long long m_timecode { 0 }
 
int64_t m_displayTimecode { 0 }
 
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 }
 
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 }
 
MythDeintType m_deinterlaceSingle { DEINT_NONE }
 
MythDeintType m_deinterlaceDouble { DEINT_NONE }
 
MythDeintType m_deinterlaceAllowed { DEINT_NONE }
 
MythDeintType m_deinterlaceInuse { DEINT_NONE }
 
bool m_deinterlaceInuse2x { false }
 

Static Private Member Functions

static MythDeintType GetDeinterlacer (MythDeintType Option)
 

Detailed Description

Definition at line 82 of file mythframe.h.

Constructor & Destructor Documentation

◆ MythVideoFrame() [1/3]

MythVideoFrame::MythVideoFrame ( )
default

◆ MythVideoFrame() [2/3]

MythVideoFrame::MythVideoFrame ( VideoFrameType  Type,
int  Width,
int  Height 
)

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,
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 
)

◆ Init() [2/2]

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

Definition at line 55 of file mythframe.cpp.

◆ ClearMetadata()

void MythVideoFrame::ClearMetadata ( )

Definition at line 147 of file mythframe.cpp.

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

◆ ClearBufferToBlank()

void MythVideoFrame::ClearBufferToBlank ( )

Definition at line 202 of file mythframe.cpp.

Referenced by AvFormatDecoder::GenerateDummyVideoFrames().

◆ CopyFrame()

bool MythVideoFrame::CopyFrame ( MythVideoFrame From)

Definition at line 272 of file mythframe.cpp.

◆ GetSingleRateOption()

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

Definition at line 436 of file mythframe.cpp.

◆ GetDoubleRateOption()

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

Definition at line 444 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 430 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 525 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 153 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

◆ GetWidthForPlan()

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

Definition at line 337 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 416 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 444 of file mythframe.h.

Referenced by ClearBufferToBlank().

◆ YUVFormat()

static bool MythVideoFrame::YUVFormat ( VideoFrameType  Type)
inlinestatic

◆ GetDeinterlacer()

MythDeintType MythVideoFrame::GetDeinterlacer ( MythDeintType  Option)
staticprivate

Definition at line 452 of file mythframe.cpp.

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

Member Data Documentation

◆ 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 114 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 119 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

long long MythVideoFrame::m_timecode { 0 }

◆ m_displayTimecode

int64_t MythVideoFrame::m_displayTimecode { 0 }

◆ m_priv

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

Definition at line 124 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 126 of file mythframe.h.

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

◆ m_interlacedReverse

bool MythVideoFrame::m_interlacedReverse { false }

Definition at line 127 of file mythframe.h.

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

◆ m_newGOP

bool MythVideoFrame::m_newGOP { false }

Definition at line 128 of file mythframe.h.

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

◆ m_repeatPic

bool MythVideoFrame::m_repeatPic { false }

Definition at line 129 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 132 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 137 of file mythframe.h.

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

◆ m_colorspace

int MythVideoFrame::m_colorspace { 1 }

Definition at line 138 of file mythframe.h.

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

◆ m_colorrange

int MythVideoFrame::m_colorrange { 1 }

Definition at line 139 of file mythframe.h.

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

◆ m_colorprimaries

int MythVideoFrame::m_colorprimaries { 1 }

Definition at line 140 of file mythframe.h.

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

◆ m_colortransfer

int MythVideoFrame::m_colortransfer { 1 }

Definition at line 141 of file mythframe.h.

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

◆ m_chromalocation

int MythVideoFrame::m_chromalocation { 1 }

Definition at line 142 of file mythframe.h.

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

◆ m_colorshifted

bool MythVideoFrame::m_colorshifted { false }

Definition at line 143 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 145 of file mythframe.h.

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

◆ m_stereo3D

uint MythVideoFrame::m_stereo3D { 0 }

Definition at line 146 of file mythframe.h.

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

◆ 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 150 of file mythframe.h.

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

◆ m_deinterlaceInuse2x

bool MythVideoFrame::m_deinterlaceInuse2x { false }

Definition at line 151 of file mythframe.h.

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


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