QPlatformMediaRecorder Class

The QPlatformMediaRecorder class provides access to the recording functionality. More...

Header: #include <QPlatformMediaRecorder>
CMake: find_package(Qt6 COMPONENTS Multimedia REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia

This class is deprecated. We strongly advise against using it in new code.

Public Functions

virtual qint64 duration() const = 0
QUrl outputLocation() const
virtual void pause()
virtual void record(QMediaEncoderSettings &settings) = 0
virtual void resume()
virtual void setOutputLocation(const QUrl &location)
virtual QMediaRecorder::RecorderState state() const
virtual void stop() = 0

Protected Functions

QPlatformMediaRecorder(QMediaRecorder *parent)
void actualLocationChanged(const QUrl &location)
void durationChanged(qint64 duration)
void error(QMediaRecorder::Error error, const QString &errorString)
void stateChanged(QMediaRecorder::RecorderState state)

Detailed Description

This control provides a means to set the output location, and record(), pause(), resume(), and stop() recording. It also provides feedback on the duration of the recording.

See also QMediaRecorder.

Member Function Documentation

[protected] QPlatformMediaRecorder::QPlatformMediaRecorder(QMediaRecorder *parent)

Constructs a media recorder control with the given parent.

[protected] void QPlatformMediaRecorder::actualLocationChanged(const QUrl &location)

Signals that the actual media location has changed. This signal should be emitted at start of recording.

[pure virtual] qint64 QPlatformMediaRecorder::duration() const

Return the current duration in milliseconds.

[protected] void QPlatformMediaRecorder::durationChanged(qint64 duration)

Signals that the duration of the recorded media has changed.

This only emitted when there is a discontinuous change in the duration such as being reset to 0.

[protected] void QPlatformMediaRecorder::error(QMediaRecorder::Error error, const QString &errorString)

Signals that an error has occurred. The errorString describes the error.

QUrl QPlatformMediaRecorder::outputLocation() const

Returns the current output location being used.

See also setOutputLocation().

[virtual] void QPlatformMediaRecorder::pause()

Pause media recording. Not all platforms supports this operation

[pure virtual] void QPlatformMediaRecorder::record(QMediaEncoderSettings &settings)

Start media recording in accordance with settings.

[virtual] void QPlatformMediaRecorder::resume()

Resume media recording. Not all platforms supports this operation

[virtual] void QPlatformMediaRecorder::setOutputLocation(const QUrl &location)

Sets the output location and returns if this operation is successful. If file at the output location already exists, it should be overwritten.

The location can be relative or empty; in this case the service should use the system specific place and file naming scheme.

After recording has started, the backend should report the actual file location with actualLocationChanged() signal.

See also outputLocation().

[virtual] QMediaRecorder::RecorderState QPlatformMediaRecorder::state() const

Return the current recording state.

[protected] void QPlatformMediaRecorder::stateChanged(QMediaRecorder::RecorderState state)

Signals that the state of a media recorder has changed.

[pure virtual] void QPlatformMediaRecorder::stop()

Stop media recording

© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.