summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-01-28 03:03:02 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-01-28 03:03:02 +0100
commit4ad0484b825524bcbb74145ac4e63bdd6274ce6a (patch)
treeff9fed7574509abb9f353513107ced1da8cfecc7 /src/multimedia
parent3a27739539638c5dd7c11262f2238eb02b14616e (diff)
parent836bde2ba1a3fc5bdce51aad839e07fb7584af35 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/multimedia')
-rw-r--r--src/multimedia/camera/qcamera.cpp82
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/multimedia-snippets.pro3
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/multiple-videooutputs.qml67
-rw-r--r--src/multimedia/playback/qmediaplayer.cpp2
-rw-r--r--src/multimedia/qmediapluginloader.cpp4
5 files changed, 120 insertions, 38 deletions
diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp
index e23193f11..40441f332 100644
--- a/src/multimedia/camera/qcamera.cpp
+++ b/src/multimedia/camera/qcamera.cpp
@@ -838,6 +838,10 @@ void QCamera::start()
/*!
Stops the camera.
The camera state is changed from QCamera::ActiveState to QCamera::LoadedState.
+
+ In this state, the camera still consumes power.
+
+ \sa unload(), QCamera::UnloadedState
*/
void QCamera::stop()
{
@@ -846,15 +850,17 @@ void QCamera::stop()
}
/*!
- Open the camera device.
- The camera state is changed to QCamera::LoadedStatus.
+ Opens the camera device.
+ The camera state is changed to QCamera::LoadedState.
- It's not necessary to explcitly load the camera,
- unless unless the application have to read the supported camera
- settings and change the default depending on the camera capabilities.
+ It's not necessary to explicitly load the camera, unless the application
+ needs to read the supported camera settings and change the default values
+ according to the camera capabilities.
- In all the other cases it's possible to start the camera directly
- from unloaded state.
+ In all the other cases, it's possible to start the camera directly
+ from the unloaded state.
+
+ /sa QCamera::UnloadedState
*/
void QCamera::load()
{
@@ -863,8 +869,8 @@ void QCamera::load()
}
/*!
- Close the camera device and deallocate the related resources.
- The camera state is changed to QCamera::UnloadedStatus.
+ Closes the camera device and deallocates the related resources.
+ The camera state is changed to QCamera::UnloadedState.
*/
void QCamera::unload()
{
@@ -911,7 +917,7 @@ QCamera::Status QCamera::status() const
/*!
- Returns the lock types, camera supports.
+ Returns the lock types that the camera supports.
*/
QCamera::LockTypes QCamera::supportedLocks() const
{
@@ -1078,23 +1084,22 @@ void QCamera::unlock()
/*!
\enum QCamera::State
+
+ This enum holds the current state of the camera.
+
\value UnloadedState
- The initial camera state, with camera not loaded,
- the camera capabilities except of supported capture modes
+ The initial camera state, with camera not loaded.
+ The camera capabilities, except supported capture modes,
are unknown.
-
While the supported settings are unknown in this state,
it's allowed to set the camera capture settings like codec,
resolution, or frame rate.
-
\value LoadedState
The camera is loaded and ready to be configured.
-
- In the Idle state it's allowed to query camera capabilities,
+ In this state it's allowed to query camera capabilities,
set capture resolution, codecs, etc.
-
The viewfinder is not active in the loaded state.
-
+ The camera consumes power in the loaded state.
\value ActiveState
In the active state as soon as camera is started
the viewfinder displays video frames and the
@@ -1109,46 +1114,40 @@ void QCamera::unlock()
/*!
\enum QCamera::Status
+
+ This enum holds the current status of the camera.
+
\value ActiveStatus
The camera has been started and can produce data.
The viewfinder displays video frames in active state.
-
Depending on backend, changing some camera settings like
capture mode, codecs or resolution in ActiveState may lead
to changing the camera status to LoadedStatus and StartingStatus while
the settings are applied and back to ActiveStatus when the camera is ready.
-
\value StartingStatus
The camera is starting in result of state transition to QCamera::ActiveState.
The camera service is not ready to capture yet.
-
\value StoppingStatus
The camera is stopping in result of state transition from QCamera::ActiveState
to QCamera::LoadedState or QCamera::UnloadedState.
-
\value StandbyStatus
The camera is in the power saving standby mode.
The camera may come to the standby mode after some time of inactivity
in the QCamera::LoadedState state.
-
\value LoadedStatus
The camera is loaded and ready to be configured.
This status indicates the camera device is opened and
it's possible to query for supported image and video capture settings,
like resolution, framerate and codecs.
-
\value LoadingStatus
The camera device loading in result of state transition from
QCamera::UnloadedState to QCamera::LoadedState or QCamera::ActiveState.
-
\value UnloadingStatus
The camera device is unloading in result of state transition from
QCamera::LoadedState or QCamera::ActiveState to QCamera::UnloadedState.
-
\value UnloadedStatus
The initial camera status, with camera not loaded.
The camera capabilities including supported capture settings may be unknown.
-
\value UnavailableStatus
The camera or camera backend is not available.
*/
@@ -1162,6 +1161,9 @@ void QCamera::unlock()
/*!
\enum QCamera::CaptureMode
+
+ This enum holds the capture mode of the camera.
+
\value CaptureViewfinder Camera is only configured to display viewfinder.
\value CaptureStillImage Camera is configured for still frames capture.
\value CaptureVideo Camera is configured for video capture.
@@ -1170,6 +1172,8 @@ void QCamera::unlock()
/*!
\enum QCamera::LockType
+ This enum holds the camera lock type.
+
\value NoLock
\value LockExposure
Lock camera exposure.
@@ -1210,28 +1214,32 @@ void QCamera::unlock()
/*!
\enum QCamera::LockStatus
+
+ This enum holds the overall status for all the requested camera locks.
+
\value Unlocked
The application is not interested in camera settings value.
The camera may keep this parameter without changes, this is common with camera focus,
or adjust exposure and white balance constantly to keep the viewfinder image nice.
-
\value Searching
The application has requested the camera focus, exposure or white balance lock with
- QCamera::searchAndLock(). This state indicates the camera is focusing or calculating exposure and white balance.
-
+ QCamera::searchAndLock(). This state indicates the camera is focusing or
+ calculating exposure and white balance.
\value Locked
The camera focus, exposure or white balance is locked.
- The camera is ready to capture, application may check the exposure parameters.
-
- The locked state usually means the requested parameter stays the same,
- except of the cases when the parameter is requested to be constantly updated.
- For example in continuous focusing mode, the focus is considered locked as long
- and the object is in focus, even while the actual focusing distance may be constantly changing.
+ The camera is ready to capture, application may check the exposure
+ stays the same, parameters. The \c Locked status usually means the
+ requested parameter except in the cases when the parameter is requested
+ to be constantly updated. For example, in continuous focusing mode,
+ the focus is considered locked as long as the object is in focus, even
+ while the actual focusing distance may be constantly changing.
*/
/*!
\enum QCamera::LockChangeReason
+ This enum holds the reason why the camera lock status changed.
+
\value UserRequest
The lock status changed in result of user request, usually to unlock camera settings.
\value LockAcquired
@@ -1252,6 +1260,8 @@ void QCamera::unlock()
/*!
\enum QCamera::Error
+ This enum holds the last error code.
+
\value NoError No errors have occurred.
\value CameraError An error has occurred.
\value InvalidRequestError System resource doesn't support requested functionality.
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/multimedia-snippets.pro b/src/multimedia/doc/snippets/multimedia-snippets/multimedia-snippets.pro
index c13090a79..a46b20bd0 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/multimedia-snippets.pro
+++ b/src/multimedia/doc/snippets/multimedia-snippets/multimedia-snippets.pro
@@ -22,4 +22,5 @@ SOURCES += \
OTHER_FILES += \
soundeffect.qml \
- qtvideosink.qml
+ qtvideosink.qml \
+ multiple-videooutputs.qml
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/multiple-videooutputs.qml b/src/multimedia/doc/snippets/multimedia-snippets/multiple-videooutputs.qml
new file mode 100644
index 000000000..e3c1587f6
--- /dev/null
+++ b/src/multimedia/doc/snippets/multimedia-snippets/multiple-videooutputs.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Window 2.2
+import QtMultimedia 5.15
+
+//! [complete]
+Item {
+ MediaPlayer {
+ id: mediaplayer
+ autoPlay: true
+ source: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
+ videoOutput: [v1, v2]
+ }
+
+ VideoOutput {
+ id: v1
+ anchors.fill: parent
+ }
+
+ Window {
+ visible: true
+ width: 480; height: 320
+ VideoOutput {
+ id: v2
+ anchors.fill: parent
+ }
+ }
+}
+//! [complete]
diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp
index 9b51bcddf..d96cb3a95 100644
--- a/src/multimedia/playback/qmediaplayer.cpp
+++ b/src/multimedia/playback/qmediaplayer.cpp
@@ -1184,7 +1184,7 @@ void QMediaPlayer::setVideoOutput(QAbstractVideoSurface *surface)
void QMediaPlayer::setVideoOutput(const QVector<QAbstractVideoSurface *> &surfaces)
{
- setVideoOutput(new QVideoSurfaces(surfaces, this));
+ setVideoOutput(!surfaces.empty() ? new QVideoSurfaces(surfaces, this) : nullptr);
}
/*! \reimp */
diff --git a/src/multimedia/qmediapluginloader.cpp b/src/multimedia/qmediapluginloader.cpp
index 78ba3207f..88bd591c2 100644
--- a/src/multimedia/qmediapluginloader.cpp
+++ b/src/multimedia/qmediapluginloader.cpp
@@ -50,7 +50,11 @@ QT_BEGIN_NAMESPACE
QMediaPluginLoader::QMediaPluginLoader(const char *iid, const QString &location, Qt::CaseSensitivity caseSensitivity):
m_iid(iid)
{
+#if defined(Q_OS_ANDROID)
+ m_location = QString(location).replace(QLatin1Char('/'), QLatin1Char('_'));
+#else
m_location = QString::fromLatin1("/%1").arg(location);
+#endif
m_factoryLoader = new QFactoryLoader(m_iid, m_location, caseSensitivity);
loadMetadata();
}