diff options
Diffstat (limited to 'elements/gstqtvideosink/delegates/qtvideosinkdelegate.h')
-rw-r--r-- | elements/gstqtvideosink/delegates/qtvideosinkdelegate.h | 110 |
1 files changed, 3 insertions, 107 deletions
diff --git a/elements/gstqtvideosink/delegates/qtvideosinkdelegate.h b/elements/gstqtvideosink/delegates/qtvideosinkdelegate.h index b2f2726..32f266b 100644 --- a/elements/gstqtvideosink/delegates/qtvideosinkdelegate.h +++ b/elements/gstqtvideosink/delegates/qtvideosinkdelegate.h @@ -18,19 +18,12 @@ #ifndef QT_VIDEO_SINK_DELEGATE_H #define QT_VIDEO_SINK_DELEGATE_H -#include "gstqtvideosinkbase.h" -#include "../utils/bufferformat.h" +#include "basedelegate.h" #include "../painters/abstractsurfacepainter.h" -#include <QObject> -#include <QEvent> -#include <QSet> -#include <QReadWriteLock> - class QGLContext; - -class QtVideoSinkDelegate : public QObject +class QtVideoSinkDelegate : public BaseDelegate { Q_OBJECT public: @@ -41,73 +34,11 @@ public: }; Q_DECLARE_FLAGS(PainterTypes, PainterType); - enum EventType { - BufferEventType = QEvent::User, - DeactivateEventType - }; - - //------------------------------------- - - class BufferEvent : public QEvent - { - public: - inline BufferEvent(GstBuffer *buf, bool formatDirty) - : QEvent(static_cast<QEvent::Type>(BufferEventType)), - buffer(gst_buffer_ref(buf)), - formatDirty(formatDirty) - {} - - virtual ~BufferEvent() { - gst_buffer_unref(buffer); - } - - GstBuffer *buffer; - bool formatDirty; - }; - - class DeactivateEvent : public QEvent - { - public: - inline DeactivateEvent() - : QEvent(static_cast<QEvent::Type>(DeactivateEventType)) - { - } - }; - - //------------------------------------- - - explicit QtVideoSinkDelegate(GstQtVideoSinkBase *sink, QObject *parent = 0); + explicit QtVideoSinkDelegate(GstElement *sink, QObject *parent = 0); virtual ~QtVideoSinkDelegate(); - // API for GstQtVideoSinkBase - - bool isActive() const; - void setActive(bool playing); - PainterTypes supportedPainterTypes() const { return m_supportedPainters; } - // GstColorBalance interface - - int brightness() const; - void setBrightness(int brightness); - - int contrast() const; - void setContrast(int contrast); - - int hue() const; - void setHue(int hue); - - int saturation() const; - void setSaturation(int saturation); - - // pixel-aspect-ratio property - Fraction pixelAspectRatio() const; - void setPixelAspectRatio(const Fraction & f); - - // force-aspect-ratio property - bool forceAspectRatio() const; - void setForceAspectRatio(bool force); - #ifndef GST_QT_VIDEO_SINK_NO_OPENGL // glcontext property QGLContext *glContext() const; @@ -121,9 +52,6 @@ protected: // internal event handling virtual bool event(QEvent *event); - // tells the surface to repaint itself - virtual void update(); - private: void changePainter(const BufferFormat & format); void destroyPainter(); @@ -134,38 +62,6 @@ private: #ifndef GST_QT_VIDEO_SINK_NO_OPENGL QGLContext *m_glContext; #endif - - // colorbalance interface properties - mutable QReadWriteLock m_colorsLock; - bool m_colorsDirty; - int m_brightness; - int m_contrast; - int m_hue; - int m_saturation; - - // pixel-aspect-ratio property - mutable QReadWriteLock m_pixelAspectRatioLock; - Fraction m_pixelAspectRatio; - - // force-aspect-ratio property - mutable QReadWriteLock m_forceAspectRatioLock; - bool m_forceAspectRatioDirty; - bool m_forceAspectRatio; - - // format caching - bool m_formatDirty; - BufferFormat m_bufferFormat; - PaintAreas m_areas; - - // whether the sink is active (PAUSED or PLAYING) - mutable QReadWriteLock m_isActiveLock; - bool m_isActive; - - // the buffer to be drawn next - GstBuffer *m_buffer; - -protected: - GstQtVideoSinkBase * const m_sink; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QtVideoSinkDelegate::PainterTypes) |