Adapt to changes in c++utilities

This commit is contained in:
Martchus 2019-06-12 20:40:45 +02:00
parent 5ad00a083c
commit c9e1dde70b
28 changed files with 73 additions and 70 deletions

View File

@ -3,7 +3,7 @@
// NOTE: The AAC parser is still WIP. It does not work yet and its API/ABI may change even in patch releases.
#include <c++utilities/application/global.h>
#include "../global.h"
#include <cstdint>
@ -11,18 +11,18 @@ namespace TagParser {
/// \cond
struct LIB_EXPORT AacHcb {
struct TAG_PARSER_EXPORT AacHcb {
std::uint8_t offset;
std::uint8_t extraBits;
};
struct LIB_EXPORT AacHcb2Pair {
struct TAG_PARSER_EXPORT AacHcb2Pair {
std::uint8_t bits;
std::int8_t x;
std::int8_t y;
};
struct LIB_EXPORT AacHcb2Quad {
struct TAG_PARSER_EXPORT AacHcb2Quad {
std::uint8_t bits;
std::int8_t x;
std::int8_t y;
@ -30,12 +30,12 @@ struct LIB_EXPORT AacHcb2Quad {
std::int8_t w;
};
struct LIB_EXPORT AacHcbBinPair {
struct TAG_PARSER_EXPORT AacHcbBinPair {
std::uint8_t isLeaf;
std::int8_t data[2];
};
struct LIB_EXPORT AacHcbBinQuad {
struct TAG_PARSER_EXPORT AacHcbBinQuad {
std::uint8_t isLeaf;
std::int8_t data[4];
};

View File

@ -1181,7 +1181,7 @@ std::uint16_t AacFrameElementParser::parsePsData(std::shared_ptr<AacPsInfo> &ps,
std::uint16_t AacFrameElementParser::parseDrmPsData(std::shared_ptr<AacDrmPsInfo> &drmPs)
{
VAR_UNUSED(drmPs)
CPP_UTILITIES_UNUSED(drmPs)
throw NotImplementedException(); // TODO
}
@ -1310,7 +1310,7 @@ shared_ptr<AacSbrInfo> AacFrameElementParser::makeSbrInfo(std::uint8_t sbrElemen
void AacFrameElementParser::parseSbrExtensionData(std::uint8_t sbrElement, std::uint16_t count, bool crcFlag)
{
VAR_UNUSED(count);
CPP_UTILITIES_UNUSED(count);
//uint16 alignBitCount = 0;
std::shared_ptr<AacSbrInfo> &sbr = m_sbrElements[sbrElement];
if (m_psResetFlag) {

View File

@ -3,6 +3,8 @@
// NOTE: The AAC parser is still WIP. It does not work yet and its API/ABI may change even in patch releases.
#include "../global.h"
#include <c++utilities/io/bitreader.h>
#include <cstdint>
@ -72,7 +74,7 @@ namespace AacSbrExtensionIds {
enum KnownIds : std::uint8_t { DrmParametricStereo = 0, Ps = 2 };
}
struct LIB_EXPORT AacLtpInfo {
struct TAG_PARSER_EXPORT AacLtpInfo {
AacLtpInfo();
std::uint8_t lastBand;
std::uint8_t dataPresent;
@ -85,7 +87,7 @@ struct LIB_EXPORT AacLtpInfo {
std::uint8_t shortLag[8];
};
struct LIB_EXPORT AacPredictorInfo {
struct TAG_PARSER_EXPORT AacPredictorInfo {
AacPredictorInfo();
std::uint8_t maxSfb;
std::uint8_t reset;
@ -93,7 +95,7 @@ struct LIB_EXPORT AacPredictorInfo {
std::uint8_t predictionUsed[aacMaxSfb];
};
struct LIB_EXPORT AacPulseInfo {
struct TAG_PARSER_EXPORT AacPulseInfo {
AacPulseInfo();
std::uint8_t count;
std::uint8_t startSfb;
@ -101,7 +103,7 @@ struct LIB_EXPORT AacPulseInfo {
std::uint8_t amp[4];
};
struct LIB_EXPORT AacTnsInfo {
struct TAG_PARSER_EXPORT AacTnsInfo {
AacTnsInfo();
std::uint8_t filt[8];
std::uint8_t coefRes[8];
@ -112,7 +114,7 @@ struct LIB_EXPORT AacTnsInfo {
std::uint8_t coef[8][4][32];
};
struct LIB_EXPORT AacSsrInfo {
struct TAG_PARSER_EXPORT AacSsrInfo {
AacSsrInfo();
std::uint8_t maxBand;
std::uint8_t adjustNum[4][8];
@ -120,7 +122,7 @@ struct LIB_EXPORT AacSsrInfo {
std::uint8_t aloccode[4][8][8];
};
struct LIB_EXPORT AacDrcInfo {
struct TAG_PARSER_EXPORT AacDrcInfo {
AacDrcInfo();
std::uint8_t present;
std::uint8_t bandCount;
@ -134,7 +136,7 @@ struct LIB_EXPORT AacDrcInfo {
std::uint8_t additionalExcludedChannels[aacMaxChannels];
};
struct LIB_EXPORT AacPsInfo {
struct TAG_PARSER_EXPORT AacPsInfo {
AacPsInfo();
std::uint8_t headerRead;
std::uint8_t use34HybridBands;
@ -145,7 +147,7 @@ struct LIB_EXPORT AacPsInfo {
// TODO
};
struct LIB_EXPORT AacDrmPsInfo {
struct TAG_PARSER_EXPORT AacDrmPsInfo {
AacDrmPsInfo();
std::uint8_t headerRead;
std::uint8_t use34HybridBands;
@ -156,7 +158,7 @@ struct LIB_EXPORT AacDrmPsInfo {
// TODO
};
struct LIB_EXPORT AacSbrInfo {
struct TAG_PARSER_EXPORT AacSbrInfo {
AacSbrInfo(std::uint8_t sbrElementType, std::uint16_t samplingFrequency, std::uint16_t frameLength, bool isDrm);
std::uint8_t aacElementId;
@ -306,7 +308,7 @@ struct LIB_EXPORT AacSbrInfo {
std::uint8_t bsDfNoise[2][3];
};
struct LIB_EXPORT AacProgramConfig {
struct TAG_PARSER_EXPORT AacProgramConfig {
AacProgramConfig();
std::uint8_t elementInstanceTag;
std::uint8_t objectType;
@ -345,7 +347,7 @@ struct LIB_EXPORT AacProgramConfig {
std::uint8_t cpeChannel[16];
};
struct LIB_EXPORT AacIcsInfo {
struct TAG_PARSER_EXPORT AacIcsInfo {
AacIcsInfo();
std::uint8_t maxSfb;
@ -401,7 +403,7 @@ struct LIB_EXPORT AacIcsInfo {
std::uint16_t dpcmNoiseLastPos;
};
class LIB_EXPORT AacFrameElementParser {
class TAG_PARSER_EXPORT AacFrameElementParser {
public:
AacFrameElementParser(std::uint8_t audioObjectId, std::uint8_t samplingFrequencyIndex, std::uint8_t extensionSamplingFrequencyIndex,
std::uint8_t channelConfig, std::uint16_t frameLength = 1024);

View File

@ -182,7 +182,7 @@ bool AbstractContainer::supportsTrackModifications() const
*/
ElementPosition AbstractContainer::determineIndexPosition(Diagnostics &diag) const
{
VAR_UNUSED(diag);
CPP_UTILITIES_UNUSED(diag);
return ElementPosition::Keep;
}
@ -196,7 +196,7 @@ ElementPosition AbstractContainer::determineIndexPosition(Diagnostics &diag) con
*/
void AbstractContainer::internalParseHeader(Diagnostics &diag)
{
VAR_UNUSED(diag);
CPP_UTILITIES_UNUSED(diag);
throw NotImplementedException();
}
@ -210,7 +210,7 @@ void AbstractContainer::internalParseHeader(Diagnostics &diag)
*/
void AbstractContainer::internalParseTags(Diagnostics &diag)
{
VAR_UNUSED(diag);
CPP_UTILITIES_UNUSED(diag);
throw NotImplementedException();
}
@ -224,7 +224,7 @@ void AbstractContainer::internalParseTags(Diagnostics &diag)
*/
void AbstractContainer::internalParseTracks(Diagnostics &diag)
{
VAR_UNUSED(diag);
CPP_UTILITIES_UNUSED(diag);
throw NotImplementedException();
}
@ -238,7 +238,7 @@ void AbstractContainer::internalParseTracks(Diagnostics &diag)
*/
void AbstractContainer::internalParseChapters(Diagnostics &diag)
{
VAR_UNUSED(diag);
CPP_UTILITIES_UNUSED(diag);
throw NotImplementedException();
}
@ -252,7 +252,7 @@ void AbstractContainer::internalParseChapters(Diagnostics &diag)
*/
void AbstractContainer::internalParseAttachments(Diagnostics &diag)
{
VAR_UNUSED(diag);
CPP_UTILITIES_UNUSED(diag);
throw NotImplementedException();
}
@ -266,8 +266,8 @@ void AbstractContainer::internalParseAttachments(Diagnostics &diag)
*/
void AbstractContainer::internalMakeFile(Diagnostics &diag, AbortableProgressFeedback &progress)
{
VAR_UNUSED(diag);
VAR_UNUSED(progress);
CPP_UTILITIES_UNUSED(diag);
CPP_UTILITIES_UNUSED(progress);
throw NotImplementedException();
}
@ -293,7 +293,7 @@ Tag *AbstractContainer::createTag(const TagTarget &)
*/
Tag *AbstractContainer::tag(size_t index)
{
VAR_UNUSED(index);
CPP_UTILITIES_UNUSED(index);
return nullptr;
}
@ -322,7 +322,7 @@ size_t AbstractContainer::tagCount() const
*/
bool AbstractContainer::removeTag(Tag *tag)
{
VAR_UNUSED(tag);
CPP_UTILITIES_UNUSED(tag);
return false;
}
@ -351,7 +351,7 @@ void AbstractContainer::removeAllTags()
*/
ElementPosition AbstractContainer::determineTagPosition(Diagnostics &diag) const
{
VAR_UNUSED(diag);
CPP_UTILITIES_UNUSED(diag);
return ElementPosition::Keep;
}
@ -362,7 +362,7 @@ ElementPosition AbstractContainer::determineTagPosition(Diagnostics &diag) const
*/
AbstractTrack *AbstractContainer::track(size_t index)
{
VAR_UNUSED(index);
CPP_UTILITIES_UNUSED(index);
return nullptr;
}
@ -390,7 +390,7 @@ size_t AbstractContainer::trackCount() const
*/
bool AbstractContainer::removeTrack(AbstractTrack *track)
{
VAR_UNUSED(track);
CPP_UTILITIES_UNUSED(track);
return false;
}
@ -418,7 +418,7 @@ void AbstractContainer::removeAllTracks()
*/
AbstractChapter *AbstractContainer::chapter(size_t index)
{
VAR_UNUSED(index);
CPP_UTILITIES_UNUSED(index);
return nullptr;
}
@ -447,7 +447,7 @@ AbstractAttachment *AbstractContainer::createAttachment()
*/
AbstractAttachment *AbstractContainer::attachment(size_t index)
{
VAR_UNUSED(index);
CPP_UTILITIES_UNUSED(index);
return nullptr;
}

View File

@ -17,7 +17,7 @@ namespace TagParser {
void AdtsStream::internalParseHeader(Diagnostics &diag)
{
VAR_UNUSED(diag)
CPP_UTILITIES_UNUSED(diag)
//static const string context("parsing ADTS frame header");
if (!m_istream) {

View File

@ -23,9 +23,9 @@ namespace TagParser {
*/
void Av1Configuration::parse(BinaryReader &reader, std::uint64_t maxSize, Diagnostics &diag)
{
VAR_UNUSED(reader)
VAR_UNUSED(maxSize)
VAR_UNUSED(diag)
CPP_UTILITIES_UNUSED(reader)
CPP_UTILITIES_UNUSED(maxSize)
CPP_UTILITIES_UNUSED(diag)
throw NotImplementedException();
}

View File

@ -25,7 +25,7 @@ namespace TagParser {
*/
void AvcConfiguration::parse(BinaryReader &reader, std::uint64_t maxSize, Diagnostics &diag)
{
VAR_UNUSED(diag)
CPP_UTILITIES_UNUSED(diag)
if (maxSize < 7) {
throw TruncatedDataException();
}

View File

@ -8,7 +8,7 @@
namespace CppUtilities {
class BinaryReader;
class BitReader;
} // namespace IoUtilities
} // namespace CppUtilities
namespace TagParser {

View File

@ -295,7 +295,7 @@ std::streamoff FlacStream::makeHeader(ostream &outputStream, Diagnostics &diag)
*/
void FlacStream::makePadding(ostream &stream, std::uint32_t size, bool isLast, Diagnostics &diag)
{
VAR_UNUSED(diag)
CPP_UTILITIES_UNUSED(diag)
// make header
FlacMetaDataBlockHeader header;

View File

@ -16,7 +16,7 @@
namespace CppUtilities {
class BinaryReader;
class BinaryWriter;
} // namespace IoUtilities
} // namespace CppUtilities
namespace TagParser {

View File

@ -10,8 +10,8 @@
#define TAG_PARSER_EXPORT
#define TAG_PARSER_IMPORT
#else
#define TAG_PARSER_EXPORT LIB_EXPORT
#define TAG_PARSER_IMPORT LIB_IMPORT
#define TAG_PARSER_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT
#define TAG_PARSER_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT
#endif
/*!

View File

@ -50,7 +50,7 @@ bool Id3v1Tag::canEncodingBeUsed(TagTextEncoding encoding) const
*/
void Id3v1Tag::parse(std::istream &stream, Diagnostics &diag)
{
VAR_UNUSED(diag)
CPP_UTILITIES_UNUSED(diag)
char buffer[128];
stream.read(buffer, 128);
if (buffer[0] != 0x54 || buffer[1] != 0x41 || buffer[2] != 0x47) {
@ -320,7 +320,7 @@ void Id3v1Tag::writeValue(const TagValue &value, size_t length, char *buffer, os
valueLength -= 3;
break;
}
FALLTHROUGH;
[[fallthrough]];
default:
diag.emplace_back(DiagLevel::Warning, "The used encoding is unlikely to be supported by other software.", "making ID3v1 tag field");
}

View File

@ -620,7 +620,7 @@ Id3v2TagMaker::Id3v2TagMaker(Id3v2Tag &tag, Diagnostics &diag)
*/
void Id3v2TagMaker::make(std::ostream &stream, std::uint32_t padding, Diagnostics &diag)
{
VAR_UNUSED(diag)
CPP_UTILITIES_UNUSED(diag)
BinaryWriter writer(&stream);

View File

@ -20,7 +20,7 @@ namespace TagParser {
*/
void IvfFrame::parseHeader(CppUtilities::BinaryReader &reader, Diagnostics &diag)
{
VAR_UNUSED(diag)
CPP_UTILITIES_UNUSED(diag)
startOffset = static_cast<std::uint64_t>(reader.stream()->tellg());
size = reader.readUInt32BE();
timestamp = reader.readUInt64BE();

View File

@ -110,7 +110,7 @@ void MatroskaSeekInfo::parse(EbmlElement *seekHeadElement, Diagnostics &diag)
*/
void MatroskaSeekInfo::make(ostream &stream, Diagnostics &diag)
{
VAR_UNUSED(diag)
CPP_UTILITIES_UNUSED(diag)
std::uint64_t totalSize = 0;
char buff0[8];

View File

@ -556,7 +556,7 @@ MatroskaTrackHeaderMaker::MatroskaTrackHeaderMaker(const MatroskaTrack &track, D
: m_track(track)
, m_dataSize(0)
{
VAR_UNUSED(diag);
CPP_UTILITIES_UNUSED(diag);
// calculate size for recognized elements
m_dataSize += 2 + 1 + EbmlElement::calculateUIntegerLength(m_track.id());

View File

@ -705,7 +705,7 @@ calculatePadding:
origMediaDataOffsets.push_back(static_cast<std::int64_t>(level0Atom->startOffset()));
newMediaDataOffsets.push_back(outputStream.tellp());
}
FALLTHROUGH;
[[fallthrough]];
default:
// update status
progress.updateStep("Writing atom: " + level0Atom->idToString());

View File

@ -233,7 +233,7 @@ bool Mp4Tag::setValue(KnownField field, const TagValue &value)
if (!this->value(Mp4TagExtendedMeanIds::iTunes, Mp4TagExtendedNameIds::label).isEmpty()) {
setValue(Mp4TagExtendedMeanIds::iTunes, Mp4TagExtendedNameIds::label, value);
}
FALLTHROUGH;
[[fallthrough]];
default:
return FieldMapBasedTag<Mp4Tag>::setValue(field, value);
}

View File

@ -1054,8 +1054,8 @@ void Mp4Track::addInfo(const AvcConfiguration &avcConfig, AbstractTrack &track)
*/
void Mp4Track::addInfo(const Av1Configuration &av1Config, AbstractTrack &track)
{
VAR_UNUSED(av1Config)
VAR_UNUSED(track)
CPP_UTILITIES_UNUSED(av1Config)
CPP_UTILITIES_UNUSED(track)
throw NotImplementedException();
}
@ -1067,7 +1067,7 @@ void Mp4Track::addInfo(const Av1Configuration &av1Config, AbstractTrack &track)
*/
void Mp4Track::bufferTrackAtoms(Diagnostics &diag)
{
VAR_UNUSED(diag)
CPP_UTILITIES_UNUSED(diag)
if (m_tkhdAtom) {
m_tkhdAtom->makeBuffer();
@ -1090,7 +1090,7 @@ void Mp4Track::bufferTrackAtoms(Diagnostics &diag)
*/
std::uint64_t Mp4Track::requiredSize(Diagnostics &diag) const
{
VAR_UNUSED(diag)
CPP_UTILITIES_UNUSED(diag)
// add size of
// ... trak header

View File

@ -267,7 +267,7 @@ bool OggIterator::resyncAt(std::uint64_t offset)
stream().seekg(currentOffset);
}
}
FALLTHROUGH;
[[fallthrough]];
default:
lettersFound = 0;
}

View File

@ -81,7 +81,7 @@ std::uint32_t OggPage::computeChecksum(istream &stream, std::uint64_t startOffse
case 22:
// bytes 22, 23, 24, 25 hold denoted checksum and must be set to zero
stream.seekg(4, ios_base::cur);
FALLTHROUGH;
[[fallthrough]];
case 23:
case 24:
case 25:

View File

@ -21,7 +21,8 @@ namespace TagParser {
class TAG_PARSER_EXPORT PositionInSet {
public:
constexpr PositionInSet(std::int32_t position = 0, std::int32_t total = 0);
template <typename StringType = std::string, CppUtilities::Traits::EnableIfAny<CppUtilities::Traits::IsSpecializationOf<StringType, std::basic_string>> * = nullptr>
template <typename StringType = std::string,
CppUtilities::Traits::EnableIfAny<CppUtilities::Traits::IsSpecializationOf<StringType, std::basic_string>> * = nullptr>
PositionInSet(const StringType &numericString);
constexpr std::int32_t position() const;
@ -29,7 +30,8 @@ public:
constexpr bool isNull() const;
constexpr bool operator==(const PositionInSet &other) const;
template <typename StringType = std::string, CppUtilities::Traits::EnableIfAny<CppUtilities::Traits::IsSpecializationOf<StringType, std::basic_string>> * = nullptr>
template <typename StringType = std::string,
CppUtilities::Traits::EnableIfAny<CppUtilities::Traits::IsSpecializationOf<StringType, std::basic_string>> * = nullptr>
StringType toString() const;
private:

View File

@ -138,7 +138,7 @@ public:
static void stripBom(const char *&text, std::size_t &length, TagTextEncoding encoding);
static void ensureHostByteOrder(std::u16string &u16str, TagTextEncoding currentEncoding);
template <typename ContainerType,
CppUtilities:: Traits::EnableIf<CppUtilities::Traits::IsIteratable<ContainerType>,
CppUtilities::Traits::EnableIf<CppUtilities::Traits::IsIteratable<ContainerType>,
std::is_same<typename std::add_const<typename std::remove_pointer<typename ContainerType::value_type>::type>::type, const TagValue>>
* = nullptr>
static std::vector<std::string> toStrings(const ContainerType &values, TagTextEncoding encoding = TagTextEncoding::Utf8);
@ -600,7 +600,7 @@ inline TagTextEncoding TagValue::descriptionEncoding() const
* \sa toString()
*/
template <typename ContainerType,
CppUtilities:: Traits::EnableIf<CppUtilities::Traits::IsIteratable<ContainerType>,
CppUtilities::Traits::EnableIf<CppUtilities::Traits::IsIteratable<ContainerType>,
std::is_same<typename std::add_const<typename std::remove_pointer<typename ContainerType::value_type>::type>::type, const TagValue>> *>
std::vector<std::string> TagValue::toStrings(const ContainerType &values, TagTextEncoding encoding)
{

View File

@ -23,4 +23,4 @@ std::ostream &operator<<(std::ostream &os, const TagParser::TagTextEncoding &enc
return os;
}
} // namespace TestUtilities
} // namespace CppUtilities

View File

@ -47,6 +47,6 @@ inline std::ostream &operator<<(std::ostream &os, const TagParser::DiagMessage &
return os << diagMessage.levelName() << ':' << ' ' << diagMessage.message() << ' ' << '(' << diagMessage.context() << ')';
}
} // namespace TestUtilities
} // namespace CppUtilities
#endif // TAGPARSER_TEST_HELPER

View File

@ -729,8 +729,7 @@ void OverallTests::testMkvMakingWithDifferentSettings()
makeFile(workingCopyPath("matroska_wave1/test6.mkv"), modifyRoutine, &OverallTests::checkMkvTestfile6);
makeFile(workingCopyPath("matroska_wave1/test7.mkv"), modifyRoutine, &OverallTests::checkMkvTestfile7);
makeFile(workingCopyPath("matroska_wave1/test8.mkv"), modifyRoutine, &OverallTests::checkMkvTestfile8);
makeFile(workingCopyPath("mtx-test-data/mkv/handbrake-chapters-2.mkv"), modifyRoutine,
&OverallTests::checkMkvTestfileHandbrakeChapters);
makeFile(workingCopyPath("mtx-test-data/mkv/handbrake-chapters-2.mkv"), modifyRoutine, &OverallTests::checkMkvTestfileHandbrakeChapters);
}
}

View File

@ -591,8 +591,8 @@ void OverallTests::testMp4Making()
void (OverallTests::*modifyRoutine)(void) = (m_mode & RemoveTagOrTrack) ? &OverallTests::removeAllTags : &OverallTests::setMp4TestMetaData;
makeFile(workingCopyPath("mtx-test-data/mp4/10-DanseMacabreOp.40.m4a"), modifyRoutine, &OverallTests::checkMp4Testfile1);
makeFile(workingCopyPath("mtx-test-data/mp4/1080p-DTS-HD-7.1.mp4"), modifyRoutine, &OverallTests::checkMp4Testfile2);
makeFile(workingCopyPath("mtx-test-data/mp4/dash/dragon-age-inquisition-H1LkM6IVlm4-video.mp4"), modifyRoutine,
&OverallTests::checkMp4Testfile3);
makeFile(
workingCopyPath("mtx-test-data/mp4/dash/dragon-age-inquisition-H1LkM6IVlm4-video.mp4"), modifyRoutine, &OverallTests::checkMp4Testfile3);
makeFile(workingCopyPath("mtx-test-data/alac/othertest-itunes.m4a"), modifyRoutine, &OverallTests::checkMp4Testfile4);
makeFile(workingCopyPath("mtx-test-data/aac/he-aacv2-ps.m4a"), modifyRoutine, &OverallTests::checkMp4Testfile5);
makeFile(workingCopyPath("mp4/android-8.1-camera-recoding.mp4"), modifyRoutine, &OverallTests::checkMp4Testfile7);

View File

@ -6,7 +6,7 @@
namespace CppUtilities {
class BinaryReader;
class BinaryWriter;
} // namespace IoUtilities
} // namespace CppUtilities
namespace TagParser {