Miam-Player  0.8.0
A nice music player
QtAV::VideoRenderer Class Referenceabstract

#include <VideoRenderer.h>

Inheritance diagram for QtAV::VideoRenderer:
QtAV::AVOutput QtAV::OpenGLRendererBase QtAV::QPainterRenderer QtAV::VideoOutput QtAV::OpenGLWindowRenderer

Public Types

enum  OutAspectRatioMode { RendererAspectRatio, VideoAspectRatio, CustomAspectRation }
 
enum  Quality { QualityDefault, QualityBest, QualityFastest }
 

Public Member Functions

 VideoRenderer ()
 
virtual ~VideoRenderer ()
 
virtual VideoRendererId id () const =0
 
bool receive (const VideoFrame &frame)
 
bool setPreferredPixelFormat (VideoFormat::PixelFormat pixfmt)
 setPreferredPixelFormat More...
 
virtual VideoFormat::PixelFormat preferredPixelFormat () const
 preferredPixelFormat More...
 
void forcePreferredPixelFormat (bool force=true)
 forcePreferredPixelFormat force to use preferredPixelFormat() even if incoming format is supported More...
 
bool isPreferredPixelFormatForced () const
 
virtual bool isSupported (VideoFormat::PixelFormat pixfmt) const =0
 
qreal sourceAspectRatio () const
 sourceAspectRatio The display aspect ratio of received video frame. More...
 
void setOutAspectRatioMode (OutAspectRatioMode mode)
 
OutAspectRatioMode outAspectRatioMode () const
 
void setOutAspectRatio (qreal ratio)
 
qreal outAspectRatio () const
 
void setQuality (Quality q)
 
Quality quality () const
 
void resizeRenderer (const QSize &size)
 
void resizeRenderer (int width, int height)
 
QSize rendererSize () const
 
int rendererWidth () const
 
int rendererHeight () const
 
QSize videoFrameSize () const
 
int orientation () const
 orientation 0, 90, 180, 270. More...
 
void setOrientation (int value)
 
QRect videoRect () const
 
QRectF regionOfInterest () const
 
void setRegionOfInterest (qreal x, qreal y, qreal width, qreal height)
 
void setRegionOfInterest (const QRectF &roi)
 
QRect realROI () const
 
QRectF normalizedROI () const
 
QPointF mapToFrame (const QPointF &p) const
 mapToFrame map point in VideoRenderer coordinate to VideoFrame, with current ROI More...
 
QPointF mapFromFrame (const QPointF &p) const
 mapFromFrame map point in VideoFrame coordinate to VideoRenderer, with current ROI More...
 
virtual QWindow * qwindow ()
 
virtual QWidget * widget ()
 widget More...
 
virtual QGraphicsItem * graphicsItem ()
 graphicsItem More...
 
qreal brightness () const
 brightness, contrast, hue, saturation values range between -1.0 and 1.0, the default is 0. More...
 
bool setBrightness (qreal brightness)
 
qreal contrast () const
 
bool setContrast (qreal contrast)
 
qreal hue () const
 
bool setHue (qreal hue)
 
qreal saturation () const
 
bool setSaturation (qreal saturation)
 
QColor backgroundColor () const
 
void setBackgroundColor (const QColor &c)
 
virtual OpenGLVideoopengl () const
 opengl Currently you can only use it to set custom shader OpenGLVideo.setUserShader() More...
 
- Public Member Functions inherited from QtAV::AVOutput
 AVOutput ()
 
virtual ~AVOutput ()
 
bool isAvailable () const
 
void pause (bool p)
 
bool isPaused () const
 
QList< Filter * > & filters ()
 
bool installFilter (Filter *filter, int index=0x7fffffff)
 installFilter Insert a filter at position 'index' of current filter list. More...
 
bool uninstallFilter (Filter *filter)
 

Static Public Member Functions

template<class C >
static bool Register (VideoRendererId id, const char *name)
 
static VideoRenderercreate (VideoRendererId id)
 
static VideoRenderercreate (const char *name)
 
