summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2020-05-28 17:35:16 +0200
committerVal Doroshchuk <valentyn.doroshchuk@qt.io>2020-06-10 10:06:22 +0200
commit22ae5eec6314b59c8a969b743a9c05fb184cc9b2 (patch)
tree898464db0d98f53ff7f10dd378c2dc4ed842cfd1 /src/multimedia
parentb5a55492a63cb2cda75d6f980acb7fc5ae8dfc22 (diff)
Introduce QAbstractVideoBuffer::MTLTextureHandle
Added MTLTextureHandle to render metal textures. Is used by default if rhi is enabled for metal backend. Also fixed the frame renderer to create new opengl context and use provided one from the video surface as a share context. To remember, when the quick item is created and updatePaintNode is called, current gl context is set to the video surface as a property. When the frame renderer is ready, it extracts the gl context and uses it as a share one. Task-number: QTBUG-78678 Change-Id: I51ce666ca7c2adc10dd2c1d1dfed99cc9f596e2b Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/multimedia')
-rw-r--r--src/multimedia/video/qabstractvideobuffer.cpp3
-rw-r--r--src/multimedia/video/qabstractvideobuffer.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/multimedia/video/qabstractvideobuffer.cpp b/src/multimedia/video/qabstractvideobuffer.cpp
index f0dd6d2eb..793241be9 100644
--- a/src/multimedia/video/qabstractvideobuffer.cpp
+++ b/src/multimedia/video/qabstractvideobuffer.cpp
@@ -97,6 +97,7 @@ int QAbstractVideoBufferPrivate::map(
\value NoHandle The buffer has no handle, its data can only be accessed by mapping the buffer.
\value GLTextureHandle The handle of the buffer is an OpenGL texture ID.
+ \value MTLTextureHandle The handle of the buffer is an Metal texture ID.
\value XvShmImageHandle The handle contains pointer to shared memory XVideo image.
\value CoreImageHandle The handle contains pointer to \macos CIImage.
\value QPixmapHandle The handle of the buffer is a QPixmap.
@@ -363,6 +364,8 @@ QDebug operator<<(QDebug dbg, QAbstractVideoBuffer::HandleType type)
return dbg << "NoHandle";
case QAbstractVideoBuffer::GLTextureHandle:
return dbg << "GLTextureHandle";
+ case QAbstractVideoBuffer::MTLTextureHandle:
+ return dbg << "MTLTextureHandle";
case QAbstractVideoBuffer::XvShmImageHandle:
return dbg << "XvShmImageHandle";
case QAbstractVideoBuffer::CoreImageHandle:
diff --git a/src/multimedia/video/qabstractvideobuffer.h b/src/multimedia/video/qabstractvideobuffer.h
index 2352c0f3d..b3f31b377 100644
--- a/src/multimedia/video/qabstractvideobuffer.h
+++ b/src/multimedia/video/qabstractvideobuffer.h
@@ -60,6 +60,7 @@ public:
{
NoHandle,
GLTextureHandle,
+ MTLTextureHandle,
XvShmImageHandle,
CoreImageHandle,
QPixmapHandle,