QNX: remove mmrenderer overlay window support
QtMultimedia no longer supports overlay windows. The QNX multimedia plugin now relies on the canonical rendering codepath via QVideoWindow. Change-Id: Ic3bb14865f147a47200554e4791c191540e5bb75 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
This commit is contained in:
parent
dfb4697e4a
commit
e555069151
@ -116,9 +116,7 @@ void QQnxNativeInterface::setWindowProperty(QPlatformWindow *window, const QStri
|
||||
{
|
||||
QQnxWindow *qnxWindow = static_cast<QQnxWindow*>(window);
|
||||
|
||||
if (name == QLatin1String("mmRendererWindowName")) {
|
||||
qnxWindow->setMMRendererWindowName(value.toString());
|
||||
} else if (name == QLatin1String("qnxWindowGroup")) {
|
||||
if (name == QLatin1String("qnxWindowGroup")) {
|
||||
if (value.isNull())
|
||||
qnxWindow->joinWindowGroup(QByteArray());
|
||||
else if (value.canConvert<QByteArray>())
|
||||
|
@ -62,13 +62,9 @@
|
||||
#error Please define QQNX_PHYSICAL_SCREEN_WIDTH and QQNX_PHYSICAL_SCREEN_HEIGHT to values greater than zero
|
||||
#endif
|
||||
|
||||
// The default z-order of a window (intended to be overlain) created by
|
||||
// mmrender.
|
||||
static const int MMRENDER_DEFAULT_ZORDER = -1;
|
||||
|
||||
// The maximum z-order at which a foreign window will be considered
|
||||
// an underlay.
|
||||
static const int MAX_UNDERLAY_ZORDER = MMRENDER_DEFAULT_ZORDER - 1;
|
||||
static const int MAX_UNDERLAY_ZORDER = -1;
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -118,38 +114,6 @@ static QSize determineScreenSize(screen_display_t display, bool primaryScreen) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static QQnxWindow *findMultimediaWindow(const QList<QQnxWindow*> &windows,
|
||||
const QByteArray &mmWindowId)
|
||||
{
|
||||
Q_FOREACH (QQnxWindow *sibling, windows) {
|
||||
if (sibling->mmRendererWindowName() == mmWindowId)
|
||||
return sibling;
|
||||
|
||||
QQnxWindow *mmWindow = findMultimediaWindow(sibling->children(), mmWindowId);
|
||||
|
||||
if (mmWindow)
|
||||
return mmWindow;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static QQnxWindow *findMultimediaWindow(const QList<QQnxWindow*> &windows,
|
||||
screen_window_t mmWindowId)
|
||||
{
|
||||
Q_FOREACH (QQnxWindow *sibling, windows) {
|
||||
if (sibling->mmRendererWindow() == mmWindowId)
|
||||
return sibling;
|
||||
|
||||
QQnxWindow *mmWindow = findMultimediaWindow(sibling->children(), mmWindowId);
|
||||
|
||||
if (mmWindow)
|
||||
return mmWindow;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, bool primaryScreen)
|
||||
: m_screenContext(screenContext),
|
||||
m_display(display),
|
||||
@ -714,19 +678,6 @@ void QQnxScreen::addUnderlayWindow(screen_window_t window)
|
||||
updateHierarchy();
|
||||
}
|
||||
|
||||
void QQnxScreen::addMultimediaWindow(const QByteArray &id, screen_window_t window)
|
||||
{
|
||||
// find the QnxWindow this mmrenderer window is related to
|
||||
QQnxWindow *mmWindow = findMultimediaWindow(m_childWindows, id);
|
||||
|
||||
if (!mmWindow)
|
||||
return;
|
||||
|
||||
mmWindow->setMMRendererWindow(window);
|
||||
|
||||
updateHierarchy();
|
||||
}
|
||||
|
||||
void QQnxScreen::removeOverlayOrUnderlayWindow(screen_window_t window)
|
||||
{
|
||||
const int numRemoved = m_overlays.removeAll(window) + m_underlays.removeAll(window);
|
||||
@ -762,32 +713,24 @@ void QQnxScreen::newWindowCreated(void *window)
|
||||
|
||||
windowName = QByteArray(windowNameBuffer);
|
||||
|
||||
if (display == nativeDisplay()) {
|
||||
// A window was created on this screen. If we don't know about this window yet, it means
|
||||
// it was not created by Qt, but by some foreign library like the multimedia renderer, which
|
||||
// creates an overlay window when playing a video.
|
||||
//
|
||||
// Treat all foreign windows as overlays, underlays or as windows
|
||||
// created by the BlackBerry QtMultimedia plugin.
|
||||
//
|
||||
// In the case of the BlackBerry QtMultimedia plugin, we need to
|
||||
// "attach" the foreign created mmrenderer window to the correct
|
||||
// platform window (usually the one belonging to QVideoWidget) to
|
||||
// ensure proper z-ordering.
|
||||
//
|
||||
// Otherwise, assume that if a foreign window already has a Z-Order both negative and
|
||||
// less than the default Z-Order installed by mmrender on windows it creates,
|
||||
// the windows should be treated as an underlay. Otherwise, we treat it as an overlay.
|
||||
if (!windowName.isEmpty() && windowName.startsWith("MmRendererVideoWindowControl")) {
|
||||
addMultimediaWindow(windowName, windowHandle);
|
||||
} else if (!findWindow(windowHandle)) {
|
||||
if (zorder <= MAX_UNDERLAY_ZORDER)
|
||||
addUnderlayWindow(windowHandle);
|
||||
else
|
||||
addOverlayWindow(windowHandle);
|
||||
Q_EMIT foreignWindowCreated(windowHandle);
|
||||
}
|
||||
}
|
||||
if (display != nativeDisplay())
|
||||
return;
|
||||
|
||||
// A window was created on this screen. If we don't know about this window yet, it means
|
||||
// it was not created by Qt, but by some foreign library.
|
||||
//
|
||||
// Treat all foreign windows as overlays or underlays. A window will
|
||||
// be treated as an underlay if its Z-order is less or equal than
|
||||
// MAX_UNDERLAY_ZORDER. Otherwise, it will be treated as an overlay.
|
||||
if (findWindow(windowHandle))
|
||||
return;
|
||||
|
||||
if (zorder <= MAX_UNDERLAY_ZORDER)
|
||||
addUnderlayWindow(windowHandle);
|
||||
else
|
||||
addOverlayWindow(windowHandle);
|
||||
|
||||
Q_EMIT foreignWindowCreated(windowHandle);
|
||||
}
|
||||
|
||||
void QQnxScreen::windowClosed(void *window)
|
||||
@ -795,12 +738,7 @@ void QQnxScreen::windowClosed(void *window)
|
||||
Q_ASSERT(thread() == QThread::currentThread());
|
||||
const screen_window_t windowHandle = reinterpret_cast<screen_window_t>(window);
|
||||
|
||||
QQnxWindow *mmWindow = findMultimediaWindow(m_childWindows, windowHandle);
|
||||
|
||||
if (mmWindow)
|
||||
mmWindow->clearMMRendererWindow();
|
||||
else
|
||||
removeOverlayOrUnderlayWindow(windowHandle);
|
||||
removeOverlayOrUnderlayWindow(windowHandle);
|
||||
}
|
||||
|
||||
void QQnxScreen::windowGroupStateChanged(const QByteArray &id, Qt::WindowState state)
|
||||
|
@ -138,7 +138,6 @@ private:
|
||||
void resizeWindows(const QRect &previousScreenGeometry);
|
||||
void addOverlayWindow(screen_window_t window);
|
||||
void addUnderlayWindow(screen_window_t window);
|
||||
void addMultimediaWindow(const QByteArray &id, screen_window_t window);
|
||||
void removeOverlayOrUnderlayWindow(screen_window_t window);
|
||||
|
||||
screen_context_t m_screenContext;
|
||||
|
@ -157,7 +157,6 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW
|
||||
m_exposed(true),
|
||||
m_foreign(false),
|
||||
m_windowState(Qt::WindowNoState),
|
||||
m_mmRendererWindow(0),
|
||||
m_firstActivateHandled(false)
|
||||
{
|
||||
qWindowDebug() << "window =" << window << ", size =" << window->size();
|
||||
@ -280,7 +279,6 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, screen_window_
|
||||
, m_exposed(true)
|
||||
, m_foreign(true)
|
||||
, m_windowState(Qt::WindowNoState)
|
||||
, m_mmRendererWindow(0)
|
||||
, m_parentGroupName(256, 0)
|
||||
, m_isTopLevel(false)
|
||||
{
|
||||
@ -752,22 +750,6 @@ void QQnxWindow::propagateSizeHints()
|
||||
qWindowDebug("ignored");
|
||||
}
|
||||
|
||||
void QQnxWindow::setMMRendererWindowName(const QString &name)
|
||||
{
|
||||
m_mmRendererWindowName = name;
|
||||
}
|
||||
|
||||
void QQnxWindow::setMMRendererWindow(screen_window_t handle)
|
||||
{
|
||||
m_mmRendererWindow = handle;
|
||||
}
|
||||
|
||||
void QQnxWindow::clearMMRendererWindow()
|
||||
{
|
||||
m_mmRendererWindowName.clear();
|
||||
m_mmRendererWindow = 0;
|
||||
}
|
||||
|
||||
QPlatformScreen *QQnxWindow::screen() const
|
||||
{
|
||||
return m_screen;
|
||||
@ -912,9 +894,6 @@ void QQnxWindow::updateZorder(int &topZorder)
|
||||
{
|
||||
updateZorder(m_window, topZorder);
|
||||
|
||||
if (m_mmRendererWindow)
|
||||
updateZorder(m_mmRendererWindow, topZorder);
|
||||
|
||||
Q_FOREACH (QQnxWindow *childWindow, m_childWindows)
|
||||
childWindow->updateZorder(topZorder);
|
||||
}
|
||||
|
@ -91,10 +91,6 @@ public:
|
||||
|
||||
void propagateSizeHints() override;
|
||||
|
||||
void setMMRendererWindowName(const QString &name);
|
||||
void setMMRendererWindow(screen_window_t handle);
|
||||
void clearMMRendererWindow();
|
||||
|
||||
QPlatformScreen *screen() const override;
|
||||
const QList<QQnxWindow*>& children() const { return m_childWindows; }
|
||||
|
||||
@ -102,10 +98,6 @@ public:
|
||||
|
||||
void minimize();
|
||||
|
||||
QString mmRendererWindowName() const { return m_mmRendererWindowName; }
|
||||
|
||||
screen_window_t mmRendererWindow() const { return m_mmRendererWindow; }
|
||||
|
||||
void setRotation(int rotation);
|
||||
|
||||
QByteArray groupName() const { return m_windowGroupName; }
|
||||
@ -152,8 +144,6 @@ private:
|
||||
bool m_foreign;
|
||||
QRect m_unmaximizedGeometry;
|
||||
Qt::WindowStates m_windowState;
|
||||
QString m_mmRendererWindowName;
|
||||
screen_window_t m_mmRendererWindow;
|
||||
|
||||
// Group name of window group headed by this window
|
||||
QByteArray m_windowGroupName;
|
||||
|
Loading…
x
Reference in New Issue
Block a user