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 tryApplyPendingSource();
86 void applyPendingSource();
89 static void onInfoTrampoline(OH_AVPlayer *player, AVPlayerOnInfoType type, OH_AVFormat *body,
91 static void onErrorTrampoline(OH_AVPlayer *player, int32_t errorCode,
const char *errorMsg,
94 OH_AVPlayer *m_player{
nullptr };
96 QPointer<QIODevice> m_stream;
100 std::unique_ptr<QFileDevice> m_sourceFile;
102 QPointer<QVideoSink> m_videoSink;
103 QPlatformAudioOutput *m_audioOutput{
nullptr };
104 std::unique_ptr<QOhosVideoOutput> m_videoOutput;
105 bool m_videoSurfaceAttached{
false };
106 bool m_pendingSetMedia{
false };
107 bool m_sourceApplied{
false };
108 bool m_surfaceWaitStarted{
false };
110 std::atomic<qint64> m_position{ 0 };
111 qint64 m_duration{ 0 };
112 int m_videoWidth{ 0 };
113 int m_videoHeight{ 0 };
114 float m_bufferProgress{ 0.0f };
115 bool m_hasVideoTrack{
false };
116 bool m_hasAudioTrack{
false };
117 qreal m_playbackRate{ 1.0 };
118 bool m_seekable{
false };
119 bool m_pendingPlay{
false };
121 AVPlayerState m_avState{
AV_IDLE };
Combined button and popup list for selecting options.