static VideoRendererIdnext (VideoRendererId *id=0)
 next More...
 
static const char * name (VideoRendererId id)
 
static VideoRendererId id (const char *name)
 

Protected Member Functions

 VideoRenderer (VideoRendererPrivate &d)
 
virtual bool receiveFrame (const VideoFrame &frame)=0
 
QRegion backgroundRegion () const
 
virtual void drawBackground ()
 
virtual void drawFrame ()=0
 
virtual void handlePaintEvent ()
 
virtual void updateUi ()
 
- Protected Member Functions inherited from QtAV::AVOutput
 AVOutput (AVOutputPrivate &d)
 
Q_DECL_DEPRECATED bool tryPause ()
 
void addOutputSet (OutputSet *set)
 
void removeOutputSet (OutputSet *set)
 
void attach (OutputSet *set)
 
void detach (OutputSet *set=0)
 
void hanlePendingTasks ()
 

Friends

class VideoOutput
 

Member Enumeration Documentation

Enumerator
RendererAspectRatio 
VideoAspectRatio 
CustomAspectRation 
Enumerator
QualityDefault 
QualityBest 
QualityFastest 

Constructor & Destructor Documentation

QtAV::VideoRenderer::VideoRenderer ( )
virtual QtAV::VideoRenderer::~VideoRenderer ( )
virtual
QtAV::VideoRenderer::VideoRenderer ( VideoRendererPrivate d)
protected

Member Function Documentation

QColor QtAV::VideoRenderer::backgroundColor ( ) const
QRegion QtAV::VideoRenderer::backgroundRegion ( ) const
protected
qreal QtAV::VideoRenderer::brightness ( ) const

brightness, contrast, hue, saturation values range between -1.0 and 1.0, the default is 0.

value is not changed if does not implementd and onChangingXXX() returns false. video widget/item will update after if onChangingXXX/setXXX returns true

Returns
false if failed to set (may be onChangingXXX not implemented or return false)
qreal QtAV::VideoRenderer::contrast ( ) const
static VideoRenderer* QtAV::VideoRenderer::create ( VideoRendererId  id)
static
static VideoRenderer* QtAV::VideoRenderer::create ( const char *  name)
static
virtual void QtAV::VideoRenderer::drawBackground ( )
protectedvirtual
virtual void QtAV::VideoRenderer::drawFrame ( )
protectedpure virtual
void QtAV::VideoRenderer::forcePreferredPixelFormat ( bool  force = true)

forcePreferredPixelFormat force to use preferredPixelFormat() even if incoming format is supported

Parameters
force
virtual QGraphicsItem* QtAV::VideoRenderer::graphicsItem ( )
inlinevirtual

graphicsItem

Returns
default is 0. A QGraphicsItem subclass can return this

Reimplemented in QtAV::VideoOutput.

virtual void QtAV::VideoRenderer::handlePaintEvent ( )
protectedvirtual

Reimplemented in QtAV::VideoOutput.

qreal QtAV::VideoRenderer::hue ( ) const
static VideoRendererId QtAV::VideoRenderer::id ( const char *  name)
static
virtual VideoRendererId QtAV::VideoRenderer::id ( ) const
pure virtual
bool QtAV::VideoRenderer::isPreferredPixelFormatForced ( ) const
virtual bool QtAV::VideoRenderer::isSupported ( VideoFormat::PixelFormat  pixfmt) const
pure virtual
QPointF QtAV::VideoRenderer::mapFromFrame ( const QPointF &  p) const

mapFromFrame map point in VideoFrame coordinate to VideoRenderer, with current ROI

QPointF QtAV::VideoRenderer::mapToFrame ( const QPointF &  p) const

mapToFrame map point in VideoRenderer coordinate to VideoFrame, with current ROI

static const char* QtAV::VideoRenderer::name ( VideoRendererId  id)
static
static VideoRendererId* QtAV::VideoRenderer::next ( VideoRendererId id = 0)
static

next

