4#ifndef QOHOSMEDIAPLAYER_P_H
5#define QOHOSMEDIAPLAYER_P_H
18#include <private/qplatformmediaplayer_p.h>
20#include <QtCore/qmutex.h>
21#include <QtCore/qpointer.h>
22#include <QtCore/qurl.h>
23#include <QtCore/qfile.h>
25#include <multimedia/player_framework/avplayer.h>
26#include <multimedia/player_framework/avplayer_base.h>
35class QPlatformAudioOutput;
58 void setMedia(
const QUrl &media, QIODevice *stream)
override;
72 void handleStateChange(AVPlayerState newState);
73 void handleEndOfStream();
74 void handleSeekDone();
75 void handleResolutionChange();
76 void handleBufferingUpdate(
int bufferingPercent);
77 void handleError(int32_t errorCode,
const QString &errorMsg);
84 void onVideoSurfaceReady();
85 void applyPendingSource();
88 static void onInfoTrampoline(OH_AVPlayer *player, AVPlayerOnInfoType type, OH_AVFormat *body,
90 static void onErrorTrampoline(OH_AVPlayer *player, int32_t errorCode,
const char *errorMsg,
93 OH_AVPlayer *m_player{
nullptr };
95 QPointer<QIODevice> m_stream;
99 std::unique_ptr<QFileDevice> m_sourceFile;
101 QPointer<QVideoSink> m_videoSink;
102 QPlatformAudioOutput *m_audioOutput{
nullptr };
103 std::unique_ptr<QOhosVideoOutput> m_videoOutput;
104 bool m_videoSurfaceAttached{
false };
105 bool m_pendingSetMedia{
false };
107 std::atomic<qint64> m_position{ 0 };
108 qint64 m_duration{ 0 };
109 int m_videoWidth{ 0 };
110 int m_videoHeight{ 0 };
111 float m_bufferProgress{ 0.0f };
112 bool m_hasVideoTrack{
false };
113 bool m_hasAudioTrack{
false };
114 qreal m_playbackRate{ 1.0 };
115 bool m_seekable{
false };
116 bool m_pendingPlay{
false };
118 AVPlayerState m_avState{
AV_IDLE };
Combined button and popup list for selecting options.
QMediaPlayer::MediaStatus mediaStatusFor(AVPlayerState state, bool atEnd)
AVPlaybackSpeed playbackSpeedFor(qreal rate)
QMediaPlayer::PlaybackState playbackStateFor(AVPlayerState state)