Miam-Player  0.8.0
A nice music player
QtAV::OpenGLVideo Class Reference

The OpenGLVideo class high level api for renderering a video frame. More...

#include <OpenGLVideo.h>

Inheritance diagram for QtAV::OpenGLVideo:

Signals

void beforeRendering ()
 
void afterRendering ()
 afterRendering Emitted when video frame is rendered. More...
 

Public Member Functions

 OpenGLVideo ()
 
void setOpenGLContext (QOpenGLContext *ctx)
 setOpenGLContext a context must be set before renderering. More...
 
QOpenGLContext * openGLContext ()
 
void setCurrentFrame (const VideoFrame &frame)
 
void fill (const QColor &color)
 
void render (const QRectF &target=QRectF(), const QRectF &roi=QRectF(), const QMatrix4x4 &transform=QMatrix4x4())
 render all are in Qt's coordinate More...
 
void setProjectionMatrixToRect (const QRectF &v)
 setProjectionMatrixToRect the rect will be viewport More...
 
void setBrightness (qreal value)
 
void setContrast (qreal value)
 
void setHue (qreal value)
 
void setSaturation (qreal value)
 
void setUserShader (VideoShader *shader)
 
VideoShaderuserShader () const
 

Static Public Member Functions

static bool isSupported (VideoFormat::PixelFormat pixfmt)
 

Detailed Description

The OpenGLVideo class high level api for renderering a video frame.

use VideoShader, VideoMaterial and ShaderManager internally. By default, VBO is used. Set environment var QTAV_NO_VBO=1 or 0 to disable/enable VBO. VAO will be enabled if supported. Disabling VAO is the same as VBO.

Constructor & Destructor Documentation

QtAV::OpenGLVideo::OpenGLVideo ( )

Member Function Documentation

void QtAV::OpenGLVideo::afterRendering ( )
signal

afterRendering Emitted when video frame is rendered.

With DirectConnection, it can be used to draw GL on top of video, or to do screen scraping of the current frame buffer.

void QtAV::OpenGLVideo::beforeRendering ( )
signal
void QtAV::OpenGLVideo::fill ( const QColor &  color)
static bool QtAV::OpenGLVideo::isSupported ( VideoFormat::PixelFormat  pixfmt)
static
QOpenGLContext* QtAV::OpenGLVideo::openGLContext ( )
void QtAV::OpenGLVideo::render ( const QRectF &  target = QRectF(),
const QRectF &  roi = QRectF(),
const QMatrix4x4 &  transform = QMatrix4x4() 
)

render all are in Qt's coordinate

Parameters
targetthe rect renderering to. in Qt's coordinate. not normalized here but in shader. // TODO: normalized check? invalid value (default) means renderering to the whole viewport
roinormalized rect of texture to renderer.
transformadditinal transformation.
void QtAV::OpenGLVideo::setBrightness ( qreal  value)
void QtAV::OpenGLVideo::setContrast ( qreal  value)
void QtAV::OpenGLVideo::setCurrentFrame ( const VideoFrame frame)
void QtAV::OpenGLVideo::setHue ( qreal  value)
void QtAV::OpenGLVideo::setOpenGLContext ( QOpenGLContext *  ctx)

setOpenGLContext a context must be set before renderering.

Parameters
ctx0: current context in OpenGL is done. shaders will be released. QOpenGLContext is QObject in Qt5, and gl resources here will be released automatically if context is destroyed. But you have to call setOpenGLContext(0) for Qt4 explicitly in the old context. Viewport is also set here using context surface/paintDevice size and devicePixelRatio. devicePixelRatio may be wrong for multi-screen with 5.0<qt<5.5, so you should call setProjectionMatrixToRect later in this case
void QtAV::OpenGLVideo::setProjectionMatrixToRect ( const QRectF &  v)

setProjectionMatrixToRect the rect will be viewport

void QtAV::OpenGLVideo::setSaturation ( qreal  value)
void QtAV::OpenGLVideo::setUserShader ( VideoShader shader)
VideoShader* QtAV::OpenGLVideo::userShader ( ) const

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