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

#include <mythvideotexture.h>

Inheritance diagram for MythVideoTexture:
Inheritance graph
[legend]
Collaboration diagram for MythVideoTexture:
Collaboration graph
[legend]

Public Member Functions

 MythVideoTexture (GLuint Texture)
 
 ~MythVideoTexture ()=default
 
- Public Member Functions inherited from MythGLTexture
 MythGLTexture (QOpenGLTexture *Texture)
 
 MythGLTexture (GLuint Texture)
 
 ~MythGLTexture ()=default
 

Static Public Member Functions

static vector< MythVideoTexture * > CreateTextures (MythRenderOpenGL *Context, VideoFrameType Type, VideoFrameType Format, vector< QSize > Sizes, GLenum Target=QOpenGLTexture::Target2D)
 Create a set of textures suitable for the given Type and Format. More...
 
static MythVideoTextureCreateHelperTexture (MythRenderOpenGL *Context)
 
static void UpdateTextures (MythRenderOpenGL *Context, const VideoFrame *Frame, const vector< MythVideoTexture * > &Textures)
 Update the contents of the given Textures for data held in Frame. More...
 
static void DeleteTexture (MythRenderOpenGL *Context, MythVideoTexture *Texture)
 
static void DeleteTextures (MythRenderOpenGL *Context, vector< MythVideoTexture * > &Textures)
 
static void SetTextureFilters (MythRenderOpenGL *Context, const vector< MythVideoTexture * > &Textures, QOpenGLTexture::Filter Filter, QOpenGLTexture::WrapMode Wrap=QOpenGLTexture::ClampToEdge)
 
static MythVideoTextureCreateTexture (MythRenderOpenGL *Context, QSize Size, GLenum Target=QOpenGLTexture::Target2D, QOpenGLTexture::PixelType PixelType=QOpenGLTexture::UInt8, QOpenGLTexture::PixelFormat PixelFormat=QOpenGLTexture::RGBA, QOpenGLTexture::TextureFormat Format=QOpenGLTexture::NoFormat, QOpenGLTexture::Filter Filter=QOpenGLTexture::Linear, QOpenGLTexture::WrapMode Wrap=QOpenGLTexture::ClampToEdge)
 Create and initialise a MythVideoTexture that is backed by a QOpenGLTexture. More...
 

Public Attributes

bool m_valid { false }
 
QOpenGLTexture::Filter m_filter { QOpenGLTexture::Linear }
 
VideoFrameType m_frameType { FMT_NONE }
 
VideoFrameType m_frameFormat { FMT_NONE }
 
uint m_plane { 0 }
 
uint m_planeCount { 0 }
 
bool m_allowGLSLDeint { false }
 
MythAVCopym_copyContext { nullptr }
 
- Public Attributes inherited from MythGLTexture
unsigned char * m_data { nullptr }
 
int m_bufferSize { 0 }
 
GLuint m_textureId { 0 }
 
QOpenGLTexture * m_texture { nullptr }
 
QOpenGLTexture::PixelFormat m_pixelFormat { QOpenGLTexture::RGBA }
 
QOpenGLTexture::PixelType m_pixelType { QOpenGLTexture::UInt8 }
 
QOpenGLBuffer * m_vbo { nullptr }
 
QSize m_size { QSize() }
 
QSize m_totalSize { QSize() }
 
bool m_flip { true }
 
bool m_crop { false }
 
QRect m_source { QRect() }
 
QRect m_destination { QRect() }
 
GLfloat m_vertexData [16] { 0.0F }
 
GLenum m_target { QOpenGLTexture::Target2D }
 
int m_rotation { 0 }
 

Protected Member Functions

 MythVideoTexture (QOpenGLTexture *Texture)
 

Static Private Member Functions

static vector< MythVideoTexture * > CreateHardwareTextures (MythRenderOpenGL *Context, VideoFrameType Type, VideoFrameType Format, vector< QSize > Sizes, GLenum Target)
 Create a set of hardware textures suitable for the given format. More...
 
