5#include <GLES2/gl2ext.h>
33 if (static_VideoFormat2GLFormatMap.
isEmpty()) {
40 static_VideoFormat2GLFormatMap.
insert(QVideoFrameFormat::Format_RGB32,
GL_BGRA_EXT);
41 static_VideoFormat2GLFormatMap.
insert(QVideoFrameFormat::Format_ARGB32,
GL_BGRA_EXT);
42 static_VideoFormat2GLFormatMap.
insert(QVideoFrameFormat::Format_BGR32,
GL_RGBA);
43 static_VideoFormat2GLFormatMap.
insert(QVideoFrameFormat::Format_BGRA32,
GL_RGBA);
46 return static_VideoFormat2GLFormatMap;
52 switch (pixelformat) {
59 case QVideoFrameFormat::Format_RGB32:
return 4;
60 case QVideoFrameFormat::Format_ARGB32:
return 4;
61 case QVideoFrameFormat::Format_BGR32:
return 4;
62 case QVideoFrameFormat::Format_BGRA32:
return 4;
iterator insert(const Key &key, const T &value)
void setMaterial(QSGMaterial *material)
Sets the material of this geometry node to material.
void markDirty(DirtyState bits)
Notifies all connected renderers that the node has dirty bits.
void setFlag(Flag, bool=true)
Sets the flag f on this node if enabled is true; otherwise clears the flag.
void setCurrentFrame(const QVideoFrame &frame, QSGVideoNode::FrameFlags flags)
void setCurrentFrame(const QVideoFrame &frame, FrameFlags flags)
QSGVivanteVideoNode(const QVideoFrameFormat &format)
static int getBytesForPixelFormat(QVideoFrameFormat::PixelFormat pixelformat)
static const QMap< QVideoFrameFormat::PixelFormat, GLenum > & getVideoFormat2GLFormatMap()
The QVideoFrame class represents a frame of video data.
GLint GLsizei GLsizei GLenum format