Re-enabled CIImage based gfx video item on Mac
Also prefer CoreImageHandle to GLTextureHandle in QuickTime player backend, to avoid unnecessary copy via FBO. Change-Id: Id5aa039c438378b7bbf816b7845b05574683c471 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
3613a14b38
commit
09a7fda971
@@ -31,8 +31,7 @@ SOURCES += \
|
|||||||
qvideowidget.cpp
|
qvideowidget.cpp
|
||||||
|
|
||||||
mac {
|
mac {
|
||||||
# QtWidgets is not yet supported on Mac (!).
|
!simulator {
|
||||||
false:!simulator {
|
|
||||||
PRIVATE_HEADERS += qpaintervideosurface_mac_p.h
|
PRIVATE_HEADERS += qpaintervideosurface_mac_p.h
|
||||||
OBJECTIVE_SOURCES += qpaintervideosurface_mac.mm
|
OBJECTIVE_SOURCES += qpaintervideosurface_mac.mm
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ void QVideoSurfaceGenericPainter::updateColors(int, int, int, int)
|
|||||||
|
|
||||||
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1)
|
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1)
|
||||||
|
|
||||||
#ifndef Q_WS_MAC
|
#ifndef Q_OS_MAC
|
||||||
# ifndef APIENTRYP
|
# ifndef APIENTRYP
|
||||||
# ifdef APIENTRY
|
# ifdef APIENTRY
|
||||||
# define APIENTRYP APIENTRY *
|
# define APIENTRYP APIENTRY *
|
||||||
@@ -1673,7 +1673,7 @@ void QPainterVideoSurface::createPainter()
|
|||||||
{
|
{
|
||||||
Q_ASSERT(!m_painter);
|
Q_ASSERT(!m_painter);
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
if (m_glContext)
|
if (m_glContext)
|
||||||
m_glContext->makeCurrent();
|
m_glContext->makeCurrent();
|
||||||
|
|
||||||
|
|||||||
@@ -134,6 +134,8 @@ QAbstractVideoSurface::Error QVideoSurfaceCoreGraphicsPainter::paint(
|
|||||||
const QRectF &target, QPainter *painter, const QRectF &source)
|
const QRectF &target, QPainter *painter, const QRectF &source)
|
||||||
{
|
{
|
||||||
if (m_frame.handleType() == QAbstractVideoBuffer::CoreImageHandle) {
|
if (m_frame.handleType() == QAbstractVideoBuffer::CoreImageHandle) {
|
||||||
|
//Non OpenGL CI rendering is disabled for now since qt_mac_cg_context is moved to platform plugin
|
||||||
|
#ifdef ENABLE_CORE_GRAPHICS_VIDEO_RENDERING
|
||||||
if (painter->paintEngine()->type() == QPaintEngine::CoreGraphics ) {
|
if (painter->paintEngine()->type() == QPaintEngine::CoreGraphics ) {
|
||||||
|
|
||||||
CIImage *img = (CIImage*)(m_frame.handle().value<void*>());
|
CIImage *img = (CIImage*)(m_frame.handle().value<void*>());
|
||||||
@@ -168,7 +170,9 @@ QAbstractVideoSurface::Error QVideoSurfaceCoreGraphicsPainter::paint(
|
|||||||
return QAbstractVideoSurface::NoError;
|
return QAbstractVideoSurface::NoError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (painter->paintEngine()->type() == QPaintEngine::OpenGL2 ||
|
} else
|
||||||
|
#endif
|
||||||
|
if (painter->paintEngine()->type() == QPaintEngine::OpenGL2 ||
|
||||||
painter->paintEngine()->type() == QPaintEngine::OpenGL) {
|
painter->paintEngine()->type() == QPaintEngine::OpenGL) {
|
||||||
CIImage *img = (CIImage*)(m_frame.handle().value<void*>());
|
CIImage *img = (CIImage*)(m_frame.handle().value<void*>());
|
||||||
|
|
||||||
|
|||||||
@@ -330,11 +330,11 @@ void QT7MovieViewRenderer::setupVideoOutput()
|
|||||||
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle;
|
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle;
|
||||||
QVideoFrame::PixelFormat pixelFormat = QVideoFrame::Format_RGB32;
|
QVideoFrame::PixelFormat pixelFormat = QVideoFrame::Format_RGB32;
|
||||||
|
|
||||||
if (glTextureSupported) {
|
if (coreImageFrameSupported) {
|
||||||
|
handleType = QAbstractVideoBuffer::CoreImageHandle;
|
||||||
|
} else if (glTextureSupported) {
|
||||||
handleType = QAbstractVideoBuffer::GLTextureHandle;
|
handleType = QAbstractVideoBuffer::GLTextureHandle;
|
||||||
pixelFormat = QVideoFrame::Format_BGR32;
|
pixelFormat = QVideoFrame::Format_BGR32;
|
||||||
} else if (coreImageFrameSupported) {
|
|
||||||
handleType = QAbstractVideoBuffer::CoreImageHandle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVideoSurfaceFormat format(m_nativeSize, pixelFormat, handleType);
|
QVideoSurfaceFormat format(m_nativeSize, pixelFormat, handleType);
|
||||||
|
|||||||
@@ -792,7 +792,7 @@ void tst_QPainterVideoSurface::shaderSupportedFormat_data()
|
|||||||
<< false
|
<< false
|
||||||
#endif
|
#endif
|
||||||
<< false;
|
<< false;
|
||||||
#ifndef Q_WS_MAC
|
#ifndef Q_OS_MAC
|
||||||
QTest::newRow((type.second + "YUV420P 640x480").constData())
|
QTest::newRow((type.second + "YUV420P 640x480").constData())
|
||||||
<< type.first
|
<< type.first
|
||||||
<< QAbstractVideoBuffer::NoHandle
|
<< QAbstractVideoBuffer::NoHandle
|
||||||
@@ -829,7 +829,7 @@ void tst_QPainterVideoSurface::shaderSupportedFormat_data()
|
|||||||
<< QSize(-640, 480)
|
<< QSize(-640, 480)
|
||||||
<< true
|
<< true
|
||||||
<< false;
|
<< false;
|
||||||
#ifndef Q_WS_MAC
|
#ifndef Q_OS_MAC
|
||||||
QTest::newRow((type.second + "Texture: rgb565 32x32").constData())
|
QTest::newRow((type.second + "Texture: rgb565 32x32").constData())
|
||||||
<< type.first
|
<< type.first
|
||||||
<< QAbstractVideoBuffer::GLTextureHandle
|
<< QAbstractVideoBuffer::GLTextureHandle
|
||||||
@@ -852,7 +852,7 @@ void tst_QPainterVideoSurface::shaderSupportedFormat_data()
|
|||||||
<< QSize(256, 256)
|
<< QSize(256, 256)
|
||||||
<< true
|
<< true
|
||||||
<< true;
|
<< true;
|
||||||
#ifndef Q_WS_MAC
|
#ifndef Q_OS_MAC
|
||||||
QTest::newRow((type.second + "Texture: rgb24 1024x768").constData())
|
QTest::newRow((type.second + "Texture: rgb24 1024x768").constData())
|
||||||
<< type.first
|
<< type.first
|
||||||
<< QAbstractVideoBuffer::GLTextureHandle
|
<< QAbstractVideoBuffer::GLTextureHandle
|
||||||
@@ -972,7 +972,7 @@ void tst_QPainterVideoSurface::shaderPresent_data()
|
|||||||
<< static_cast<const uchar *>(rgb565ImageData)
|
<< static_cast<const uchar *>(rgb565ImageData)
|
||||||
<< int(sizeof(rgb565ImageData))
|
<< int(sizeof(rgb565ImageData))
|
||||||
<< 4;
|
<< 4;
|
||||||
#ifndef Q_WS_MAC
|
#ifndef Q_OS_MAC
|
||||||
QTest::newRow((type.second + "rgb32 -> yuv420p").constData())
|
QTest::newRow((type.second + "rgb32 -> yuv420p").constData())
|
||||||
<< type.first
|
<< type.first
|
||||||
<< QVideoFrame::Format_RGB32
|
<< QVideoFrame::Format_RGB32
|
||||||
|
|||||||
Reference in New Issue
Block a user