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
QPlatformMediaPlayer Class Referenceabstract

#include <qplatformmediaplayer_p.h>

+ Inheritance diagram for QPlatformMediaPlayer:
+ Collaboration diagram for QPlatformMediaPlayer:

Public Types

enum  TrackType : uint8_t { VideoStream , AudioStream , SubtitleStream , NTrackTypes }
 

Public Member Functions

virtual ~QPlatformMediaPlayer ()
 
virtual QMediaPlayer::PlaybackState state () const
 
virtual QMediaPlayer::MediaStatus mediaStatus () const
 
virtual qint64 duration () const =0
 
virtual qint64 position () const
 
virtual void setPosition (qint64 position)=0
 
virtual float bufferProgress () const =0
 
virtual bool isAudioAvailable () const
 
virtual bool isVideoAvailable () const
 
virtual bool isSeekable () const
 
virtual QMediaTimeRange availablePlaybackRanges () const =0
 
virtual qreal playbackRate () const =0
 
virtual void setPlaybackRate (qreal rate)=0
 
virtual QUrl media () const =0
 
virtual const QIODevicemediaStream () const =0
 
virtual void setMedia (const QUrl &media, QIODevice *stream)=0
 
virtual void play ()=0
 
virtual void pause ()=0
 
virtual void stop ()=0
 
virtual bool streamPlaybackSupported () const
 
virtual void setAudioOutput (QPlatformAudioOutput *)
 
virtual void setAudioBufferOutput (QAudioBufferOutput *)
 
virtual QMediaMetaData metaData () const
 
virtual void setVideoSink (QVideoSink *)=0
 
virtual int trackCount (TrackType)
 
virtual QMediaMetaData trackMetaData (TrackType, int)
 
virtual int activeTrack (TrackType)
 
virtual void setActiveTrack (TrackType, int)
 
void durationChanged (std::chrono::milliseconds ms)
 
void durationChanged (qint64 duration)
 
void positionChanged (std::chrono::milliseconds ms)
 
void positionChanged (qint64 position)
 
void audioAvailableChanged (bool audioAvailable)
 
void videoAvailableChanged (bool videoAvailable)
 
void seekableChanged (bool seekable)
 
void playbackRateChanged (qreal rate)
 
void bufferProgressChanged (float progress)
 
void metaDataChanged ()
 
void tracksChanged ()
 
void activeTracksChanged ()
 
void stateChanged (QMediaPlayer::PlaybackState newState)
 
void mediaStatusChanged (QMediaPlayer::MediaStatus status)
 
void error (int error, const QString &errorString)
 
void resetCurrentLoop ()
 
bool doLoop ()
 
int loops () const
 
virtual void setLoops (int loops)
 

Protected Member Functions

 QPlatformMediaPlayer (QMediaPlayer *parent=nullptr)
 

Detailed Description

Definition at line 32 of file qplatformmediaplayer_p.h.

Member Enumeration Documentation

◆ TrackType

Enumerator
VideoStream 
AudioStream 
SubtitleStream 
NTrackTypes 

Definition at line 75 of file qplatformmediaplayer_p.h.

Constructor & Destructor Documentation

◆ ~QPlatformMediaPlayer()

QPlatformMediaPlayer::~QPlatformMediaPlayer ( )
virtualdefault

◆ QPlatformMediaPlayer()

QT_BEGIN_NAMESPACE QPlatformMediaPlayer::QPlatformMediaPlayer ( QMediaPlayer * parent = nullptr)
explicitprotected

Definition at line 12 of file qplatformmediaplayer.cpp.

References QPlatformMediaIntegration::instance().

+ Here is the call graph for this function:

Member Function Documentation

◆ activeTrack()

virtual int QPlatformMediaPlayer::activeTrack ( TrackType )
inlinevirtual

◆ activeTracksChanged()

void QPlatformMediaPlayer::activeTracksChanged ( )
inline

Definition at line 113 of file qplatformmediaplayer_p.h.

References QMediaPlayer::activeTracksChanged(), emit, and player.

Referenced by AVFMediaPlayer::setActiveTrack(), and QAndroidMediaPlayer::setActiveTrack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioAvailableChanged()

void QPlatformMediaPlayer::audioAvailableChanged ( bool audioAvailable)
inline

Definition at line 91 of file qplatformmediaplayer_p.h.

