Remove some constructors

Signed-off-by: Rosen Penev <rosenp@gmail.com>
main
Rosen Penev 2 years ago
parent 2205a14a06
commit 3fe6d78014

@ -49,11 +49,15 @@ enum matroskaTypeEnum : char {
Master = 'm', Master = 'm',
Float = 'f', Float = 'f',
Utf8 = '8', Utf8 = '8',
UndefinedType = 'z' UndefinedType = 'z',
}; };
enum matroskaProcessEnum : char { Process = 'p', Skip = 's', Composite = 'c', Undefined = 'u' }; enum matroskaProcessEnum : char {
Process = 'p',
Skip = 's',
Composite = 'c',
Undefined = 'u',
};
struct MatroskaTag { struct MatroskaTag {
uint64_t _id; uint64_t _id;
@ -72,6 +76,10 @@ struct MatroskaTag {
_process(matroskaProcessEnum::Undefined) { _process(matroskaProcessEnum::Undefined) {
} }
bool operator==(uint64_t id) const {
return id == _id;
}
bool isSkipped() const { bool isSkipped() const {
return _process == Skip; return _process == Skip;
} }
@ -84,17 +92,6 @@ struct MatroskaTag {
<< "]\n"; << "]\n";
} }
}; };
/// @brief Utility function to search into std::array of pairs
/// @return the searched pair if exist,else nullptr
template <size_t N>
[[nodiscard]] const MatroskaTag* findTag(const std::array<MatroskaTag, N>& src, const uint64_t& key) {
const auto rc = std::find_if(src.begin(), src.end(), [&key](const MatroskaTag& tag) { return tag._id == key; });
// the return value is of type "const MatroskaTag*", so we return the adress of the content of the input
// iterator return by find_if
return rc == std::end(src) ? nullptr : &(*rc);
}
} // namespace Internal } // namespace Internal
/*! /*!

@ -30,11 +30,9 @@ class EXIV2API Key {
//! @name Creators //! @name Creators
//@{ //@{
Key() = default;
//! Destructor //! Destructor
virtual ~Key() = default; virtual ~Key() = default;
//@} //@}
Key(const Key&) = default;
//! @name Accessors //! @name Accessors
//@{ //@{
/*! /*!
@ -74,6 +72,8 @@ class EXIV2API Key {
//@} //@}
protected: protected:
Key() = default;
Key(const Key&) = default;
//! @name Manipulators //! @name Manipulators
//@{ //@{
/*! /*!
@ -102,10 +102,6 @@ class EXIV2API Metadatum {
public: public:
//! @name Creators //! @name Creators
//@{ //@{
//! Default Constructor
Metadatum() = default;
//! Copy constructor
Metadatum(const Metadatum&) = default;
//! Destructor //! Destructor
virtual ~Metadatum() = default; virtual ~Metadatum() = default;
//@} //@}
@ -258,6 +254,8 @@ class EXIV2API Metadatum {
//@} //@}
protected: protected:
Metadatum() = default;
Metadatum(const Metadatum&) = default;
//! @name Manipulators //! @name Manipulators
//@{ //@{
/*! /*!

@ -41,15 +41,11 @@ struct EXIV2API XmpPropertyInfo {
struct EXIV2API XmpNsInfo { struct EXIV2API XmpNsInfo {
//! For comparison with prefix //! For comparison with prefix
struct Prefix { struct Prefix {
//! Constructor.
explicit Prefix(std::string prefix);
//! The prefix string. //! The prefix string.
std::string prefix_; std::string prefix_;
}; };
//! For comparison with namespace //! For comparison with namespace
struct Ns { struct Ns {
//! Constructor.
explicit Ns(std::string ns);
//! The namespace string //! The namespace string
std::string ns_; std::string ns_;
}; };

@ -39,7 +39,6 @@ class EXIV2API Value {
//@{ //@{
//! Constructor, taking a type id to initialize the base class with //! Constructor, taking a type id to initialize the base class with
explicit Value(TypeId typeId); explicit Value(TypeId typeId);
Value(const Value&) = default;
//! Virtual destructor. //! Virtual destructor.
virtual ~Value() = default; virtual ~Value() = default;
//@} //@}
@ -223,6 +222,7 @@ class EXIV2API Value {
static UniquePtr create(TypeId typeId); static UniquePtr create(TypeId typeId);
protected: protected:
Value(const Value&) = default;
/*! /*!
@brief Assignment operator. Protected so that it can only be used @brief Assignment operator. Protected so that it can only be used
by subclasses but not directly. by subclasses but not directly.
@ -322,10 +322,6 @@ class EXIV2API StringValueBase : public Value {
explicit StringValueBase(TypeId typeId); explicit StringValueBase(TypeId typeId);
//! Constructor for subclasses //! Constructor for subclasses
StringValueBase(TypeId typeId, const std::string& buf); StringValueBase(TypeId typeId, const std::string& buf);
//! Copy constructor
StringValueBase(const StringValueBase&) = default;
//! Virtual destructor.
~StringValueBase() override = default;
//@} //@}
//! @name Manipulators //! @name Manipulators
@ -364,8 +360,6 @@ class EXIV2API StringValueBase : public Value {
//@} //@}
protected: protected:
//! Assignment operator.
StringValueBase& operator=(const StringValueBase&);
//! Internal virtual copy constructor. //! Internal virtual copy constructor.
StringValueBase* clone_() const override = 0; StringValueBase* clone_() const override = 0;
@ -471,8 +465,6 @@ class EXIV2API CommentValue : public StringValueBase {
enum CharsetId { ascii, jis, unicode, undefined, invalidCharsetId, lastCharsetId }; enum CharsetId { ascii, jis, unicode, undefined, invalidCharsetId, lastCharsetId };
//! Information pertaining to the defined character sets //! Information pertaining to the defined character sets
struct CharsetTable { struct CharsetTable {
//! Constructor
constexpr CharsetTable(CharsetId charsetId, const char* name, const char* code);
CharsetId charsetId_; //!< Charset id CharsetId charsetId_; //!< Charset id
const char* name_; //!< Name of the charset const char* name_; //!< Name of the charset
const char* code_; //!< Code of the charset const char* code_; //!< Code of the charset

@ -101,7 +101,6 @@ class FileIo::Impl {
// TYPES // TYPES
//! Simple struct stat wrapper for internal use //! Simple struct stat wrapper for internal use
struct StructStat { struct StructStat {
StructStat() = default;
mode_t st_mode{0}; //!< Permissions mode_t st_mode{0}; //!< Permissions
off_t st_size{0}; //!< Size off_t st_size{0}; //!< Size
}; };

@ -254,283 +254,329 @@ enum matroskaEnum : uint64_t {
Cluster = 0xf43b675 Cluster = 0xf43b675
}; };
const std::array<MatroskaTag, 198> matroskaTags = { const MatroskaTag matroskaTags[] = {
MatroskaTag(ChapterDisplay, "ChapterDisplay", Master, Composite), {ChapterDisplay, "ChapterDisplay", Master, Composite},
MatroskaTag(TrackType, "TrackType", Boolean, Process), {TrackType, "TrackType", Boolean, Process},
MatroskaTag(ChapterString, "ChapterString", String, Skip), {ChapterString, "ChapterString", String, Skip},
MatroskaTag(Video_Audio_CodecID, "Video.Audio.CodecID", InternalField, Skip), // process {Video_Audio_CodecID, "Video.Audio.CodecID", InternalField, Skip}, // process
MatroskaTag(TrackDefault, "TrackDefault", Boolean, Process), {TrackDefault, "TrackDefault", Boolean, Process},
MatroskaTag(ChapterTrackNumber, "ChapterTrackNumber", UInteger, Skip), {ChapterTrackNumber, "ChapterTrackNumber", UInteger, Skip},
MatroskaTag(Slices, "Slices", Master, Composite), {Slices, "Slices", Master, Composite},
MatroskaTag(ChapterTrack, "ChapterTrack", Master, Composite), {ChapterTrack, "ChapterTrack", Master, Composite},
MatroskaTag(ChapterTimeStart, "ChapterTimeStart", UInteger, Skip), {ChapterTimeStart, "ChapterTimeStart", UInteger, Skip},
MatroskaTag(ChapterTimeEnd, "ChapterTimeEnd", UInteger, Skip), {ChapterTimeEnd, "ChapterTimeEnd", UInteger, Skip},
MatroskaTag(CueRefTime, "CueRefTime", UInteger, Skip), {CueRefTime, "CueRefTime", UInteger, Skip},
MatroskaTag(CueRefCluster, "CueRefCluster", UInteger, Skip), {CueRefCluster, "CueRefCluster", UInteger, Skip},
MatroskaTag(ChapterFlagHidden, "ChapterFlagHidden", UInteger, Skip), {ChapterFlagHidden, "ChapterFlagHidden", UInteger, Skip},
MatroskaTag(Xmp_video_VideoScanTpye, "Xmp.video.VideoScanTpye", InternalField, Process), {Xmp_video_VideoScanTpye, "Xmp.video.VideoScanTpye", InternalField, Process},
MatroskaTag(BlockDuration, "BlockDuration", UInteger, Skip), {BlockDuration, "BlockDuration", UInteger, Skip},
MatroskaTag(TrackLacing, "TrackLacing", Boolean, Process), {TrackLacing, "TrackLacing", Boolean, Process},
MatroskaTag(Xmp_audio_ChannelType, "Xmp.audio.ChannelType", InternalField, Process), {Xmp_audio_ChannelType, "Xmp.audio.ChannelType", InternalField, Process},
MatroskaTag(BlockGroup, "BlockGroup", Master, Composite), {BlockGroup, "BlockGroup", Master, Composite},
MatroskaTag(Block, "Block", Binary, Skip), {Block, "Block", Binary, Skip},
MatroskaTag(BlockVirtual, "BlockVirtual", Binary, Skip), {BlockVirtual, "BlockVirtual", Binary, Skip},
MatroskaTag(SimpleBlock, "SimpleBlock", Binary, Skip), {SimpleBlock, "SimpleBlock", Binary, Skip},
MatroskaTag(CodecState, "CodecState", Binary, Skip), {CodecState, "CodecState", Binary, Skip},
MatroskaTag(BlockAdditional, "BlockAdditional", UInteger, Skip), {BlockAdditional, "BlockAdditional", UInteger, Skip},
MatroskaTag(BlockMore, "BlockMore", Master, Composite), {BlockMore, "BlockMore", Master, Composite},
MatroskaTag(Position, "Position", UInteger, Skip), {Position, "Position", UInteger, Skip},
MatroskaTag(CodecDecodeAll, "CodecDecodeAll", Boolean, Process), {CodecDecodeAll, "CodecDecodeAll", Boolean, Process},
MatroskaTag(PrevSize, "PrevSize", UInteger, Skip), {PrevSize, "PrevSize", UInteger, Skip},
MatroskaTag(TrackEntry, "TrackEntry", Master, Composite), {TrackEntry, "TrackEntry", Master, Composite},
MatroskaTag(EncryptedBlock, "EncryptedBlock", Binary, Skip), {EncryptedBlock, "EncryptedBlock", Binary, Skip},
MatroskaTag(Xmp_video_Width_1, "Xmp.video.Width", UInteger, Process), {Xmp_video_Width_1, "Xmp.video.Width", UInteger, Process},
MatroskaTag(CueTime, "CueTime", UInteger, Skip), {CueTime, "CueTime", UInteger, Skip},
MatroskaTag(Xmp_audio_SampleRate, "Xmp.audio.SampleRate", Float, Process), {Xmp_audio_SampleRate, "Xmp.audio.SampleRate", Float, Process},
MatroskaTag(ChapterAtom, "ChapterAtom", Master, Composite), {ChapterAtom, "ChapterAtom", Master, Composite},
MatroskaTag(CueTrackPositions, "CueTrackPositions", Master, Composite), {CueTrackPositions, "CueTrackPositions", Master, Composite},
MatroskaTag(TrackUsed, "TrackUsed", Boolean, Process), {TrackUsed, "TrackUsed", Boolean, Process},
MatroskaTag(Xmp_video_Height_1, "Xmp.video.Height", Integer, Process), {Xmp_video_Height_1, "Xmp.video.Height", Integer, Process},
MatroskaTag(CuePoint, "CuePoint", Master, Composite), {CuePoint, "CuePoint", Master, Composite},
MatroskaTag(CRC_32, "CRC_32", Binary, Skip), {CRC_32, "CRC_32", Binary, Skip},
MatroskaTag(BlockAdditionalID, "BlockAdditionalID", UInteger, Skip), {BlockAdditionalID, "BlockAdditionalID", UInteger, Skip},
MatroskaTag(LaceNumber, "LaceNumber", UInteger, Skip), {LaceNumber, "LaceNumber", UInteger, Skip},
MatroskaTag(FrameNumber, "FrameNumber", UInteger, Skip), {FrameNumber, "FrameNumber", UInteger, Skip},
MatroskaTag(Delay, "Delay", UInteger, Skip), {Delay, "Delay", UInteger, Skip},
MatroskaTag(ClusterDuration, "ClusterDuration", Float, Skip), {ClusterDuration, "ClusterDuration", Float, Skip},
MatroskaTag(TrackNumber, "Xmp.video.TotalStream", String, Process), {TrackNumber, "Xmp.video.TotalStream", String, Process},
MatroskaTag(CueReference, "CueReference", Master, Composite), {CueReference, "CueReference", Master, Composite},
MatroskaTag(Video, "Video", Master, Composite), {Video, "Video", Master, Composite},
MatroskaTag(Audio, "Audio", Master, Composite), {Audio, "Audio", Master, Composite},
MatroskaTag(Timecode, "Timecode", UInteger, Skip), {Timecode, "Timecode", UInteger, Skip},
MatroskaTag(TimeSlice, "TimeSlice", Master, Composite), {TimeSlice, "TimeSlice", Master, Composite},
MatroskaTag(CueCodecState, "CueCodecState", UInteger, Skip), {CueCodecState, "CueCodecState", UInteger, Skip},
MatroskaTag(CueRefCodecState, "CueRefCodecState", UInteger, Skip), {CueRefCodecState, "CueRefCodecState", UInteger, Skip},
MatroskaTag(Void, "Void", Binary, Skip), {Void, "Void", Binary, Skip},
MatroskaTag(BlockAddID, "BlockAddID", UInteger, Skip), {BlockAddID, "BlockAddID", UInteger, Skip},
MatroskaTag(CueClusterPosition, "CueClusterPosition", UInteger, Skip), {CueClusterPosition, "CueClusterPosition", UInteger, Skip},
MatroskaTag(CueTrack, "CueTrack", UInteger, Skip), {CueTrack, "CueTrack", UInteger, Skip},
MatroskaTag(ReferencePriority, "ReferencePriority", UInteger, Skip), {ReferencePriority, "ReferencePriority", UInteger, Skip},
MatroskaTag(ReferenceBlock, "ReferenceBlock", Integer, Skip), {ReferenceBlock, "ReferenceBlock", Integer, Skip},
MatroskaTag(ReferenceVirtual, "ReferenceVirtual", Integer, Skip), {ReferenceVirtual, "ReferenceVirtual", Integer, Skip},
MatroskaTag(Xmp_video_ContentCompressAlgo, "Xmp.video.ContentCompressAlgo", InternalField, Process), {Xmp_video_ContentCompressAlgo, "Xmp.video.ContentCompressAlgo", InternalField, Process},
MatroskaTag(ContentCompressionSettings, "ContentCompressionSettings", Binary, Skip), {ContentCompressionSettings, "ContentCompressionSettings", Binary, Skip},
MatroskaTag(Xmp_video_DocType, "Xmp.video.DocType", String, Process), {Xmp_video_DocType, "Xmp.video.DocType", String, Process},
MatroskaTag(Xmp_video_DocTypeReadVersion, "Xmp.video.DocTypeReadVersion", Integer, Process), {Xmp_video_DocTypeReadVersion, "Xmp.video.DocTypeReadVersion", Integer, Process},
MatroskaTag(Xmp_video_EBMLVersion, "Xmp.video.EBMLVersion", Integer, Process), {Xmp_video_EBMLVersion, "Xmp.video.EBMLVersion", Integer, Process},
MatroskaTag(Xmp_video_DocTypeVersion, "Xmp.video.DocTypeVersion", Integer, Process), {Xmp_video_DocTypeVersion, "Xmp.video.DocTypeVersion", Integer, Process},
MatroskaTag(EBMLMaxIDLength, "EBMLMaxIDLength", UInteger, Skip), {EBMLMaxIDLength, "EBMLMaxIDLength", UInteger, Skip},
MatroskaTag(EBMLMaxSizeLength, "EBMLMaxSizeLength", UInteger, Skip), {EBMLMaxSizeLength, "EBMLMaxSizeLength", UInteger, Skip},
MatroskaTag(Xmp_video_EBMLReadVersion, "Xmp.video.EBMLReadVersion", UInteger, Process), {Xmp_video_EBMLReadVersion, "Xmp.video.EBMLReadVersion", UInteger, Process},
MatroskaTag(ChapterLanguage, "ChapterLanguage", String, Skip), {ChapterLanguage, "ChapterLanguage", String, Skip},
MatroskaTag(ChapterCountry, "ChapterCountry", Utf8, Skip), {ChapterCountry, "ChapterCountry", Utf8, Skip},
MatroskaTag(SegmentFamily, "SegmentFamily", Binary, Skip), {SegmentFamily, "SegmentFamily", Binary, Skip},
MatroskaTag(Xmp_video_DateUTC, "Xmp.video.DateUTC", Date, Process), {Xmp_video_DateUTC, "Xmp.video.DateUTC", Date, Process},
MatroskaTag(Xmp_video_TagLanguage, "Xmp.video.TagLanguage", String, Process), {Xmp_video_TagLanguage, "Xmp.video.TagLanguage", String, Process},
MatroskaTag(Xmp_video_TagDefault, "Xmp.video.TagDefault", Boolean, Process), {Xmp_video_TagDefault, "Xmp.video.TagDefault", Boolean, Process},
MatroskaTag(TagBinary, "TagBinary", Binary, Skip), {TagBinary, "TagBinary", Binary, Skip},
MatroskaTag(Xmp_video_TagString, "Xmp.video.TagString", String, Process), {Xmp_video_TagString, "Xmp.video.TagString", String, Process},
MatroskaTag(Xmp_video_Duration, "Xmp.video.Duration", Date, Process), {Xmp_video_Duration, "Xmp.video.Duration", Date, Process},
MatroskaTag(ChapterProcessPrivate, "ChapterProcessPrivate", Master, Skip), {ChapterProcessPrivate, "ChapterProcessPrivate", Master, Skip},
MatroskaTag(ChapterFlagEnabled, "ChapterFlagEnabled", Boolean, Skip), {ChapterFlagEnabled, "ChapterFlagEnabled", Boolean, Skip},
MatroskaTag(Xmp_video_TagName, "Xmp.video.TagName", String, Process), {Xmp_video_TagName, "Xmp.video.TagName", String, Process},
MatroskaTag(EditionEntry, "EditionEntry", Master, Composite), {EditionEntry, "EditionEntry", Master, Composite},
MatroskaTag(EditionUID, "EditionUID", UInteger, Skip), {EditionUID, "EditionUID", UInteger, Skip},
MatroskaTag(EditionFlagHidden, "EditionFlagHidden", Boolean, Skip), {EditionFlagHidden, "EditionFlagHidden", Boolean, Skip},
MatroskaTag(EditionFlagDefault, "EditionFlagDefault", Boolean, Skip), {EditionFlagDefault, "EditionFlagDefault", Boolean, Skip},
MatroskaTag(EditionFlagOrdered, "EditionFlagOrdered", Boolean, Skip), {EditionFlagOrdered, "EditionFlagOrdered", Boolean, Skip},
MatroskaTag(Xmp_video_AttachFileData, "Xmp.video.AttachFileData", String, Process), {Xmp_video_AttachFileData, "Xmp.video.AttachFileData", String, Process},
MatroskaTag(Xmp_video_AttachFileMIME, "Xmp.video.AttachFileMIME", String, Process), {Xmp_video_AttachFileMIME, "Xmp.video.AttachFileMIME", String, Process},
MatroskaTag(Xmp_video_AttachFileName, "Xmp.video.AttachFileName", String, Process), {Xmp_video_AttachFileName, "Xmp.video.AttachFileName", String, Process},
MatroskaTag(AttachedFileReferral, "AttachedFileReferral", Binary, Skip), {AttachedFileReferral, "AttachedFileReferral", Binary, Skip},
MatroskaTag(Xmp_video_AttachFileDesc, "Xmp.video.AttachFileDesc", String, Process), {Xmp_video_AttachFileDesc, "Xmp.video.AttachFileDesc", String, Process},
MatroskaTag(Xmp_video_AttachFileUID, "Xmp.video.AttachFileUID", UInteger, Process), {Xmp_video_AttachFileUID, "Xmp.video.AttachFileUID", UInteger, Process},
MatroskaTag(Xmp_video_ContentEncryptAlgo, "Xmp.video.ContentEncryptAlgo", InternalField, Process), {Xmp_video_ContentEncryptAlgo, "Xmp.video.ContentEncryptAlgo", InternalField, Process},
MatroskaTag(ContentEncryptionKeyID, "ContentEncryptionKeyID", Binary, Skip), {ContentEncryptionKeyID, "ContentEncryptionKeyID", Binary, Skip},
MatroskaTag(ContentSignature, "ContentSignature", Binary, Skip), {ContentSignature, "ContentSignature", Binary, Skip},
MatroskaTag(ContentSignatureKeyID, "ContentSignatureKeyID", Binary, Skip), {ContentSignatureKeyID, "ContentSignatureKeyID", Binary, Skip},
MatroskaTag(Xmp_video_ContentSignAlgo_1, "Xmp.video.ContentSignAlgo", InternalField, Process), {Xmp_video_ContentSignAlgo_1, "Xmp.video.ContentSignAlgo", InternalField, Process},
MatroskaTag(Xmp_video_ContentSignHashAlgo_1, "Xmp.video.ContentSignHashAlgo", InternalField, Process), {Xmp_video_ContentSignHashAlgo_1, "Xmp.video.ContentSignHashAlgo", InternalField, Process},
MatroskaTag(Xmp_video_MuxingApp, "Xmp.video.MuxingApp", String, Process), {Xmp_video_MuxingApp, "Xmp.video.MuxingApp", String, Process},
MatroskaTag(Seek, "Seek", Master, Composite), {Seek, "Seek", Master, Composite},
MatroskaTag(ContentEncodingOrder, "ContentEncodingOrder", UInteger, Skip), {ContentEncodingOrder, "ContentEncodingOrder", UInteger, Skip},
MatroskaTag(ContentEncodingScope, "ContentEncodingScope", UInteger, Skip), {ContentEncodingScope, "ContentEncodingScope", UInteger, Skip},
MatroskaTag(Xmp_video_ContentEncodingType, "Xmp.video.ContentEncodingType", InternalField, Process), {Xmp_video_ContentEncodingType, "Xmp.video.ContentEncodingType", InternalField, Process},
MatroskaTag(ContentCompression, "ContentCompression", Master, Composite), {ContentCompression, "ContentCompression", Master, Composite},
MatroskaTag(ContentEncryption, "ContentEncryption", Master, Composite), {ContentEncryption, "ContentEncryption", Master, Composite},
MatroskaTag(CueRefNumber, "CueRefNumber", UInteger, Skip), {CueRefNumber, "CueRefNumber", UInteger, Skip},
MatroskaTag(Xmp_video_TrackName, "Xmp.video.TrackName", String, Process), {Xmp_video_TrackName, "Xmp.video.TrackName", String, Process},
MatroskaTag(CueBlockNumber, "CueBlockNumber", UInteger, Skip), {CueBlockNumber, "CueBlockNumber", UInteger, Skip},
MatroskaTag(TrackOffset, "TrackOffset", Integer, Skip), {TrackOffset, "TrackOffset", Integer, Skip},
MatroskaTag(SeekID, "SeekID", Binary, Skip), {SeekID, "SeekID", Binary, Skip},
MatroskaTag(SeekPosition, "SeekPosition", UInteger, Skip), {SeekPosition, "SeekPosition", UInteger, Skip},
MatroskaTag(Stereo3DMode, "Stereo3DMode", UInteger, Skip), {Stereo3DMode, "Stereo3DMode", UInteger, Skip},
MatroskaTag(Xmp_video_CropBottom, "Xmp.video.CropBottom", Integer, Process), {Xmp_video_CropBottom, "Xmp.video.CropBottom", Integer, Process},
MatroskaTag(Xmp_video_Width_2, "Xmp.video.Width", Integer, Process), {Xmp_video_Width_2, "Xmp.video.Width", Integer, Process},
MatroskaTag(Xmp_video_DisplayUnit, "Xmp.video.DisplayUnit", InternalField, Process), {Xmp_video_DisplayUnit, "Xmp.video.DisplayUnit", InternalField, Process},
MatroskaTag(Xmp_video_AspectRatioType, "Xmp.video.AspectRatioType", InternalField, Process), {Xmp_video_AspectRatioType, "Xmp.video.AspectRatioType", InternalField, Process},
MatroskaTag(Xmp_video_Height_2, "Xmp.video.Height", Integer, Process), {Xmp_video_Height_2, "Xmp.video.Height", Integer, Process},
MatroskaTag(Xmp_video_CropTop, "Xmp.video.CropTop", Integer, Process), {Xmp_video_CropTop, "Xmp.video.CropTop", Integer, Process},
MatroskaTag(Xmp_video_CropLeft, "Xmp.video.CropLeft", Integer, Process), {Xmp_video_CropLeft, "Xmp.video.CropLeft", Integer, Process},
MatroskaTag(Xmp_video_CropRight, "Xmp.video.CropRight", Integer, Process), {Xmp_video_CropRight, "Xmp.video.CropRight", Integer, Process},
MatroskaTag(TrackForced, "TrackForced", Boolean, Process), {TrackForced, "TrackForced", Boolean, Process},
MatroskaTag(MaxBlockAdditionID, "MaxBlockAdditionID", UInteger, Skip), {MaxBlockAdditionID, "MaxBlockAdditionID", UInteger, Skip},
MatroskaTag(Xmp_video_WritingApp, "Xmp.video.WritingApp", String, Process), {Xmp_video_WritingApp, "Xmp.video.WritingApp", String, Process},
MatroskaTag(SilentTracks, "SilentTracks", Master, Composite), {SilentTracks, "SilentTracks", Master, Composite},
MatroskaTag(SilentTrackNumber, "SilentTrackNumber", UInteger, Skip), {SilentTrackNumber, "SilentTrackNumber", UInteger, Skip},
MatroskaTag(AttachedFile, "AttachedFile", Master, Composite), {AttachedFile, "AttachedFile", Master, Composite},
MatroskaTag(ContentEncoding, "ContentEncoding", Master, Composite), {ContentEncoding, "ContentEncoding", Master, Composite},
MatroskaTag(Xmp_audio_BitsPerSample, "Xmp.audio.BitsPerSample", Integer, Process), {Xmp_audio_BitsPerSample, "Xmp.audio.BitsPerSample", Integer, Process},
MatroskaTag(CodecPrivate, "CodecPrivate", Binary, Skip), {CodecPrivate, "CodecPrivate", Binary, Skip},
MatroskaTag(Targets, "Targets", Master, Composite), {Targets, "Targets", Master, Composite},
MatroskaTag(Xmp_video_PhysicalEquivalent, "Xmp.video.PhysicalEquivalent", InternalField, Process), {Xmp_video_PhysicalEquivalent, "Xmp.video.PhysicalEquivalent", InternalField, Process},
MatroskaTag(TagChapterUID, "TagChapterUID", UInteger, Skip), {TagChapterUID, "TagChapterUID", UInteger, Skip},
MatroskaTag(TagTrackUID, "TagTrackUID", UInteger, Skip), {TagTrackUID, "TagTrackUID", UInteger, Skip},
MatroskaTag(TagAttachmentUID, "TagAttachmentUID", UInteger, Skip), {TagAttachmentUID, "TagAttachmentUID", UInteger, Skip},
MatroskaTag(TagEditionUID, "TagEditionUID", UInteger, Skip), {TagEditionUID, "TagEditionUID", UInteger, Skip},
MatroskaTag(Xmp_video_TargetType, "Xmp.video.TargetType", String, Process), {Xmp_video_TargetType, "Xmp.video.TargetType", String, Process},
MatroskaTag(SignedElement, "SignedElement", Binary, Skip), {SignedElement, "SignedElement", Binary, Skip},
MatroskaTag(TrackTranslate, "TrackTranslate", Master, Composite), {TrackTranslate, "TrackTranslate", Master, Composite},
MatroskaTag(TrackTranslateTrackID, "TrackTranslateTrackID", Binary, Skip), {TrackTranslateTrackID, "TrackTranslateTrackID", Binary, Skip},
MatroskaTag(TrackTranslateCodec, "TrackTranslateCodec", UInteger, Skip), {TrackTranslateCodec, "TrackTranslateCodec", UInteger, Skip},
MatroskaTag(TrackTranslateEditionUID, "TrackTranslateEditionUID", UInteger, Skip), {TrackTranslateEditionUID, "TrackTranslateEditionUID", UInteger, Skip},
MatroskaTag(SimpleTag, "SimpleTag", Master, Composite), {SimpleTag, "SimpleTag", Master, Composite},
MatroskaTag(TargetTypeValue, "TargetTypeValue", UInteger, Skip), {TargetTypeValue, "TargetTypeValue", UInteger, Skip},
MatroskaTag(ChapterProcessCommand, "ChapterProcessCommand", Master, Composite), {ChapterProcessCommand, "ChapterProcessCommand", Master, Composite},
MatroskaTag(ChapterProcessTime, "ChapterProcessTime", UInteger, Skip), {ChapterProcessTime, "ChapterProcessTime", UInteger, Skip},
MatroskaTag(ChapterTranslate, "ChapterTranslate", Master, Composite), {ChapterTranslate, "ChapterTranslate", Master, Composite},
MatroskaTag(ChapterProcessData, "ChapterProcessData", Binary, Skip), {ChapterProcessData, "ChapterProcessData", Binary, Skip},
MatroskaTag(ChapterProcess, "ChapterProcess", Master, Composite), {ChapterProcess, "ChapterProcess", Master, Composite},
MatroskaTag(ChapterProcessCodecID, "ChapterProcessCodecID", UInteger, Skip), {ChapterProcessCodecID, "ChapterProcessCodecID", UInteger, Skip},
MatroskaTag(ChapterTranslateID, "ChapterTranslateID", Binary, Skip), {ChapterTranslateID, "ChapterTranslateID", Binary, Skip},
MatroskaTag(Xmp_video_TranslateCodec, "Xmp.video.TranslateCodec", InternalField, Process), {Xmp_video_TranslateCodec, "Xmp.video.TranslateCodec", InternalField, Process},
MatroskaTag(ChapterTranslateEditionUID, "ChapterTranslateEditionUID", UInteger, Skip), {ChapterTranslateEditionUID, "ChapterTranslateEditionUID", UInteger, Skip},
MatroskaTag(ContentEncodings, "ContentEncodings", Master, Composite), {ContentEncodings, "ContentEncodings", Master, Composite},
MatroskaTag(MinCache, "MinCache", UInteger, Skip), {MinCache, "MinCache", UInteger, Skip},
MatroskaTag(MaxCache, "MaxCache", UInteger, Skip), {MaxCache, "MaxCache", UInteger, Skip},
MatroskaTag(ChapterSegmentUID, "ChapterSegmentUID", Binary, Skip), {ChapterSegmentUID, "ChapterSegmentUID", Binary, Skip},
MatroskaTag(ChapterSegmentEditionUID, "ChapterSegmentEditionUID", UInteger, Skip), {ChapterSegmentEditionUID, "ChapterSegmentEditionUID", UInteger, Skip},
MatroskaTag(TrackOverlay, "TrackOverlay", UInteger, Skip), {TrackOverlay, "TrackOverlay", UInteger, Skip},
MatroskaTag(Tag, "Tag", Master, Composite), {Tag, "Tag", Master, Composite},
MatroskaTag(SegmentFileName, "SegmentFileName", Utf8, Skip), {SegmentFileName, "SegmentFileName", Utf8, Skip},
MatroskaTag(SegmentUID, "SegmentUID", Binary, Skip), {SegmentUID, "SegmentUID", Binary, Skip},
MatroskaTag(ChapterUID, "ChapterUID", UInteger, Skip), {ChapterUID, "ChapterUID", UInteger, Skip},
MatroskaTag(TrackUID, "TrackUID", UInteger, Skip), {TrackUID, "TrackUID", UInteger, Skip},
MatroskaTag(TrackAttachmentUID, "TrackAttachmentUID", UInteger, Skip), {TrackAttachmentUID, "TrackAttachmentUID", UInteger, Skip},
MatroskaTag(BlockAdditions, "BlockAdditions", Master, Composite), {BlockAdditions, "BlockAdditions", Master, Composite},
MatroskaTag(Xmp_audio_OutputSampleRate, "Xmp.audio.OutputSampleRate", Float, Process), {Xmp_audio_OutputSampleRate, "Xmp.audio.OutputSampleRate", Float, Process},
MatroskaTag(Xmp_video_Title, "Xmp.video.Title", String, Process), {Xmp_video_Title, "Xmp.video.Title", String, Process},
MatroskaTag(ChannelPositions, "ChannelPositions", Binary, Skip), {ChannelPositions, "ChannelPositions", Binary, Skip},
MatroskaTag(SignatureElements, "SignatureElements", Master, Composite), {SignatureElements, "SignatureElements", Master, Composite},
MatroskaTag(SignatureElementList, "SignatureElementList", Master, Composite), {SignatureElementList, "SignatureElementList", Master, Composite},
MatroskaTag(Xmp_video_ContentSignAlgo_2, "Xmp.video.ContentSignAlgo", InternalField, Process), {Xmp_video_ContentSignAlgo_2, "Xmp.video.ContentSignAlgo", InternalField, Process},
MatroskaTag(Xmp_video_ContentSignHashAlgo_2, "Xmp.video.ContentSignHashAlgo", InternalField, Process), {Xmp_video_ContentSignHashAlgo_2, "Xmp.video.ContentSignHashAlgo", InternalField, Process},
MatroskaTag(SignaturePublicKey, "SignaturePublicKey", Binary, Skip), {SignaturePublicKey, "SignaturePublicKey", Binary, Skip},
MatroskaTag(Signature, "Signature", Binary, Skip), {Signature, "Signature", Binary, Skip},
MatroskaTag(TrackLanguage, "TrackLanguage", String, {TrackLanguage, "TrackLanguage", String,
Skip), // Process : see values here https://www.loc.gov/standards/iso639-2/php/code_list.php Skip}, // Process : see values here https://www.loc.gov/standards/iso639-2/php/code_list.php
MatroskaTag(TrackTimecodeScale, "TrackTimecodeScale", Float, Skip), {TrackTimecodeScale, "TrackTimecodeScale", Float, Skip},
MatroskaTag(Xmp_video_FrameRate, "Xmp.video.FrameRate", Float, Process), {Xmp_video_FrameRate, "Xmp.video.FrameRate", Float, Process},
MatroskaTag(VideoFrameRate_DefaultDuration, "VideoFrameRate.DefaultDuration", Float, Skip), {VideoFrameRate_DefaultDuration, "VideoFrameRate.DefaultDuration", Float, Skip},
MatroskaTag(Video_Audio_CodecName, "Video.Audio.CodecName", InternalField, Process), {Video_Audio_CodecName, "Video.Audio.CodecName", InternalField, Process},
MatroskaTag(CodecDownloadURL, "CodecDownloadURL", InternalField, Process), {CodecDownloadURL, "CodecDownloadURL", InternalField, Process},
MatroskaTag(TimecodeScale, "Xmp.video.TimecodeScale", Date, Process), {TimecodeScale, "Xmp.video.TimecodeScale", Date, Process},
MatroskaTag(ColorSpace, "ColorSpace", String, Process), {ColorSpace, "ColorSpace", String, Process},
MatroskaTag(Xmp_video_OpColor, "Xmp.video.OpColor", Float, Skip), {Xmp_video_OpColor, "Xmp.video.OpColor", Float, Skip},
MatroskaTag(CodecSettings, "CodecSettings", Boolean, Process), {CodecSettings, "CodecSettings", Boolean, Process},
MatroskaTag(CodecInfoURL, "CodecInfoURL", InternalField, Process), {CodecInfoURL, "CodecInfoURL", InternalField, Process},
MatroskaTag(PrevFileName, "PrevFileName", Utf8, Skip), {PrevFileName, "PrevFileName", Utf8, Skip},
MatroskaTag(PrevUID, "PrevUID", Binary, Skip), {PrevUID, "PrevUID", Binary, Skip},
MatroskaTag(NextFileName, "NextFileName", Utf8, Skip), {NextFileName, "NextFileName", Utf8, Skip},
MatroskaTag(NextUID, "NextUID", Binary, Skip), {NextUID, "NextUID", Binary, Skip},
MatroskaTag(Chapters, "Chapters", Master, Skip), {Chapters, "Chapters", Master, Skip},
MatroskaTag(SeekHead, "SeekHead", Master, Composite), {SeekHead, "SeekHead", Master, Composite},
MatroskaTag(Tags, "Tags", Master, Composite), {Tags, "Tags", Master, Composite},
MatroskaTag(Info, "Info", Master, Composite), {Info, "Info", Master, Composite},
MatroskaTag(Tracks, "Tracks", Master, Composite), {Tracks, "Tracks", Master, Composite},
MatroskaTag(SegmentHeader, "SegmentHeader", Master, Composite), {SegmentHeader, "SegmentHeader", Master, Composite},
MatroskaTag(Attachments, "Attachments", Master, Composite), {Attachments, "Attachments", Master, Composite},
MatroskaTag(EBMLHeader, "EBMLHeader", Master, Composite), {EBMLHeader, "EBMLHeader", Master, Composite},
MatroskaTag(SignatureSlot, "SignatureSlot", Master, Composite), {SignatureSlot, "SignatureSlot", Master, Composite},
MatroskaTag(Cues, "Cues", Master, Composite), {Cues, "Cues", Master, Composite},
MatroskaTag(Cluster, "Cluster", Master, Composite)}; {Cluster, "Cluster", Master, Composite},
};
std::array<MatroskaTag, 7> matroskaTrackType = {
MatroskaTag(0x1, "Video"), MatroskaTag(0x2, "Audio"), MatroskaTag(0x3, "Complex"), MatroskaTag(0x10, "Logo"), const MatroskaTag matroskaTrackType[] = {
MatroskaTag(0x11, "Subtitle"), MatroskaTag(0x12, "Buttons"), MatroskaTag(0x20, "Control")}; {0x1, "Video"}, {0x2, "Audio"}, {0x3, "Complex"}, {0x10, "Logo"},
{0x11, "Subtitle"}, {0x12, "Buttons"}, {0x20, "Control"},
const std::array<MatroskaTag, 4> compressionAlgorithm = {MatroskaTag(0, "zlib "), MatroskaTag(1, "bzlib"), };
MatroskaTag(2, "lzo1x"), MatroskaTag(3, "Header Stripping")};
const MatroskaTag compressionAlgorithm[] = {
const std::array<MatroskaTag, 4> audioChannels = {MatroskaTag(1, "Mono"), MatroskaTag(2, "Stereo"), {0, "zlib "},
MatroskaTag(5, "5.1 Surround Sound"), {1, "bzlib"},
MatroskaTag(7, "7.1 Surround Sound")}; {2, "lzo1x"},
{3, "Header Stripping"},
const std::array<MatroskaTag, 5> displayUnit = {MatroskaTag(0x0, "Pixels"), MatroskaTag(0x1, "cm"), };
MatroskaTag(0x2, "inches"), MatroskaTag(0x3, "display aspect ratio"),
MatroskaTag(0x2, "unknown")}; const MatroskaTag audioChannels[] = {
{1, "Mono"},
const std::array<MatroskaTag, 6> encryptionAlgorithm = {MatroskaTag(0, "Not Encrypted"), MatroskaTag(1, "DES"), {2, "Stereo"},
MatroskaTag(2, "3DES"), MatroskaTag(3, "Twofish"), {5, "5.1 Surround Sound"},
MatroskaTag(4, "Blowfish"), MatroskaTag(5, "AES")}; {7, "7.1 Surround Sound"},
};
const std::array<MatroskaTag, 7> chapterPhysicalEquivalent = {
MatroskaTag(10, "Index"), MatroskaTag(20, "Track"), MatroskaTag(30, "Session"), MatroskaTag(40, "Layer"), const MatroskaTag displayUnit[] = {
MatroskaTag(50, "Side"), MatroskaTag(60, "CD / DVD"), MatroskaTag(70, "Set / Package")}; {0x0, "Pixels"}, {0x1, "cm"}, {0x2, "inches"}, {0x3, "display aspect ratio"}, {0x2, "unknown"},
};
const std::array<MatroskaTag, 2> encodingType = {MatroskaTag(0, "Compression"), MatroskaTag(1, "Encryption")};
const MatroskaTag encryptionAlgorithm[] = {
const std::array<MatroskaTag, 2> videoScanType = {MatroskaTag(0, "Progressive"), MatroskaTag(1, "Interlaced")}; {0, "Not Encrypted"}, {1, "DES"}, {2, "3DES"}, {3, "Twofish"}, {4, "Blowfish"}, {5, "AES"},
};
const std::array<MatroskaTag, 2> chapterTranslateCodec = {MatroskaTag(0, "Matroska Script"),
MatroskaTag(1, "DVD Menu")}; const MatroskaTag chapterPhysicalEquivalent[] = {
{10, "Index"}, {20, "Track"}, {30, "Session"}, {40, "Layer"}, {50, "Side"}, {60, "CD / DVD"}, {70, "Set / Package"},
const std::array<MatroskaTag, 3> aspectRatioType = {MatroskaTag(0, "Free Resizing"), };
MatroskaTag(1, "Keep Aspect Ratio"), MatroskaTag(2, "Fixed")};
const MatroskaTag encodingType[] = {
const std::array<MatroskaTag, 2> contentSignatureAlgorithm = {MatroskaTag(0, "Not Signed"), MatroskaTag(1, "RSA")}; {0, "Compression"},
{1, "Encryption"},
const std::array<MatroskaTag, 3> contentSignatureHashAlgorithm = {MatroskaTag(0, "Not Signed"), };
MatroskaTag(1, "SHA1-160"), MatroskaTag(2, "MD5")};
const MatroskaTag videoScanType[] = {
const std::array<MatroskaTag, 3> trackEnable = {MatroskaTag(0x1, "Xmp.video.Enabled"), {0, "Progressive"},
MatroskaTag(0x2, "Xmp.audio.Enabled"), {1, "Interlaced"},
MatroskaTag(0x11, "Xmp.video.SubTEnabled")}; };
const std::array<MatroskaTag, 3> defaultOn = {MatroskaTag(0x1, "Xmp.video.DefaultOn"), const MatroskaTag chapterTranslateCodec[] = {
MatroskaTag(0x2, "Xmp.audio.DefaultOn"), {0, "Matroska Script"},
MatroskaTag(0x11, "Xmp.video.SubTDefaultOn")}; {1, "DVD Menu"},
};
const std::array<MatroskaTag, 3> trackForced = {MatroskaTag(0x1, "Xmp.video.TrackForced"),
MatroskaTag(0x2, "Xmp.audio.TrackForced"), const MatroskaTag aspectRatioType[] = {
MatroskaTag(0x11, "Xmp.video.SubTTrackForced")}; {0, "Free Resizing"},
{1, "Keep Aspect Ratio"},
const std::array<MatroskaTag, 3> trackLacing = {MatroskaTag(0x1, "Xmp.video.TrackLacing"), {2, "Fixed"},
MatroskaTag(0x2, "Xmp.audio.TrackLacing"), };
MatroskaTag(0x11, "Xmp.video.SubTTrackLacing")};
const MatroskaTag contentSignatureAlgorithm[] = {
const std::array<MatroskaTag, 3> codecDecodeAll = {MatroskaTag(0x1, "Xmp.video.CodecDecodeAll"), {0, "Not Signed"},
MatroskaTag(0x2, "Xmp.audio.CodecDecodeAll"), {1, "RSA"},
MatroskaTag(0x11, "Xmp.video.SubTCodecDecodeAll")}; };
const std::array<MatroskaTag, 3> codecDownloadUrl = {MatroskaTag(0x1, "Xmp.video.CodecDownloadUrl"), const MatroskaTag contentSignatureHashAlgorithm[] = {
MatroskaTag(0x2, "Xmp.audio.CodecDownloadUrl"), {0, "Not Signed"},
MatroskaTag(0x11, "Xmp.video.SubTCodecDownloadUrl")}; {1, "SHA1-160"},
{2, "MD5"},
const std::array<MatroskaTag, 3> codecSettings = {MatroskaTag(0x1, "Xmp.video.CodecSettings"), };
MatroskaTag(0x2, "Xmp.audio.CodecSettings"),
MatroskaTag(0x11, "Xmp.video.SubTCodecSettings")}; const MatroskaTag trackEnable[] = {
{0x1, "Xmp.video.Enabled"},
const std::array<MatroskaTag, 3> trackCodec = {MatroskaTag(0x1, "Xmp.video.Codec"), {0x2, "Xmp.audio.Enabled"},
MatroskaTag(0x2, "Xmp.audio.Compressor"), {0x11, "Xmp.video.SubTEnabled"},
MatroskaTag(0x11, "Xmp.video.SubTCodec")}; };
const std::array<MatroskaTag, 3> codecInfo = {MatroskaTag(0x1, "Xmp.video.CodecInfo"), const MatroskaTag defaultOn[] = {
MatroskaTag(0x2, "Xmp.audio.CodecInfo"), {0x1, "Xmp.video.DefaultOn"},
MatroskaTag(0x11, "Xmp.video.SubTCodecInfo")}; {0x2, "Xmp.audio.DefaultOn"},
{0x11, "Xmp.video.SubTDefaultOn"},
const std::array<MatroskaTag, 2> streamRate = {MatroskaTag(0x1, "Xmp.video.FrameRate"), };
MatroskaTag(0x2, "Xmp.audio.DefaultDuration")};
const MatroskaTag trackForced[] = {
{0x1, "Xmp.video.TrackForced"},
{0x2, "Xmp.audio.TrackForced"},
{0x11, "Xmp.video.SubTTrackForced"},
};
const MatroskaTag trackLacing[] = {
{0x1, "Xmp.video.TrackLacing"},
{0x2, "Xmp.audio.TrackLacing"},
{0x11, "Xmp.video.SubTTrackLacing"},
};
const MatroskaTag codecDecodeAll[] = {
{0x1, "Xmp.video.CodecDecodeAll"},
{0x2, "Xmp.audio.CodecDecodeAll"},
{0x11, "Xmp.video.SubTCodecDecodeAll"},
};
const MatroskaTag codecDownloadUrl[] = {
{0x1, "Xmp.video.CodecDownloadUrl"},
{0x2, "Xmp.audio.CodecDownloadUrl"},
{0x11, "Xmp.video.SubTCodecDownloadUrl"},
};
const MatroskaTag codecSettings[] = {
{0x1, "Xmp.video.CodecSettings"},
{0x2, "Xmp.audio.CodecSettings"},
{0x11, "Xmp.video.SubTCodecSettings"},
};
const MatroskaTag trackCodec[] = {
{0x1, "Xmp.video.Codec"},
{0x2, "Xmp.audio.Compressor"},
{0x11, "Xmp.video.SubTCodec"},
};
const MatroskaTag codecInfo[] = {
{0x1, "Xmp.video.CodecInfo"},
{0x2, "Xmp.audio.CodecInfo"},
{0x11, "Xmp.video.SubTCodecInfo"},
};
const MatroskaTag streamRate[] = {
{0x1, "Xmp.video.FrameRate"},
{0x2, "Xmp.audio.DefaultDuration"},
};
/*! /*!
@brief Function used to calculate Tags, Tags may comprise of more than @brief Function used to calculate Tags, Tags may comprise of more than
@ -624,7 +670,7 @@ void MatroskaVideo::decodeBlock() {
io_->read(buf + 1, block_size - 1); io_->read(buf + 1, block_size - 1);
auto tag_id = returnTagValue(buf, block_size); auto tag_id = returnTagValue(buf, block_size);
const MatroskaTag* tag = findTag(matroskaTags, tag_id); const MatroskaTag* tag = Exiv2::find(matroskaTags, tag_id);
if (!tag) { if (!tag) {
continueTraversing_ = false; continueTraversing_ = false;
@ -701,49 +747,49 @@ void MatroskaVideo::decodeInternalTags(const MatroskaTag* tag, const byte* buf,
switch (tag->_id) { switch (tag->_id) {
case Xmp_video_VideoScanTpye: case Xmp_video_VideoScanTpye:
internalMt = findTag(videoScanType, key); internalMt = Exiv2::find(videoScanType, key);
break; break;
case Xmp_audio_ChannelType: case Xmp_audio_ChannelType:
internalMt = findTag(audioChannels, key); internalMt = Exiv2::find(audioChannels, key);
break; break;
case Xmp_video_ContentCompressAlgo: case Xmp_video_ContentCompressAlgo:
internalMt = findTag(compressionAlgorithm, key); internalMt = Exiv2::find(compressionAlgorithm, key);
break; break;
case Xmp_video_ContentEncryptAlgo: case Xmp_video_ContentEncryptAlgo:
internalMt = findTag(encryptionAlgorithm, key); internalMt = Exiv2::find(encryptionAlgorithm, key);
break; break;
case Xmp_video_ContentSignAlgo_1: case Xmp_video_ContentSignAlgo_1:
case Xmp_video_ContentSignAlgo_2: case Xmp_video_ContentSignAlgo_2:
internalMt = findTag(contentSignatureAlgorithm, key); internalMt = Exiv2::find(contentSignatureAlgorithm, key);
break; break;
case Xmp_video_ContentSignHashAlgo_1: case Xmp_video_ContentSignHashAlgo_1:
case Xmp_video_ContentSignHashAlgo_2: case Xmp_video_ContentSignHashAlgo_2:
internalMt = findTag(contentSignatureHashAlgorithm, key); internalMt = Exiv2::find(contentSignatureHashAlgorithm, key);
break; break;
case Xmp_video_ContentEncodingType: case Xmp_video_ContentEncodingType:
internalMt = findTag(encodingType, key); internalMt = Exiv2::find(encodingType, key);
break; break;
case Xmp_video_DisplayUnit: case Xmp_video_DisplayUnit:
internalMt = findTag(displayUnit, key); internalMt = Exiv2::find(displayUnit, key);
break; break;
case Xmp_video_AspectRatioType: case Xmp_video_AspectRatioType:
internalMt = findTag(aspectRatioType, key); internalMt = Exiv2::find(aspectRatioType, key);
break; break;
case Xmp_video_PhysicalEquivalent: case Xmp_video_PhysicalEquivalent:
internalMt = findTag(chapterPhysicalEquivalent, key); internalMt = Exiv2::find(chapterPhysicalEquivalent, key);
break; break;
case Xmp_video_TranslateCodec: case Xmp_video_TranslateCodec:
internalMt = findTag(chapterTranslateCodec, key); internalMt = Exiv2::find(chapterTranslateCodec, key);
break; break;
case Video_Audio_CodecID: case Video_Audio_CodecID:
internalMt = findTag(trackCodec, key); internalMt = Exiv2::find(trackCodec, key);
break; break;
case Video_Audio_CodecName: case Video_Audio_CodecName:
internalMt = findTag(codecInfo, key); internalMt = Exiv2::find(codecInfo, key);
break; break;
case CodecDownloadURL: case CodecDownloadURL:
case CodecInfoURL: case CodecInfoURL:
internalMt = findTag(codecDownloadUrl, key); internalMt = Exiv2::find(codecDownloadUrl, key);
break; break;
default: default:
break; break;
@ -785,27 +831,27 @@ void MatroskaVideo::decodeBooleanTags(const MatroskaTag* tag, const byte* buf, s
switch (tag->_id) { switch (tag->_id) {
case TrackType: // this tags is used internally only to deduce the type of track (video or audio) case TrackType: // this tags is used internally only to deduce the type of track (video or audio)
internalMt = findTag(matroskaTrackType, key); internalMt = Exiv2::find(matroskaTrackType, key);
stream_ = internalMt->_id; stream_ = internalMt->_id;
internalMt = nullptr; internalMt = nullptr;
break; break;
case TrackUsed: case TrackUsed:
internalMt = findTag(trackEnable, key); internalMt = Exiv2::find(trackEnable, key);
break; break;
case TrackDefault: case TrackDefault:
internalMt = findTag(defaultOn, key); internalMt = Exiv2::find(defaultOn, key);
break; break;
case TrackForced: case TrackForced:
internalMt = findTag(trackForced, key); internalMt = Exiv2::find(trackForced, key);
break; break;
case TrackLacing: case TrackLacing:
internalMt = findTag(trackLacing, key); internalMt = Exiv2::find(trackLacing, key);
break; break;
case CodecDecodeAll: case CodecDecodeAll:
internalMt = findTag(codecDecodeAll, key); internalMt = Exiv2::find(codecDecodeAll, key);
break; break;
case CodecSettings: case CodecSettings:
internalMt = findTag(codecSettings, key); internalMt = Exiv2::find(codecSettings, key);
break; break;
case Xmp_video_TagDefault: case Xmp_video_TagDefault:
internalMt = tag; internalMt = tag;
@ -866,7 +912,7 @@ void MatroskaVideo::decodeFloatTags(const MatroskaTag* tag, const byte* buf, siz
uint64_t key = 0; uint64_t key = 0;
if (!convertToUint64(buf, size, key)) if (!convertToUint64(buf, size, key))
return; return;
const MatroskaTag* internalMt = findTag(streamRate, key); const MatroskaTag* internalMt = Exiv2::find(streamRate, key);
if (internalMt) { if (internalMt) {
switch (stream_) { switch (stream_) {
case 1: // video case 1: // video

@ -4904,12 +4904,6 @@ const XmpPrintInfo xmpPrintInfo[] = {
{"Xmp.plus.PropertyReleaseStatus", EXV_PRINT_VOCABULARY(plusPropertyReleaseStatus)}, {"Xmp.plus.PropertyReleaseStatus", EXV_PRINT_VOCABULARY(plusPropertyReleaseStatus)},
{"Xmp.plus.Reuse", EXV_PRINT_VOCABULARY(plusReuse)}}; {"Xmp.plus.Reuse", EXV_PRINT_VOCABULARY(plusReuse)}};
XmpNsInfo::Ns::Ns(std::string ns) : ns_(std::move(ns)) {
}
XmpNsInfo::Prefix::Prefix(std::string prefix) : prefix_(std::move(prefix)) {
}
bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const { bool XmpNsInfo::operator==(const XmpNsInfo::Ns& ns) const {
return ns_ == ns.ns_; return ns_ == ns.ns_;
} }
@ -4945,7 +4939,7 @@ void XmpProperties::registerNs(const std::string& ns, const std::string& prefix)
if (ns2.back() != '/' && ns2.back() != '#') if (ns2.back() != '/' && ns2.back() != '#')
ns2 += '/'; ns2 += '/';
// Check if there is already a registered namespace with this prefix // Check if there is already a registered namespace with this prefix
const XmpNsInfo* xnp = lookupNsRegistryUnsafe(XmpNsInfo::Prefix(prefix)); const XmpNsInfo* xnp = lookupNsRegistryUnsafe(XmpNsInfo::Prefix{prefix});
if (xnp) { if (xnp) {
#ifndef SUPPRESS_WARNINGS #ifndef SUPPRESS_WARNINGS
if (ns2 != xnp->ns_) if (ns2 != xnp->ns_)
@ -5003,7 +4997,7 @@ std::string XmpProperties::prefix(const std::string& ns) {
if (i != nsRegistry_.end()) { if (i != nsRegistry_.end()) {
p = i->second.prefix_; p = i->second.prefix_;
} else { } else {
auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns(ns2)); auto xn = Exiv2::find(xmpNsInfo, XmpNsInfo::Ns{ns2});
if (xn) if (xn)
p = std::string(xn->prefix_); p = std::string(xn->prefix_);
} }
@ -5012,7 +5006,7 @@ std::string XmpProperties::prefix(const std::string& ns) {
std::string XmpProperties::ns(const std::string& prefix) { std::string XmpProperties::ns(const std::string& prefix) {
auto scoped_read_lock = std::scoped_lock(mutex_); auto scoped_read_lock = std::scoped_lock(mutex_);
const XmpNsInfo* xn = lookupNsRegistryUnsafe(XmpNsInfo::Prefix(prefix)); const XmpNsInfo* xn = lookupNsRegistryUnsafe(XmpNsInfo::Prefix{prefix});
if (xn) if (xn)
return xn->ns_; return xn->ns_;
return nsInfoUnsafe(prefix)->ns_; return nsInfoUnsafe(prefix)->ns_;
@ -5079,7 +5073,7 @@ const XmpNsInfo* XmpProperties::nsInfo(const std::string& prefix) {
} }
const XmpNsInfo* XmpProperties::nsInfoUnsafe(const std::string& prefix) { const XmpNsInfo* XmpProperties::nsInfoUnsafe(const std::string& prefix) {
const XmpNsInfo::Prefix pf(prefix); const auto pf = XmpNsInfo::Prefix{prefix};
const XmpNsInfo* xn = lookupNsRegistryUnsafe(pf); const XmpNsInfo* xn = lookupNsRegistryUnsafe(pf);
if (!xn) if (!xn)
xn = Exiv2::find(xmpNsInfo, pf); xn = Exiv2::find(xmpNsInfo, pf);

@ -2399,7 +2399,7 @@ const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
IfdId groupId(const std::string& groupName) { IfdId groupId(const std::string& groupName) {
IfdId ifdId = IfdId::ifdIdNotSet; IfdId ifdId = IfdId::ifdIdNotSet;
auto ii = Exiv2::find(groupInfo, GroupInfo::GroupName(groupName)); auto ii = Exiv2::find(groupInfo, groupName);
if (ii) if (ii)
ifdId = static_cast<IfdId>(ii->ifdId_); ifdId = static_cast<IfdId>(ii->ifdId_);
return ifdId; return ifdId;
@ -3047,7 +3047,7 @@ const GroupInfo* groupList() {
} }
const TagInfo* tagList(const std::string& groupName) { const TagInfo* tagList(const std::string& groupName) {
auto ii = Exiv2::find(groupInfo, GroupInfo::GroupName(groupName)); auto ii = Exiv2::find(groupInfo, groupName);
if (!ii || !ii->tagList_) { if (!ii || !ii->tagList_) {
return nullptr; return nullptr;
} }

@ -366,9 +366,6 @@ struct TiffMappingInfo {
//! Search key for TIFF mapping structures. //! Search key for TIFF mapping structures.
struct TiffMappingInfo::Key { struct TiffMappingInfo::Key {
//! Constructor
Key(std::string m, uint32_t e, IfdId g) : m_(std::move(m)), e_(e), g_(g) {
}
std::string m_; //!< Camera make std::string m_; //!< Camera make
uint32_t e_; //!< Extended tag uint32_t e_; //!< Extended tag
IfdId g_; //!< %Group IfdId g_; //!< %Group

@ -1967,7 +1967,7 @@ const TiffMappingInfo TiffMapping::tiffMappingInfo_[] = {
DecoderFct TiffMapping::findDecoder(const std::string& make, uint32_t extendedTag, IfdId group) { DecoderFct TiffMapping::findDecoder(const std::string& make, uint32_t extendedTag, IfdId group) {
DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry; DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key(make, extendedTag, group)); auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group});
if (td) { if (td) {
// This may set decoderFct to 0, meaning that the tag should not be decoded // This may set decoderFct to 0, meaning that the tag should not be decoded
decoderFct = td->decoderFct_; decoderFct = td->decoderFct_;
@ -1977,7 +1977,7 @@ DecoderFct TiffMapping::findDecoder(const std::string& make, uint32_t extendedTa
EncoderFct TiffMapping::findEncoder(const std::string& make, uint32_t extendedTag, IfdId group) { EncoderFct TiffMapping::findEncoder(const std::string& make, uint32_t extendedTag, IfdId group) {
EncoderFct encoderFct = nullptr; EncoderFct encoderFct = nullptr;
auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key(make, extendedTag, group)); auto td = Exiv2::find(tiffMappingInfo_, TiffMappingInfo::Key{make, extendedTag, group});
if (td) { if (td) {
// Returns 0 if no special encoder function is found // Returns 0 if no special encoder function is found
encoderFct = td->encoderFct_; encoderFct = td->encoderFct_;

@ -177,14 +177,6 @@ StringValueBase::StringValueBase(TypeId typeId, const std::string& buf) : Value(
read(buf); read(buf);
} }
StringValueBase& StringValueBase::operator=(const StringValueBase& rhs) {
if (this == &rhs)
return *this;
Value::operator=(rhs);
value_ = rhs.value_;
return *this;
}
int StringValueBase::read(const std::string& buf) { int StringValueBase::read(const std::string& buf) {
value_ = buf; value_ = buf;
return 0; return 0;
@ -273,18 +265,14 @@ std::ostream& AsciiValue::write(std::ostream& os) const {
return os << value_.substr(0, pos); return os << value_.substr(0, pos);
} }
constexpr CommentValue::CharsetTable::CharsetTable(CharsetId charsetId, const char* name, const char* code) :
charsetId_(charsetId), name_(name), code_(code) {
}
//! Lookup list of supported IFD type information //! Lookup list of supported IFD type information
constexpr CommentValue::CharsetTable CommentValue::CharsetInfo::charsetTable_[] = { constexpr CommentValue::CharsetTable CommentValue::CharsetInfo::charsetTable_[] = {
CharsetTable(ascii, "Ascii", "ASCII\0\0\0"), {ascii, "Ascii", "ASCII\0\0\0"},
CharsetTable(jis, "Jis", "JIS\0\0\0\0\0"), {jis, "Jis", "JIS\0\0\0\0\0"},
CharsetTable(unicode, "Unicode", "UNICODE\0"), {unicode, "Unicode", "UNICODE\0"},
CharsetTable(undefined, "Undefined", "\0\0\0\0\0\0\0\0"), {undefined, "Undefined", "\0\0\0\0\0\0\0\0"},
CharsetTable(invalidCharsetId, "InvalidCharsetId", "\0\0\0\0\0\0\0\0"), {invalidCharsetId, "InvalidCharsetId", "\0\0\0\0\0\0\0\0"},
CharsetTable(lastCharsetId, "InvalidCharsetId", "\0\0\0\0\0\0\0\0"), {lastCharsetId, "InvalidCharsetId", "\0\0\0\0\0\0\0\0"},
}; };
const char* CommentValue::CharsetInfo::name(CharsetId charsetId) { const char* CommentValue::CharsetInfo::name(CharsetId charsetId) {

Loading…
Cancel
Save