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
|
||||
|
||||
mac {
|
||||
# QtWidgets is not yet supported on Mac (!).
|
||||
false:!simulator {
|
||||
!simulator {
|
||||
PRIVATE_HEADERS += qpaintervideosurface_mac_p.h
|
||||
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)
|
||||
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
# ifndef APIENTRYP
|
||||
# ifdef APIENTRY
|
||||
# define APIENTRYP APIENTRY *
|
||||
@@ -1673,7 +1673,7 @@ void QPainterVideoSurface::createPainter()
|
||||
{
|
||||
Q_ASSERT(!m_painter);
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
if (m_glContext)
|
||||
m_glContext->makeCurrent();
|
||||
|
||||
|
||||
@@ -134,6 +134,8 @@ QAbstractVideoSurface::Error QVideoSurfaceCoreGraphicsPainter::paint(
|
||||
const QRectF &target, QPainter *painter, const QRectF &source)
|
||||
{
|
||||
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 ) {
|
||||
|
||||
CIImage *img = (CIImage*)(m_frame.handle().value<void*>());
|
||||
@@ -168,7 +170,9 @@ QAbstractVideoSurface::Error QVideoSurfaceCoreGraphicsPainter::paint(
|
||||
return QAbstractVideoSurface::NoError;
|
||||
}
|
||||
}
|
||||
} else if (painter->paintEngine()->type() == QPaintEngine::OpenGL2 ||
|
||||
} else
|
||||
#endif
|
||||
if (painter->paintEngine()->type() == QPaintEngine::OpenGL2 ||
|
||||
painter->paintEngine()->type() == QPaintEngine::OpenGL) {
|
||||
CIImage *img = (CIImage*)(m_frame.handle().value<void*>());
|
||||
|
||||
|
||||
@@ -330,11 +330,11 @@ void QT7MovieViewRenderer::setupVideoOutput()
|
||||
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle;
|
||||
QVideoFrame::PixelFormat pixelFormat = QVideoFrame::Format_RGB32;
|
||||
|
||||
if (glTextureSupported) {
|
||||
if (coreImageFrameSupported) {
|
||||
handleType = QAbstractVideoBuffer::CoreImageHandle;
|
||||
} else if (glTextureSupported) {
|
||||
handleType = QAbstractVideoBuffer::GLTextureHandle;
|
||||
pixelFormat = QVideoFrame::Format_BGR32;
|
||||
} else if (coreImageFrameSupported) {
|
||||
handleType = QAbstractVideoBuffer::CoreImageHandle;
|
||||
}
|
||||
|
||||
QVideoSurfaceFormat format(m_nativeSize, pixelFormat, handleType);
|
||||
|
||||
@@ -792,7 +792,7 @@ void tst_QPainterVideoSurface::shaderSupportedFormat_data()
|
||||
<< false
|
||||
#endif
|
||||
<< false;
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
QTest::newRow((type.second + "YUV420P 640x480").constData())
|
||||
<< type.first
|
||||
<< QAbstractVideoBuffer::NoHandle
|
||||
@@ -829,7 +829,7 @@ void tst_QPainterVideoSurface::shaderSupportedFormat_data()
|
||||
<< QSize(-640, 480)
|
||||
<< true
|
||||
<< false;
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
QTest::newRow((type.second + "Texture: rgb565 32x32").constData())
|
||||
<< type.first
|
||||
<< QAbstractVideoBuffer::GLTextureHandle
|
||||
@@ -852,7 +852,7 @@ void tst_QPainterVideoSurface::shaderSupportedFormat_data()
|
||||
<< QSize(256, 256)
|
||||
<< true
|
||||
<< true;
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
QTest::newRow((type.second + "Texture: rgb24 1024x768").constData())
|
||||
<< type.first
|
||||
<< QAbstractVideoBuffer::GLTextureHandle
|
||||
@@ -972,7 +972,7 @@ void tst_QPainterVideoSurface::shaderPresent_data()
|
||||
<< static_cast<const uchar *>(rgb565ImageData)
|
||||
<< int(sizeof(rgb565ImageData))
|
||||
<< 4;
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
QTest::newRow((type.second + "rgb32 -> yuv420p").constData())
|
||||
<< type.first
|
||||
<< QVideoFrame::Format_RGB32
|
||||
|
||||
Reference in New Issue
Block a user