diff options
-rw-r--r-- | elements/gstqtvideosink/CMakeLists.txt | 2 | ||||
-rw-r--r-- | elements/gstqtvideosink/gstqtvideosink.cpp | 2 | ||||
-rw-r--r-- | elements/gstqtvideosink/gstqtvideosinkbase.cpp | 6 | ||||
-rw-r--r-- | elements/gstqtvideosink/gstqtvideosinkbase.h | 4 | ||||
-rw-r--r-- | elements/gstqtvideosink/gstqwidgetvideosink.cpp | 2 | ||||
-rw-r--r-- | elements/gstqtvideosink/qtvideosinkdelegate.cpp (renamed from elements/gstqtvideosink/gstqtvideosinksurface.cpp) | 50 | ||||
-rw-r--r-- | elements/gstqtvideosink/qtvideosinkdelegate.h (renamed from elements/gstqtvideosink/gstqtvideosinksurface.h) | 14 |
7 files changed, 39 insertions, 41 deletions
diff --git a/elements/gstqtvideosink/CMakeLists.txt b/elements/gstqtvideosink/CMakeLists.txt index be03077..f21e51c 100644 --- a/elements/gstqtvideosink/CMakeLists.txt +++ b/elements/gstqtvideosink/CMakeLists.txt @@ -12,7 +12,7 @@ set(GstQtVideoSink_SRCS gstqtvideosink.cpp gstqwidgetvideosink.cpp gstqtvideosinkplugin.cpp - gstqtvideosinksurface.cpp + qtvideosinkdelegate.cpp ${CMAKE_CURRENT_BINARY_DIR}/gstqtvideosinkmarshal.c ) diff --git a/elements/gstqtvideosink/gstqtvideosink.cpp b/elements/gstqtvideosink/gstqtvideosink.cpp index d990249..ffb3b2a 100644 --- a/elements/gstqtvideosink/gstqtvideosink.cpp +++ b/elements/gstqtvideosink/gstqtvideosink.cpp @@ -25,7 +25,7 @@ #include "gstqtvideosink.h" #include "gstqtvideosinkmarshal.h" -#include "gstqtvideosinksurface.h" +#include "qtvideosinkdelegate.h" //------------------------------ diff --git a/elements/gstqtvideosink/gstqtvideosinkbase.cpp b/elements/gstqtvideosink/gstqtvideosinkbase.cpp index cfb9707..385c333 100644 --- a/elements/gstqtvideosink/gstqtvideosinkbase.cpp +++ b/elements/gstqtvideosink/gstqtvideosinkbase.cpp @@ -16,7 +16,7 @@ */ #include "gstqtvideosinkbase.h" -#include "gstqtvideosinksurface.h" +#include "qtvideosinkdelegate.h" #include <QtCore/QCoreApplication> @@ -132,7 +132,7 @@ void GstQtVideoSinkBase::init(GTypeInstance *instance, gpointer g_class) GstQtVideoSinkBase *sink = GST_QT_VIDEO_SINK_BASE(instance); Q_UNUSED(g_class); - sink->surface = new GstQtVideoSinkSurface(sink); + sink->surface = new QtVideoSinkDelegate(sink); sink->formatDirty = true; } @@ -221,7 +221,7 @@ GstFlowReturn GstQtVideoSinkBase::show_frame(GstVideoSink *video_sink, GstBuffer "Format dirty: %d", buffer, (int)sink->formatDirty); QCoreApplication::postEvent(sink->surface, - new GstQtVideoSinkSurface::BufferEvent(buffer, sink->formatDirty)); + new QtVideoSinkDelegate::BufferEvent(buffer, sink->formatDirty)); sink->formatDirty = false; return GST_FLOW_OK; diff --git a/elements/gstqtvideosink/gstqtvideosinkbase.h b/elements/gstqtvideosink/gstqtvideosinkbase.h index bb0cc0e..e90cce0 100644 --- a/elements/gstqtvideosink/gstqtvideosinkbase.h +++ b/elements/gstqtvideosink/gstqtvideosinkbase.h @@ -31,7 +31,7 @@ #define GST_QT_VIDEO_SINK_BASE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_QT_VIDEO_SINK_BASE, GstQtVideoSinkBaseClass)) -class GstQtVideoSinkSurface; +class QtVideoSinkDelegate; struct GstQtVideoSinkBase { @@ -66,7 +66,7 @@ private: static GstFlowReturn show_frame(GstVideoSink *sink, GstBuffer *buffer); public: - GstQtVideoSinkSurface *surface; + QtVideoSinkDelegate *surface; private: bool formatDirty; diff --git a/elements/gstqtvideosink/gstqwidgetvideosink.cpp b/elements/gstqtvideosink/gstqwidgetvideosink.cpp index 6e5fafd..ed04569 100644 --- a/elements/gstqtvideosink/gstqwidgetvideosink.cpp +++ b/elements/gstqtvideosink/gstqwidgetvideosink.cpp @@ -37,7 +37,7 @@ */ #include "gstqwidgetvideosink.h" -#include "gstqtvideosinksurface.h" +#include "qtvideosinkdelegate.h" #include <QtCore/QWeakPointer> #include <QtCore/QEvent> #include <QtGui/QWidget> diff --git a/elements/gstqtvideosink/gstqtvideosinksurface.cpp b/elements/gstqtvideosink/qtvideosinkdelegate.cpp index b6f4a3c..0dc6011 100644 --- a/elements/gstqtvideosink/gstqtvideosinksurface.cpp +++ b/elements/gstqtvideosink/qtvideosinkdelegate.cpp @@ -15,7 +15,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "gstqtvideosinksurface.h" +#include "qtvideosinkdelegate.h" #include "genericsurfacepainter.h" #include "openglsurfacepainter.h" @@ -31,7 +31,7 @@ (float) rect.x(), (float) rect.y(), (float) rect.width(), (float) rect.height() -GstQtVideoSinkSurface::GstQtVideoSinkSurface(GstQtVideoSinkBase *sink, QObject *parent) +QtVideoSinkDelegate::QtVideoSinkDelegate(GstQtVideoSinkBase *sink, QObject *parent) : QObject(parent) , m_painter(0) #ifndef GST_QT_VIDEO_SINK_NO_OPENGL @@ -52,7 +52,7 @@ GstQtVideoSinkSurface::GstQtVideoSinkSurface(GstQtVideoSinkBase *sink, QObject * { } -GstQtVideoSinkSurface::~GstQtVideoSinkSurface() +QtVideoSinkDelegate::~QtVideoSinkDelegate() { Q_ASSERT(!isActive()); destroyPainter(); @@ -60,7 +60,7 @@ GstQtVideoSinkSurface::~GstQtVideoSinkSurface() //------------------------------------- -QSet<GstVideoFormat> GstQtVideoSinkSurface::supportedPixelFormats() const +QSet<GstVideoFormat> QtVideoSinkDelegate::supportedPixelFormats() const { QSet<GstVideoFormat> result; #ifndef GST_QT_VIDEO_SINK_NO_OPENGL @@ -73,13 +73,13 @@ QSet<GstVideoFormat> GstQtVideoSinkSurface::supportedPixelFormats() const return result; } -bool GstQtVideoSinkSurface::isActive() const +bool QtVideoSinkDelegate::isActive() const { QReadLocker l(&m_isActiveLock); return m_isActive; } -void GstQtVideoSinkSurface::setActive(bool active) +void QtVideoSinkDelegate::setActive(bool active) { GST_INFO_OBJECT(m_sink, active ? "Activating" : "Deactivating"); @@ -92,52 +92,52 @@ void GstQtVideoSinkSurface::setActive(bool active) //------------------------------------- -int GstQtVideoSinkSurface::brightness() const +int QtVideoSinkDelegate::brightness() const { QReadLocker l(&m_colorsLock); return m_brightness; } -void GstQtVideoSinkSurface::setBrightness(int brightness) +void QtVideoSinkDelegate::setBrightness(int brightness) { QWriteLocker l(&m_colorsLock); m_brightness = brightness; m_colorsDirty = true; } -int GstQtVideoSinkSurface::contrast() const +int QtVideoSinkDelegate::contrast() const { QReadLocker l(&m_colorsLock); return m_contrast; } -void GstQtVideoSinkSurface::setContrast(int contrast) +void QtVideoSinkDelegate::setContrast(int contrast) { QWriteLocker l(&m_colorsLock); m_contrast = contrast; m_colorsDirty = true; } -int GstQtVideoSinkSurface::hue() const +int QtVideoSinkDelegate::hue() const { QReadLocker l(&m_colorsLock); return m_hue; } -void GstQtVideoSinkSurface::setHue(int hue) +void QtVideoSinkDelegate::setHue(int hue) { QWriteLocker l(&m_colorsLock); m_hue = hue; m_colorsDirty = true; } -int GstQtVideoSinkSurface::saturation() const +int QtVideoSinkDelegate::saturation() const { QReadLocker l(&m_colorsLock); return m_saturation; } -void GstQtVideoSinkSurface::setSaturation(int saturation) +void QtVideoSinkDelegate::setSaturation(int saturation) { QWriteLocker l(&m_colorsLock); m_saturation = saturation; @@ -146,13 +146,13 @@ void GstQtVideoSinkSurface::setSaturation(int saturation) //------------------------------------- -bool GstQtVideoSinkSurface::forceAspectRatio() const +bool QtVideoSinkDelegate::forceAspectRatio() const { QReadLocker l(&m_forceAspectRatioLock); return m_forceAspectRatio; } -void GstQtVideoSinkSurface::setForceAspectRatio(bool force) +void QtVideoSinkDelegate::setForceAspectRatio(bool force) { QWriteLocker l(&m_forceAspectRatioLock); if (m_forceAspectRatio != force) { @@ -185,7 +185,7 @@ static QRectF centerRect(const QRectF & src, const QRectF & dst) return result; } -void GstQtVideoSinkSurface::paint(QPainter *painter, qreal x, qreal y, qreal width, qreal height) +void QtVideoSinkDelegate::paint(QPainter *painter, qreal x, qreal y, qreal width, qreal height) { GST_TRACE_OBJECT(m_sink, "paint called"); @@ -299,12 +299,12 @@ void GstQtVideoSinkSurface::paint(QPainter *painter, qreal x, qreal y, qreal wid #ifndef GST_QT_VIDEO_SINK_NO_OPENGL -QGLContext *GstQtVideoSinkSurface::glContext() const +QGLContext *QtVideoSinkDelegate::glContext() const { return m_glContext; } -void GstQtVideoSinkSurface::setGLContext(QGLContext *context) +void QtVideoSinkDelegate::setGLContext(QGLContext *context) { GST_LOG_OBJECT(m_sink, "Setting GL context. context=%p m_glContext=%p m_painter=%p", context, m_glContext, m_painter); @@ -342,7 +342,7 @@ void GstQtVideoSinkSurface::setGLContext(QGLContext *context) enum PainterType { Glsl, ArbFp, Generic }; -void GstQtVideoSinkSurface::changePainter(const BufferFormat & format) +void QtVideoSinkDelegate::changePainter(const BufferFormat & format) { if (m_painter) { m_painter->cleanup(); @@ -359,13 +359,13 @@ void GstQtVideoSinkSurface::changePainter(const BufferFormat & format) #ifndef GST_QT_VIDEO_SINK_NO_OPENGL # ifndef QT_OPENGL_ES - if (m_supportedShaderTypes & GstQtVideoSinkSurface::FragmentProgramShader + if (m_supportedShaderTypes & QtVideoSinkDelegate::FragmentProgramShader && ArbFpSurfacePainter::supportedPixelFormats().contains(format.videoFormat())) { possiblePainters.push(ArbFp); } # endif - if (m_supportedShaderTypes & GstQtVideoSinkSurface::GlslShader + if (m_supportedShaderTypes & QtVideoSinkDelegate::GlslShader && GlslSurfacePainter::supportedPixelFormats().contains(format.videoFormat())) { possiblePainters.push(Glsl); } @@ -411,7 +411,7 @@ void GstQtVideoSinkSurface::changePainter(const BufferFormat & format) ("Failed to create a painter for the given format"), (NULL)); } -void GstQtVideoSinkSurface::destroyPainter() +void QtVideoSinkDelegate::destroyPainter() { GST_LOG_OBJECT(m_sink, "Destroying painter"); @@ -419,7 +419,7 @@ void GstQtVideoSinkSurface::destroyPainter() m_painter = 0; } -bool GstQtVideoSinkSurface::event(QEvent *event) +bool QtVideoSinkDelegate::event(QEvent *event) { switch((int) event->type()) { case BufferEventType: @@ -471,5 +471,3 @@ bool GstQtVideoSinkSurface::event(QEvent *event) return QObject::event(event); } } - -#include "gstqtvideosinksurface.moc" diff --git a/elements/gstqtvideosink/gstqtvideosinksurface.h b/elements/gstqtvideosink/qtvideosinkdelegate.h index ee3b74e..9bb361a 100644 --- a/elements/gstqtvideosink/gstqtvideosinksurface.h +++ b/elements/gstqtvideosink/qtvideosinkdelegate.h @@ -15,8 +15,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef GST_QT_VIDEO_SINK_SURFACE_H -#define GST_QT_VIDEO_SINK_SURFACE_H +#ifndef QT_VIDEO_SINK_DELEGATE_H +#define QT_VIDEO_SINK_DELEGATE_H #include "gstqtvideosinkbase.h" #include "bufferformat.h" @@ -30,7 +30,7 @@ class QGLContext; -class GstQtVideoSinkSurface : public QObject +class QtVideoSinkDelegate : public QObject { Q_OBJECT public: @@ -68,8 +68,8 @@ public: //------------------------------------- - explicit GstQtVideoSinkSurface(GstQtVideoSinkBase *sink, QObject *parent = 0); - ~GstQtVideoSinkSurface(); + explicit QtVideoSinkDelegate(GstQtVideoSinkBase *sink, QObject *parent = 0); + ~QtVideoSinkDelegate(); // API for GstQtVideoSink @@ -163,7 +163,7 @@ private: }; #ifndef GST_QT_VIDEO_SINK_NO_OPENGL -Q_DECLARE_OPERATORS_FOR_FLAGS(GstQtVideoSinkSurface::ShaderTypes) +Q_DECLARE_OPERATORS_FOR_FLAGS(QtVideoSinkDelegate::ShaderTypes) #endif -#endif // GST_QT_VIDEO_SINK_SURFACE_H +#endif // QT_VIDEO_SINK_DELEGATE_H |