Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qt6-changes.qdoc
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \page qtmultimedia-changes-qt6.html
6 \title Changes to Qt Multimedia
7 \ingroup changes-qt-5-to-6
8 \brief Migrate Qt Multimedia to Qt 6.
9
10 Qt 6 is a result of the conscious effort to make the framework more
11 efficient and easy to use.
12
13 We try to maintain binary and source compatibility for all the public
14 APIs in each release. But some changes were inevitable in an effort to
15 make Qt a better framework.
16
17The module has been refactored significantly and has changed classification,
18from essential to add-on. The Qt Multimedia module in Qt 6 replaces the
19Qt Multimedia module from Qt 5.x. Existing code that uses Qt Multimedia from
20Qt 5 can be ported with limited effort.
21
22
23\section1 New features in Qt 6
24
25There are a number of new features in Qt Multimedia:
26\list
27 \li QMediaCaptureSession class is the central object for media capture.
28 \li QMediaRecorder class is now a class limited to recording audio and video.
29 It handles encoding of data produced in a capture session.
30 \li Using QMediaFormat and QMediaRecorder, setting up the desired encoding
31 when recording has changed significantly.
32 \li You can now also monitor the audio recorded by a capture session.
33 \li Support for selection of audio, video and subtitle tracks when playing
34 back media files has been added.
35 \li QAudioDecoder is now supported on all platforms.
36\endlist
37
38
39\section1 Removed features
40
41\table 70%
42 \header
43 \li Removed feature
44 \li Notes or suggested alternative
45 \row
46 \li Playlist in QMediaPlayer
47 \li QMediaPlayer does not do any playlist handling anymore in Qt 6.
48 \row
49 \li QMediaPlayList
50 \li This class has been removed from the API. It does however still exist
51 as part of the \l{Media Player Example}.
52 \row
53 \li QAudioProbe and QVideoProbe
54 \li The audio and video probing API has been removed.
55 \row
56 \li QAudioRecorder
57 \li Use the QMediaCaptureSession or CaptureSession QML type.
58 \row
59 \li \l{Audio QML type}
60 \li Use MediaPlayer QML type.
61 \row
62 \li QMediaObject and QMediaBindableInterface
63 \li These classes have been removed in favor of a more direct API for
64 setting up connections between objects using, for example, setVideoOutput
65 and QMediaCaptureSession.
66 \row
67 \li QCameraViewFinderSettings
68 \li This class has been removed. Use QCameraFormat to define the
69 resolution and frame rate the camera should be using.
70 \row
71 \li QMediaContent
72 \li The class has been removed. Use QUrl for individual media files instead.
73 \row
74 \li QSound
75 \li Use QSoundEffect instead.
76 \row
77 \li QVideoFilterRunnable
78 \li Use \l{shader effects} in QML instead or access the QVideoFrame's
79 content in C++.
80 \row
81 \li Public back-end API
82 \li The back-end API of Qt Multimedia is private in Qt 6. This improves
83 response time for supporting new multimedia use cases. Any classes that
84 contain the words "Control" or "Abstract" in the class name in Qt 5 are
85 now private in Qt 6.
86 \row
87 \li Back-end plugins
88 \li Qt Multimedia in Qt 6 does not use a plugin infrastructure for its
89 back ends anymore.
90 This means that users no longer need to ship those back ends with their
91 application. Instead, the back end being used is determined at compile
92 time based on the underlying operating system. Qt uses \l gstreamer on
93 Linux, WMF on Windows, AVFoundation on macOS and iOS and the Android
94 multimedia APIs on Android.
95\endtable
96
97\section1 Changed features
98
99A number of classes previously offered in Qt Multimedia have
100changed in ways that may affect previously written code. The following table
101highlights these changes.
102
103\table 70%
104 \header
105 \li Changed feature
106 \li Notes
107 \row
108 \li Handling of Camera resolutions and frame rates
109 \li Handling of these has been simplified and a new QCameraFormat class
110 helps with selecting the correct resolution and frame rate for the camera.
111 \row
112 \li Video output handling on the C++ side has changed significantly.
113 \li QAbstractVideoSurface has been replaced by the QVideoSink class, and
114 generic rendering support has been enhanced to cover all \l{pixel format}s
115 supported by Qt Multimedia.
116 \row
117 \li Metadata types
118 \li QMediaMetaData has changed significantly: mainly moving from string
119 based to enum based keys, and reducing the set of supported keys to the
120 ones that can be supported on most platforms.
121 \row
122 \li QMediaFormat
123 \li Handling of formats for encoded media and the settings for the media
124 recorder have changed significantly. Qt 5 provides a string-based
125 API, a separated file format, and audio and video codecs into three classes.
126 However, Qt 6 unifies the formats in the QMediaFormat class. Additional
127 settings are directly specified in QMediaRecorder. Setting up file formats
128 and codecs is now implemented with enums and no longer uses strings. This
129 puts some limitations on the set of codecs that can be used, but helps
130 provide a consistent cross-platform API.
131 \row
132 \li QCameraImageCapture renamed QImageCapture
133 \li None
134 \row
135 \li Audio inputs and outputs
136 \li QMediaPlayer and QMediaCaptureSession (and the corresponding QML types MediaPlayer and
137 CaptureSession) are not connected to any audio devices by default. Explicitly connect them
138 to a QAudioInput/AudioInput or QAudioOutput/AudioOutput to capture or play back audio.
139 \row
140 \li Capturing video
141 \li A capture session is by default not connected to a Camera. Connect it to a QCamera object
142 (Camera item) to be able to capture video or still images.
143\endtable
144
145*/