Go to the documentation of this file. 1 #ifndef MYTHVIDEOTEXTURE_H
2 #define MYTHVIDEOTEXTURE_H
11 #include "libavutil/pixfmt.h"
19 using VideoFramebuffer = std::pair<QOpenGLFramebufferObject*, MythVideoTextureOpenGL*>;
28 std::vector<QSize> Sizes,
29 GLenum Target = QOpenGLTexture::Target2D);
31 const std::vector<MythVideoTextureOpenGL*> &Textures);
35 QOpenGLTexture::Filter Filter,
36 QOpenGLTexture::WrapMode Wrap = QOpenGLTexture::ClampToEdge);
38 GLenum Target = QOpenGLTexture::Target2D,
39 QOpenGLTexture::PixelType PixelType = QOpenGLTexture::UInt8,
40 QOpenGLTexture::PixelFormat PixelFormat = QOpenGLTexture::RGBA,
41 QOpenGLTexture::TextureFormat
Format = QOpenGLTexture::NoFormat,
42 QOpenGLTexture::Filter Filter = QOpenGLTexture::Linear,
43 QOpenGLTexture::WrapMode Wrap = QOpenGLTexture::ClampToEdge);
45 QSize Size,
bool HighPrecision =
true);
50 QOpenGLTexture::Filter
m_filter { QOpenGLTexture::Linear };
56 #ifdef USING_MEDIACODEC
57 QMatrix4x4 *m_transform {
nullptr };
67 std::vector<QSize> Sizes, GLenum Target);
70 std::vector<QSize> Sizes, GLenum Target);
MythVideoTextureOpenGL(GLuint Texture)
VideoFrameType m_frameFormat
static void SetTextureFilters(MythRenderOpenGL *Context, const std::vector< MythVideoTextureOpenGL * > &Textures, QOpenGLTexture::Filter Filter, QOpenGLTexture::WrapMode Wrap=QOpenGLTexture::ClampToEdge)
static void UpdateTextures(MythRenderOpenGL *Context, const MythVideoFrame *Frame, const std::vector< MythVideoTextureOpenGL * > &Textures)
Update the contents of the given Textures for data held in Frame.
~MythVideoTextureOpenGL()=default
static std::vector< MythVideoTextureOpenGL * > CreateSoftwareTextures(MythRenderOpenGL *Context, VideoFrameType Type, VideoFrameType Format, std::vector< QSize > Sizes, GLenum Target)
Create a set of OpenGL textures to represent the given Format.
static void DeleteTexture(MythRenderOpenGL *Context, MythVideoTextureOpenGL *Texture)
std::pair< QOpenGLFramebufferObject *, MythVideoTextureOpenGL * > VideoFramebuffer
static std::vector< MythVideoTextureOpenGL * > CreateHardwareTextures(MythRenderOpenGL *Context, VideoFrameType Type, VideoFrameType Format, std::vector< QSize > Sizes, GLenum Target)
Create a set of hardware textures suitable for the given format.
static void DeleteTextures(MythRenderOpenGL *Context, std::vector< MythVideoTextureOpenGL * > &Textures)
static VideoFramebuffer CreateVideoFrameBuffer(MythRenderOpenGL *Context, VideoFrameType OutputType, QSize Size, bool HighPrecision=true)
static void YV12ToYV12(MythRenderOpenGL *Context, const MythVideoFrame *Frame, MythVideoTextureOpenGL *Texture, uint Plane)
Copy YV12 frame data to 'YV12' textures.
static bool CreateBuffer(MythVideoTextureOpenGL *Texture, int Size)
Create a data buffer for holding CPU side texture data.
VideoFrameType m_frameType
static MythVideoTextureOpenGL * 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)
Create and initialise a MythVideoTexture that is backed by a QOpenGLTexture.
static void NV12ToNV12(MythRenderOpenGL *Context, const MythVideoFrame *Frame, MythVideoTextureOpenGL *Texture, uint Plane)
Copy NV12 video frame data to 'NV12' textures.
QOpenGLTexture::Filter m_filter
static void YV12ToYUYV(const MythVideoFrame *Frame, MythVideoTextureOpenGL *Texture)
Copy YV12 frame data to a YUYV texture.
static std::vector< MythVideoTextureOpenGL * > CreateTextures(MythRenderOpenGL *Context, VideoFrameType Type, VideoFrameType Format, std::vector< QSize > Sizes, GLenum Target=QOpenGLTexture::Target2D)
Create a set of textures suitable for the given Type and Format.
MythAVCopy * m_copyContext