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
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
26class QWasmAudioOutput;
28
30{
32
33public:
36
49
51 Q_ENUM(QWasmMediaNetworkState)
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;
65 void setAudioOutput(QPlatformAudioOutput *output) 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 void seekableMediaChanged(bool seekable);
87
88 void onMediaStatusChanged(QMediaPlayer::MediaStatus status);
89
90private:
91 void setMediaStatus(QMediaPlayer::MediaStatus status);
92 void setAudioAvailable(bool available);
93 void setVideoAvailable(bool available);
94 void updateAvailablePlaybackRanges();
95 void resetBufferingProgress();
96
97 void setSubtitle(QString subtitle);
98 void disableTrack(TrackType trackType);
99 void initVideo();
100 void initAudio();
101
103
104 QPointer<QWasmVideoOutput> m_videoOutput;
105 QWasmAudioOutput *m_audioOutput = nullptr;
106
107 QUrl m_mediaContent;
108 QIODevice *m_mediaStream = nullptr;
109
110 QVideoSink *m_videoSink = nullptr;
111 int m_bufferPercent = -1;
112 bool m_audioAvailable = false;
113 bool m_videoAvailable = false;
114 QSize m_videoSize;
115 bool m_buffering = false;
116 QMediaTimeRange m_availablePlaybackRange;
117 int m_State;
118
119 bool m_playWhenReady = false;
120
121};
122
123QT_END_NAMESPACE
124
125#endif // QWASMMEDIAPLAYER_H
void setVideoSink(QVideoSink *surface) 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
~QWasmMediaPlayer() override
void setMedia(const QUrl &mediaContent, QIODevice *stream) override
void setPosition(qint64 position) override
void setPlaybackRate(qreal rate) 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.
Q_STATIC_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core")