Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows and C++17 fixes #762

Merged
merged 5 commits into from
Jun 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tools/ld-analyse/blacksnranalysisdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ BlackSnrAnalysisDialog::BlackSnrAnalysisDialog(QWidget *parent) :
numberOfFrames = 0;

// Connect to scale changed slot
#ifdef Q_OS_WIN32
// Workaround for linker issue with Qwt on windows
connect(
plot->axisWidget(QwtPlot::xBottom), SIGNAL( scaleDivChanged() ),
this, SLOT( scaleDivChangedSlot() )
);
#else
connect(plot->axisWidget(QwtPlot::xBottom), &QwtScaleWidget::scaleDivChanged, this, &BlackSnrAnalysisDialog::scaleDivChangedSlot);
#endif
}

BlackSnrAnalysisDialog::~BlackSnrAnalysisDialog()
Expand Down
8 changes: 8 additions & 0 deletions tools/ld-analyse/dropoutanalysisdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ DropoutAnalysisDialog::DropoutAnalysisDialog(QWidget *parent) :
numberOfFrames = 0;

// Connect to scale changed slot
#ifdef Q_OS_WIN32
// Workaround for linker issue with Qwt on windows
connect(
plot->axisWidget(QwtPlot::xBottom), SIGNAL( scaleDivChanged() ),
this, SLOT( scaleDivChangedSlot() )
);
#else
connect(plot->axisWidget(QwtPlot::xBottom), &QwtScaleWidget::scaleDivChanged, this, &DropoutAnalysisDialog::scaleDivChangedSlot);
#endif
}

DropoutAnalysisDialog::~DropoutAnalysisDialog()
Expand Down
3 changes: 2 additions & 1 deletion tools/ld-analyse/ld-analyse.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ TEMPLATE = app
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
win32:DEFINES += _USE_MATH_DEFINES

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

CONFIG += c++11
CONFIG += c++17

SOURCES += \
blacksnranalysisdialog.cpp \
Expand Down
8 changes: 8 additions & 0 deletions tools/ld-analyse/visibledropoutanalysisdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ VisibleDropOutAnalysisDialog::VisibleDropOutAnalysisDialog(QWidget *parent) :
numberOfFrames = 0;

// Connect to scale changed slot
#ifdef Q_OS_WIN32
// Workaround for linker issue with Qwt on windows
connect(
plot->axisWidget(QwtPlot::xBottom), SIGNAL( scaleDivChanged() ),
this, SLOT( scaleDivChangedSlot() )
);
#else
connect(plot->axisWidget(QwtPlot::xBottom), &QwtScaleWidget::scaleDivChanged, this, &VisibleDropOutAnalysisDialog::scaleDivChangedSlot);
#endif
}

VisibleDropOutAnalysisDialog::~VisibleDropOutAnalysisDialog()
Expand Down
8 changes: 8 additions & 0 deletions tools/ld-analyse/whitesnranalysisdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ WhiteSnrAnalysisDialog::WhiteSnrAnalysisDialog(QWidget *parent) :
numberOfFrames = 0;

// Connect to scale changed slot
#ifdef Q_OS_WIN32
// Workaround for linker issue with Qwt on windows
connect(
plot->axisWidget(QwtPlot::xBottom), SIGNAL( scaleDivChanged() ),
this, SLOT( scaleDivChangedSlot() )
);
#else
connect(plot->axisWidget(QwtPlot::xBottom), &QwtScaleWidget::scaleDivChanged, this, &WhiteSnrAnalysisDialog::scaleDivChangedSlot);
#endif
}

WhiteSnrAnalysisDialog::~WhiteSnrAnalysisDialog()
Expand Down
12 changes: 3 additions & 9 deletions tools/ld-chroma-decoder/comb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
#include <memory>
#include <utility>

// Definitions of static constexpr data members, for compatibility with
// pre-C++17 compilers
constexpr qint32 Comb::MAX_WIDTH;
constexpr qint32 Comb::MAX_HEIGHT;

