diff options
Diffstat (limited to 'src/plugins/multimedia/windows/player/mfplayersession_p.h')
-rw-r--r-- | src/plugins/multimedia/windows/player/mfplayersession_p.h | 87 |
1 files changed, 21 insertions, 66 deletions
diff --git a/src/plugins/multimedia/windows/player/mfplayersession_p.h b/src/plugins/multimedia/windows/player/mfplayersession_p.h index 1f3555ba8..50141a7fb 100644 --- a/src/plugins/multimedia/windows/player/mfplayersession_p.h +++ b/src/plugins/multimedia/windows/player/mfplayersession_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef MFPLAYERSESSION_H #define MFPLAYERSESSION_H @@ -66,12 +30,12 @@ #include <qaudiodevice.h> #include <qtimer.h> #include "mfplayercontrol_p.h" +#include <private/qcomptr_p.h> +#include <evrhelpers_p.h> QT_BEGIN_NAMESPACE -class QUrl; -QT_END_NAMESPACE -QT_USE_NAMESPACE +class QUrl; class SourceResolver; class MFVideoRendererControl; @@ -86,7 +50,6 @@ class MFPlayerSession : public QObject, public IMFAsyncCallback friend class SourceResolver; public: MFPlayerSession(MFPlayerControl *playerControl = 0); - ~MFPlayerSession(); STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObject) override; @@ -151,11 +114,11 @@ public Q_SLOTS: void updateOutputRouting(); Q_SIGNALS: - void sessionEvent(IMFMediaEvent *sessionEvent); + void sessionEvent(const ComPtr<IMFMediaEvent> &sessionEvent); private Q_SLOTS: void handleMediaSourceReady(); - void handleSessionEvent(IMFMediaEvent *sessionEvent); + void handleSessionEvent(const ComPtr<IMFMediaEvent> &sessionEvent); void handleSourceError(long hr); void timeout(); @@ -163,20 +126,17 @@ private: long m_cRef; MFPlayerControl *m_playerControl = nullptr; MFVideoRendererControl *m_videoRendererControl = nullptr; - IMFMediaSession *m_session; - IMFPresentationClock *m_presentationClock; - IMFRateControl *m_rateControl; - IMFRateSupport *m_rateSupport; - IMFAudioStreamVolume *m_volumeControl; - IPropertyStore *m_netsourceStatistics; + ComPtr<IMFMediaSession> m_session; + ComPtr<IMFPresentationClock> m_presentationClock; + ComPtr<IMFRateControl> m_rateControl; + ComPtr<IMFRateSupport> m_rateSupport; + ComPtr<IMFAudioStreamVolume> m_volumeControl; + ComPtr<IPropertyStore> m_netsourceStatistics; qint64 m_position = 0; qint64 m_restorePosition = -1; qint64 m_timeCounter = 0; UINT64 m_duration = 0; bool m_updatingTopology = false; - qint64 m_lastSeekPos = 0; - MFTIME m_lastSeekSysTime = 0; - bool m_altTiming = false; bool m_updateRoutingOnStart = false; enum Command @@ -199,8 +159,8 @@ private: bool m_scrubbing; float m_restoreRate; - SourceResolver *m_sourceResolver; - HANDLE m_hCloseEvent; + ComPtr<SourceResolver> m_sourceResolver; + EventHandle m_hCloseEvent; bool m_closing; enum MediaType @@ -260,26 +220,21 @@ private: bool createSession(); void setupPlaybackTopology(IMFMediaSource *source, IMFPresentationDescriptor *sourcePD); bool getStreamInfo(IMFStreamDescriptor *stream, MFPlayerSession::MediaType *type, QString *name, QString *language, GUID *format) const; - IMFTopologyNode* addSourceNode(IMFTopology* topology, IMFMediaSource* source, - IMFPresentationDescriptor* presentationDesc, IMFStreamDescriptor *streamDesc); - IMFTopologyNode* addOutputNode(MediaType mediaType, IMFTopology* topology, DWORD sinkID); + ComPtr<IMFTopologyNode> addSourceNode(IMFTopology *topology, IMFMediaSource *source, + IMFPresentationDescriptor *presentationDesc, + IMFStreamDescriptor *streamDesc); + ComPtr<IMFTopologyNode> addOutputNode(MediaType mediaType, IMFTopology *topology, DWORD sinkID); - bool addAudioSampleGrabberNode(IMFTopology* topology); - bool setupAudioSampleGrabber(IMFTopology *topology, IMFTopologyNode *sourceNode, IMFTopologyNode *outputNode); QAudioFormat audioFormatForMFMediaType(IMFMediaType *mediaType) const; - // ### Below can be used to monitor the audio channel. Currently unused. - AudioSampleGrabberCallback *m_audioSampleGrabber; - IMFTopologyNode *m_audioSampleGrabberNode; - IMFTopology *insertMFT(IMFTopology *topology, TOPOID outputNodeId); + ComPtr<IMFTopology> insertMFT(const ComPtr<IMFTopology> &topology, TOPOID outputNodeId); bool insertResizer(IMFTopology *topology); void insertColorConverter(IMFTopology *topology, TOPOID outputNodeId); - // ### Below can be used to monitor the video channel. Functionality currently unused. - MFTransform *m_videoProbeMFT; QTimer m_signalPositionChangeTimer; qint64 m_lastPosition = -1; }; +QT_END_NAMESPACE #endif |