QPlatformMediaRecorder Class

The QPlatformMediaRecorder class provides access to the recording functionality. 更多...

头: #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.

公共函数

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

保护函数

  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 )

详细描述

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

另请参阅 QMediaRecorder .

成员函数文档编制

[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 )

信号 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.

另请参阅 setOutputLocation ().

[虚拟] 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 .

[虚拟] void QPlatformMediaRecorder:: resume ()

Resume media recording. Not all platforms supports this operation

[虚拟] 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.

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 () 信号。

另请参阅 outputLocation ().

[虚拟] QMediaRecorder::RecorderState QPlatformMediaRecorder:: state () const

Return the current recording state.

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

信号 state of a media recorder has changed.

[pure virtual] void QPlatformMediaRecorder:: stop ()

Stop media recording