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>
33#include <private/qcomptr_p.h>
44class AudioSampleGrabberCallback;
60 STDMETHODIMP
Invoke(IMFAsyncResult *pResult)
override;
70 void stop(
bool immediate =
false);
120 void handleMediaSourceReady();
121 void handleSessionEvent(
const ComPtr<IMFMediaEvent> &
sessionEvent);
122 void handleSourceError(
long hr);
130 ComPtr<IMFPresentationClock> m_presentationClock;
131 ComPtr<IMFRateControl> m_rateControl;
132 ComPtr<IMFRateSupport> m_rateSupport;
133 ComPtr<IMFAudioStreamVolume> m_volumeControl;
134 ComPtr<IPropertyStore> m_netsourceStatistics;
136 qint64 m_restorePosition = -1;
138 UINT64 m_duration = 0;
139 bool m_updatingTopology =
false;
140 bool m_updateRoutingOnStart =
false;
155 void setPlaybackRateInternal(
qreal rate);
156 void commitRateChange(
qreal rate, BOOL isThin);
157 bool canScrub()
const;
158 void scrub(
bool enableScrub);
162 ComPtr<SourceResolver> m_sourceResolver;
183 void setCommand(Command cmd) {
195 PendingState m_pendingState;
197 void updatePendingCommands(Command command);
201 QList<QMediaMetaData> metaData;
202 QList<int> nativeIndexes;
203 int currentIndex = -1;
204 TOPOID sourceNodeId = -1;
205 TOPOID outputNodeId = -1;
213 bool m_muted =
false;
218 void setVolumeInternal(
float volume);
220 bool createSession();
221 void setupPlaybackTopology(IMFMediaSource *
source, IMFPresentationDescriptor *sourcePD);
223 ComPtr<IMFTopologyNode> addSourceNode(IMFTopology *topology, IMFMediaSource *
source,
224 IMFPresentationDescriptor *presentationDesc,
225 IMFStreamDescriptor *streamDesc);
226 ComPtr<IMFTopologyNode> addOutputNode(MediaType mediaType, IMFTopology *topology, DWORD sinkID);
228 QAudioFormat audioFormatForMFMediaType(IMFMediaType *mediaType)
const;
230 ComPtr<IMFTopology> insertMFT(
const ComPtr<IMFTopology> &topology, TOPOID outputNodeId);
231 bool insertResizer(IMFTopology *topology);
232 void insertColorConverter(IMFTopology *topology, TOPOID outputNodeId);
234 QTimer m_signalPositionChangeTimer;
235 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)
MFPlayerSession(MFPlayerControl *playerControl=0)
void sessionEvent(const ComPtr< IMFMediaEvent > &sessionEvent)
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 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