References emit, QMediaPlayer::hasAudioChanged(), and player.

Referenced by MFPlayerControl::handleAudioAvailable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ availablePlaybackRanges()

virtual QMediaTimeRange QPlatformMediaPlayer::availablePlaybackRanges ( ) const
pure virtual

◆ bufferProgress()

virtual float QPlatformMediaPlayer::bufferProgress ( ) const
pure virtual

◆ bufferProgressChanged()

void QPlatformMediaPlayer::bufferProgressChanged ( float progress)
inline

Definition at line 110 of file qplatformmediaplayer_p.h.

References QMediaPlayer::bufferProgressChanged(), emit, and player.

Referenced by MFPlayerSession::bufferProgressChanged(), and AVFMediaPlayer::processBufferStateChange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doLoop()

bool QPlatformMediaPlayer::doLoop ( )
inline

Definition at line 120 of file qplatformmediaplayer_p.h.

Referenced by MFPlayerControl::handleStatusChanged(), QGstreamerMediaPlayer::processBusMessage(), and AVFMediaPlayer::processEOS().

+ Here is the caller graph for this function:

◆ duration()

virtual qint64 QPlatformMediaPlayer::duration ( ) const
pure virtual

◆ durationChanged() [1/2]

void QPlatformMediaPlayer::durationChanged ( qint64 duration)
inline

Definition at line 83 of file qplatformmediaplayer_p.h.

References QMediaPlayer::durationChanged(), emit, and player.

+ Here is the call graph for this function:

◆ durationChanged() [2/2]

void QPlatformMediaPlayer::durationChanged ( std::chrono::milliseconds ms)
inline

Definition at line 82 of file qplatformmediaplayer_p.h.

References durationChanged().

Referenced by durationChanged(), MFPlayerControl::handleDurationUpdate(), AVFMediaPlayer::processDurationChange(), QGstreamerMediaPlayer::setMedia(), and AVFMediaPlayer::setMedia().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ error()

void QPlatformMediaPlayer::error ( int error,
const QString & errorString )

Definition at line 35 of file qplatformmediaplayer.cpp.

References error.

Referenced by QMediaPlayerPrivate::setMedia().

+ Here is the caller graph for this function:

◆ isAudioAvailable()

virtual bool QPlatformMediaPlayer::isAudioAvailable ( ) const
inlinevirtual

◆ isSeekable()

virtual bool QPlatformMediaPlayer::isSeekable ( ) const
inlinevirtual

Reimplemented in AVFMediaPlayer, QQnxMediaPlayer, QWasmMediaPlayer, and MFPlayerControl.

Definition at line 49 of file qplatformmediaplayer_p.h.

Referenced by QAndroidMediaPlayer::setPosition().

+ Here is the caller graph for this function:

◆ isVideoAvailable()

virtual bool QPlatformMediaPlayer::isVideoAvailable ( ) const
inlinevirtual

◆ loops()

int QPlatformMediaPlayer::loops ( ) const
inline

Definition at line 123 of file qplatformmediaplayer_p.h.

Referenced by QFFmpegMediaPlayer::setLoops().

+ Here is the caller graph for this function:

◆ media()

virtual QUrl QPlatformMediaPlayer::media ( ) const
pure virtual

◆ mediaStatus()

◆ mediaStatusChanged()

void QPlatformMediaPlayer::mediaStatusChanged ( QMediaPlayer::MediaStatus status)

◆ mediaStream()

virtual const QIODevice * QPlatformMediaPlayer::mediaStream ( ) const
pure virtual

◆ metaData()

virtual QMediaMetaData QPlatformMediaPlayer::metaData ( ) const
inlinevirtual

◆ metaDataChanged()

void QPlatformMediaPlayer::metaDataChanged ( )
inline

Definition at line 111 of file qplatformmediaplayer_p.h.

References emit, QMediaPlayer::metaDataChanged(), and player.

Referenced by MFPlayerSession::metaDataChanged(), QGstreamerMediaPlayer::processBusMessage(), AVFMediaPlayer::processLoadStateChange(), QGstreamerMediaPlayer::setMedia(), and AVFMediaPlayer::setMedia().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pause()

virtual void QPlatformMediaPlayer::pause ( )
pure virtual

◆ play()

virtual void QPlatformMediaPlayer::play ( )
pure virtual

