diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-01-08 14:32:41 +0100 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-02-03 14:41:39 +0000 |
commit | 3e94b7ce2d8166767ec47425d2cefbc77cb5fde2 (patch) | |
tree | c27061139c94b04d8237d4fabba05801a39f9369 /src/plugins/videonode/egl | |
parent | 2f494446388e314286506eae335439b7bbc75736 (diff) |
Add video filtering support to VideoOutput
Add the QAbstractVideoFilter base class and integrate it with VideoOutput.
This can be used to perform arbitrary filtering or image processing
on the frames of a video stream of a VideoOutput element right before
the OpenGL texture is provided to the scenegraph by the video node.
This opens up the possibility to integrate computer vision
frameworks or accelerated image processing with Qt Quick applications
that display video streams using Qt Multimedia.
Conceptually it is somewhat similar to QVideoProbe, this
approach however allows modifying the frame, in real time
with tight integration to the scenegraph node, and targets
Qt Quick meaning setting up the filter and processing the results
of the computations happen completely in QML.
[ChangeLog] Added QAbstractVideoFilter that serves as a base class for QML
video filtering elements that integrate compute, vision, and image processing
frameworks with VideoOutput.
Change-Id: Ice1483f8c2daec5a43536978627a7bbb64549480
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/plugins/videonode/egl')
-rw-r--r-- | src/plugins/videonode/egl/qsgvideonode_egl.cpp | 7 | ||||
-rw-r--r-- | src/plugins/videonode/egl/qsgvideonode_egl.h | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/videonode/egl/qsgvideonode_egl.cpp b/src/plugins/videonode/egl/qsgvideonode_egl.cpp index 4e63c0dba..15af8b5e7 100644 --- a/src/plugins/videonode/egl/qsgvideonode_egl.cpp +++ b/src/plugins/videonode/egl/qsgvideonode_egl.cpp @@ -187,7 +187,7 @@ QSGVideoNode_EGL::~QSGVideoNode_EGL() { } -void QSGVideoNode_EGL::setCurrentFrame(const QVideoFrame &frame) +void QSGVideoNode_EGL::setCurrentFrame(const QVideoFrame &frame, FrameFlags) { EGLImageKHR image = frame.handle().value<void *>(); m_material.setImage(image); @@ -199,6 +199,11 @@ QVideoFrame::PixelFormat QSGVideoNode_EGL::pixelFormat() const return m_pixelFormat; } +QAbstractVideoBuffer::HandleType QSGVideoNode_EGL::handleType() const +{ + return QAbstractVideoBuffer::EGLImageHandle; +} + static bool isExtensionSupported() { static const bool supported = eglGetProcAddress("glEGLImageTargetTexture2DOES"); diff --git a/src/plugins/videonode/egl/qsgvideonode_egl.h b/src/plugins/videonode/egl/qsgvideonode_egl.h index b6f70abfb..7e9cfe871 100644 --- a/src/plugins/videonode/egl/qsgvideonode_egl.h +++ b/src/plugins/videonode/egl/qsgvideonode_egl.h @@ -74,8 +74,9 @@ public: QSGVideoNode_EGL(const QVideoSurfaceFormat &format); ~QSGVideoNode_EGL(); - void setCurrentFrame(const QVideoFrame &frame); + void setCurrentFrame(const QVideoFrame &frame, FrameFlags flags); QVideoFrame::PixelFormat pixelFormat() const; + QAbstractVideoBuffer::HandleType handleType() const; private: QSGVideoMaterial_EGL m_material; |