Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
mfdecodersourcereader_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef MFDECODERSOURCEREADER_H
5#define MFDECODERSOURCEREADER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <mfapi.h>
19#include <mfidl.h>
20#include <mfreadwrite.h>
21
22#include <QtCore/qobject.h>
23#include "qaudioformat.h"
24#include <private/qcomptr_p.h>
25
27
28class MFDecoderSourceReader : public QObject, public IMFSourceReaderCallback
29{
31public:
34
35 void clearSource() { m_sourceReader.Reset(); }
36 ComPtr<IMFMediaType> setSource(IMFMediaSource *source, QAudioFormat::SampleFormat);
37
38 void readNextSample();
39
40 //from IUnknown
41 STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObject) override;
42 STDMETHODIMP_(ULONG) AddRef() override;
43 STDMETHODIMP_(ULONG) Release() override;
44
45 //from IMFSourceReaderCallback
46 STDMETHODIMP OnReadSample(HRESULT hrStatus, DWORD dwStreamIndex,
47 DWORD dwStreamFlags, LONGLONG llTimestamp, IMFSample *pSample) override;
48 STDMETHODIMP OnFlush(DWORD) override { return S_OK; }
49 STDMETHODIMP OnEvent(DWORD, IMFMediaEvent *) override { return S_OK; }
50
52 void newSample(ComPtr<IMFSample>);
53 void finished();
54
55private:
56 long m_cRef = 1;
57 ComPtr<IMFSourceReader> m_sourceReader;
58
59};
60
62
63#endif//MFDECODERSOURCEREADER_H
ComPtr< IMFMediaType > setSource(IMFMediaSource *source, QAudioFormat::SampleFormat)
STDMETHODIMP OnEvent(DWORD, IMFMediaEvent *) override
STDMETHODIMP OnReadSample(HRESULT hrStatus, DWORD dwStreamIndex, DWORD dwStreamFlags, LONGLONG llTimestamp, IMFSample *pSample) override
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObject) override
void newSample(ComPtr< IMFSample >)
STDMETHODIMP OnFlush(DWORD) override
STDMETHODIMP_(ULONG) Release() override
STDMETHODIMP_(ULONG) AddRef() override
SampleFormat
Qt will always expect and use samples in the endianness of the host platform.
\inmodule QtCore
Definition qobject.h:103
Combined button and popup list for selecting options.
GLsizei GLsizei GLchar * source
#define Q_OBJECT
#define Q_SIGNALS
IUIViewSettingsInterop __RPC__in REFIID riid
long HRESULT