◆ playbackRate()

virtual qreal QPlatformMediaPlayer::playbackRate ( ) const
pure virtual

◆ playbackRateChanged()

void QPlatformMediaPlayer::playbackRateChanged ( qreal rate)
inline

Definition at line 109 of file qplatformmediaplayer_p.h.

References emit, QMediaPlayer::playbackRateChanged(), and player.

Referenced by QAndroidMediaPlayer::play(), MFPlayerSession::playbackRateChanged(), QAndroidMediaPlayer::setPlaybackRate(), AVFMediaPlayer::setPlaybackRate(), QFFmpegMediaPlayer::setPlaybackRate(), QGstreamerMediaPlayer::setPlaybackRate(), and QWasmMediaPlayer::setPlaybackRate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ position()

virtual qint64 QPlatformMediaPlayer::position ( ) const
inlinevirtual

Reimplemented in QAndroidMediaPlayer, AVFMediaPlayer, QQnxMediaPlayer, QWasmMediaPlayer, and MFPlayerControl.

Definition at line 41 of file qplatformmediaplayer_p.h.

Referenced by QGstreamerMediaPlayer::processBusMessage(), QGstreamerMediaPlayer::setMedia(), QFFmpegMediaPlayer::setPosition(), and QGstreamerMediaPlayer::stop().

+ Here is the caller graph for this function:

◆ positionChanged() [1/2]

void QPlatformMediaPlayer::positionChanged ( qint64 position)
inline

Definition at line 85 of file qplatformmediaplayer_p.h.

References emit, player, position(), and QMediaPlayer::positionChanged().

+ Here is the call graph for this function:

◆ positionChanged() [2/2]

void QPlatformMediaPlayer::positionChanged ( std::chrono::milliseconds ms)
inline

◆ resetCurrentLoop()

void QPlatformMediaPlayer::resetCurrentLoop ( )
inline

Definition at line 119 of file qplatformmediaplayer_p.h.

Referenced by QAndroidMediaPlayer::play(), AVFMediaPlayer::play(), QGstreamerMediaPlayer::play(), QWasmMediaPlayer::play(), and MFPlayerControl::play().

+ Here is the caller graph for this function:

◆ seekableChanged()

void QPlatformMediaPlayer::seekableChanged ( bool seekable)
inline

Definition at line 103 of file qplatformmediaplayer_p.h.

References emit, player, and QMediaPlayer::seekableChanged().

Referenced by QAndroidMediaPlayer::QAndroidMediaPlayer(), MFPlayerControl::handleSeekableUpdate(), and QGstreamerMediaPlayer::setMedia().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActiveTrack()

virtual void QPlatformMediaPlayer::setActiveTrack ( TrackType ,
int  )
inlinevirtual

◆ setAudioBufferOutput()

virtual void QPlatformMediaPlayer::setAudioBufferOutput ( QAudioBufferOutput * )
inlinevirtual

Reimplemented in QFFmpegMediaPlayer.

Definition at line 68 of file qplatformmediaplayer_p.h.

◆ setAudioOutput()

virtual void QPlatformMediaPlayer::setAudioOutput ( QPlatformAudioOutput * )
inlinevirtual

◆ setLoops()

virtual void QPlatformMediaPlayer::setLoops ( int loops)
inlinevirtual

Reimplemented in QFFmpegMediaPlayer.

Definition at line 124 of file qplatformmediaplayer_p.h.

References QMediaPlayer::loopsChanged(), player, and Q_EMIT.

Referenced by QFFmpegMediaPlayer::setLoops().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMedia()

virtual void QPlatformMediaPlayer::setMedia ( const QUrl & media,
QIODevice * stream )
pure virtual

Implemented in QGstreamerMediaPlayer, AVFMediaPlayer, QFFmpegMediaPlayer, QQnxMediaPlayer, MFPlayerControl, QAndroidMediaPlayer, and QWasmMediaPlayer.

Referenced by QMediaPlayerPrivate::setMedia().

+ Here is the caller graph for this function:

◆ setPlaybackRate()

virtual void QPlatformMediaPlayer::setPlaybackRate ( qreal rate)
pure virtual

◆ setPosition()

virtual void QPlatformMediaPlayer::setPosition ( qint64 position)
pure virtual

◆ setVideoSink()