static vector< MythVideoTexture * > CreateSoftwareTextures (MythRenderOpenGL *Context, VideoFrameType Type, VideoFrameType Format, vector< QSize > Sizes, GLenum Target)
 Create a set of OpenGL textures to represent the given Format. More...
 
static void YV12ToYV12 (MythRenderOpenGL *Context, const VideoFrame *Frame, MythVideoTexture *Texture, uint Plane)
 Copy YV12 frame data to 'YV12' textures. More...
 
static void YV12ToYUYV (const VideoFrame *Frame, MythVideoTexture *Texture)
 Copy YV12 frame data to a YUYV texture. More...
 
static void NV12ToNV12 (MythRenderOpenGL *Context, const VideoFrame *Frame, MythVideoTexture *Texture, uint Plane)
 Copy NV12 video frame data to 'NV12' textures. More...
 
static bool CreateBuffer (MythVideoTexture *Texture, int Size)
 Create a data buffer for holding CPU side texture data. More...
 
static void StoreBicubicWeights (float X, float *Dest)
 

Detailed Description

Definition at line 20 of file mythvideotexture.h.

Constructor & Destructor Documentation

◆ MythVideoTexture() [1/2]

MythVideoTexture::MythVideoTexture ( GLuint  Texture)
explicit

Definition at line 12 of file mythvideotexture.cpp.

Referenced by CreateHardwareTextures(), and CreateTexture().

◆ ~MythVideoTexture()

MythVideoTexture::~MythVideoTexture ( )
default

◆ MythVideoTexture() [2/2]

MythVideoTexture::MythVideoTexture ( QOpenGLTexture *  Texture)
explicitprotected

Definition at line 7 of file mythvideotexture.cpp.

Member Function Documentation

◆ CreateTextures()

vector< MythVideoTexture * > MythVideoTexture::CreateTextures ( MythRenderOpenGL Context,
VideoFrameType  Type,
VideoFrameType  Format,
vector< QSize >  Sizes,
GLenum  Target = QOpenGLTexture::Target2D 
)
static

◆ CreateHelperTexture()

MythVideoTexture * MythVideoTexture::CreateHelperTexture ( MythRenderOpenGL Context)
static

Definition at line 578 of file mythvideotexture.cpp.

◆ UpdateTextures()

void MythVideoTexture::UpdateTextures ( MythRenderOpenGL Context,
const VideoFrame Frame,
const vector< MythVideoTexture * > &  Textures 
)
static

Update the contents of the given Textures for data held in Frame.

Definition at line 281 of file mythvideotexture.cpp.

Referenced by MythOpenGLVideo::ProcessFrame().

◆ DeleteTexture()

void MythVideoTexture::DeleteTexture ( MythRenderOpenGL Context,
MythVideoTexture Texture 
)
static

◆ DeleteTextures()

void MythVideoTexture::DeleteTextures ( MythRenderOpenGL Context,
vector< MythVideoTexture * > &  Textures 
)
static

◆ SetTextureFilters()

void MythVideoTexture::SetTextureFilters ( MythRenderOpenGL Context,
const vector< MythVideoTexture * > &  Textures,
QOpenGLTexture::Filter  Filter,
QOpenGLTexture::WrapMode  Wrap = QOpenGLTexture::ClampToEdge 
)
static

◆ CreateTexture()

MythVideoTexture * MythVideoTexture::CreateTexture ( MythRenderOpenGL Context,
QSize  Size,
GLenum  Target = QOpenGLTexture::Target2D,
QOpenGLTexture::PixelType  PixelType = QOpenGLTexture::UInt8,
QOpenGLTexture::PixelFormat  PixelFormat = QOpenGLTexture::RGBA,
QOpenGLTexture::TextureFormat  Format = QOpenGLTexture::NoFormat,
QOpenGLTexture::Filter  Filter = QOpenGLTexture::Linear,
QOpenGLTexture::WrapMode  Wrap = QOpenGLTexture::ClampToEdge 
)
static

Create and initialise a MythVideoTexture that is backed by a QOpenGLTexture.

QOpenGLTexture abstracts much of the detail of handling textures but is not compatible with a number of hardware decoder requirements.

Definition at line 431 of file mythvideotexture.cpp.

