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
qwasmmediaplayer_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QWASMMEDIAPLAYER_H
5#define QWASMMEDIAPLAYER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <qglobal.h>
19#include <private/qplatformmediaplayer_p.h>
20#include <qsize.h>
21#include <qurl.h>
22#include <QtCore/qpointer.h>
23
25
28
30{
32
33public:
35 ~QWasmMediaPlayer() override;
36
49
52
53 qint64 duration() const override;
54 qint64 position() const override;
55 float bufferProgress() const override;
56 bool isAudioAvailable() const override;
57 bool isVideoAvailable() const override;
59 qreal playbackRate() const override;
60 void setPlaybackRate(qreal rate) override;
61 QUrl media() const override;
62 const QIODevice *mediaStream() const override;
63 void setMedia(const QUrl &mediaContent, QIODevice *stream) override;
64 void setVideoSink(QVideoSink *surface) override;
66 void setPosition(qint64 position) override;
67 void play() override;
68 void pause() override;
69 void stop() override;
70 bool isSeekable() const override;
71 int trackCount(TrackType trackType) override;
72
73 void updateAudioDevice();
74
75private Q_SLOTS:
76 void volumeChanged(float volume);
77 void mutedChanged(bool muted);
78 void videoOutputReady(bool ready);
79 void errorOccured(qint32 code, const QString &message);
80 void bufferingChanged(qint32 percent);
81 void videoSizeChanged(qint32 width, qint32 height);
82 void mediaStateChanged(QWasmMediaPlayer::QWasmMediaPlayerState state);
83 void setPositionChanged(qint64 position);
84 void setDurationChanged(qint64 duration);
85 void videoMetaDataChanged();
86
87 void onMediaStatusChanged(QMediaPlayer::MediaStatus status);
88
89private:
90 void setMediaStatus(QMediaPlayer::MediaStatus status);
91 void setAudioAvailable(bool available);
92 void setVideoAvailable(bool available);
93 void updateAvailablePlaybackRanges();
94 void resetBufferingProgress();
95
96 void setSubtitle(QString subtitle);
97 void disableTrack(TrackType trackType);
98 void initVideo();
99 void initAudio();
100
102
103 QPointer<QWasmVideoOutput> m_videoOutput;
104 QWasmAudioOutput *m_audioOutput = nullptr;
105
106 QUrl m_mediaContent;
107 QIODevice *m_mediaStream = nullptr;
108
109 QVideoSink *m_videoSink = nullptr;
110 int m_bufferPercent = -1;
111 bool m_audioAvailable = false;
112 bool m_videoAvailable = false;
113 QSize m_videoSize;
114 bool m_buffering = false;
115 QMediaTimeRange m_availablePlaybackRange;
116 int m_State;
117
118 bool m_playWhenReady = false;
119
120};
121
123
124#endif // QWASMMEDIAPLAYER_H
\inmodule QtCore \reentrant
Definition qiodevice.h:34
The QMediaPlayer class allows the playing of a media files.
MediaStatus
\qmlproperty enumeration QtMultimedia::MediaPlayer::playbackState
The QMediaTimeRange class represents a set of zero or more disjoint time intervals.
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
virtual QMediaPlayer::PlaybackState state() const
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
void setVideoSink(QVideoSink *surface) override
qint64 duration() const override
void pause() override
qint64 position() const override
void play() override
const QIODevice * mediaStream() const override
QMediaTimeRange availablePlaybackRanges() const override
qreal playbackRate() const override
float bufferProgress() const override
bool isVideoAvailable() const override
friend class StateChangeNotifier
QWasmMediaPlayer(QMediaPlayer *parent=0)
~QWasmMediaPlayer() override
void setMedia(const QUrl &mediaContent, QIODevice *stream) override
void setPlaybackRate(qreal rate) override
void setAudioOutput(QPlatformAudioOutput *output) override
bool isSeekable() const override
bool isAudioAvailable() const override
int trackCount(TrackType trackType) override
void stop() override
QUrl media() const override
Combined button and popup list for selecting options.
EGLStreamKHR stream
n void setPosition(void) \n\
GLint GLsizei GLsizei height
GLint GLsizei width
GLuint GLsizei const GLchar * message
GLuint GLenum * rate
#define Q_ENUM(x)
#define Q_OBJECT
#define Q_SLOTS
int qint32
Definition qtypes.h:49
long long qint64
Definition qtypes.h:60
double qreal
Definition qtypes.h:187
QT_BEGIN_NAMESPACE typedef uchar * output