virtual void QPlatformMediaPlayer::setVideoSink ( QVideoSink * )
pure virtual

Implemented in AVFMediaPlayer, QFFmpegMediaPlayer, QGstreamerMediaPlayer, MFPlayerControl, QAndroidMediaPlayer, QWasmMediaPlayer, and QQnxMediaPlayer.

Referenced by QMediaPlayerPrivate::setVideoSink().

+ Here is the caller graph for this function:

◆ state()

virtual QMediaPlayer::PlaybackState QPlatformMediaPlayer::state ( ) const
inlinevirtual

Reimplemented in AVFMediaPlayer, and MFPlayerControl.

Definition at line 36 of file qplatformmediaplayer_p.h.

Referenced by QFFmpegMediaPlayer::pause(), QGstreamerMediaPlayer::pause(), QQnxMediaPlayer::pause(), QFFmpegMediaPlayer::play(), QGstreamerMediaPlayer::play(), QQnxMediaPlayer::play(), QGstreamerMediaPlayer::processBusMessage(), QQnxMediaPlayer::setPlaybackRate(), QGstreamerMediaPlayer::stop(), and QQnxMediaPlayer::stop().

+ Here is the caller graph for this function:

◆ stateChanged()

void QPlatformMediaPlayer::stateChanged ( QMediaPlayer::PlaybackState newState)

Definition at line 19 of file qplatformmediaplayer.cpp.

References newState().

Referenced by QAndroidMediaPlayer::pause(), AVFMediaPlayer::pause(), QFFmpegMediaPlayer::pause(), QGstreamerMediaPlayer::pause(), QWasmMediaPlayer::pause(), QAndroidMediaPlayer::play(), AVFMediaPlayer::play(), QGstreamerMediaPlayer::play(), QQnxMediaPlayer::play(), AVFMediaPlayer::processEOS(), AVFMediaPlayer::processLoadStateFailure(), QGstreamerMediaPlayer::setMedia(), AVFMediaPlayer::setMedia(), QQnxMediaPlayer::setMedia(), QAndroidMediaPlayer::stop(), AVFMediaPlayer::stop(), and QFFmpegMediaPlayer::stop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop()

virtual void QPlatformMediaPlayer::stop ( )
pure virtual

◆ streamPlaybackSupported()

virtual bool QPlatformMediaPlayer::streamPlaybackSupported ( ) const
inlinevirtual

Reimplemented in QGstreamerMediaPlayer, and MFPlayerControl.

Definition at line 64 of file qplatformmediaplayer_p.h.

Referenced by QMediaPlayerPrivate::setMedia().

+ Here is the caller graph for this function:

◆ trackCount()

virtual int QPlatformMediaPlayer::trackCount ( TrackType )
inlinevirtual

Reimplemented in QAndroidMediaPlayer, QWasmMediaPlayer, MFPlayerControl, QFFmpegMediaPlayer, and QGstreamerMediaPlayer.

Definition at line 77 of file qplatformmediaplayer_p.h.

Referenced by QMediaPlayerPrivate::trackMetaData().

+ Here is the caller graph for this function:

◆ trackMetaData()

virtual QMediaMetaData QPlatformMediaPlayer::trackMetaData ( TrackType ,
int  )
inlinevirtual

Reimplemented in QAndroidMediaPlayer, QFFmpegMediaPlayer, MFPlayerControl, and QGstreamerMediaPlayer.

Definition at line 78 of file qplatformmediaplayer_p.h.

Referenced by QMediaPlayerPrivate::trackMetaData().

+ Here is the caller graph for this function:

◆ tracksChanged()

void QPlatformMediaPlayer::tracksChanged ( )
inline

Definition at line 112 of file qplatformmediaplayer_p.h.

References emit, player, and QMediaPlayer::tracksChanged().

Referenced by MFPlayerControl::handleTracksChanged(), QGstreamerMediaPlayer::processBusMessage(), AVFMediaPlayer::setMedia(), and AVFMediaPlayer::updateTracks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ videoAvailableChanged()

void QPlatformMediaPlayer::videoAvailableChanged ( bool videoAvailable)
inline

Definition at line 97 of file qplatformmediaplayer_p.h.

References emit, QMediaPlayer::hasVideoChanged(), and player.

Referenced by MFPlayerControl::handleVideoAvailable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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