Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
samplegrabber_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 SAMPLEGRABBER_H
5#define SAMPLEGRABBER_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 <QtCore/qmutex.h>
19#include <QtCore/qlist.h>
20#include <QtMultimedia/qaudioformat.h>
21#include <mfapi.h>
22#include <mfidl.h>
23
25
26class SampleGrabberCallback : public IMFSampleGrabberSinkCallback
27{
28public:
29 // IUnknown methods
30 STDMETHODIMP QueryInterface(REFIID iid, void** ppv) override;
31 STDMETHODIMP_(ULONG) AddRef() override;
32 STDMETHODIMP_(ULONG) Release() override;
33
34 // IMFClockStateSink methods
35 STDMETHODIMP OnClockStart(MFTIME hnsSystemTime, LONGLONG llClockStartOffset) override;
36 STDMETHODIMP OnClockStop(MFTIME hnsSystemTime) override;
37 STDMETHODIMP OnClockPause(MFTIME hnsSystemTime) override;
38 STDMETHODIMP OnClockRestart(MFTIME hnsSystemTime) override;
39 STDMETHODIMP OnClockSetRate(MFTIME hnsSystemTime, float flRate) override;
40
41 // IMFSampleGrabberSinkCallback methods
42 STDMETHODIMP OnSetPresentationClock(IMFPresentationClock* pClock) override;
43 STDMETHODIMP OnShutdown() override;
44
45protected:
46 SampleGrabberCallback() : m_cRef(1) {}
47
48public:
50
51private:
52 long m_cRef;
53};
54
56public:
57 void setFormat(const QAudioFormat& format);
58
59 STDMETHODIMP OnProcessSample(REFGUID guidMajorMediaType, DWORD dwSampleFlags,
60 LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE * pSampleBuffer,
61 DWORD dwSampleSize) override;
62
63private:
64// QList<MFAudioProbeControl*> m_audioProbes;
65 QMutex m_audioProbeMutex;
66 QAudioFormat m_format;
67};
68
70
71#endif // SAMPLEGRABBER_H
STDMETHODIMP OnProcessSample(REFGUID guidMajorMediaType, DWORD dwSampleFlags, LONGLONG llSampleTime, LONGLONG llSampleDuration, const BYTE *pSampleBuffer, DWORD dwSampleSize) override
void setFormat(const QAudioFormat &format)
The QAudioFormat class stores audio stream parameter information.
\inmodule QtCore
Definition qmutex.h:285
STDMETHODIMP_(ULONG) AddRef() override
STDMETHODIMP OnShutdown() override
STDMETHODIMP QueryInterface(REFIID iid, void **ppv) override
STDMETHODIMP OnClockSetRate(MFTIME hnsSystemTime, float flRate) override
STDMETHODIMP OnClockStop(MFTIME hnsSystemTime) override
STDMETHODIMP_(ULONG) Release() override
STDMETHODIMP OnClockPause(MFTIME hnsSystemTime) override
STDMETHODIMP OnClockRestart(MFTIME hnsSystemTime) override
STDMETHODIMP OnSetPresentationClock(IMFPresentationClock *pClock) override
STDMETHODIMP OnClockStart(MFTIME hnsSystemTime, LONGLONG llClockStartOffset) override
Combined button and popup list for selecting options.
GLint GLsizei GLsizei GLenum format
IUIViewSettingsInterop __RPC__in REFIID __RPC__deref_out_opt void ** ppv