3#ifndef QQnxMediaPlayer_H
4#define QQnxMediaPlayer_H
20#include <private/qplatformmediaplayer_p.h>
21#include <QtCore/qabstractnativeeventfilter.h>
22#include <QtCore/qpointer.h>
23#include <QtCore/qtimer.h>
25#include <mm/renderer.h>
26#include <mm/renderer/types.h>
65 void setMedia(
const QUrl &media, QIODevice *stream)
override;
75 void setMuted(
bool muted);
79 void startMonitoring();
80 void stopMonitoring();
81 void resetMonitoring();
83 void openConnection();
84 void emitMmError(
const char *msg);
85 void emitMmError(
const QString &msg);
86 void emitPError(
const QString &msg);
88 void handleMmPositionChanged(qint64 newPosition);
89 void updateBufferLevel(
int level,
int capacity);
92 void handleMmEventState(
const mmr_event_t *event);
93 void handleMmEventStatus(
const mmr_event_t *event);
94 void handleMmEventStatusData(
const strm_dict_t *data);
95 void handleMmEventError(
const mmr_event_t *event);
97 QByteArray resourcePathForUrl(
const QUrl &url);
99 void closeConnection();
102 bool attachVideoOutput();
103 bool attachAudioOutput();
107 void detachVideoOutput();
108 void detachAudioOutput();
111 bool isVideoOutputAttached()
const;
112 bool isAudioOutputAttached()
const;
113 bool isInputAttached()
const;
115 void updateScene(
const QSize &size);
119 void setPositionInternal(qint64 position);
120 void flushPosition();
122 bool isPendingPositionFlush()
const;
124 void setDeferredSpeedEnabled(
bool enabled);
125 bool isDeferredSpeedEnabled()
const;
127 mmr_context_t *m_context =
nullptr;
128 mmr_connection_t *m_connection =
nullptr;
130 QString m_contextName;
137 QPointer<QAudioOutput> m_audioOutput;
138 QPointer<QQnxVideoSink> m_platformVideoSink;
140 QQnxMediaMetaData m_metaData;
142 qint64 m_position = 0;
143 qint64 m_pendingPosition = 0;
145 int m_bufferLevel = 0;
149 QTimer m_flushPositionTimer;
154 int m_configuredSpeed = 1000;
156 std::optional<
int> m_deferredSpeed;
160 bool m_inputAttached =
false;
161 bool m_muted =
false;
162 bool m_deferredSpeedEnabled =
false;
MapData map(QVideoFrame::MapMode mode) override
Maps the planes of a video buffer to memory.
QnxRasterBuffer(QQnxWindowGrabber *windowGrabber)
void unmap() override
Releases the memory mapped by the map() function.
QVideoFrameFormat format() const override
Gets \l QVideoFrameFormat of the underlying video buffer.
quint64 textureHandle(QRhi &, int plane) override
QnxTextureBuffer(QQnxWindowGrabber *QQnxWindowGrabber)
MapData map(QVideoFrame::MapMode) override
Maps the planes of a video buffer to memory.
void unmap() override
Releases the memory mapped by the map() function.