diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-06-20 16:29:21 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-06-20 16:29:21 +0200 |
commit | 7a688806f677adb8dbab346943b5e2dc8f24b748 (patch) | |
tree | c7294ec88b924c46377113d2f2e7e5242e203b66 /src | |
parent | 1410fda0ffddd7501033fe192e02d87c4c2a858b (diff) | |
parent | 09fea23419b86fc6e2d2fce9ec2b26e7f346657a (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Iaadfcd68fec91611b6341860e41a70b9023719de
Diffstat (limited to 'src')
8 files changed, 118 insertions, 16 deletions
diff --git a/src/multimedia/doc/src/examples/video-qml-paint-rate.qdocinc b/src/multimedia/doc/src/examples/video-qml-paint-rate.qdocinc index 860f14270..84098e241 100644 --- a/src/multimedia/doc/src/examples/video-qml-paint-rate.qdocinc +++ b/src/multimedia/doc/src/examples/video-qml-paint-rate.qdocinc @@ -2,7 +2,7 @@ The QML painting rate is calculated by the FrequencyMonitor class, which turns a stream of events (received via the notify() slot), into an instantaneous and an averaged frequency: -\quotefromfile multimedia/video/snippets/frequencymonitor/frequencymonitor.h +\quotefromfile video/snippets/frequencymonitor/frequencymonitor.h \skipto class FrequencyMonitor : public QObject \printuntil Q_OBJECT \skipto Q_PROPERTY(qreal instantaneousFrequency @@ -19,13 +19,13 @@ instantaneous and an averaged frequency: The FrequencyMonitor class is exposed to QML like this -\quotefromfile multimedia/video/snippets/frequencymonitor/frequencymonitordeclarative.cpp +\quotefromfile video/snippets/frequencymonitor/frequencymonitordeclarative.cpp \skipto FrequencyMonitor::qmlRegisterType \printuntil } and its data is displayed by defining a QML item called FrequencyItem, like this: -\quotefromfile multimedia/video/snippets/frequencymonitor/qml/frequencymonitor/FrequencyItem.qml +\quotefromfile video/snippets/frequencymonitor/qml/frequencymonitor/FrequencyItem.qml \skipto import FrequencyMonitor \printuntil id: root \dots diff --git a/src/multimedia/doc/src/platform-notes-windows.qdoc b/src/multimedia/doc/src/platform-notes-windows.qdoc new file mode 100644 index 000000000..2f72ea1e0 --- /dev/null +++ b/src/multimedia/doc/src/platform-notes-windows.qdoc @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +\page platform-notes-windows.html +\title Qt Multimedia on Windows +\brief Platform notes for Windows + +This page covers the availability of Qt Multimedia features on Windows. + +\section1 Implementation + +Qt Multimedia features for Windows are implemented in two plugins; one +using the Microsoft DirectShow API, and another using WMF (Windows Media +Foundation) framework. DirectShow API was introduced in Windows 98, and +gradually deprecated from Windows XP onwards. Media Foundation framework +was introduced in Windows Vista as a replacement for DirectShow and other +multimedia APIs. Consequently, WMF plugin in Qt is supported only for +Windows Vista and later versions of the operating system. + +\section1 Limitations + +The WMF plugin in Qt does not currently provide a camera backend. Instead, +limited support for camera features is provided by the DirectShow +plugin. Basic features such as displaying a viewfinder and capturing a +still image are supported, however, majority of camera controls are not +implemented. + +Video recording is currently not supported. Additionally, the DirectShow +plugin does not support any low-level video functionality such as +monitoring video frames being played or recorded using \l QVideoProbe or +related classes. +*/ diff --git a/src/multimedia/doc/src/qtmultimedia-index.qdoc b/src/multimedia/doc/src/qtmultimedia-index.qdoc index 417c0c494..4cd59fd52 100644 --- a/src/multimedia/doc/src/qtmultimedia-index.qdoc +++ b/src/multimedia/doc/src/qtmultimedia-index.qdoc @@ -131,6 +131,7 @@ \section2 Platform Notes \list \li \l{BlackBerry} + \li \l{Qt Multimedia on Windows}{Windows} \endlist \section2 Reference diff --git a/src/multimedia/doc/src/qtmultimedia5.qdoc b/src/multimedia/doc/src/qtmultimedia5.qdoc index bbf9907f6..c1267f097 100644 --- a/src/multimedia/doc/src/qtmultimedia5.qdoc +++ b/src/multimedia/doc/src/qtmultimedia5.qdoc @@ -31,9 +31,7 @@ \ingroup qmlmodules \brief Provides QML types for multimedia support. -\section1 Overview - -The QML types for Qt Multimedia support the basic use cases such as: +The QML types for \l{Qt Multimedia} support the basic use cases such as: \list \li audio and video playback, \li access camera and radio functionality, @@ -41,6 +39,11 @@ The QML types for Qt Multimedia support the basic use cases such as: \li and access camera settings. \endlist +The QML types can be imported into your application using the following import +statement in your .qml file: +\code +import QtMultimedia 5.0 +\endcode + \section1 QML types */ - diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index c3eb09ebf..eaac82820 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -1220,7 +1220,7 @@ QMultimedia::AvailabilityStatus QMediaPlayer::availability() const \property QMediaPlayer::volume \brief the current playback volume. - The playback volume is a linear in effect and the value can range from 0 - + The playback volume is linear in effect and the value can range from 0 - 100, values outside this range will be clamped. */ diff --git a/src/plugins/blackberry/common/windowgrabber.cpp b/src/plugins/blackberry/common/windowgrabber.cpp index db070d8e5..144b5a693 100644 --- a/src/plugins/blackberry/common/windowgrabber.cpp +++ b/src/plugins/blackberry/common/windowgrabber.cpp @@ -55,6 +55,8 @@ QT_BEGIN_NAMESPACE WindowGrabber::WindowGrabber(QObject *parent) : QObject(parent), m_screenBuffer(0), + m_screenBufferWidth(-1), + m_screenBufferHeight(-1), m_active(false), m_screenContextInitialized(false), m_screenPixmapInitialized(false), @@ -145,7 +147,8 @@ void WindowGrabber::start() } int size[2] = { 0, 0 }; - result = screen_get_window_property_iv(m_window, SCREEN_PROPERTY_SIZE, size); + + result = screen_get_window_property_iv(m_window, SCREEN_PROPERTY_SOURCE_SIZE, size); if (result != 0) { cleanup(); qWarning() << "WindowGrabber: cannot get window size:" << strerror(errno); @@ -155,7 +158,18 @@ void WindowGrabber::start() m_screenBufferWidth = size[0]; m_screenBufferHeight = size[1]; - result = screen_set_pixmap_property_iv(m_screenPixmap, SCREEN_PROPERTY_BUFFER_SIZE, size); + updateFrameSize(); + + m_timer.start(); + + m_active = true; +} + +void WindowGrabber::updateFrameSize() +{ + int size[2] = { m_screenBufferWidth, m_screenBufferHeight }; + + int result = screen_set_pixmap_property_iv(m_screenPixmap, SCREEN_PROPERTY_BUFFER_SIZE, size); if (result != 0) { cleanup(); qWarning() << "WindowGrabber: cannot set pixmap size:" << strerror(errno); @@ -191,10 +205,6 @@ void WindowGrabber::start() qWarning() << "WindowGrabber: cannot get pixmap buffer stride:" << strerror(errno); return; } - - m_timer.start(); - - m_active = true; } void WindowGrabber::stop() @@ -284,7 +294,31 @@ QByteArray WindowGrabber::windowGroupId() const void WindowGrabber::grab() { - const int result = screen_read_window(m_window, m_screenPixmapBuffer, 0, 0, 0); + int size[2] = { 0, 0 }; + + int result = screen_get_window_property_iv(m_window, SCREEN_PROPERTY_SOURCE_SIZE, size); + if (result != 0) { + cleanup(); + qWarning() << "WindowGrabber: cannot get window size:" << strerror(errno); + return; + } + + if (m_screenBufferWidth != size[0] || m_screenBufferHeight != size[1]) { + // The source viewport size changed, so we have to adapt our buffers + + if (m_screenPixmapBufferInitialized) { + screen_destroy_pixmap_buffer(m_screenPixmap); + m_screenPixmapBufferInitialized = false; + } + + m_screenBufferWidth = size[0]; + m_screenBufferHeight = size[1]; + + updateFrameSize(); + } + + const int rect[] = { 0, 0, m_screenBufferWidth, m_screenBufferHeight }; + result = screen_read_window(m_window, m_screenPixmapBuffer, 1, rect, 0); if (result != 0) return; diff --git a/src/plugins/blackberry/common/windowgrabber.h b/src/plugins/blackberry/common/windowgrabber.h index 547742da1..f8e3686a2 100644 --- a/src/plugins/blackberry/common/windowgrabber.h +++ b/src/plugins/blackberry/common/windowgrabber.h @@ -79,6 +79,7 @@ private slots: private: void cleanup(); + void updateFrameSize(); QTimer m_timer; diff --git a/src/plugins/blackberry/mediaplayer/bbplayervideorenderercontrol.cpp b/src/plugins/blackberry/mediaplayer/bbplayervideorenderercontrol.cpp index 096ae55ec..d9226d91f 100644 --- a/src/plugins/blackberry/mediaplayer/bbplayervideorenderercontrol.cpp +++ b/src/plugins/blackberry/mediaplayer/bbplayervideorenderercontrol.cpp @@ -142,8 +142,14 @@ void BbPlayerVideoRendererControl::resume() void BbPlayerVideoRendererControl::frameGrabbed(const QImage &frame) { if (m_surface) { - if (!m_surface->isActive()) + if (!m_surface->isActive()) { m_surface->start(QVideoSurfaceFormat(frame.size(), QVideoFrame::Format_ARGB32)); + } else { + if (m_surface->surfaceFormat().frameSize() != frame.size()) { + m_surface->stop(); + m_surface->start(QVideoSurfaceFormat(frame.size(), QVideoFrame::Format_ARGB32)); + } + } m_surface->present(frame.copy()); } |