Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qffmpegresampler_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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#ifndef QFFMPEGRESAMPLER_P_H
4#define QFFMPEGRESAMPLER_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include "qaudiobuffer.h"
18#include "qffmpeg_p.h"
19
21
22namespace QFFmpeg
23{
24
25class Codec;
26
28{
29public:
30 Resampler(const Codec *codec, const QAudioFormat &outputFormat);
32
33 QAudioBuffer resample(const AVFrame *frame);
34 qint64 samplesProcessed() const { return m_samplesProcessed; }
37
38private:
39 int adjustMaxOutSamples(const AVFrame *frame);
40
41private:
42 QAudioFormat m_outputFormat;
43 SwrContext *resampler = nullptr;
44 qint64 m_samplesProcessed = 0;
45 qint64 m_endCompensationSample = std::numeric_limits<qint64>::min();
46 qint32 m_sampleCompensationDelta = 0;
47};
48
49}
50
52
53#endif
\inmodule QtMultimedia
The QAudioFormat class stores audio stream parameter information.
qint64 samplesProcessed() const
void setSampleCompensation(qint32 delta, quint32 distance)
qint32 activeSampleCompensationDelta() const
QAudioBuffer resample(const AVFrame *frame)
Resampler(const Codec *codec, const QAudioFormat &outputFormat)
Combined button and popup list for selecting options.
QMediaFormat::AudioCodec codec
GLsizei GLsizei GLfloat distance
unsigned int quint32
Definition qtypes.h:45
int qint32
Definition qtypes.h:44
long long qint64
Definition qtypes.h:55
QFrame frame
[0]