// Indexes for the candidates considered in 3D adaptive mode
enum CandidateIndex : qint32 {
CAND_LEFT,
Expand Down Expand Up @@ -144,10 +139,9 @@ void Comb::decodeFrames(const QVector<SourceField> &inputFields, qint32 startInd
// Buffers for the next, current and previous frame.
// Because we only need three of these, we allocate them upfront then
// rotate the pointers below.
std::unique_ptr<FrameBuffer> nextFrameBuffer, currentFrameBuffer, previousFrameBuffer;
nextFrameBuffer.reset(new FrameBuffer(videoParameters, configuration));
currentFrameBuffer.reset(new FrameBuffer(videoParameters, configuration));
previousFrameBuffer.reset(new FrameBuffer(videoParameters, configuration));
auto nextFrameBuffer = std::make_unique<FrameBuffer>(videoParameters, configuration);
auto currentFrameBuffer = std::make_unique<FrameBuffer>(videoParameters, configuration);
auto previousFrameBuffer = std::make_unique<FrameBuffer>(videoParameters, configuration);

// Decode each pair of fields into a frame.
// To support 3D operation, where we need to see three input frames at a time,
Expand Down
4 changes: 0 additions & 4 deletions tools/ld-chroma-decoder/decoderpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@

#include "decoderpool.h"

// Definitions of static constexpr data members, for compatibility with
// pre-C++17 compilers
constexpr qint32 DecoderPool::DEFAULT_BATCH_SIZE;

DecoderPool::DecoderPool(Decoder &_decoder, QString _inputFileName,
LdDecodeMetaData &_ldDecodeMetaData,
OutputWriter::Configuration &_outputConfig, QString _outputFileName,
Expand Down
2 changes: 1 addition & 1 deletion tools/ld-chroma-decoder/encoder/encoder.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QT -= gui

CONFIG += c++11 console
CONFIG += c++17 console
CONFIG -= app_bundle

TARGET = ld-chroma-encoder
Expand Down
2 changes: 1 addition & 1 deletion tools/ld-chroma-decoder/ld-chroma-decoder.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QT -= gui

CONFIG += c++11 console
CONFIG += c++17 console
CONFIG -= app_bundle

# The following define makes your compiler emit warnings if you use
Expand Down
16 changes: 8 additions & 8 deletions tools/ld-chroma-decoder/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,34 +492,34 @@ int main(int argc, char *argv[])
// Select the decoder
std::unique_ptr<Decoder> decoder;
if (decoderName == "pal2d") {
decoder.reset(new PalDecoder(palConfig));
decoder = std::make_unique<PalDecoder>(palConfig);
} else if (decoderName == "transform2d") {
palConfig.chromaFilter = PalColour::transform2DFilter;
if (!loadTransformThresholds(parser, transformThresholdsOption, palConfig)) {
return -1;
}
decoder.reset(new PalDecoder(palConfig));
decoder = std::make_unique<PalDecoder>(palConfig);
} else if (decoderName == "transform3d") {
palConfig.chromaFilter = PalColour::transform3DFilter;
if (!loadTransformThresholds(parser, transformThresholdsOption, palConfig)) {
return -1;
}
decoder.reset(new PalDecoder(palConfig));
decoder = std::make_unique<PalDecoder>(palConfig);
} else if (decoderName == "ntsc1d") {
combConfig.dimensions = 1;
decoder.reset(new NtscDecoder(combConfig));
decoder = std::make_unique<NtscDecoder>(combConfig);
} else if (decoderName == "ntsc2d") {
combConfig.dimensions = 2;
decoder.reset(new NtscDecoder(combConfig));
decoder = std::make_unique<NtscDecoder>(combConfig);
} else if (decoderName == "ntsc3d") {
combConfig.dimensions = 3;
decoder.reset(new NtscDecoder(combConfig));
decoder = std::make_unique<NtscDecoder>(combConfig);
} else if (decoderName == "ntsc3dnoadapt") {
combConfig.dimensions = 3;
combConfig.adaptive = false;
decoder.reset(new NtscDecoder(combConfig));
decoder = std::make_unique<NtscDecoder>(combConfig);
} else if (decoderName == "mono") {
decoder.reset(new MonoDecoder);
decoder = std::make_unique<MonoDecoder>();
} else {
qCritical() << "Unknown decoder" << decoderName;
return -1;
Expand Down
9 changes: 2 additions & 7 deletions tools/ld-chroma-decoder/palcolour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@
filters with more complex coefficients than the report describes.
*/

// Definitions of static constexpr data members, for compatibility with
// pre-C++17 compilers
constexpr qint32 PalColour::MAX_WIDTH;
constexpr qint32 PalColour::FILTER_SIZE;

PalColour::PalColour()
: configurationSet(false)
{
Expand Down Expand Up @@ -123,9 +118,9 @@ void PalColour::updateConfiguration(const LdDecodeMetaData::VideoParameters &_vi
if (configuration.chromaFilter == transform2DFilter || configuration.chromaFilter == transform3DFilter) {
// Create the Transform PAL filter
if (configuration.chromaFilter == transform2DFilter) {
transformPal.reset(new TransformPal2D);
transformPal = std::make_unique<TransformPal2D>();
} else {
transformPal.reset(new TransformPal3D);
transformPal = std::make_unique<TransformPal3D>();
}

// Configure the filter
Expand Down
9 changes: 0 additions & 9 deletions tools/ld-chroma-decoder/transformpal2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@
site (http://www.jim-easterbrook.me.uk/pal/).
*/

// Definitions of static constexpr data members, for compatibility with
// pre-C++17 compilers
constexpr qint32 TransformPal2D::YTILE;
constexpr qint32 TransformPal2D::HALFYTILE;
constexpr qint32 TransformPal2D::XTILE;
constexpr qint32 TransformPal2D::HALFXTILE;
constexpr qint32 TransformPal2D::YCOMPLEX;
constexpr qint32 TransformPal2D::XCOMPLEX;

// Compute one value of the window function, applied to the data blocks before
// the FFT to reduce edge effects. This is a symmetrical raised-cosine
// function, which means that the overlapping inverse-FFT blocks can be summed
Expand Down
12 changes: 0 additions & 12 deletions tools/ld-chroma-decoder/transformpal3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@
site (http://www.jim-easterbrook.me.uk/pal/).
*/

// Definitions of static constexpr data members, for compatibility with
// pre-C++17 compilers
constexpr qint32 TransformPal3D::ZTILE;
constexpr qint32 TransformPal3D::HALFZTILE;
constexpr qint32 TransformPal3D::YTILE;
constexpr qint32 TransformPal3D::HALFYTILE;
constexpr qint32 TransformPal3D::XTILE;
constexpr qint32 TransformPal3D::HALFXTILE;
constexpr qint32 TransformPal3D::ZCOMPLEX;
constexpr qint32 TransformPal3D::YCOMPLEX;
constexpr qint32 TransformPal3D::XCOMPLEX;

// Compute one value of the window function, applied to the data blocks before
// the FFT to reduce edge effects. This is a symmetrical raised-cosine
// function, which means that the overlapping inverse-FFT blocks can be summed
Expand Down
2 changes: 1 addition & 1 deletion tools/ld-disc-stacker/ld-disc-stacker.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QT -= gui

CONFIG += c++11 console
CONFIG += c++17 console
CONFIG -= app_bundle

# You can make your code fail to compile if it uses deprecated APIs.
Expand Down
2 changes: 1 addition & 1 deletion tools/ld-discmap/ld-discmap.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QT -= gui

CONFIG += c++11 console
CONFIG += c++17 console
CONFIG -= app_bundle

# The following define makes your compiler emit warnings if you use
Expand Down
2 changes: 1 addition & 1 deletion tools/ld-dropout-correct/ld-dropout-correct.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QT -= gui

CONFIG += c++11 console
CONFIG += c++17 console
CONFIG -= app_bundle

# The following define makes your compiler emit warnings if you use
Expand Down
2 changes: 1 addition & 1 deletion tools/ld-export-metadata/ld-export-metadata.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QT -= gui

CONFIG += c++11 console
CONFIG += c++17 console
CONFIG -= app_bundle

# The following define makes your compiler emit warnings if you use
Expand Down
2 changes: 1 addition & 1 deletion tools/ld-lds-converter/ld-lds-converter.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QT -= gui

CONFIG += c++11 console
CONFIG += c++17 console
CONFIG -= app_bundle

# The following define makes your compiler emit warnings if you use
Expand Down
2 changes: 1 addition & 1 deletion tools/ld-process-efm/ld-process-efm.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QT -= gui

CONFIG += c++11 console
CONFIG += c++17 console
CONFIG -= app_bundle

# The following define makes your compiler emit warnings if you use
Expand Down
2 changes: 1 addition & 1 deletion tools/ld-process-vbi/ld-process-vbi.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QT -= gui

CONFIG += c++11 console
CONFIG += c++17 console
CONFIG -= app_bundle

# The following define makes your compiler emit warnings if you use
Expand Down
5 changes: 0 additions & 5 deletions tools/ld-process-vbi/vbilinedecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
#include "vbilinedecoder.h"
#include "decoderpool.h"

// Definitions of static constexpr data members, for compatibility with
// pre-C++17 compilers
constexpr qint32 VbiLineDecoder::startFieldLine;
constexpr qint32 VbiLineDecoder::endFieldLine;

VbiLineDecoder::VbiLineDecoder(QAtomicInt& _abort, DecoderPool& _decoderPool, QObject *parent)
: QThread(parent), abort(_abort), decoderPool(_decoderPool)
{
Expand Down
2 changes: 1 addition & 1 deletion tools/ld-process-vits/ld-process-vits.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QT -= gui

CONFIG += c++11 console
CONFIG += c++17 console
CONFIG -= app_bundle

# You can make your code fail to compile if it uses deprecated APIs.
Expand Down
2 changes: 1 addition & 1 deletion tools/library/filter/testfilter/testfilter.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG += c++11 testcase
CONFIG += c++17 testcase
CONFIG -= app_bundle

SOURCES += \
Expand Down
2 changes: 1 addition & 1 deletion tools/library/tbc/testlinenumber/testlinenumber.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG += c++11 testcase
CONFIG += c++17 testcase
CONFIG -= app_bundle

SOURCES += \
Expand Down
2 changes: 1 addition & 1 deletion tools/library/tbc/testmetadata/testmetadata.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG += c++11 testcase
CONFIG += c++17 testcase
CONFIG -= app_bundle

SOURCES += \
Expand Down
2 changes: 1 addition & 1 deletion tools/library/tbc/testvbidecoder/testvbidecoder.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG += c++11 testcase
CONFIG += c++17 testcase
CONFIG -= app_bundle

SOURCES += \
Expand Down