4#ifndef MFPLAYERSESSION_H
5#define MFPLAYERSESSION_H
24#include <QtCore/qcoreevent.h>
25#include <QtCore/qmutex.h>
26#include <QtCore/qurl.h>
27#include <QtCore/qwaitcondition.h>
28#include <QtMultimedia/qaudioformat.h>
29#include <QtMultimedia/qvideoframeformat.h>
59 STDMETHODIMP
Invoke(IMFAsyncResult *pResult)
override;
69 void stop(
bool immediate =
false);
119 void handleMediaSourceReady();
121 void handleSourceError(
long hr);
129 IMFPresentationClock *m_presentationClock;
130 IMFRateControl *m_rateControl;
131 IMFRateSupport *m_rateSupport;
132 IMFAudioStreamVolume *m_volumeControl;
133 IPropertyStore *m_netsourceStatistics;
135 qint64 m_restorePosition = -1;
137 UINT64 m_duration = 0;
138 bool m_updatingTopology =
false;
139 bool m_updateRoutingOnStart =
false;
154 void setPlaybackRateInternal(
qreal rate);
155 void commitRateChange(
qreal rate, BOOL isThin);
156 bool canScrub()
const;
157 void scrub(
bool enableScrub);
162 HANDLE m_hCloseEvent;
182 void setCommand(Command cmd) {
194 PendingState m_pendingState;
196 void updatePendingCommands(Command command);
202 int currentIndex = -1;
203 TOPOID sourceNodeId = -1;
204 TOPOID outputNodeId = -1;
212 bool m_muted =
false;
217 void setVolumeInternal(
float volume);
219 bool createSession();
220 void setupPlaybackTopology(IMFMediaSource *
source, IMFPresentationDescriptor *sourcePD);
222 IMFTopologyNode* addSourceNode(IMFTopology* topology, IMFMediaSource*
source,
223 IMFPresentationDescriptor* presentationDesc, IMFStreamDescriptor *streamDesc);
224 IMFTopologyNode* addOutputNode(MediaType mediaType, IMFTopology* topology, DWORD sinkID);
226 bool addAudioSampleGrabberNode(IMFTopology* topology);
227 bool setupAudioSampleGrabber(IMFTopology *topology, IMFTopologyNode *sourceNode, IMFTopologyNode *outputNode);
228 QAudioFormat audioFormatForMFMediaType(IMFMediaType *mediaType)
const;
231 IMFTopologyNode *m_audioSampleGrabberNode;
233 IMFTopology *insertMFT(IMFTopology *topology, TOPOID outputNodeId);
234 bool insertResizer(IMFTopology *topology);
235 void insertColorConverter(IMFTopology *topology, TOPOID outputNodeId);
239 QTimer m_signalPositionChangeTimer;
240 qint64 m_lastPosition = -1;
AVFCameraSession * m_session
IOBluetoothDevice * device
void handleError(QMediaPlayer::Error errorCode, const QString &errorString, bool isFatal)
void handleAudioAvailable()
void handleSeekableUpdate(bool seekable)
void handleVideoAvailable()
void handleDurationUpdate(qint64 duration)
void handleTracksChanged()
void handleStatusChanged()
void seekableUpdate(bool seekable)
void setPlaybackRate(qreal rate)
QMediaMetaData metaData() const
void setAudioOutput(QPlatformAudioOutput *device)
void setVideoSink(QVideoSink *sink)
void bufferProgressChanged(float percentFilled)
void setActiveTrack(QPlatformMediaPlayer::TrackType type, int index)
void playbackRateChanged(qreal rate)
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObject) override
void positionChanged(qint64 position)
void setPlayerControl(MFPlayerControl *playerControl)
void durationUpdate(qint64 duration)
qreal playbackRate() const
void stop(bool immediate=false)
void setVolume(float volume)
QMediaMetaData trackMetaData(QPlatformMediaPlayer::TrackType type, int trackNumber)
STDMETHODIMP Invoke(IMFAsyncResult *pResult) override
void load(const QUrl &media, QIODevice *stream)
int activeTrack(QPlatformMediaPlayer::TrackType type)
QMediaPlayer::MediaStatus status() const
void changeStatus(QMediaPlayer::MediaStatus newStatus)
QMediaTimeRange availablePlaybackRanges()
STDMETHODIMP_(ULONG) Release(void) override
void setMuted(bool muted)
STDMETHODIMP_(ULONG) AddRef(void) override
void sessionEvent(IMFMediaEvent *sessionEvent)
void error(QMediaPlayer::Error error, QString errorString, bool isFatal)
void updateOutputRouting()
STDMETHODIMP GetParameters(DWORD *pdwFlags, DWORD *pdwQueue) override
int trackCount(QPlatformMediaPlayer::TrackType)
\inmodule QtCore \reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QVideoSink class represents a generic sink for video data.
static bool isFatal(QtMsgType msgType)
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
n void setPosition(void) \n\
GLbitfield GLuint64 timeout
[4]
GLint GLsizei GLsizei GLenum format
GLsizei GLsizei GLchar * source
GLsizei GLenum GLboolean sink
IUIViewSettingsInterop __RPC__in REFIID riid