Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
mfaudiodecodercontrol_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 MFAUDIODECODERCONTROL_H
5#define MFAUDIODECODERCONTROL_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 <decoder/mfdecodersourcereader_p.h>
19#include <sourceresolver_p.h>
20
21#include <QtMultimedia/private/qplatformaudiodecoder_p.h>
22#include <QtMultimedia/private/qwindowsresampler_p.h>
23
25
27{
29public:
32
33 QUrl source() const override { return m_source; }
34 void setSource(const QUrl &fileName) override;
35
36 QIODevice* sourceDevice() const override { return m_device; }
37 void setSourceDevice(QIODevice *device) override;
38
39 void start() override;
40 void stop() override;
41
42 QAudioFormat audioFormat() const override { return m_outputFormat; }
43 void setAudioFormat(const QAudioFormat &format) override;
44
45 QAudioBuffer read() override;
46 bool bufferAvailable() const override { return m_audioBuffer.sampleCount() > 0; }
47
48 bool canReadQrc() const override { return true; }
49
50private Q_SLOTS:
52 void handleMediaSourceError(long hr);
53 void handleNewSample(ComPtr<IMFSample>);
54 void handleSourceFinished();
55
56private:
57 void startReadingSource(const ComPtr<IMFMediaSource> &source);
58
59 std::unique_ptr<MFDecoderSourceReader> m_decoderSourceReader;
60 ComPtr<SourceResolver> m_sourceResolver;
61 QWindowsResampler m_resampler;
62 QUrl m_source;
63 QIODevice *m_device = nullptr;
64 QAudioFormat m_outputFormat;
65 QAudioBuffer m_audioBuffer;
66 bool m_loadingSource = false;
67 bool m_deferredStart = false;
68};
69
70QT_END_NAMESPACE
71
72#endif//MFAUDIODECODERCONTROL_H
bool canReadQrc() const override
void setAudioFormat(const QAudioFormat &format) override
bool bufferAvailable() const override
QUrl source() const override
void setSourceDevice(QIODevice *device) override
QAudioFormat audioFormat() const override
QAudioBuffer read() override
void setSource(const QUrl &fileName) override
QIODevice * sourceDevice() const override
q23::expected< QPlatformVideoSink *, QString > createVideoSink(QVideoSink *sink) override
QPlatformMediaFormatInfo * createFormatInfo() override
q23::expected< QPlatformAudioDecoder *, QString > createAudioDecoder(QAudioDecoder *decoder) override
q23::expected< QPlatformCamera *, QString > createCamera(QCamera *camera) override
q23::expected< QPlatformImageCapture *, QString > createImageCapture(QImageCapture *imageCapture) override
QPlatformVideoDevices * createVideoDevices() override
q23::expected< QPlatformMediaRecorder *, QString > createRecorder(QMediaRecorder *recorder) override
q23::expected< QPlatformMediaPlayer *, QString > createPlayer(QMediaPlayer *parent) override
q23::expected< QPlatformMediaCaptureSession *, QString > createCaptureSession() override
Combined button and popup list for selecting options.