Referenced by MythVTBInterop::Acquire(), MythVAAPIInteropGLXCopy::Acquire(), CreateHelperTexture(), and CreateSoftwareTextures().

◆ CreateHardwareTextures()

vector< MythVideoTexture * > MythVideoTexture::CreateHardwareTextures ( MythRenderOpenGL Context,
VideoFrameType  Type,
VideoFrameType  Format,
vector< QSize >  Sizes,
GLenum  Target 
)
staticprivate

Create a set of hardware textures suitable for the given format.

Note
This is a simple wrapper that deliberately does nothing more than create a texture and sets suitable defaults. In most instances, hardware textures require specific handling.
Linear filtering is always set (except MediaCodec/MMAL which use OES)

Definition at line 85 of file mythvideotexture.cpp.

Referenced by CreateTextures().

◆ CreateSoftwareTextures()

vector< MythVideoTexture * > MythVideoTexture::CreateSoftwareTextures ( MythRenderOpenGL Context,
VideoFrameType  Type,
VideoFrameType  Format,
vector< QSize >  Sizes,
GLenum  Target 
)
staticprivate

Create a set of OpenGL textures to represent the given Format.

Note
All textures are created with CreateTexture which defaults to Linear filtering.

Definition at line 133 of file mythvideotexture.cpp.

Referenced by CreateTextures().

◆ YV12ToYV12()

void MythVideoTexture::YV12ToYV12 ( MythRenderOpenGL Context,
const VideoFrame Frame,
MythVideoTexture Texture,
uint  Plane 
)
inlinestaticprivate

Copy YV12 frame data to 'YV12' textures.

Definition at line 484 of file mythvideotexture.cpp.

Referenced by UpdateTextures().

◆ YV12ToYUYV()

void MythVideoTexture::YV12ToYUYV ( const VideoFrame Frame,
MythVideoTexture Texture 
)
inlinestaticprivate

Copy YV12 frame data to a YUYV texture.

Definition at line 511 of file mythvideotexture.cpp.

Referenced by UpdateTextures().

◆ NV12ToNV12()

void MythVideoTexture::NV12ToNV12 ( MythRenderOpenGL Context,
const VideoFrame Frame,
MythVideoTexture Texture,
uint  Plane 
)
inlinestaticprivate

Copy NV12 video frame data to 'NV12' textures.

Definition at line 537 of file mythvideotexture.cpp.

Referenced by UpdateTextures().

◆ CreateBuffer()

bool MythVideoTexture::CreateBuffer ( MythVideoTexture Texture,
int  Size 
)
inlinestaticprivate

Create a data buffer for holding CPU side texture data.

Definition at line 562 of file mythvideotexture.cpp.

Referenced by NV12ToNV12(), YV12ToYUYV(), and YV12ToYV12().

◆ StoreBicubicWeights()

void MythVideoTexture::StoreBicubicWeights ( float  X,
float *  Dest 
)
staticprivate

Definition at line 615 of file mythvideotexture.cpp.

Referenced by CreateHelperTexture().

Member Data Documentation

◆ m_valid

bool MythVideoTexture::m_valid { false }

Definition at line 47 of file mythvideotexture.h.

Referenced by NV12ToNV12(), YV12ToYUYV(), and YV12ToYV12().

◆ m_filter

QOpenGLTexture::Filter MythVideoTexture::m_filter { QOpenGLTexture::Linear }

Definition at line 48 of file mythvideotexture.h.

◆ m_frameType

VideoFrameType MythVideoTexture::m_frameType { FMT_NONE }

◆ m_frameFormat

VideoFrameType MythVideoTexture::m_frameFormat { FMT_NONE }

◆ m_plane

uint MythVideoTexture::m_plane { 0 }

◆ m_planeCount

uint MythVideoTexture::m_planeCount { 0 }

◆ m_allowGLSLDeint

bool MythVideoTexture::m_allowGLSLDeint { false }

◆ m_copyContext

MythAVCopy* MythVideoTexture::m_copyContext { nullptr }

Definition at line 57 of file mythvideotexture.h.

Referenced by DeleteTexture(), and YV12ToYUYV().


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