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
sourceresolver_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 SOURCERESOLVER_H
5#define SOURCERESOLVER_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 "mfstream_p.h"
19#include <QUrl>
20
22
24{
26public:
28
30
31 STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObject) override;
34
35 HRESULT STDMETHODCALLTYPE Invoke(IMFAsyncResult *pAsyncResult) override;
36
38
39 void load(const QUrl &url, QIODevice* stream);
40
41 void cancel();
42
43 void shutdown();
44
46
48 void error(long hr);
50
51private:
52 class State : public IUnknown
53 {
54 public:
55 State(IMFSourceResolver *sourceResolver, bool fromStream);
56 virtual ~State();
57
58 STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObject) override;
59
60 STDMETHODIMP_(ULONG) AddRef(void) override;
61
62 STDMETHODIMP_(ULONG) Release(void) override;
63
64 IMFSourceResolver* sourceResolver() const;
65 bool fromStream() const;
66
67 private:
68 long m_cRef;
69 IMFSourceResolver *m_sourceResolver;
70 bool m_fromStream;
71 };
72
73 long m_cRef;
74 IUnknown *m_cancelCookie;
75 IMFSourceResolver *m_sourceResolver;
76 IMFMediaSource *m_mediaSource;
77 MFStream *m_stream;
78 QMutex m_mutex;
79};
80
81QT_END_NAMESPACE
82
83#endif
qint64 duration() 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
qint64 position() const override
QIODevice * sourceDevice() const override
bool streamPlaybackSupported() const override
bool isAudioAvailable() const override
void handleError(QMediaPlayer::Error errorCode, const QString &errorString, bool isFatal)
qreal playbackRate() const override
QMediaPlayer::PlaybackState state() const override
QMediaMetaData metaData() const override
const QIODevice * mediaStream() const override
void pause() override
void setActiveTrack(TrackType type, int index) override
void setAudioOutput(QPlatformAudioOutput *output) override
QMediaMetaData trackMetaData(TrackType type, int trackNumber) override
void setPlaybackRate(qreal rate) override
void setMedia(const QUrl &media, QIODevice *stream) override
void play() override
QMediaPlayer::MediaStatus mediaStatus() const override
int activeTrack(TrackType type) override
QUrl media() const override
QMediaTimeRange availablePlaybackRanges() const override
MFPlayerControl(QMediaPlayer *player)
float bufferProgress() const override
void setVideoSink(QVideoSink *sink) override
bool isVideoAvailable() const override
void handleSeekableUpdate(bool seekable)
qint64 duration() const override
qint64 position() const override
void handleDurationUpdate(qint64 duration)
int trackCount(TrackType type) override
void setPosition(qint64 position) override
bool isSeekable() const override
void stop() override
The QAudioFormat class stores audio stream parameter information.
constexpr ChannelConfig channelConfig() const noexcept
Returns the current channel configuration.
constexpr SampleFormat sampleFormat() const noexcept
Returns the current sample format.
Q_MULTIMEDIA_EXPORT void setChannelConfig(ChannelConfig config) noexcept
Sets the channel configuration to config.
constexpr void setChannelCount(int channelCount) noexcept
Sets the channel count to channels.
AudioChannelPosition
Describes the possible audio channel positions.
Q_MULTIMEDIA_EXPORT int channelOffset(AudioChannelPosition channel) const noexcept
Returns the position of a certain audio channel inside an audio frame for the given format.
constexpr void setSampleFormat(SampleFormat f) noexcept
Sets the sample format to format.
friend bool operator==(const QAudioFormat &a, const QAudioFormat &b)
Returns true if audio format a is equal to b, otherwise returns false.
constexpr bool isValid() const noexcept
Returns true if all of the parameters are valid.
constexpr int sampleRate() const noexcept
Returns the current sample rate in Hertz.
static constexpr int NChannelPositions
constexpr int bytesPerFrame() const
Returns the number of bytes required to represent one frame (a sample in each channel) in this format...
static constexpr ChannelConfig channelConfig(Args... channels)
Returns the current channel configuration for the given channels.
friend bool operator!=(const QAudioFormat &a, const QAudioFormat &b)
Returns true if audio format a is not equal to b, otherwise returns false.
SampleFormat
Qt will always expect and use samples in the endianness of the host platform.
constexpr int channelCount() const noexcept
Returns the current channel count value.
constexpr int bytesPerSample() const noexcept
Returns the number of bytes required to represent one sample in this format.
Q_MULTIMEDIA_EXPORT float normalizedSampleValue(const void *sample) const
Normalizes the sample value to a number between -1 and 1.
constexpr void setSampleRate(int sampleRate) noexcept
Sets the sample rate to samplerate in Hertz.
ChannelConfig
\variable QAudioFormat::NChannelPositions
@ ChannelConfigSurround7Dot1
@ ChannelConfigSurround5Dot1
@ ChannelConfigSurround7Dot0
@ ChannelConfigSurround5Dot0
int capture(const QString &fileName) override
virtual ~QWindowsImageCapture()
QImageEncoderSettings imageSettings() const override
void setImageSettings(const QImageEncoderSettings &settings) override
void setCaptureSession(QPlatformMediaCaptureSession *session)
bool isReadyForCapture() const override
QPlatformImageCapture * imageCapture() override
void setCamera(QPlatformCamera *camera) override
void setAudioInput(QPlatformAudioInput *) override
QPlatformCamera * camera() override
QPlatformMediaRecorder * mediaRecorder() override
void setImageCapture(QPlatformImageCapture *imageCapture) override
void setAudioOutput(QPlatformAudioOutput *output) override
void setMediaRecorder(QPlatformMediaRecorder *recorder) override
QWindowsMediaDeviceSession * session() const
void setMetaData(const QMediaMetaData &metaData) override
QMediaRecorder::RecorderState state() const override
void setCaptureSession(QPlatformMediaCaptureSession *session)
QMediaMetaData metaData() const override
bool isLocationWritable(const QUrl &location) const override
qint64 duration() const override
void record(QMediaEncoderSettings &settings) override
QPlatformMediaFormatInfo * createFormatInfo() override
QMaybe< QPlatformCamera * > createCamera(QCamera *camera) override
QMaybe< QPlatformMediaRecorder * > createRecorder(QMediaRecorder *recorder) override
QMaybe< QPlatformMediaCaptureSession * > createCaptureSession() override
QPlatformVideoDevices * createVideoDevices() override
QMaybe< QPlatformMediaPlayer * > createPlayer(QMediaPlayer *parent) override
QMaybe< QPlatformImageCapture * > createImageCapture(QImageCapture *imageCapture) override
QMaybe< QPlatformVideoSink * > createVideoSink(QVideoSink *sink) override
QMaybe< QPlatformAudioDecoder * > createAudioDecoder(QAudioDecoder *decoder) override
STDMETHODIMP_(ULONG) AddRef(void) override
void mediaSourceReady()
IMFMediaSource * mediaSource() const
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObject) override
Combined button and popup list for selecting options.
constexpr int channelConfig(Args... values)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2462