Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QPlaybackOptions Class Reference

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

#include <qplaybackoptions.h>

Inheritance diagram for QPlaybackOptions:
Collaboration diagram for QPlaybackOptions:

Public Types

enum class  PlaybackIntent { Playback , LowLatencyStreaming }

Public Member Functions

Q_MULTIMEDIA_EXPORT QPlaybackOptions ()
 \qmltype playbackOptions \nativetype QPlaybackOptions
Q_MULTIMEDIA_EXPORT QPlaybackOptions (const QPlaybackOptions &)
Q_MULTIMEDIA_EXPORT QPlaybackOptionsoperator= (const QPlaybackOptions &)
 QPlaybackOptions (QPlaybackOptions &&) noexcept=default
Q_MULTIMEDIA_EXPORT ~QPlaybackOptions ()
void swap (QPlaybackOptions &other) noexcept
Q_MULTIMEDIA_EXPORT std::chrono::milliseconds networkTimeout () const
 \qmlproperty qint64 playbackOptions::networkTimeoutMs
Q_MULTIMEDIA_EXPORT void setNetworkTimeout (std::chrono::milliseconds timeout)
Q_MULTIMEDIA_EXPORT void resetNetworkTimeout ()
Q_MULTIMEDIA_EXPORT PlaybackIntent playbackIntent () const
 \qmlproperty PlaybackOptions::PlaybackIntent PlaybackOptions::playbackIntent
Q_MULTIMEDIA_EXPORT void setPlaybackIntent (PlaybackIntent intent)
Q_MULTIMEDIA_EXPORT void resetPlaybackIntent ()
Q_MULTIMEDIA_EXPORT qsizetype probeSize () const
 \qmlproperty qsizetype PlaybackOptions::probeSize
Q_MULTIMEDIA_EXPORT void setProbeSize (qsizetype probeSizeBytes)
Q_MULTIMEDIA_EXPORT void resetProbeSize ()

Properties

std::chrono::milliseconds networkTimeout
PlaybackIntent playbackIntent
qsizetype probeSize

Friends

class QPlaybackOptionsPrivate
Q_MULTIMEDIA_EXPORT bool comparesEqual (const QPlaybackOptions &lhs, const QPlaybackOptions &rhs)
Q_MULTIMEDIA_EXPORT Qt::strong_ordering compareThreeWay (const QPlaybackOptions &lhs, const QPlaybackOptions &rhs)

Detailed Description

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

\inmodule QtMultimedia

Since
6.10

QPlaybackOptions gives low-level control of media playback options. Although we strongly recommend to rely on the default settings of \l 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.

See also
QMediaPlayer

Definition at line 20 of file qplaybackoptions.h.

Member Enumeration Documentation

◆ PlaybackIntent

Since
6.10

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

\value Playback The intent is robust and high quality media playback, enabling sufficient buffering to prevent glitches during playback. \value LowLatencyStreaming Buffering is reduced to optimize for low latency streaming, but with a higher likelihood of lost frames or other glitches during playback.

Enumerator
Playback 
LowLatencyStreaming 

Definition at line 30 of file qplaybackoptions.h.

Constructor & Destructor Documentation

◆ QPlaybackOptions() [1/3]

QPlaybackOptions::QPlaybackOptions ( )

\qmltype playbackOptions \nativetype QPlaybackOptions

Low level media playback options.

\inqmlmodule QtMultimedia

Since
6.10

Playback options gives low-level control of media playback options. Although we strongly recommend to rely on the default settings of \l MediaPlayer, playbackOptions 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.

See also
MediaPlayer

Definition at line 85 of file qplaybackoptions.cpp.

◆ QPlaybackOptions() [2/3]

QPlaybackOptions::QPlaybackOptions ( const QPlaybackOptions & )
default

◆ QPlaybackOptions() [3/3]

QPlaybackOptions::QPlaybackOptions ( QPlaybackOptions && )
defaultnoexcept

◆ ~QPlaybackOptions()

