qvideowidget.cpp
mac {
- # QtWidgets is not yet supported on Mac (!).
- false:!simulator {
+ !simulator {
PRIVATE_HEADERS += qpaintervideosurface_mac_p.h
OBJECTIVE_SOURCES += qpaintervideosurface_mac.mm
}
#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 *
{
Q_ASSERT(!m_painter);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
if (m_glContext)
m_glContext->makeCurrent();
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*>());
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*>());
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);
<< false
#endif
<< false;
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
QTest::newRow((type.second + "YUV420P 640x480").constData())
<< type.first
<< QAbstractVideoBuffer::NoHandle
<< 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
<< 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
<< 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