1#ifndef MYTHVIDEOTEXTURE_H
2#define MYTHVIDEOTEXTURE_H
5#include "libmythbase/mythconfig.h"
12#include "libavutil/pixfmt.h"
29 std::vector<QSize> Sizes,
30 GLenum Target = QOpenGLTexture::Target2D);
32 const std::vector<MythVideoTextureOpenGL*> &Textures);
36 QOpenGLTexture::Filter Filter,
37 QOpenGLTexture::WrapMode Wrap = QOpenGLTexture::ClampToEdge);
39 GLenum Target = QOpenGLTexture::Target2D,
40 QOpenGLTexture::PixelType PixelType = QOpenGLTexture::UInt8,
41 QOpenGLTexture::PixelFormat PixelFormat = QOpenGLTexture::RGBA,
42 QOpenGLTexture::TextureFormat
Format = QOpenGLTexture::NoFormat,
43 QOpenGLTexture::Filter Filter = QOpenGLTexture::Linear,
44 QOpenGLTexture::WrapMode Wrap = QOpenGLTexture::ClampToEdge);
46 QSize Size,
bool HighPrecision =
true);
51 QOpenGLTexture::Filter
m_filter { QOpenGLTexture::Linear };
58 QMatrix4x4 *m_transform {
nullptr };
68 std::vector<QSize> Sizes, GLenum Target);
71 std::vector<QSize> Sizes, GLenum Target);
static void SetTextureFilters(MythRenderOpenGL *Context, const std::vector< MythVideoTextureOpenGL * > &Textures, QOpenGLTexture::Filter Filter, QOpenGLTexture::WrapMode Wrap=QOpenGLTexture::ClampToEdge)
MythVideoTextureOpenGL(GLuint Texture)
VideoFrameType m_frameFormat
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.
static VideoFramebuffer CreateVideoFrameBuffer(MythRenderOpenGL *Context, VideoFrameType OutputType, QSize Size, bool HighPrecision=true)
~MythVideoTextureOpenGL() override=default
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 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.
MythAVCopy * m_copyContext
static void YV12ToYUYV(const MythVideoFrame *Frame, MythVideoTextureOpenGL *Texture)
Copy YV12 frame data to a YUYV texture.
QOpenGLTexture::Filter m_filter
VideoFrameType m_frameType
static void NV12ToNV12(MythRenderOpenGL *Context, const MythVideoFrame *Frame, MythVideoTextureOpenGL *Texture, uint Plane)
Copy NV12 video frame data to 'NV12' textures.
static bool CreateBuffer(MythVideoTextureOpenGL *Texture, int Size)
Create a data buffer for holding CPU side texture data.
static void DeleteTexture(MythRenderOpenGL *Context, MythVideoTextureOpenGL *Texture)
static void YV12ToYV12(MythRenderOpenGL *Context, const MythVideoFrame *Frame, MythVideoTextureOpenGL *Texture, uint Plane)
Copy YV12 frame data to 'YV12' textures.
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 UpdateTextures(MythRenderOpenGL *Context, const MythVideoFrame *Frame, const std::vector< MythVideoTextureOpenGL * > &Textures)
Update the contents of the given Textures for data held in Frame.
std::pair< QOpenGLFramebufferObject *, MythVideoTextureOpenGL * > VideoFramebuffer