summaryrefslogtreecommitdiffstats
path: root/src/multimedia/doc
diff options
context:
space:
mode:
Diffstat (limited to 'src/multimedia/doc')
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/audiorecorder.cpp210
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/camera.cpp2
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/media.cpp24
-rw-r--r--src/multimedia/doc/src/audiooverview.qdoc22
-rw-r--r--src/multimedia/doc/src/cameraoverview.qdoc74
-rw-r--r--src/multimedia/doc/src/changes.qdoc142
-rw-r--r--src/multimedia/doc/src/multimedia.qdoc19
-rw-r--r--src/multimedia/doc/src/multimediabackend.qdoc46
-rw-r--r--src/multimedia/doc/src/platform-notes-apple.qdoc (renamed from src/multimedia/doc/src/platform-notes-ios.qdoc)8
-rw-r--r--src/multimedia/doc/src/platform-notes-gstreamer-on-android.qdoc59
-rw-r--r--src/multimedia/doc/src/platform-notes-windows.qdoc59
-rw-r--r--src/multimedia/doc/src/qtaudioengine.qdoc59
-rw-r--r--src/multimedia/doc/src/qtmultimedia-index.qdoc10
-rw-r--r--src/multimedia/doc/src/qtmultimedia5.qdoc16
-rw-r--r--src/multimedia/doc/src/videooverview.qdoc32
15 files changed, 136 insertions, 646 deletions
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/audiorecorder.cpp b/src/multimedia/doc/snippets/multimedia-snippets/audiorecorder.cpp
deleted file mode 100644
index bf4a321ea..000000000
--- a/src/multimedia/doc/snippets/multimedia-snippets/audiorecorder.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Mobility Components.
-**
-** $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$
-**
-****************************************************************************/
-
-#include <QtWidgets>
-
-#include <qaudiorecorder.h>
-
-#include <QtMultimedia/qaudioformat.h>
-
-#include "audiorecorder.h"
-
-AudioRecorder::AudioRecorder()
-{
-//! [create-objs-1]
- capture = new QAudioRecorder();
-//! [create-objs-1]
-
- // set a default file
- capture->setOutputLocation(QUrl("test.raw"));
-
- QWidget *window = new QWidget;
- QGridLayout* layout = new QGridLayout;
-
- QLabel* deviceLabel = new QLabel;
- deviceLabel->setText("Devices");
- deviceBox = new QComboBox(this);
- deviceBox->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
-
- QLabel* codecLabel = new QLabel;
- codecLabel->setText("Codecs");
- codecsBox = new QComboBox(this);
- codecsBox->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
-
- QLabel* qualityLabel = new QLabel;
- qualityLabel->setText("Quality");
- qualityBox = new QComboBox(this);
- qualityBox->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
-
-//! [device-list]
- for(int i = 0; i < audiosource->deviceCount(); i++)
- deviceBox->addItem(audiosource->name(i));
-//! [device-list]
-
-//! [codec-list]
- QStringList codecs = capture->supportedAudioCodecs();
- for(int i = 0; i < codecs.count(); i++)
- codecsBox->addItem(codecs.at(i));
-//! [codec-list]
-
- qualityBox->addItem("Low");
- qualityBox->addItem("Medium");
- qualityBox->addItem("High");
-
- connect(capture, SIGNAL(durationChanged(qint64)), this, SLOT(updateProgress(qint64)));
- connect(capture, SIGNAL(stateChanged(QMediaRecorder::State)), this, SLOT(stateChanged(QMediaRecorder::State)));
-
- layout->addWidget(deviceLabel,0,0,Qt::AlignHCenter);
- connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int)));
- layout->addWidget(deviceBox,0,1,1,3,Qt::AlignLeft);
-
- layout->addWidget(codecLabel,1,0,Qt::AlignHCenter);
- connect(codecsBox,SIGNAL(activated(int)),SLOT(codecChanged(int)));
- layout->addWidget(codecsBox,1,1,Qt::AlignLeft);
-
- layout->addWidget(qualityLabel,1,2,Qt::AlignHCenter);
- connect(qualityBox,SIGNAL(activated(int)),SLOT(qualityChanged(int)));
- layout->addWidget(qualityBox,1,3,Qt::AlignLeft);
-
- fileButton = new QPushButton(this);
- fileButton->setText(tr("Output File"));
- connect(fileButton,SIGNAL(clicked()),SLOT(selectOutputFile()));
- layout->addWidget(fileButton,3,0,Qt::AlignHCenter);
-
- button = new QPushButton(this);
- button->setText(tr("Record"));
- connect(button,SIGNAL(clicked()),SLOT(toggleRecord()));
- layout->addWidget(button,3,3,Qt::AlignHCenter);
-
- recTime = new QLabel;
- recTime->setText("0 sec");
- layout->addWidget(recTime,4,0,Qt::AlignHCenter);
-
- window->setLayout(layout);
- setCentralWidget(window);
- window->show();
-
- active = false;
-}
-
-AudioRecorder::~AudioRecorder()
-{
- delete capture;
- delete audiosource;
-}
-
-void AudioRecorder::updateProgress(qint64 pos)
-{
- currentTime = pos;
- if(currentTime == 0) currentTime = 1;
- QString text = QString("%1 secs").arg(currentTime/1000);
- recTime->setText(text);
-}
-
-void AudioRecorder::stateChanged(QMediaRecorder::State state)
-{
- qWarning()<<"stateChanged() "<<state;
-}
-
-void AudioRecorder::deviceChanged(int idx)
-{
-//! [get-device]
- for(int i = 0; i < audiosource->deviceCount(); i++) {
- if(deviceBox->itemText(idx).compare(audiosource->name(i)) == 0)
- audiosource->setSelectedDevice(i);
- }
-//! [get-device]
-}
-
-void AudioRecorder::codecChanged(int idx)
-{
- Q_UNUSED(idx);
- //capture->setAudioCodec(codecsBox->itemText(idx));
-}
-
-void AudioRecorder::qualityChanged(int idx)
-{
- Q_UNUSED(idx);
- /*
- if(capture->audioCodec().compare("audio/x-raw") == 0) {
- if(qualityBox->itemText(idx).compare("Low") == 0) {
- // 8000Hz mono is 8kbps
- capture->setAudioBitrate(8);
- } else if(qualityBox->itemText(idx).compare("Medium") == 0) {
- // 22050Hz mono is 44.1kbps
- capture->setAudioBitrate(44);
- } else if(qualityBox->itemText(idx).compare("High") == 0) {
- // 44100Hz mono is 88.2kbps
- capture->setAudioBitrate(88);
- }
- }
- */
-}
-
-//! [toggle-record]
-void AudioRecorder::toggleRecord()
-{
- if(!active) {
- recTime->setText("0 sec");
- currentTime = 0;
- capture->record();
-
- button->setText(tr("Stop"));
- active = true;
- } else {
- capture->stop();
- button->setText(tr("Record"));
- active = false;
- }
-}
-//! [toggle-record]
-
-void AudioRecorder::selectOutputFile()
-{
- QStringList fileNames;
-
- QFileDialog dialog(this);
-
- dialog.setFileMode(QFileDialog::AnyFile);
- if (dialog.exec())
- fileNames = dialog.selectedFiles();
-
- if(fileNames.size() > 0)
- capture->setOutputLocation(QUrl(fileNames.first()));
-}
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/camera.cpp b/src/multimedia/doc/snippets/multimedia-snippets/camera.cpp
index 48f63e797..80d4853f7 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/camera.cpp
+++ b/src/multimedia/doc/snippets/multimedia-snippets/camera.cpp
@@ -100,7 +100,7 @@ void overview_surface()
camera->setVideoOutput(mySink);
camera->start();
- // MyVideoSurface::newVideoFrame(..) will be called with video frames
+ // MyVideoSink::newVideoFrame(..) will be called with video frames
//! [Camera overview surface]
}
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/media.cpp b/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
index 87eb5999c..fcd1a6b17 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
+++ b/src/multimedia/doc/snippets/multimedia-snippets/media.cpp
@@ -51,6 +51,7 @@
#include "qcamera.h"
#include "qcameraviewfinder.h"
#include "qaudiorecorder.h"
+#include "qurl.h"
#include <QVideoSink>
class MediaExample : public QObject {
@@ -75,7 +76,6 @@ private:
QCameraViewfinder *viewfinder;
QCameraImageCapture *imageCapture;
QString fileName;
- QAudioRecorder *audioRecorder;
QMediaContent image1;
QMediaContent image2;
@@ -147,29 +147,17 @@ void MediaExample::MediaRecorder()
void MediaExample::AudioRecorder()
{
//! [Audio recorder]
- audioRecorder = new QAudioRecorder;
+ QMediaRecorder recorder;
+ recorder.setCaptureMode(QMediaRecorder::AudioOnly);
QMediaEncoderSettings audioSettings;
audioSettings.setFormat(QMediaEncoderSettings::MP3);
audioSettings.setQuality(QMediaEncoderSettings::HighQuality);
- audioRecorder->setEncodingSettings(audioSettings);
+ recorder.setEncoderSettings(audioSettings);
- audioRecorder->setOutputLocation(QUrl::fromLocalFile("test.amr"));
- audioRecorder->record();
+ recorder.setOutputLocation(QUrl::fromLocalFile("test.amr"));
+ recorder.record();
//! [Audio recorder]
-
- //! [Audio recorder inputs]
- const QStringList inputs = audioRecorder->audioInputs();
- QString selectedInput = audioRecorder->defaultAudioInput();
-
- for (const QString &input : inputs) {
- QString description = audioRecorder->audioInputDescription(input);
- // show descriptions to user and allow selection
- selectedInput = input;
- }
-
- audioRecorder->setAudioInput(selectedInput);
- //! [Audio recorder inputs]
}
diff --git a/src/multimedia/doc/src/audiooverview.qdoc b/src/multimedia/doc/src/audiooverview.qdoc
index 30f94d548..e74b285c7 100644
--- a/src/multimedia/doc/src/audiooverview.qdoc
+++ b/src/multimedia/doc/src/audiooverview.qdoc
@@ -33,19 +33,16 @@
\section1 Audio Features
Qt Multimedia offers a range of audio classes, covering both low and
-high level approaches to audio input, output and processing. In
-addition to traditional audio usage, the \l{Qt Audio Engine QML Types}{Qt Audio Engine}
-QML types offer high level 3D positional audio for QML applications.
-See that documentation for more information.
+high level approaches to audio input, output and processing.
\section1 Audio Implementation Details
\section2 Playing Compressed Audio
For playing media or audio files that are not simple, uncompressed audio, you can
-use the \l QMediaPlayer C++ class, or the \l {Audio} and \l {MediaPlayer} QML types.
+use the \l QMediaPlayer C++ class, or the \l {MediaPlayer} QML type.
The QMediaPlayer class and associated QML types are also capable of playing
\l{multimedia-playing-video}{video}, if required. The compressed audio formats supported does depend
-on the operating system environment, and also what media plugins the user
+on the operating system environment, and also what decoder plugins the user
may have installed.
Here is how you play a local file using C++:
@@ -56,18 +53,19 @@ You can also put files (even remote URLs) into a playlist:
\snippet multimedia-snippets/media.cpp Audio playlist
\section2 Recording Audio to a File
-For recording audio to a file, the \l {QAudioRecorder} class allows you
+For recording audio to a file, the \l {QMediaRecorder} class allows you
to compress audio data from an input device and record it.
\snippet multimedia-snippets/media.cpp Audio recorder
+\l {QMediaCaptureSession} provides support for more complex capturing and recording use cases.
+
\section2 Low Latency Sound Effects
In addition to the raw access to sound devices described above, the QSoundEffect class (and
\l {SoundEffect} QML type) offers a slightly higher level way to play
-sounds. These classes allow you to specify a WAV format file which can
-then be played with low latency when necessary. Both QSoundEffect and
-SoundEffect have essentially the same API.
+sounds. This class allows you to specify a WAV format file which can
+then be played with low latency when necessary.
You can adjust the number of \l {QSoundEffect::loopCount()}{loops} a sound effect is played, as well as
the \l {QSoundEffect::setVolume()}{volume} (or \l {QSoundEffect::setMuted()}{muting}) of the effect.
@@ -80,9 +78,7 @@ these classes do not do any audio decoding, or other processing, but they
can support different types of raw audio data.
The QAudioOutput class offers raw audio data output, while QAudioInput
-offers raw audio data input. Both classes have adjustable buffers and
-latency, so they are suitable for both low latency use cases (like games
-or VOIP) and high latency (like music playback). The available hardware
+offers raw audio data input. The available hardware
determines what audio outputs and inputs are available.
\section3 Push and Pull
diff --git a/src/multimedia/doc/src/cameraoverview.qdoc b/src/multimedia/doc/src/cameraoverview.qdoc
index 6ae14c015..f832bc6bb 100644
--- a/src/multimedia/doc/src/cameraoverview.qdoc
+++ b/src/multimedia/doc/src/cameraoverview.qdoc
@@ -98,12 +98,12 @@ check in C++, use the \l QCameraInfo::availableCameras() function, as shown in t
\snippet multimedia-snippets/camera.cpp Camera overview check
-In QML, use the \l{QtMultimedia::QtMultimedia::availableCameras}{QtMultimedia.availableCameras}
+In QML, use the \l{QtMultimedia::MediaDevices::availableCameras}{MediaDevices.availableCameras}
property:
\qml
Item {
- property bool isCameraAvailable: QtMultimedia.availableCameras.length > 0
+ property bool isCameraAvailable: MediaDevices.availableCameras.length > 0
}
\endqml
@@ -116,16 +116,16 @@ In C++:
\snippet multimedia-snippets/camera.cpp Camera selection
-In QML, you can set the \c Camera \l{Camera::deviceId}{deviceId} property. All available IDs can
-be retrieved from \l{QtMultimedia::QtMultimedia::availableCameras}{QtMultimedia.availableCameras}:
+In QML, you can set the \c Camera \l{Camera::cameraInfo}{cameraInfo} property. All available cameras can
+be retrieved from \l{QtMultimedia::MediaDevices::availableCameras}{MediaDevices.availableCameras}:
\qml
Camera {
- deviceId: QtMultimedia.availableCameras[0].deviceId
+ cameraInfo: QtMultimedia.availableCameras[0]
}
\endqml
-You can also select the camera by its physical position on the system rather than its device ID.
+You can also select the camera by its physical position on the system rather than by camera info.
This is useful on mobile devices, which often have a front-facing and a back-facing camera.
In C++:
@@ -140,50 +140,51 @@ Camera {
}
\endqml
-If neither device ID nor position is specified, the default camera will be used. On desktop
+If neither cameraInfo nor position is specified, the default camera will be used. On desktop
platforms, the default camera is set by the user in the system settings. On a mobile device, the
back-facing camera is usually the default camera. You can get information about the default camera
using \l QCameraInfo::defaultCamera() in C++ or
-\l{QtMultimedia::QtMultimedia::defaultCamera}{QtMultimedia.defaultCamera} in QML.
+\l{QtMultimedia::MediaDevices::defaultCamera}{MediaDevices.defaultCamera} in QML.
-\section2 Viewfinder
+\section2 Preview
While not strictly necessary, it's often useful to be able to see
-what the camera is pointing at. Most digital cameras allow an image
-feed from the camera sensor at a lower resolution (usually up to
-the size of the display of the camera) so you can compose
-a photo or video, and then switch to a slower but higher resolution
-mode for capturing the image.
+what the camera is pointing at.
Depending on whether you're using QML or C++, you can do this in multiple ways.
-In QML, you can use \l Camera and \l VideoOutput together to show a
+In QML, you can use \l Camera and \l VideoOutput together in a CaptureSession to show a
simple viewfinder:
\qml
-VideoOutput {
- source: camera
+Item {
+ VideoOutput {
+ id: output
+ anchors.fill: parent
+ }
+ CaptureSession {
+ videoOutput: output
- Camera {
- id: camera
- // You can adjust various settings in here
+ Camera {
+ // You can adjust various settings in here
+ }
}
}
\endqml
In C++, your choice depends on whether you are using widgets, or QGraphicsView.
-The \l QCameraViewfinder class is used in the widgets case, and \l QGraphicsVideoItem
+The \l QVideoWidget class is used in the widgets case, and \l QGraphicsVideoItem
is useful for QGraphicsView.
\snippet multimedia-snippets/camera.cpp Camera overview viewfinder
-For advanced usage (like processing viewfinder frames as they come, to detect
-objects or patterns), you can also use your own QVideoSink and set that as the viewfinder
+For advanced usage (like processing preview frames as they come, to detect
+objects or patterns), you can also use your own QVideoSink and set that as the videoOutput
for the QCamera object. In this case you will need to render the viewfinder image yourself
by processing the data received from the newVideoFrame() signal.
\snippet multimedia-snippets/camera.cpp Camera overview surface
-On mobile devices, the viewfinder image might not always be in the orientation you would expect.
+On mobile devices, the preview image might not always be in the orientation you would expect.
The camera sensors on these devices are often mounted in landscape while the natural
orientation of the screen is portrait. This results in the image appearing sideways or inverted
depending on the device orientation. In order to reflect on screen what the user actually sees, you
@@ -196,31 +197,30 @@ account the camera sensor orientation and the current display orientation.
After setting up a viewfinder and finding something photogenic,
to capture an image we need to initialize a new QCameraImageCapture
-object. All that is then needed is to start the camera, lock it so
-that things are in focus and the settings are not different from the
-viewfinder while the image capture occurs, capture the image, and
-finally unlock the camera ready for the next photo.
+object. All that is then needed is to start the camera and capture the image.
\snippet multimedia-snippets/camera.cpp Camera overview capture
\section2 Movies
Previously we saw code that allowed the capture of a still image. Recording
-video requires the use of a \l QMediaRecorder object.
+video requires the use of a \l QMediaEncoder object.
To record video we need to create a camera object as before but this time as
well as creating a viewfinder, we will also initialize a media recorder object.
\snippet multimedia-snippets/camera.cpp Camera overview movie
-Signals from the \e mediaRecorder can be connected to slots to react to
-changes in the state of the recorder or error events. Recording itself
-starts with the \l {QMediaRecorder::record()}{record()} function of
-mediaRecorder being called, this causes the signal \l
-{QMediaRecorder::stateChanged()}{stateChanged()} to be emitted. The
-recording process can be changed with the \l {QMediaRecorder::record()}{record()},
-\l {QMediaRecorder::stop()}{stop()} and \l {QMediaRecorder::setMuted()}{setMuted()}
-slots in \l QMediaRecorder.
+Signals from the \e mediaEncoder can be connected to slots to react to
+changes in the state of the encoding process or error events. Recording itself
+starts with the \l {QMediaEncoder::record()}{record()} function of
+mediaEncoder being called, this causes the signal \l
+{QMediaEncoder::stateChanged()}{stateChanged()} to be emitted. The
+recording process can be changed with the \l {QMediaEncoder::record()}{record()},
+\l {QMediaEncoder::stop()}{stop()} slots in \l QMediaEncoder.
+
+On top of the above, QMediaRecorder provides a simple to use, but more limited all-in-one class
+for recording audio and video content.
\section2 Controlling the Imaging Pipeline
diff --git a/src/multimedia/doc/src/changes.qdoc b/src/multimedia/doc/src/changes.qdoc
index fd7188fa3..871dc92b5 100644
--- a/src/multimedia/doc/src/changes.qdoc
+++ b/src/multimedia/doc/src/changes.qdoc
@@ -32,44 +32,74 @@
\brief A description of changes in this version of Qt Multimedia
-The Qt Multimedia module in Qt 5 combines (and replaces) two older modules, namely the
-Qt Multimedia module from Qt 4.x, and Qt Multimedia Kit module from Qt Mobility.
-Existing code that uses Qt Multimedia from Qt 4 can be ported with minimal effort, but
-porting code that uses Qt Multimedia Kit may be a more involved process. The
+The Qt Multimedia module in Qt 6 replaces the Qt Multimedia module from Qt 5.x.
+Existing code that uses Qt Multimedia from Qt 5 can be ported with limited effort. The
\l {changed features} section highlights changes relevant to porting.
-Also, note that widget-based classes, such as \l QVideoWidget, are now in a separate
-module called Qt Multimedia Widgets.
-
-\section1 New features in Qt 5.0
+\section1 New features in Qt 6.0
There are a number of new features in Qt Multimedia:
\list
-\li Expanded QML API
-\li In addition to the \l Video QML type, there is now the option of using \l MediaPlayer and \l VideoOutput together
-\li QML \l Torch class
-\li New \l QAudioRecorder class
-\li Volume support for QAudioOutput and QAudioInput
-\li More examples and documentation
-\li QSound moved from Qt GUI to Qt Multimedia
-\li QSoundEffect available to C++ now, as well as QML
-\li Various other API improvements and bugfixes
+\li QMediaCaptureSession class as the central object for media capture
+\li Changed QMediaRecorder class to be a high level class for audio/video recording
+\li new QMediaEncoder class to handle encoding of data produced in a capture session
+\li Setting up the desired encodings when recording has changed significantly, see
+QMediaEncoderSettings for details
+\li Support for selection of audio, video and subtitle tracks when playing back media files
+\li QAudioDecoder is now supported on all platforms
\endlist
\section1 Removed features
-A number of classes or features previously offered in Qt Multimedia or Qt Multimedia Kit have
-been removed.
-
\table 70%
\header
\li Removed feature
\li Notes
\row
- \li QMediaImageViewer
- \li This class (and related controls and services) were removed since
- their functionality was not suitable for many applications
+ \li Playlist in QMediaPlayer
+ \li QMediaPlayer does not do any playlist handling anymore in Qt 6. The QMediaPlayList class
+ does however still exist and provides this functionality. Users will need to connect the
+ playlist to the mediaplayer themselves to handle playlists.
+ \row
+ \li QAudioProbe and QVideoProbe
+ \li The audio and video probing API has been removed. A replacement API using custom audio
+ and video outputs may be added in a future release.
+ \row
+ \li QAudioRecorder and the Audio QML type
+ \li QMediaRecorder and the MediaRecorder QML type provide the same functionality
+ \row
+ \li QMediaObject and QMediaBindableInterface
+ \li These classes have been removed in favor of a more direct API for setting up connections
+ between objects using e.g. setVideoOutput and QMediaCaptureSession.
+ \row
+ \li QCameraViewFinderSettings
+ \li This class has been removed. Use QCameraFormat to define the resolution and framerate the
+ camera should be using.
+ \row
+ \li QMediaContent
+ \li The class has been removed. Use QMediaPlayList for play lists and QUrl for individual
+ media files instead.
+ \row
+ \li QSound
+ \li Use QSoundEffect instead.
+ \row
+ \li QVideoFilterRunnable
+ \li Use shader effects in QML instead or access the QVideoFrame's content in C++.
+ \row
+ \li Backend API
+ \li The backend API of Qt Multimedia is private in Qt 6. Having a public backend API was one
+ the main things that made supporting and enhancing Qt Multimedia in Qt 5 very difficult.
+ By making the backend API private, we expect to be able to better support new multimedia
+ use cases in the future. This includes all classes the contain "Control" or "Abstract"
+ in the class name in Qt 5.
+ \row
+ \li Pluggable backends
+ \li Qt Multimedia in Qt 6 does not use a plugin infrastructure for its backends anymore.
+ This means that users do not need to ship those backends with their application anymore
+ neither. Instead the backend being used is determined at compile time based on the
+ underlying operating system. Qt uses gstreamer on Linux, WMF on Windows, AVFoundation
+ on macOS and iOS and the Android multimedia APIs on Android.
\endtable
\section1 Changed features
@@ -82,59 +112,27 @@ changed in ways that may affect previously written code. This table highlights s
\li Changed feature
\li Notes
\row
- \li \c qmake project file changes
- \li Previously, to use Qt Multimedia Kit, the \c qmake project file must contain
- \code
- CONFIG += mobility
- MOBILITY += multimedia
- \endcode
- Now, you only need to write
- \code
- QT += multimedia
- \endcode
- Or, if you want to use the widget classes,
- \code
- QT += multimedia multimediawidgets
- \endcode
+ \li Handling of Camera resolutions and frame rates
+ \li Handling of those has been simplified and a new QCameraFormat class helps selecting
+ the correct resolution and frame rate on the camera.
\row
- \li Namespaces
- \li The \c QtMultimediaKit namespace has been renamed to QMultimedia. This
- affects a few enumerations, namely \c SupportEstimate, \c EncodingQuality,
- \c EncodingMode and \c AvailabilityStatus. Searching and replacing
- \c QtMultimediaKit with \c QMultimedia will greatly aid porting efforts. Metadata
- have been split off into their own namespace, QMediaMetaData.
+ \li Video output handling on the C++ side has changed significantly.
+ \li QAbstractVideoSurface has been replaced by the QVideoSink class, and generic rendering
+ support has been enhanced to cover all pixel formats supported by Qt Multimedia
\row
\li Metadata types
- \li In Qt Multimedia Kit, pre-defined metadata keys were enumerations in the
- \c QtMultimediaKit namespace. These pre-defined keys have been changed to
- string literals in the \c QMediaMetaData namespace, for consistency with
- extended keys.
- \row
- \li Metadata accessor methods
- \li In Qt Multimedia Kit, there were two different families of methods to access
- metadata. Functions such as \c QMediaObject::metaData() operated on pre-defined
- metadata using enumerated keys, while functions such as
- \c QMediaObject::extendedMetaData() operated on extended metadata using
- string keys. Qt 5 combines both families into one (e.g. QMediaObject::metaData()),
- which can operate on both pre-defined and extended metadata, using string keys.
+ \li QMediaMetaData has changed significantly, mainly moving from string based
+ to enum based keys, and reducing the set of supported keys to the ones that
+ can be supported on most platforms.
\row
- \li Qt Metatype registration
- \li Qt 5 registers many more classes and types with the meta-object system than before.
- If you have previously applied Q_DECLARE_METATYPE macros to any Qt Multimedia class,
- you will probably need to remove them.
- \row
- \li QSoundEffect availability
- \li The SoundEffect QML type was publicly accessible in Qt Multimeda Kit,
- and now the C++ version is officially public too. If your code contains the
- previously undocumented QSoundEffect, you may need to update it.
- \row
- \li Camera controls
- \li A large number of the camera controls (QCameraImageProcessingControl,
- QCameraFocusControl, etc.) have been updated to address a number of
- design flaws. In particular, a number of discrete
- accessor methods have been collapsed into parametrized methods, and
- the ranges or data types of some parameters have been adjusted.
-
+ \li QMediaFormat and QMediaEncoderSettings
+ \li Handling of formats for encoded media and the settings for the media encoder have
+ changed significantly. While Qt 5 provided a string based API and separated file format,
+ audio and video codecs into 3 classes, Qt 6 does unify the formats in the QMediaFormat class,
+ and encoder settings in QMediaEncoderSettings. Setting up of file formats and codecs is now
+ enum based and doesn't use strings anymore. This puts some limitations on the set of codecs
+ that can be used, but helps provide a consistent cross-platform API and reduces the changes
+ for inconsistencies.
\endtable
*/
diff --git a/src/multimedia/doc/src/multimedia.qdoc b/src/multimedia/doc/src/multimedia.qdoc
index f0272c4b1..804333db3 100644
--- a/src/multimedia/doc/src/multimedia.qdoc
+++ b/src/multimedia/doc/src/multimedia.qdoc
@@ -153,31 +153,18 @@ The Qt Multimedia APIs build upon the multimedia framework of the underlying
platform. This can mean that support for various codecs or containers can vary
between machines, depending on what the end user has installed.
-\section1 Advanced Usage
-
-For developers wishing to access some platform specific settings, or to port the
-Qt Multimedia APIs to a new platform or technology, see \l{Multimedia Backend
-Development}.
-
\section1 Changes from Previous Versions
-If you previously used Qt Multimedia in Qt 4, or used Qt Multimedia Kit in
-Qt Mobility, please see \l {Changes in Qt Multimedia} for more information on
-what changed, and what you might need to change when porting code.
+If you previously used Qt Multimedia in Qt 5, please see \l {Changes in Qt Multimedia}
+for more information on what changed, and what you might need to change when porting code.
\section1 Reference Documentation
\section2 QML Types
The QML types are accessed by using:
\code
-import QtMultimedia 5.8
+import QtMultimedia
\endcode
-\annotatedlist multimedia_qml
-The following types are accessed by using \l{Qt Audio Engine QML Types}{Qt Audio Engine}:
-\qml \QtMinorVersion
-import QtAudioEngine 1.\1
-\endqml
-\annotatedlist multimedia_audioengine
\section2 Multimedia Classes
diff --git a/src/multimedia/doc/src/multimediabackend.qdoc b/src/multimedia/doc/src/multimediabackend.qdoc
deleted file mode 100644
index 39b2841a2..000000000
--- a/src/multimedia/doc/src/multimediabackend.qdoc
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** 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 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 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: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-/*!
-
-\title Multimedia Backend Development
-\page multimediabackend.html
-\brief Information for implementing a new multimedia backend.
-\ingroup mobility
-
-\tableofcontents
-
-\section1 Overview
-
-A multimedia backend provides the glue between platform-specific libraries, and
-Qt Multimedia. In some cases the available cross-platform Multimedia APIs or
-implementations are not sufficient, or not immediately available on a certain
-platform.
-*/
-
-
diff --git a/src/multimedia/doc/src/platform-notes-ios.qdoc b/src/multimedia/doc/src/platform-notes-apple.qdoc
index db5cd6d5a..ac0655c5b 100644
--- a/src/multimedia/doc/src/platform-notes-ios.qdoc
+++ b/src/multimedia/doc/src/platform-notes-apple.qdoc
@@ -26,17 +26,17 @@
****************************************************************************/
/*!
-\page qtmultimedia-ios.html
+\page qtmultimedia-apple.html
\title Qt Multimedia on iOS
\brief Platform notes for iOS
-This page covers the availability of Qt Multimedia features on iOS.
+This page covers the availability of Qt Multimedia features on iOS and macOS.
\section1 Limitations
-Since Qt Multimedia for iOS uses the camera, the \c Info.plist assigned to
+Since Qt Multimedia for iOS uses the camera and microphone, the \c Info.plist assigned to
QMAKE_INFO_PLIST in the project file must contain the key
-\c NSCameraUsageDescription. Otherwise the application will
+\c NSCameraUsageDescription and NSMicrophoneUsageDescription. Otherwise the application will
abort on startup. See Info.plist documentation from Apple for more information
regarding this key.
diff --git a/src/multimedia/doc/src/platform-notes-gstreamer-on-android.qdoc b/src/multimedia/doc/src/platform-notes-gstreamer-on-android.qdoc
deleted file mode 100644
index 51836d99a..000000000
--- a/src/multimedia/doc/src/platform-notes-gstreamer-on-android.qdoc
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** 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 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 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: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page platform-notes-gstreamer-on-android.html
-\title Qt Multimedia GStreamer on Android
-\brief Platform notes for GStreamer on Android
-\since 5.14
-
-This page covers the availability of GStreamer on Android.
-
-\section1 Limitations
-
-Since GStreamer is licensed under LGPL and distributed in archives (and should be statically linked),
-Qt Multimedia does not provide support of GStreamer on Android by default.
-
-Therefore GStreamer support must be explicitly enabled by configuring Qt with the \c -gstreamer option.
-
-\section1 Setup
-
-The GStreamer project provides prebuilt binaries which you can download and unzip into any location of your choice.
-
-The environment variable \c GSTREAMER_ROOT_ANDROID should be set to the location where you unzipped the downloaded package.
-
-\section1 Application
-
-Qt Multimedia does not contain any plugins and all needed plugins must be included
-and registered in applications manually by \c GST_PLUGIN_STATIC_DECLARE and \c GST_PLUGIN_STATIC_REGISTER
-after \c gst_init().
-
-Please refer to the official manual on how to statically link plugins to an application.
-
-https://gstreamer.freedesktop.org/documentation/gstreamer/gstplugin.html?gi-language=c#GST_PLUGIN_STATIC_REGISTER
-
-*/
diff --git a/src/multimedia/doc/src/platform-notes-windows.qdoc b/src/multimedia/doc/src/platform-notes-windows.qdoc
deleted file mode 100644
index 3b8d6aa18..000000000
--- a/src/multimedia/doc/src/platform-notes-windows.qdoc
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** 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 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 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: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qtmultimedia-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.
-
-The environment variable \c QT_MULTIMEDIA_PREFERRED_PLUGINS can be used to
-control the priority of the plugins. For example, setting it to
-"windowsmediafoundation" or "directshow" will cause the corresponding plugin
-to be the preferred one.
-
-\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.
-*/
diff --git a/src/multimedia/doc/src/qtaudioengine.qdoc b/src/multimedia/doc/src/qtaudioengine.qdoc
deleted file mode 100644
index c45d4e8af..000000000
--- a/src/multimedia/doc/src/qtaudioengine.qdoc
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** 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 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 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: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\qmlmodule QtAudioEngine 1.\QtMinorVersion
-\title Qt Audio Engine QML Types
-\ingroup qmlmodules
-\brief Provides QML types for 3D positional audio playback and content management.
-
-Qt Audio Engine is part of the \l{Qt Multimedia} module. Qt Audio
-Engine provides types for 3D positional audio playback and content management.
-
-The QML types can be imported into your application using the following import
-statement in your .qml file:
-\qml \QtMinorVersion
-import QtAudioEngine 1.\1
-\endqml
-
-\section1 Qt Audio Engine Features
-
-Qt Audio Engine enables developers to organize wave files into discrete \l Sound
-with different \l {PlayVariation}{play variations}, group sound controls by \l
-{AudioCategory} categories and define \l {AttenuationModelLinear}{attenuation
-models} and various 3D audio settings all in one place. Playback of \l
-{SoundInstance}{sound instances} can be conveniently activated by in-app events
-and managed by QtAudioEngine or controlled by explicitly defining \l
-SoundInstance for easier QML bindings.
-
-\section1 Examples
-\list
- \li \l {AudioEngine Example}{Audio Engine}
-\endlist
-
-\section1 QML Types
-*/
diff --git a/src/multimedia/doc/src/qtmultimedia-index.qdoc b/src/multimedia/doc/src/qtmultimedia-index.qdoc
index d2d39a5aa..607215d3b 100644
--- a/src/multimedia/doc/src/qtmultimedia-index.qdoc
+++ b/src/multimedia/doc/src/qtmultimedia-index.qdoc
@@ -159,8 +159,7 @@
following topics provide more platform-specific information.
\list
- \li \l{Qt Multimedia on Windows}{Windows}
- \li \l{Qt Multimedia on iOS}{iOS}
+ \li \l{Qt Multimedia on macOS and iOS}{iOS}
\endlist
\section2 Reference
@@ -172,13 +171,6 @@
\endlist
\endlist
- \list
- \li Qt Audio Engine
- \list
- \li \l{Qt Audio Engine QML Types}{QML Types}
- \endlist
- \endlist
-
\section2 Examples
\list
\li \l{Qt Multimedia Examples}
diff --git a/src/multimedia/doc/src/qtmultimedia5.qdoc b/src/multimedia/doc/src/qtmultimedia5.qdoc
index 461cc716f..16e0e581b 100644
--- a/src/multimedia/doc/src/qtmultimedia5.qdoc
+++ b/src/multimedia/doc/src/qtmultimedia5.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
-\qmlmodule QtMultimedia 5.\QtMinorVersion
+\qmlmodule QtMultimedia
\title Qt Multimedia QML Types
\ingroup qmlmodules
\brief Provides QML types for multimedia support.
@@ -45,22 +45,10 @@ Qt Multimedia QML types can be imported into your application using the
following import statement in your .qml file:
\qml \QtMinorVersion
-import QtMultimedia 5.\1
+import QtMultimedia
\endqml
\generatelist qmltypesbymodule QtMultimedia
-\section2 Qt Audio Engine
-
-\l {QtAudioEngine}{Qt Audio Engine} provides types for 3D positional audio
-playback and content management. These types can be imported into your
-application using the following import statement in your .qml file:
-
-\qml \QtMinorVersion
-import QtAudioEngine 1.\1
-\endqml
-
-\generatelist qmltypesbymodule QtAudioEngine
-
\noautolist
*/
diff --git a/src/multimedia/doc/src/videooverview.qdoc b/src/multimedia/doc/src/videooverview.qdoc
index 725c8873f..e3fe0175e 100644
--- a/src/multimedia/doc/src/videooverview.qdoc
+++ b/src/multimedia/doc/src/videooverview.qdoc
@@ -58,10 +58,7 @@ You can use \l VideoOutput to render content that is
provided by either a \l MediaPlayer or a \l Camera.
The VideoOutput is a visual component that can be transformed
or acted upon by shaders (as the \l {QML Video Shader Effects Example} shows), while
-all media decoding and playback control is handled by the \l MediaPlayer.
-
-Alternatively there is also a higher level \l Video type that
-acts as a single, visual element to play video and control playback.
+all media decoding and playback control is handled by the \l MediaPlayer or \l CaptureSession.
\section2 Working with Low Level Video Frames
@@ -77,32 +74,9 @@ processing. Using your own QVideoSink
allows you to receive these frames from \l QMediaPlayer and
\l QCamera.
-\snippet multimedia-snippets/video.cpp Derived Surface
-
-and with an instance of this surface, \c myVideoSurface, you can set
-the surface as the \l {QMediaPlayer::setVideoOutput()}{video output} for QMediaPlayer.
-
-\snippet multimedia-snippets/video.cpp Setting surface in player
-
-Several of the built-in Qt classes offer this functionality
-as well, so if you decode video in your application, you can present
-it to classes that offer a \l QVideoRendererControl class, and in QML
-you can set a custom object for the source of a \l VideoOutput
-with either a writable \c videoSurface property (that the instance will
-set it's internal video surface to) or a readable \c mediaObject property
-with a QMediaObject derived class that implements the \l QVideoRendererControl
-interface.
-
-The following snippet shows a class that has a writable \c videoSurface property
-and receives frames through a public slot \c onNewVideoContentReceived(). These
-frames are then presented on the surface set in \c setVideoSurface().
-
-\snippet multimedia-snippets/video.cpp Video producer
-
\section2 Recording Video
-You can use the \l QMediaRecorder class in conjunction with other
-classes to record video to disk. Primarily this is used with
-the camera, so consult the \l {Camera Overview} for more information.
+You can use the \l QMediaRecorder class as a simple way to record video to disk.
+For more advances use cases \l QMediaCaptureSession provides a more flexible API.
\section1 Examples