QPlaybackOptions Class

The QPlaybackOptions class enables low-level control of media playback options. 更多...

头: #include <QPlaybackOptions>
CMake: find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia
Since: Qt 6.10
在 QML: PlaybackOptions

公共类型

(从 6.10 起) 枚举类 PlaybackIntent { Playback, LowLatencyStreaming }

特性

公共函数

std::chrono::milliseconds networkTimeout () const
QPlaybackOptions::PlaybackIntent playbackIntent () const
qsizetype probeSize () const
void resetNetworkTimeout ()
void resetPlaybackIntent ()
void resetProbeSize ()
void setNetworkTimeout (std::chrono::milliseconds timeout )
void setPlaybackIntent (QPlaybackOptions::PlaybackIntent intent )
void setProbeSize (qsizetype probeSizeBytes )

详细描述

QPlaybackOptions gives low-level control of media playback options. Although we strongly recommend to rely on the default settings of QMediaPlayer , QPlaybackOptions can be used to optimize media playback to specific use cases where the default options are not ideal.

Note that options are hints to the media backend, and may be ignored if they are not supported by the current media format or codec.

Playback options rely on support in the media backend. Availability is documented per option.

另请参阅 QMediaPlayer .

成员类型文档编制

[since 6.10] enum class QPlaybackOptions:: PlaybackIntent

Configures the intent of media playback, to focus on either high quality playback or low latency media streaming.

常量 描述
QPlaybackOptions::PlaybackIntent::Playback 0 The intent is robust and high quality media playback, enabling sufficient buffering to prevent glitches during playback.
QPlaybackOptions::PlaybackIntent::LowLatencyStreaming 1 Buffering is reduced to optimize for low latency streaming, but with a higher likelihood of lost frames or other glitches during playback.

This enum was introduced in Qt 6.10.

特性文档编制

[since 6.10] networkTimeout : std::chrono::milliseconds

Determines the network timeout used for socket I/O operations with some network formats.

This option is only supported with the FFmpeg media backend.

此特性在 Qt 6.10 引入。

访问函数:

std::chrono::milliseconds networkTimeout () const
void setNetworkTimeout (std::chrono::milliseconds timeout )
void resetNetworkTimeout ()

[since 6.10] playbackIntent : PlaybackIntent

Determines if QMediaPlayer should optimize for robust high quality video playback (default), or low latency streaming.

This option is only supported with the FFmpeg media backend.

此特性在 Qt 6.10 引入。

访问函数:

QPlaybackOptions::PlaybackIntent playbackIntent () const
void setPlaybackIntent (QPlaybackOptions::PlaybackIntent intent )
void resetPlaybackIntent ()

[since 6.10] probeSize : qsizetype

Probesize defines the amount of data (in bytes) to analyze in order to gather stream information before media playback starts.

A larger probesize value can give more robust playback but may increase latency. Conversely, a smaller probesize can reduce latency but might miss some stream details. The default probesize is -1, and the actual probesize is determined by the media backend.

This option is only supported with the FFmpeg media backend.

此特性在 Qt 6.10 引入。

访问函数:

qsizetype probeSize () const
void setProbeSize (qsizetype probeSizeBytes )
void resetProbeSize ()