Parameters
idNULL to get the first id address
Returns
address of id or NULL if not found/end
QRectF QtAV::VideoRenderer::normalizedROI ( ) const
virtual OpenGLVideo* QtAV::VideoRenderer::opengl ( ) const
inlinevirtual

opengl Currently you can only use it to set custom shader OpenGLVideo.setUserShader()

Reimplemented in QtAV::VideoOutput, and QtAV::OpenGLRendererBase.

int QtAV::VideoRenderer::orientation ( ) const

orientation 0, 90, 180, 270.

other values are ignored outAspectRatio() corresponds with orientation == 0. displayed aspect ratio may change if orientation is not 0

qreal QtAV::VideoRenderer::outAspectRatio ( ) const
OutAspectRatioMode QtAV::VideoRenderer::outAspectRatioMode ( ) const
virtual VideoFormat::PixelFormat QtAV::VideoRenderer::preferredPixelFormat ( ) const
virtual

preferredPixelFormat

Returns
preferred pixel format. e.g. WidgetRenderer is rgb formats.

Reimplemented in QtAV::VideoOutput.

Quality QtAV::VideoRenderer::quality ( ) const
virtual QWindow* QtAV::VideoRenderer::qwindow ( )
inlinevirtual
QRect QtAV::VideoRenderer::realROI ( ) const
bool QtAV::VideoRenderer::receive ( const VideoFrame frame)
virtual bool QtAV::VideoRenderer::receiveFrame ( const VideoFrame frame)
protectedpure virtual
QRectF QtAV::VideoRenderer::regionOfInterest ( ) const
template<class C >
static bool QtAV::VideoRenderer::Register ( VideoRendererId  id,
const char *  name 
)
inlinestatic
int QtAV::VideoRenderer::rendererHeight ( ) const
QSize QtAV::VideoRenderer::rendererSize ( ) const
int QtAV::VideoRenderer::rendererWidth ( ) const
void QtAV::VideoRenderer::resizeRenderer ( const QSize &  size)
void QtAV::VideoRenderer::resizeRenderer ( int  width,
int  height 
)
qreal QtAV::VideoRenderer::saturation ( ) const
void QtAV::VideoRenderer::setBackgroundColor ( const QColor &  c)
bool QtAV::VideoRenderer::setBrightness ( qreal  brightness)
bool QtAV::VideoRenderer::setContrast ( qreal  contrast)
bool QtAV::VideoRenderer::setHue ( qreal  hue)
void QtAV::VideoRenderer::setOrientation ( int  value)
void QtAV::VideoRenderer::setOutAspectRatio ( qreal  ratio)
void QtAV::VideoRenderer::setOutAspectRatioMode ( OutAspectRatioMode  mode)
bool QtAV::VideoRenderer::setPreferredPixelFormat ( VideoFormat::PixelFormat  pixfmt)

setPreferredPixelFormat

Parameters
pixfmtpixfmt will be used if decoded format is not supported by this renderer. otherwise, use decoded format. return false if pixfmt is not supported and not changed.
void QtAV::VideoRenderer::setQuality ( Quality  q)
void QtAV::VideoRenderer::setRegionOfInterest ( qreal  x,
qreal  y,
qreal  width,
qreal  height 
)
void QtAV::VideoRenderer::setRegionOfInterest ( const QRectF &  roi)
bool QtAV::VideoRenderer::setSaturation ( qreal  saturation)
qreal QtAV::VideoRenderer::sourceAspectRatio ( ) const

sourceAspectRatio The display aspect ratio of received video frame.

0 for an invalid frame. sourceAspectRatioChanged() (a signal for QObject renderers) will be called if the new frame has a different DAR.

virtual void QtAV::VideoRenderer::updateUi ( )
protectedvirtual
QSize QtAV::VideoRenderer::videoFrameSize ( ) const
QRect QtAV::VideoRenderer::videoRect ( ) const
virtual QWidget* QtAV::VideoRenderer::widget ( )
inlinevirtual

widget

Returns
default is 0. A QWidget subclass can return this

Reimplemented in QtAV::VideoOutput.

Friends And Related Function Documentation

friend class VideoOutput
friend

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