22 #ifndef QAV_VIDEORENDERER_H 23 #define QAV_VIDEORENDERER_H 25 #include <QtCore/QByteArray> 26 #include <QtCore/QSize> 27 #include <QtCore/QRectF> 28 #include <QtGui/QColor> 70 static bool Register(VideoRendererId
id,
const char* name) {
return Register(
id, create<C>, name);}
78 static VideoRendererId* next(VideoRendererId*
id = 0);
79 static const char* name(VideoRendererId
id);
80 static VideoRendererId id(
const char* name);
84 virtual VideoRendererId id()
const = 0;
104 void forcePreferredPixelFormat(
bool force =
true);
105 bool isPreferredPixelFormatForced()
const;
113 qreal sourceAspectRatio()
const;
118 void setOutAspectRatio(qreal ratio);
119 qreal outAspectRatio()
const;
124 void resizeRenderer(
const QSize&
size);
125 void resizeRenderer(
int width,
int height);
126 QSize rendererSize()
const;
127 int rendererWidth()
const;
128 int rendererHeight()
const;
130 QSize videoFrameSize()
const;
137 int orientation()
const;
138 void setOrientation(
int value);
141 QRect videoRect()
const;
152 QRectF regionOfInterest()
const;
154 void setRegionOfInterest(qreal x, qreal y, qreal width, qreal height);
155 void setRegionOfInterest(
const QRectF& roi);
157 QRect realROI()
const;
159 QRectF normalizedROI()
const;
166 QPointF mapToFrame(
const QPointF& p)
const;
171 QPointF mapFromFrame(
const QPointF& p)
const;
191 qreal brightness()
const;
192 bool setBrightness(qreal brightness);
193 qreal contrast()
const;
194 bool setContrast(qreal contrast);
196 bool setHue(qreal hue);
197 qreal saturation()
const;
198 bool setSaturation(qreal saturation);
199 QColor backgroundColor()
const;
200 void setBackgroundColor(
const QColor& c);
210 virtual bool receiveFrame(
const VideoFrame& frame) = 0;
211 QRegion backgroundRegion()
const;
212 virtual void drawBackground();
215 virtual void drawFrame() = 0;
216 virtual void handlePaintEvent();
217 virtual void updateUi();
220 virtual void sourceAspectRatioChanged(qreal) {}
221 virtual void outAspectRatioChanged() {}
222 virtual void outAspectRatioModeChanged() {}
223 virtual void orientationChanged() {}
224 virtual void videoRectChanged() {}
225 virtual void contentRectChanged() {}
226 virtual void regionOfInterestChanged() {}
227 virtual void videoFrameSizeChanged() {}
228 virtual void rendererSizeChanged() {}
229 virtual void brightnessChanged(qreal) {}
230 virtual void contrastChanged(qreal) {}
231 virtual void hueChanged(qreal) {}
232 virtual void saturationChanged(qreal) {}
233 virtual void backgroundColorChanged() {}
239 virtual bool onForcePreferredPixelFormat(
bool force =
true);
241 virtual void onSetOutAspectRatio(qreal ratio);
242 virtual bool onSetQuality(
Quality q);
243 virtual void onResizeRenderer(
int width,
int height);
244 virtual bool onSetOrientation(
int value);
245 virtual bool onSetRegionOfInterest(
const QRectF& roi);
246 virtual QPointF onMapToFrame(
const QPointF& p)
const;
247 virtual QPointF onMapFromFrame(
const QPointF& p)
const;
255 virtual bool onSetBrightness(qreal brightness);
256 virtual bool onSetContrast(qreal contrast);
257 virtual bool onSetHue(qreal hue);
258 virtual bool onSetSaturation(qreal saturation);
259 virtual void onSetBackgroundColor(
const QColor& color);
266 static bool Register(VideoRendererId
id, VideoRendererCreator,
const char *name);
269 void setInSize(
const QSize& s);
270 void setInSize(
int width,
int height);
274 #endif // QAV_VIDEORENDERER_H #define Q_AV_EXPORT
Definition: QtAV_Global.h:40
static bool Register(VideoRendererId id, const char *name)
Definition: VideoRenderer.h:70
#define DPTR_DECLARE_PRIVATE(Class)
Definition: dptr.h:107
size_t size
Definition: mem.h:207
Q_AV_EXPORT VideoRendererId VideoRendererId_OpenGLWindow
The VideoOutput class A VideoRenderer wrapper with QObject features.
Definition: VideoOutput.h:35
Definition: VideoRenderer.h:64
OutAspectRatioMode
Definition: VideoRenderer.h:57
Definition: VideoFrame.h:32
virtual QWidget * widget()
widget
Definition: VideoRenderer.h:178
virtual OpenGLVideo * opengl() const
opengl Currently you can only use it to set custom shader OpenGLVideo.setUserShader() ...
Definition: VideoRenderer.h:206
virtual QGraphicsItem * graphicsItem()
graphicsItem
Definition: VideoRenderer.h:183
Definition: VideoRenderer.h:65
Definition: AVOutput.h:39
Definition: VideoRenderer_p.h:42
Quality
Definition: VideoRenderer.h:63
int VideoRendererId
Definition: VideoRenderer.h:45
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31
The OpenGLVideo class high level api for renderering a video frame.
Definition: OpenGLVideo.h:51
Definition: VideoRenderer.h:51
virtual QWindow * qwindow()
Definition: VideoRenderer.h:173