QPlaybackOptions::~QPlaybackOptions ( )
default

Member Function Documentation

◆ networkTimeout()

std::chrono::milliseconds QPlaybackOptions::networkTimeout ( ) const

\qmlproperty qint64 playbackOptions::networkTimeoutMs

Since
6.10

Determines the network timeout (in milliseconds) used for socket I/O operations with some network formats.

This option is only supported with the FFmpeg media backend.

Definition at line 123 of file qplaybackoptions.cpp.

◆ operator=()

QPlaybackOptions & QPlaybackOptions::operator= ( const QPlaybackOptions & )
default

◆ playbackIntent()

QPlaybackOptions::PlaybackIntent QPlaybackOptions::playbackIntent ( ) const

\qmlproperty PlaybackOptions::PlaybackIntent PlaybackOptions::playbackIntent

Since
6.10

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

This option is only supported with the FFmpeg media backend.

\qmlenumeratorsfrom QPlaybackOptions::PlaybackIntent

Definition at line 175 of file qplaybackoptions.cpp.

◆ probeSize()

qsizetype QPlaybackOptions::probeSize ( ) const

\qmlproperty qsizetype PlaybackOptions::probeSize

Since
6.10

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 then determined by the media backend.

Note that a too small probeSize can result in failure to play the media, while a too high probeSize can increase latency.

This option is only supported with the FFmpeg media backend.

Definition at line 223 of file qplaybackoptions.cpp.

◆ resetNetworkTimeout()

void QPlaybackOptions::resetNetworkTimeout ( )

Definition at line 134 of file qplaybackoptions.cpp.

◆ resetPlaybackIntent()

void QPlaybackOptions::resetPlaybackIntent ( )

Definition at line 186 of file qplaybackoptions.cpp.

◆ resetProbeSize()

void QPlaybackOptions::resetProbeSize ( )

Definition at line 234 of file qplaybackoptions.cpp.

◆ setNetworkTimeout()

void QPlaybackOptions::setNetworkTimeout ( std::chrono::milliseconds timeout)

Definition at line 128 of file qplaybackoptions.cpp.

◆ setPlaybackIntent()

void QPlaybackOptions::setPlaybackIntent ( PlaybackIntent intent)

Definition at line 180 of file qplaybackoptions.cpp.

◆ setProbeSize()

void QPlaybackOptions::setProbeSize ( qsizetype probeSizeBytes)

Definition at line 228 of file qplaybackoptions.cpp.

◆ swap()

void QPlaybackOptions::swap ( QPlaybackOptions & other)
inlinenoexcept

Definition at line 43 of file qplaybackoptions.h.

◆ comparesEqual

Q_MULTIMEDIA_EXPORT bool comparesEqual ( const QPlaybackOptions & lhs,
const QPlaybackOptions & rhs )
friend

Definition at line 90 of file qplaybackoptions.cpp.

◆ compareThreeWay

Q_MULTIMEDIA_EXPORT Qt::strong_ordering compareThreeWay ( const QPlaybackOptions & lhs,
const QPlaybackOptions & rhs )
friend

Definition at line 98 of file qplaybackoptions.cpp.

◆ QPlaybackOptionsPrivate

friend class QPlaybackOptionsPrivate
friend

Definition at line 64 of file qplaybackoptions.h.

Property Documentation

◆ networkTimeout

std::chrono::milliseconds QPlaybackOptions::networkTimeout
readwrite
Since
6.10

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

This option is only supported with the FFmpeg media backend.

Definition at line 23 of file qplaybackoptions.h.

◆ playbackIntent

PlaybackIntent QPlaybackOptions::playbackIntent
readwrite
Since
6.10

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

This option is only supported with the FFmpeg media backend.

Definition at line 25 of file qplaybackoptions.h.

◆ probeSize

qsizetype QPlaybackOptions::probeSize
readwrite
Since
6.10

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.

Definition at line 27 of file qplaybackoptions.h.


The documentation for this class was generated from the following files: