From 0cf30edbff671bdc9203e488b1b672337e3158dd Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 29 Aug 2016 15:43:05 +0200 Subject: [PATCH] Fix decoration for static builds --- abstractattachment.h | 6 +- abstractchapter.h | 2 +- abstractcontainer.h | 2 +- abstracttrack.h | 2 +- adts/adtsframe.h | 5 +- adts/adtsstream.h | 2 +- aspectratio.h | 5 +- avc/avcconfiguration.h | 2 +- avc/avcinfo.h | 12 +- avi/bitmapinfoheader.h | 5 +- backuphelper.h | 10 +- basicfileinfo.h | 5 +- caseinsensitivecomparer.h | 6 +- exceptions.h | 16 +- flac/flacmetadata.h | 9 +- flac/flacstream.h | 2 +- flac/flactooggmappingheader.h | 2 +- genericcontainer.h | 2 +- genericfileelement.h | 2 +- generictagfield.h | 2 +- global.h | 17 + id3/id3genres.h | 5 +- id3/id3v1tag.h | 2 +- id3/id3v2frame.h | 6 +- id3/id3v2tag.h | 6 +- localeawarestring.h | 4 +- margin.h | 5 +- matroska/ebmlelement.h | 4 +- matroska/matroskaattachment.h | 4 +- matroska/matroskachapter.h | 2 +- matroska/matroskacontainer.h | 2 +- matroska/matroskacues.h | 6 +- matroska/matroskaeditionentry.h | 2 +- matroska/matroskaid.h | 5 +- matroska/matroskaseekinfo.h | 2 +- matroska/matroskatag.h | 4 +- matroska/matroskatagfield.h | 6 +- matroska/matroskatagid.h | 212 ++-- matroska/matroskatrack.h | 2 +- mediafileinfo.h | 2 +- mediaformat.h | 6 +- mp4/mp4atom.h | 4 +- mp4/mp4container.h | 2 +- mp4/mp4ids.cpp | 754 +++++++------- mp4/mp4ids.h | 1425 ++++++++++++++------------- mp4/mp4tag.h | 4 +- mp4/mp4tagfield.h | 6 +- mp4/mp4track.h | 8 +- mp4/mpeg4descriptor.h | 4 +- mpegaudio/mpegaudioframe.h | 7 +- mpegaudio/mpegaudioframestream.h | 2 +- notification.h | 4 +- ogg/oggcontainer.h | 6 +- ogg/oggiterator.h | 2 +- ogg/oggpage.h | 5 +- ogg/oggstream.h | 2 +- opus/opusidentificationheader.h | 5 +- positioninset.h | 5 +- signature.h | 15 +- size.h | 5 +- statusprovider.h | 2 +- tag.h | 2 +- tagtarget.h | 7 +- tagvalue.h | 2 +- vorbis/vorbiscomment.h | 2 +- vorbis/vorbiscommentfield.h | 4 +- vorbis/vorbiscommentids.h | 74 +- vorbis/vorbisidentificationheader.h | 5 +- wav/waveaudiostream.h | 4 +- 69 files changed, 1402 insertions(+), 1368 deletions(-) create mode 100644 global.h diff --git a/abstractattachment.h b/abstractattachment.h index 2b72a26..a693d80 100644 --- a/abstractattachment.h +++ b/abstractattachment.h @@ -13,7 +13,7 @@ namespace Media { class MediaFileInfo; -class LIB_EXPORT StreamDataBlock +class TAG_PARSER_EXPORT StreamDataBlock { public: StreamDataBlock(const std::function &stream, @@ -88,7 +88,7 @@ inline void StreamDataBlock::discardBuffer() m_buffer.reset(); } -class LIB_EXPORT FileDataBlock : public StreamDataBlock +class TAG_PARSER_EXPORT FileDataBlock : public StreamDataBlock { public: FileDataBlock(const std::string &path); @@ -103,7 +103,7 @@ inline const MediaFileInfo *FileDataBlock::fileInfo() const return m_fileInfo.get(); } -class LIB_EXPORT AbstractAttachment : public StatusProvider +class TAG_PARSER_EXPORT AbstractAttachment : public StatusProvider { public: const std::string &description() const; diff --git a/abstractchapter.h b/abstractchapter.h index cb94913..e824ef4 100644 --- a/abstractchapter.h +++ b/abstractchapter.h @@ -11,7 +11,7 @@ namespace Media { -class LIB_EXPORT AbstractChapter : public StatusProvider +class TAG_PARSER_EXPORT AbstractChapter : public StatusProvider { public: virtual ~AbstractChapter(); diff --git a/abstractcontainer.h b/abstractcontainer.h index e3d0e66..1b0f3f6 100644 --- a/abstractcontainer.h +++ b/abstractcontainer.h @@ -26,7 +26,7 @@ class AbstractTrack; class AbstractChapter; class AbstractAttachment; -class LIB_EXPORT AbstractContainer : public StatusProvider +class TAG_PARSER_EXPORT AbstractContainer : public StatusProvider { public: virtual ~AbstractContainer(); diff --git a/abstracttrack.h b/abstracttrack.h index 0f07e12..6646401 100644 --- a/abstracttrack.h +++ b/abstracttrack.h @@ -37,7 +37,7 @@ enum class TrackType FlacStream, /**< The track is a Media::FlacStream. */ }; -class LIB_EXPORT AbstractTrack : public StatusProvider +class TAG_PARSER_EXPORT AbstractTrack : public StatusProvider { friend class MpegAudioFrameStream; friend class WaveAudioStream; diff --git a/adts/adtsframe.h b/adts/adtsframe.h index 9b31cbd..8ce0b22 100644 --- a/adts/adtsframe.h +++ b/adts/adtsframe.h @@ -1,8 +1,9 @@ #ifndef MEDIA_ADTSFRAME_H #define MEDIA_ADTSFRAME_H +#include "../global.h" + #include -#include namespace IoUtilities { class BinaryReader; @@ -10,7 +11,7 @@ class BinaryReader; namespace Media { -class LIB_EXPORT AdtsFrame +class TAG_PARSER_EXPORT AdtsFrame { public: AdtsFrame(); diff --git a/adts/adtsstream.h b/adts/adtsstream.h index ff99839..7caab1d 100644 --- a/adts/adtsstream.h +++ b/adts/adtsstream.h @@ -7,7 +7,7 @@ namespace Media { -class LIB_EXPORT AdtsStream : public AbstractTrack +class TAG_PARSER_EXPORT AdtsStream : public AbstractTrack { public: AdtsStream(std::iostream &stream, uint64 startOffset); diff --git a/aspectratio.h b/aspectratio.h index d393dec..937910f 100644 --- a/aspectratio.h +++ b/aspectratio.h @@ -1,12 +1,13 @@ #ifndef MEDIA_ASPECTRATIO_H #define MEDIA_ASPECTRATIO_H -#include +#include "./global.h" + #include namespace Media { -struct LIB_EXPORT AspectRatio { +struct TAG_PARSER_EXPORT AspectRatio { AspectRatio(); AspectRatio(byte aspectRatioType); AspectRatio(uint16 numerator, uint16 denominator); diff --git a/avc/avcconfiguration.h b/avc/avcconfiguration.h index 72d4ff0..8a9a470 100644 --- a/avc/avcconfiguration.h +++ b/avc/avcconfiguration.h @@ -9,7 +9,7 @@ namespace Media { class MediaFormat; -struct LIB_EXPORT AvcConfiguration +struct TAG_PARSER_EXPORT AvcConfiguration { AvcConfiguration(); byte profileIndication; diff --git a/avc/avcinfo.h b/avc/avcinfo.h index c04e361..3ae9c2f 100644 --- a/avc/avcinfo.h +++ b/avc/avcinfo.h @@ -22,7 +22,7 @@ typedef uint32 ugolomb; */ typedef int32 sgolomb; -struct LIB_EXPORT TimingInfo { +struct TAG_PARSER_EXPORT TimingInfo { TimingInfo(); uint32 unitsInTick; uint32 timeScale; @@ -43,7 +43,7 @@ inline int64 TimingInfo::defaultDuration() const return 1000000000ll * unitsInTick / timeScale; } -struct LIB_EXPORT HrdParameters { +struct TAG_PARSER_EXPORT HrdParameters { HrdParameters(); ugolomb cpbCount; byte bitRateScale; @@ -66,7 +66,7 @@ inline HrdParameters::HrdParameters() : timeOffsetLength(0) {} -struct LIB_EXPORT SpsInfo { +struct TAG_PARSER_EXPORT SpsInfo { SpsInfo(); ugolomb id; byte profileIndication; @@ -115,7 +115,7 @@ inline SpsInfo::SpsInfo() : size(0) {} -struct LIB_EXPORT PpsInfo { +struct TAG_PARSER_EXPORT PpsInfo { PpsInfo(); ugolomb id; ugolomb spsId; @@ -132,7 +132,7 @@ inline PpsInfo::PpsInfo() : size(0) {} -struct LIB_EXPORT SliceInfo { +struct TAG_PARSER_EXPORT SliceInfo { SliceInfo(); byte naluType; byte naluRefIdc; @@ -167,7 +167,7 @@ inline SliceInfo::SliceInfo() : pps(0) {} -class LIB_EXPORT AvcFrame { +class TAG_PARSER_EXPORT AvcFrame { AvcFrame(); private: diff --git a/avi/bitmapinfoheader.h b/avi/bitmapinfoheader.h index ba633f7..b70b23a 100644 --- a/avi/bitmapinfoheader.h +++ b/avi/bitmapinfoheader.h @@ -1,7 +1,8 @@ #ifndef MEDIA_BITMAPINFOHEADER_H #define MEDIA_BITMAPINFOHEADER_H -#include +#include "../global.h" + #include namespace IoUtilities { @@ -10,7 +11,7 @@ class BinaryReader; namespace Media { -class LIB_EXPORT BitmapInfoHeader +class TAG_PARSER_EXPORT BitmapInfoHeader { public: BitmapInfoHeader(); diff --git a/backuphelper.h b/backuphelper.h index d1395c1..aa01a24 100644 --- a/backuphelper.h +++ b/backuphelper.h @@ -1,7 +1,7 @@ #ifndef BACKUPHELPER_H #define BACKUPHELPER_H -#include +#include "./global.h" #include #include @@ -12,10 +12,10 @@ class MediaFileInfo; namespace BackupHelper { -LIB_EXPORT std::string &backupDirectory(); -LIB_EXPORT void restoreOriginalFileFromBackupFile(const std::string &originalPath, const std::string &backupPath, std::fstream &originalStream, std::fstream &backupStream); -LIB_EXPORT void createBackupFile(const std::string &originalPath, std::string &backupPath, std::fstream &originalStream, std::fstream &backupStream); -LIB_EXPORT void handleFailureAfterFileModified(MediaFileInfo &mediaFileInfo, const std::string &backupPath, std::fstream &outputStream, std::fstream &backupStream, const std::string &context = "making file"); +TAG_PARSER_EXPORT std::string &backupDirectory(); +TAG_PARSER_EXPORT void restoreOriginalFileFromBackupFile(const std::string &originalPath, const std::string &backupPath, std::fstream &originalStream, std::fstream &backupStream); +TAG_PARSER_EXPORT void createBackupFile(const std::string &originalPath, std::string &backupPath, std::fstream &originalStream, std::fstream &backupStream); +TAG_PARSER_EXPORT void handleFailureAfterFileModified(MediaFileInfo &mediaFileInfo, const std::string &backupPath, std::fstream &outputStream, std::fstream &backupStream, const std::string &context = "making file"); } diff --git a/basicfileinfo.h b/basicfileinfo.h index fffb5a1..2b2bbb9 100644 --- a/basicfileinfo.h +++ b/basicfileinfo.h @@ -1,7 +1,8 @@ #ifndef BASICFILEINFO_H #define BASICFILEINFO_H -#include +#include "./global.h" + #include #include @@ -9,7 +10,7 @@ namespace Media { -class LIB_EXPORT BasicFileInfo +class TAG_PARSER_EXPORT BasicFileInfo { public: // constructor, destructor diff --git a/caseinsensitivecomparer.h b/caseinsensitivecomparer.h index 8351275..00c7a40 100644 --- a/caseinsensitivecomparer.h +++ b/caseinsensitivecomparer.h @@ -1,7 +1,7 @@ #ifndef CASEINSENSITIVECOMPARER #define CASEINSENSITIVECOMPARER -#include +#include "./global.h" #include @@ -12,7 +12,7 @@ namespace Media { /*! * \brief The CaseInsensitiveCharComparer struct defines a method for case-insensivive character comparsion (less). */ -struct LIB_EXPORT CaseInsensitiveCharComparer +struct TAG_PARSER_EXPORT CaseInsensitiveCharComparer { static constexpr unsigned char toLower(const unsigned char c) { @@ -28,7 +28,7 @@ struct LIB_EXPORT CaseInsensitiveCharComparer /*! * \brief The CaseInsensitiveStringComparer struct defines a method for case-insensivive string comparsion (less). */ -struct LIB_EXPORT CaseInsensitiveStringComparer +struct TAG_PARSER_EXPORT CaseInsensitiveStringComparer { bool operator()(const std::string &lhs, const std::string &rhs) const { diff --git a/exceptions.h b/exceptions.h index aba8b8d..f0121e3 100644 --- a/exceptions.h +++ b/exceptions.h @@ -1,14 +1,14 @@ #ifndef MEDIA_EXCEPTIONS_H #define MEDIA_EXCEPTIONS_H -#include +#include "./global.h" #include #include namespace Media { -class LIB_EXPORT Failure : public std::exception +class TAG_PARSER_EXPORT Failure : public std::exception { public: Failure() USE_NOTHROW; @@ -16,7 +16,7 @@ public: virtual const char *what() const USE_NOTHROW; }; -class LIB_EXPORT NoDataFoundException : public Failure +class TAG_PARSER_EXPORT NoDataFoundException : public Failure { public: NoDataFoundException() USE_NOTHROW; @@ -24,7 +24,7 @@ public: virtual const char *what() const USE_NOTHROW; }; -class LIB_EXPORT InvalidDataException : public Failure +class TAG_PARSER_EXPORT InvalidDataException : public Failure { public: InvalidDataException() USE_NOTHROW; @@ -32,7 +32,7 @@ public: virtual const char *what() const USE_NOTHROW; }; -class LIB_EXPORT TruncatedDataException : public InvalidDataException +class TAG_PARSER_EXPORT TruncatedDataException : public InvalidDataException { public: TruncatedDataException() USE_NOTHROW; @@ -40,7 +40,7 @@ public: virtual const char *what() const USE_NOTHROW; }; -class LIB_EXPORT OperationAbortedException : public Failure +class TAG_PARSER_EXPORT OperationAbortedException : public Failure { public: OperationAbortedException() USE_NOTHROW; @@ -48,7 +48,7 @@ public: virtual const char *what() const USE_NOTHROW; }; -class LIB_EXPORT VersionNotSupportedException : public Failure +class TAG_PARSER_EXPORT VersionNotSupportedException : public Failure { public: VersionNotSupportedException() USE_NOTHROW; @@ -56,7 +56,7 @@ public: virtual const char *what() const USE_NOTHROW; }; -class LIB_EXPORT NotImplementedException : public Failure +class TAG_PARSER_EXPORT NotImplementedException : public Failure { public: NotImplementedException() USE_NOTHROW; diff --git a/flac/flacmetadata.h b/flac/flacmetadata.h index 523f097..6c56d71 100644 --- a/flac/flacmetadata.h +++ b/flac/flacmetadata.h @@ -1,7 +1,8 @@ #ifndef MEDIA_FLACMETADATAHEADER_H #define MEDIA_FLACMETADATAHEADER_H -#include +#include "../global.h" + #include #include @@ -34,7 +35,7 @@ constexpr bool operator !=(byte lhs, FlacMetaDataBlockType type) return lhs != static_cast(type); } -class LIB_EXPORT FlacMetaDataBlockHeader +class TAG_PARSER_EXPORT FlacMetaDataBlockHeader { public: FlacMetaDataBlockHeader(); @@ -115,7 +116,7 @@ inline void FlacMetaDataBlockHeader::setDataSize(uint32 dataSize) m_dataSize = dataSize; } -class LIB_EXPORT FlacMetaDataBlockStreamInfo +class TAG_PARSER_EXPORT FlacMetaDataBlockStreamInfo { public: FlacMetaDataBlockStreamInfo(); @@ -254,7 +255,7 @@ inline const char *FlacMetaDataBlockStreamInfo::md5Sum() const return m_md5Sum; } -class LIB_EXPORT FlacMetaDataBlockPicture +class TAG_PARSER_EXPORT FlacMetaDataBlockPicture { public: FlacMetaDataBlockPicture(TagValue &tagValue); diff --git a/flac/flacstream.h b/flac/flacstream.h index 3303360..8d94678 100644 --- a/flac/flacstream.h +++ b/flac/flacstream.h @@ -12,7 +12,7 @@ namespace Media { class MediaFileInfo; class VorbisComment; -class LIB_EXPORT FlacStream : public AbstractTrack +class TAG_PARSER_EXPORT FlacStream : public AbstractTrack { public: FlacStream(MediaFileInfo &mediaFileInfo, uint64 startOffset); diff --git a/flac/flactooggmappingheader.h b/flac/flactooggmappingheader.h index 9d57ade..f5e475e 100644 --- a/flac/flactooggmappingheader.h +++ b/flac/flactooggmappingheader.h @@ -7,7 +7,7 @@ namespace Media { class OggIterator; -class LIB_EXPORT FlacToOggMappingHeader +class TAG_PARSER_EXPORT FlacToOggMappingHeader { public: FlacToOggMappingHeader(); diff --git a/genericcontainer.h b/genericcontainer.h index c01c8bb..631eb40 100644 --- a/genericcontainer.h +++ b/genericcontainer.h @@ -22,7 +22,7 @@ namespace Media { * \tparam ElementType Specifies the class which is used to deal with the elements the file consists of. */ template -class LIB_EXPORT GenericContainer : public AbstractContainer +class TAG_PARSER_EXPORT GenericContainer : public AbstractContainer { friend FileInfoType; diff --git a/genericfileelement.h b/genericfileelement.h index e0ac518..11bd2b4 100644 --- a/genericfileelement.h +++ b/genericfileelement.h @@ -114,7 +114,7 @@ class FileElementTraits * \tparam ImplementationType Specifies the type of the actual implementation. */ template -class LIB_EXPORT GenericFileElement : public StatusProvider +class TAG_PARSER_EXPORT GenericFileElement : public StatusProvider { friend class FileElementTraits; diff --git a/generictagfield.h b/generictagfield.h index 7d434c0..6af0865 100644 --- a/generictagfield.h +++ b/generictagfield.h @@ -29,7 +29,7 @@ class TagFieldTraits * with the "Curiously recurring template pattern". */ template -class LIB_EXPORT TagField +class TAG_PARSER_EXPORT TagField { public: friend class TagFieldTraits; diff --git a/global.h b/global.h new file mode 100644 index 0000000..53a6d85 --- /dev/null +++ b/global.h @@ -0,0 +1,17 @@ +// Created via CMake from template global.h.in +// WARNING! Any changes to this file will be overwritten by the next CMake run! + +#ifndef TAG_PARSER_GLOBAL +#define TAG_PARSER_GLOBAL + +#include + +#ifdef TAG_PARSER_STATIC +# define TAG_PARSER_EXPORT +# define TAG_PARSER_IMPORT +#else +# define TAG_PARSER_EXPORT LIB_EXPORT +# define TAG_PARSER_IMPORT LIB_IMPORT +#endif + +#endif // TAG_PARSER_GLOBAL diff --git a/id3/id3genres.h b/id3/id3genres.h index c0afbdf..6e99b2a 100644 --- a/id3/id3genres.h +++ b/id3/id3genres.h @@ -1,7 +1,8 @@ #ifndef ID3GENRES_H #define ID3GENRES_H -#include +#include "../global.h" + #include #include @@ -9,7 +10,7 @@ namespace Media { -class LIB_EXPORT Id3Genres +class TAG_PARSER_EXPORT Id3Genres { public: static const char *stringFromIndex(int index); diff --git a/id3/id3v1tag.h b/id3/id3v1tag.h index 3e2039d..0adad65 100644 --- a/id3/id3v1tag.h +++ b/id3/id3v1tag.h @@ -6,7 +6,7 @@ namespace Media { -class LIB_EXPORT Id3v1Tag : public Tag +class TAG_PARSER_EXPORT Id3v1Tag : public Tag { public: Id3v1Tag(); diff --git a/id3/id3v2frame.h b/id3/id3v2frame.h index 1c02dc4..38b93d1 100644 --- a/id3/id3v2frame.h +++ b/id3/id3v2frame.h @@ -20,7 +20,7 @@ namespace Media class Id3v2Frame; -class LIB_EXPORT Id3v2FrameMaker +class TAG_PARSER_EXPORT Id3v2FrameMaker { friend class Id3v2Frame; @@ -78,7 +78,7 @@ inline uint32 Id3v2FrameMaker::requiredSize() const * \brief Defines traits for the TagField implementation of the Id3v2Frame class. */ template <> -class LIB_EXPORT TagFieldTraits +class TAG_PARSER_EXPORT TagFieldTraits { public: /*! @@ -97,7 +97,7 @@ public: typedef Id3v2Frame implementationType; }; -class LIB_EXPORT Id3v2Frame : public TagField, public StatusProvider +class TAG_PARSER_EXPORT Id3v2Frame : public TagField, public StatusProvider { friend class TagField; diff --git a/id3/id3v2tag.h b/id3/id3v2tag.h index b70f241..fcbd35c 100644 --- a/id3/id3v2tag.h +++ b/id3/id3v2tag.h @@ -12,12 +12,12 @@ namespace Media class Id3v2Tag; -struct LIB_EXPORT FrameComparer +struct TAG_PARSER_EXPORT FrameComparer { bool operator()(const uint32 &lhs, const uint32 &rhs) const; }; -class LIB_EXPORT Id3v2TagMaker +class TAG_PARSER_EXPORT Id3v2TagMaker { friend class Id3v2Tag; @@ -52,7 +52,7 @@ inline uint64 Id3v2TagMaker::requiredSize() const return m_requiredSize; } -class LIB_EXPORT Id3v2Tag : public FieldMapBasedTag +class TAG_PARSER_EXPORT Id3v2Tag : public FieldMapBasedTag { public: Id3v2Tag(); diff --git a/localeawarestring.h b/localeawarestring.h index 8a31196..c87432b 100644 --- a/localeawarestring.h +++ b/localeawarestring.h @@ -1,7 +1,7 @@ #ifndef MEDIA_LOCALEAWARESTRING_H #define MEDIA_LOCALEAWARESTRING_H -#include +#include "./global.h" #include #include @@ -11,7 +11,7 @@ namespace Media { /*! * \brief The LocaleAwareString class is a standard string with locale information (languages, countries). */ -class LIB_EXPORT LocaleAwareString : public std::string +class TAG_PARSER_EXPORT LocaleAwareString : public std::string { public: LocaleAwareString(const std::string &value = std::string()); diff --git a/margin.h b/margin.h index f13cf3e..a4e1a90 100644 --- a/margin.h +++ b/margin.h @@ -1,7 +1,8 @@ #ifndef MARGIN_H #define MARGIN_H -#include +#include "./global.h" + #include #include @@ -12,7 +13,7 @@ namespace Media { /*! * \brief The Margin class defines the four margins of a rectangle. */ -class LIB_EXPORT Margin +class TAG_PARSER_EXPORT Margin { public: constexpr Margin(uint32 top = 0, uint32 left = 0, uint32 bottom = 0, uint32 right = 0); diff --git a/matroska/ebmlelement.h b/matroska/ebmlelement.h index 10ea66f..aa4b126 100644 --- a/matroska/ebmlelement.h +++ b/matroska/ebmlelement.h @@ -23,7 +23,7 @@ class MatroskaContainer; * \brief Defines traits for the GenericFileElement implementation EbmlElement. */ template <> -class LIB_EXPORT FileElementTraits +class TAG_PARSER_EXPORT FileElementTraits { public: /*! @@ -47,7 +47,7 @@ public: typedef EbmlElement implementationType; }; -class LIB_EXPORT EbmlElement : public GenericFileElement +class TAG_PARSER_EXPORT EbmlElement : public GenericFileElement { friend class GenericFileElement; diff --git a/matroska/matroskaattachment.h b/matroska/matroskaattachment.h index 20ecdcb..c5f221c 100644 --- a/matroska/matroskaattachment.h +++ b/matroska/matroskaattachment.h @@ -8,7 +8,7 @@ namespace Media { class EbmlElement; class MatroskaAttachment; -class LIB_EXPORT MatroskaAttachmentMaker +class TAG_PARSER_EXPORT MatroskaAttachmentMaker { friend class MatroskaAttachment; @@ -42,7 +42,7 @@ inline uint64 MatroskaAttachmentMaker::requiredSize() const return m_totalSize; } -class LIB_EXPORT MatroskaAttachment : public AbstractAttachment +class TAG_PARSER_EXPORT MatroskaAttachment : public AbstractAttachment { public: MatroskaAttachment(); diff --git a/matroska/matroskachapter.h b/matroska/matroskachapter.h index 44e0a83..0af89e0 100644 --- a/matroska/matroskachapter.h +++ b/matroska/matroskachapter.h @@ -9,7 +9,7 @@ namespace Media { class EbmlElement; -class LIB_EXPORT MatroskaChapter : public AbstractChapter +class TAG_PARSER_EXPORT MatroskaChapter : public AbstractChapter { public: MatroskaChapter(EbmlElement *chapterAtomElement); diff --git a/matroska/matroskacontainer.h b/matroska/matroskacontainer.h index e8802f1..f0a4d22 100644 --- a/matroska/matroskacontainer.h +++ b/matroska/matroskacontainer.h @@ -22,7 +22,7 @@ class MatroskaEditionEntry; class MediaFileInfo; -class LIB_EXPORT MatroskaContainer : public GenericContainer +class TAG_PARSER_EXPORT MatroskaContainer : public GenericContainer { public: MatroskaContainer(MediaFileInfo &stream, uint64 startOffset); diff --git a/matroska/matroskacues.h b/matroska/matroskacues.h index 491b54c..0e59947 100644 --- a/matroska/matroskacues.h +++ b/matroska/matroskacues.h @@ -8,7 +8,7 @@ namespace Media { -class LIB_EXPORT MatroskaOffsetStates +class TAG_PARSER_EXPORT MatroskaOffsetStates { public: MatroskaOffsetStates(uint64 initialValue); @@ -40,7 +40,7 @@ inline uint64 MatroskaOffsetStates::initialValue() const return m_initialValue; } -class LIB_EXPORT MatroskaReferenceOffsetPair : public MatroskaOffsetStates +class TAG_PARSER_EXPORT MatroskaReferenceOffsetPair : public MatroskaOffsetStates { public: MatroskaReferenceOffsetPair(uint64 referenceOffset, uint64 initialValue); @@ -59,7 +59,7 @@ inline uint64 MatroskaReferenceOffsetPair::referenceOffset() const return m_referenceOffset; } -class LIB_EXPORT MatroskaCuePositionUpdater : public StatusProvider +class TAG_PARSER_EXPORT MatroskaCuePositionUpdater : public StatusProvider { public: MatroskaCuePositionUpdater(); diff --git a/matroska/matroskaeditionentry.h b/matroska/matroskaeditionentry.h index c9079ee..936711b 100644 --- a/matroska/matroskaeditionentry.h +++ b/matroska/matroskaeditionentry.h @@ -7,7 +7,7 @@ namespace Media { class EbmlElement; -class LIB_EXPORT MatroskaEditionEntry : public StatusProvider +class TAG_PARSER_EXPORT MatroskaEditionEntry : public StatusProvider { public: MatroskaEditionEntry(EbmlElement *editionEntryElement); diff --git a/matroska/matroskaid.h b/matroska/matroskaid.h index 1189bb8..b040849 100644 --- a/matroska/matroskaid.h +++ b/matroska/matroskaid.h @@ -1,7 +1,8 @@ #ifndef MATROSKAIDS_H #define MATROSKAIDS_H -#include +#include "../global.h" + #include namespace Media { @@ -488,7 +489,7 @@ enum KnownValues { } -LIB_EXPORT const char *matroskaIdName(uint32 matroskaId); +TAG_PARSER_EXPORT const char *matroskaIdName(uint32 matroskaId); } diff --git a/matroska/matroskaseekinfo.h b/matroska/matroskaseekinfo.h index ef2e302..229443a 100644 --- a/matroska/matroskaseekinfo.h +++ b/matroska/matroskaseekinfo.h @@ -9,7 +9,7 @@ namespace Media { -class LIB_EXPORT MatroskaSeekInfo : public StatusProvider +class TAG_PARSER_EXPORT MatroskaSeekInfo : public StatusProvider { public: MatroskaSeekInfo(); diff --git a/matroska/matroskatag.h b/matroska/matroskatag.h index f7d6cb9..af67e66 100644 --- a/matroska/matroskatag.h +++ b/matroska/matroskatag.h @@ -11,7 +11,7 @@ namespace Media { class EbmlElement; class MatroskaTag; -class LIB_EXPORT MatroskaTagMaker +class TAG_PARSER_EXPORT MatroskaTagMaker { friend class MatroskaTag; @@ -47,7 +47,7 @@ inline uint64 MatroskaTagMaker::requiredSize() const return m_totalSize; } -class LIB_EXPORT MatroskaTag : public FieldMapBasedTag +class TAG_PARSER_EXPORT MatroskaTag : public FieldMapBasedTag { public: MatroskaTag(); diff --git a/matroska/matroskatagfield.h b/matroska/matroskatagfield.h index 0dc3e52..09bcc4c 100644 --- a/matroska/matroskatagfield.h +++ b/matroska/matroskatagfield.h @@ -13,7 +13,7 @@ class MatroskaTagField; * \brief Defines traits for the TagField implementation of the MatroskaTagField class. */ template <> -class LIB_EXPORT TagFieldTraits +class TAG_PARSER_EXPORT TagFieldTraits { public: /*! @@ -42,7 +42,7 @@ inline bool TagFieldTraits::supportsNestedFields() return true; } -class LIB_EXPORT MatroskaTagFieldMaker +class TAG_PARSER_EXPORT MatroskaTagFieldMaker { friend class MatroskaTagField; @@ -80,7 +80,7 @@ inline uint64 MatroskaTagFieldMaker::requiredSize() const -class LIB_EXPORT MatroskaTagField : public TagField, public StatusProvider +class TAG_PARSER_EXPORT MatroskaTagField : public TagField, public StatusProvider { friend class TagField; diff --git a/matroska/matroskatagid.h b/matroska/matroskatagid.h index 84f3307..bdfa30b 100644 --- a/matroska/matroskatagid.h +++ b/matroska/matroskatagid.h @@ -10,327 +10,327 @@ namespace Media { */ namespace MatroskaTagIds { -inline LIB_EXPORT const char *original() { +inline TAG_PARSER_EXPORT const char *original() { return "ORIGINAL"; } -inline LIB_EXPORT const char *sample() { +inline TAG_PARSER_EXPORT const char *sample() { return "SAMPLE"; } -inline LIB_EXPORT const char *country() { +inline TAG_PARSER_EXPORT const char *country() { return "COUNTRY"; } -inline LIB_EXPORT const char *totalParts() { +inline TAG_PARSER_EXPORT const char *totalParts() { return "TOTAL_PARTS"; } -inline LIB_EXPORT const char *partNumber() { +inline TAG_PARSER_EXPORT const char *partNumber() { return "PART_NUMBER"; } -inline LIB_EXPORT const char *partOffset() { +inline TAG_PARSER_EXPORT const char *partOffset() { return "PART_OFFSET"; } -inline LIB_EXPORT const char *title() { +inline TAG_PARSER_EXPORT const char *title() { return "TITLE"; } -inline LIB_EXPORT const char *subtitle() { +inline TAG_PARSER_EXPORT const char *subtitle() { return "SUBTITLE"; } -inline LIB_EXPORT const char *url() { +inline TAG_PARSER_EXPORT const char *url() { return "URL"; } -inline LIB_EXPORT const char *sortWith() { +inline TAG_PARSER_EXPORT const char *sortWith() { return "SORT_WITH"; } -inline LIB_EXPORT const char *instruments() { +inline TAG_PARSER_EXPORT const char *instruments() { return "INSTRUMENTS"; } -inline LIB_EXPORT const char *email() { +inline TAG_PARSER_EXPORT const char *email() { return "EMAIL"; } -inline LIB_EXPORT const char *address() { +inline TAG_PARSER_EXPORT const char *address() { return "ADDRESS"; } -inline LIB_EXPORT const char *fax() { +inline TAG_PARSER_EXPORT const char *fax() { return "FAX"; } -inline LIB_EXPORT const char *phone() { +inline TAG_PARSER_EXPORT const char *phone() { return "PHONE"; } -inline LIB_EXPORT const char *artist() { +inline TAG_PARSER_EXPORT const char *artist() { return "ARTIST"; } -inline LIB_EXPORT const char *album() { +inline TAG_PARSER_EXPORT const char *album() { return "ALBUM"; } -inline LIB_EXPORT const char *leadPerformer() { +inline TAG_PARSER_EXPORT const char *leadPerformer() { return "LEAD_PERFORMER"; } -inline LIB_EXPORT const char *accompaniment() { +inline TAG_PARSER_EXPORT const char *accompaniment() { return "ACCOMPANIMENT"; } -inline LIB_EXPORT const char *composer() { +inline TAG_PARSER_EXPORT const char *composer() { return "COMPOSER"; } -inline LIB_EXPORT const char *arranger() { +inline TAG_PARSER_EXPORT const char *arranger() { return "ARRANGER"; } -inline LIB_EXPORT const char *lyrics() { +inline TAG_PARSER_EXPORT const char *lyrics() { return "LYRICS"; } -inline LIB_EXPORT const char *lyricist() { +inline TAG_PARSER_EXPORT const char *lyricist() { return "LYRICIST"; } -inline LIB_EXPORT const char *conductor() { +inline TAG_PARSER_EXPORT const char *conductor() { return "CONDUCTOR"; } -inline LIB_EXPORT const char *director() { +inline TAG_PARSER_EXPORT const char *director() { return "DIRECTOR"; } -inline LIB_EXPORT const char *assistantDirector() { +inline TAG_PARSER_EXPORT const char *assistantDirector() { return "ASSISTANT_DIRECTOR"; } -inline LIB_EXPORT const char *directorOfPhotography() { +inline TAG_PARSER_EXPORT const char *directorOfPhotography() { return "DIRECTOR_OF_PHOTOGRAPHY"; } -inline LIB_EXPORT const char *soundEngineer() { +inline TAG_PARSER_EXPORT const char *soundEngineer() { return "SOUND_ENGINEER"; } -inline LIB_EXPORT const char *artDirector() { +inline TAG_PARSER_EXPORT const char *artDirector() { return "ART_DIRECTOR"; } -inline LIB_EXPORT const char *productionDesigner() { +inline TAG_PARSER_EXPORT const char *productionDesigner() { return "PRODUCTION_DESIGNER"; } -inline LIB_EXPORT const char *choregrapher() { +inline TAG_PARSER_EXPORT const char *choregrapher() { return "CHOREGRAPHER"; } -inline LIB_EXPORT const char *costumeDesigner() { +inline TAG_PARSER_EXPORT const char *costumeDesigner() { return "COSTUME_DESIGNER"; } -inline LIB_EXPORT const char *actor() { +inline TAG_PARSER_EXPORT const char *actor() { return "ACTOR"; } -inline LIB_EXPORT const char *character() { +inline TAG_PARSER_EXPORT const char *character() { return "CHARACTER"; } -inline LIB_EXPORT const char *writtenBy() { +inline TAG_PARSER_EXPORT const char *writtenBy() { return "WRITTEN_BY"; } -inline LIB_EXPORT const char *screenplayBy() { +inline TAG_PARSER_EXPORT const char *screenplayBy() { return "SCREENPLAY_BY"; } -inline LIB_EXPORT const char *editedBy() { +inline TAG_PARSER_EXPORT const char *editedBy() { return "EDITED_BY"; } -inline LIB_EXPORT const char *producer() { +inline TAG_PARSER_EXPORT const char *producer() { return "PRODUCER"; } -inline LIB_EXPORT const char *coproducer() { +inline TAG_PARSER_EXPORT const char *coproducer() { return "COPRODUCER"; } -inline LIB_EXPORT const char *executiveProducer() { +inline TAG_PARSER_EXPORT const char *executiveProducer() { return "EXECUTIVE_PRODUCER"; } -inline LIB_EXPORT const char *distributedBy() { +inline TAG_PARSER_EXPORT const char *distributedBy() { return "DISTRIBUTED_BY"; } -inline LIB_EXPORT const char *masteredBy() { +inline TAG_PARSER_EXPORT const char *masteredBy() { return "MASTERED_BY"; } -inline LIB_EXPORT const char *encodedBy() { +inline TAG_PARSER_EXPORT const char *encodedBy() { return "ENCODED_BY"; } -inline LIB_EXPORT const char *mixedBy() { +inline TAG_PARSER_EXPORT const char *mixedBy() { return "MIXED_BY"; } -inline LIB_EXPORT const char *remixedBy() { +inline TAG_PARSER_EXPORT const char *remixedBy() { return "REMIXED_BY"; } -inline LIB_EXPORT const char *productionStudio() { +inline TAG_PARSER_EXPORT const char *productionStudio() { return "PRODUCTION_STUDIO"; } -inline LIB_EXPORT const char *thanksTo() { +inline TAG_PARSER_EXPORT const char *thanksTo() { return "THANKS_TO"; } -inline LIB_EXPORT const char *publisher() { +inline TAG_PARSER_EXPORT const char *publisher() { return "PUBLISHER"; } -inline LIB_EXPORT const char *label() { +inline TAG_PARSER_EXPORT const char *label() { return "LABEL"; } -inline LIB_EXPORT const char *genre() { +inline TAG_PARSER_EXPORT const char *genre() { return "GENRE"; } -inline LIB_EXPORT const char *mood() { +inline TAG_PARSER_EXPORT const char *mood() { return "MOOD"; } -inline LIB_EXPORT const char *originalMediaType() { +inline TAG_PARSER_EXPORT const char *originalMediaType() { return "ORIGINAL_MEDIA_TYPE"; } -inline LIB_EXPORT const char *contentType() { +inline TAG_PARSER_EXPORT const char *contentType() { return "CONTENT_TYPE"; } -inline LIB_EXPORT const char *subject() { +inline TAG_PARSER_EXPORT const char *subject() { return "SUBJECT"; } -inline LIB_EXPORT const char *description() { +inline TAG_PARSER_EXPORT const char *description() { return "DESCRIPTION"; } -inline LIB_EXPORT const char *keywords() { +inline TAG_PARSER_EXPORT const char *keywords() { return "KEYWORDS"; } -inline LIB_EXPORT const char *summary() { +inline TAG_PARSER_EXPORT const char *summary() { return "SUMMARY"; } -inline LIB_EXPORT const char *synopsis() { +inline TAG_PARSER_EXPORT const char *synopsis() { return "SYNOPSIS"; } -inline LIB_EXPORT const char *initialKey() { +inline TAG_PARSER_EXPORT const char *initialKey() { return "INITIAL_KEY"; } -inline LIB_EXPORT const char *period() { +inline TAG_PARSER_EXPORT const char *period() { return "PERIOD"; } -inline LIB_EXPORT const char *lawRating() { +inline TAG_PARSER_EXPORT const char *lawRating() { return "LAW_RATING"; } -inline LIB_EXPORT const char *icra() { +inline TAG_PARSER_EXPORT const char *icra() { return "ICRA"; } -inline LIB_EXPORT const char *dateRelease() { +inline TAG_PARSER_EXPORT const char *dateRelease() { return "DATE_RELEASED"; } -inline LIB_EXPORT const char *dateRecorded() { +inline TAG_PARSER_EXPORT const char *dateRecorded() { return "DATE_RECORDED"; } -inline LIB_EXPORT const char *dateEncoded() { +inline TAG_PARSER_EXPORT const char *dateEncoded() { return "DATE_ENCODED"; } -inline LIB_EXPORT const char *dateTagged() { +inline TAG_PARSER_EXPORT const char *dateTagged() { return "DATE_TAGGED"; } -inline LIB_EXPORT const char *dateDigitized() { +inline TAG_PARSER_EXPORT const char *dateDigitized() { return "DATE_DIGITIZED"; } -inline LIB_EXPORT const char *dateWritten() { +inline TAG_PARSER_EXPORT const char *dateWritten() { return "DATE_WRITTEN"; } -inline LIB_EXPORT const char *datePurchased() { +inline TAG_PARSER_EXPORT const char *datePurchased() { return "DATE_PURCHASED"; } -inline LIB_EXPORT const char *recordingLocation() { +inline TAG_PARSER_EXPORT const char *recordingLocation() { return "RECORDING_LOCATION"; } -inline LIB_EXPORT const char *compositionLocation() { +inline TAG_PARSER_EXPORT const char *compositionLocation() { return "COMPOSITION_LOCATION"; } -inline LIB_EXPORT const char *composerNationality() { +inline TAG_PARSER_EXPORT const char *composerNationality() { return "COMPOSER_NATIONALITY"; } -inline LIB_EXPORT const char *comment() { +inline TAG_PARSER_EXPORT const char *comment() { return "COMMENT"; } -inline LIB_EXPORT const char *playCounter() { +inline TAG_PARSER_EXPORT const char *playCounter() { return "PLAY_COUNTER"; } -inline LIB_EXPORT const char *rating() { +inline TAG_PARSER_EXPORT const char *rating() { return "RATING"; } -inline LIB_EXPORT const char *encoder() { +inline TAG_PARSER_EXPORT const char *encoder() { return "ENCODER"; } -inline LIB_EXPORT const char *encoderSettings() { +inline TAG_PARSER_EXPORT const char *encoderSettings() { return "ENCODER_SETTINGS"; } -inline LIB_EXPORT const char *bps() { +inline TAG_PARSER_EXPORT const char *bps() { return "BPS"; } -inline LIB_EXPORT const char *fps() { +inline TAG_PARSER_EXPORT const char *fps() { return "FPS"; } -inline LIB_EXPORT const char *bpm() { +inline TAG_PARSER_EXPORT const char *bpm() { return "BPM"; } -inline LIB_EXPORT const char *duration() { +inline TAG_PARSER_EXPORT const char *duration() { return "DURATION"; } -inline LIB_EXPORT const char *numberOfFrames() { +inline TAG_PARSER_EXPORT const char *numberOfFrames() { return "NUMBER_OF_FRAMES"; } -inline LIB_EXPORT const char *numberOfBytes() { +inline TAG_PARSER_EXPORT const char *numberOfBytes() { return "NUMBER_OF_BYTES"; } -inline LIB_EXPORT const char *measure() { +inline TAG_PARSER_EXPORT const char *measure() { return "MEASURE"; } -inline LIB_EXPORT const char *tuning() { +inline TAG_PARSER_EXPORT const char *tuning() { return "TUNING"; } -inline LIB_EXPORT const char *replaygainGain() { +inline TAG_PARSER_EXPORT const char *replaygainGain() { return "REPLAYGAIN_GAIN"; } -inline LIB_EXPORT const char *replaygainPeak() { +inline TAG_PARSER_EXPORT const char *replaygainPeak() { return "REPLAYGAIN_PEAK"; } -inline LIB_EXPORT const char *identifiers() { +inline TAG_PARSER_EXPORT const char *identifiers() { return "Identifiers"; } -inline LIB_EXPORT const char *isrc() { +inline TAG_PARSER_EXPORT const char *isrc() { return "ISRC"; } -inline LIB_EXPORT const char *mcdi() { +inline TAG_PARSER_EXPORT const char *mcdi() { return "MCDI"; } -inline LIB_EXPORT const char *isbn() { +inline TAG_PARSER_EXPORT const char *isbn() { return "ISBN"; } -inline LIB_EXPORT const char *barcode() { +inline TAG_PARSER_EXPORT const char *barcode() { return "BARCODE"; } -inline LIB_EXPORT const char *catalogNumber() { +inline TAG_PARSER_EXPORT const char *catalogNumber() { return "CATALOG_NUMBER"; } -inline LIB_EXPORT const char *labelCode() { +inline TAG_PARSER_EXPORT const char *labelCode() { return "LABEL_CODE"; } -inline LIB_EXPORT const char *lccn() { +inline TAG_PARSER_EXPORT const char *lccn() { return "LCCN"; } -inline LIB_EXPORT const char *purchaseItem() { +inline TAG_PARSER_EXPORT const char *purchaseItem() { return "PURCHASE_ITEM"; } -inline LIB_EXPORT const char *purchaseInfo() { +inline TAG_PARSER_EXPORT const char *purchaseInfo() { return "PURCHASE_INFO"; } -inline LIB_EXPORT const char *purchaseOwner() { +inline TAG_PARSER_EXPORT const char *purchaseOwner() { return "PURCHASE_OWNER"; } -inline LIB_EXPORT const char *purchasePrice() { +inline TAG_PARSER_EXPORT const char *purchasePrice() { return "PURCHASE_PRICE"; } -inline LIB_EXPORT const char *purchaseCurrency() { +inline TAG_PARSER_EXPORT const char *purchaseCurrency() { return "PURCHASE_CURRENCY"; } -inline LIB_EXPORT const char *copyright() { +inline TAG_PARSER_EXPORT const char *copyright() { return "COPYRIGHT"; } -inline LIB_EXPORT const char *productionCopyright() { +inline TAG_PARSER_EXPORT const char *productionCopyright() { return "PRODUCTION_COPYRIGHT"; } -inline LIB_EXPORT const char *license() { +inline TAG_PARSER_EXPORT const char *license() { return "LICENSE"; } -inline LIB_EXPORT const char *termsOfUse() { +inline TAG_PARSER_EXPORT const char *termsOfUse() { return "TERMS_OF_USE"; } @@ -339,7 +339,7 @@ inline LIB_EXPORT const char *termsOfUse() { /*! * \brief Returns the general TagTargetLevel for the Matroska specific \a targetLevelValue. */ -inline LIB_EXPORT TagTargetLevel matroskaTagTargetLevel(uint64 targetLevelValue) +inline TAG_PARSER_EXPORT TagTargetLevel matroskaTagTargetLevel(uint64 targetLevelValue) { return targetLevelValue > 70 ? TagTargetLevel::Collection : static_cast(targetLevelValue / 10); } @@ -347,7 +347,7 @@ inline LIB_EXPORT TagTargetLevel matroskaTagTargetLevel(uint64 targetLevelValue) /*! * \brief Returns the Matroska specific target level value for the specified general \a targetLevel. */ -inline LIB_EXPORT uint64 matroskaTagTargetLevelValue(TagTargetLevel targetLevel) +inline TAG_PARSER_EXPORT uint64 matroskaTagTargetLevelValue(TagTargetLevel targetLevel) { return static_cast(targetLevel) * 10; } diff --git a/matroska/matroskatrack.h b/matroska/matroskatrack.h index 06c9684..49e2b90 100644 --- a/matroska/matroskatrack.h +++ b/matroska/matroskatrack.h @@ -8,7 +8,7 @@ namespace Media { class EbmlElement; class MatroskaContainer; -class LIB_EXPORT MatroskaTrack : public AbstractTrack +class TAG_PARSER_EXPORT MatroskaTrack : public AbstractTrack { friend class MatroskaContainer; diff --git a/mediafileinfo.h b/mediafileinfo.h index 2e08b1e..da21ca3 100644 --- a/mediafileinfo.h +++ b/mediafileinfo.h @@ -56,7 +56,7 @@ enum class ParsingStatus : byte CriticalFailure /**< tried to parse the part, but critical errors occured */ }; -class LIB_EXPORT MediaFileInfo : public BasicFileInfo, public StatusProvider +class TAG_PARSER_EXPORT MediaFileInfo : public BasicFileInfo, public StatusProvider { public: // constructor, destructor diff --git a/mediaformat.h b/mediaformat.h index 3eb5269..8f849f2 100644 --- a/mediaformat.h +++ b/mediaformat.h @@ -1,7 +1,7 @@ #ifndef MEDIAFORMAT_H #define MEDIAFORMAT_H -#include +#include "./global.h" #include @@ -21,7 +21,7 @@ enum class MediaType Hint /**< hint */ }; -extern const char *LIB_EXPORT mediaTypeName(MediaType mediaType); +extern const char *TAG_PARSER_EXPORT mediaTypeName(MediaType mediaType); /*! * \brief The GeneralMediaFormat enum specifies the general format of media data (PCM, MPEG-4, PNG, ...). @@ -253,7 +253,7 @@ enum AudioFormatExtensions : unsigned char { }; } -class LIB_EXPORT MediaFormat +class TAG_PARSER_EXPORT MediaFormat { public: MediaFormat(GeneralMediaFormat general = GeneralMediaFormat::Unknown, unsigned char sub = 0, unsigned char extension = 0); diff --git a/mp4/mp4atom.h b/mp4/mp4atom.h index b2e2d4b..64e3425 100644 --- a/mp4/mp4atom.h +++ b/mp4/mp4atom.h @@ -22,7 +22,7 @@ class Mp4Container; * \brief Defines traits for the GenericFileElement implementation Mp4Atom. */ template <> -class LIB_EXPORT FileElementTraits +class TAG_PARSER_EXPORT FileElementTraits { public: /*! @@ -54,7 +54,7 @@ public: } }; -class LIB_EXPORT Mp4Atom : public GenericFileElement +class TAG_PARSER_EXPORT Mp4Atom : public GenericFileElement { friend class GenericFileElement; diff --git a/mp4/mp4container.h b/mp4/mp4container.h index 76e9250..5d05253 100644 --- a/mp4/mp4container.h +++ b/mp4/mp4container.h @@ -16,7 +16,7 @@ namespace Media { class MediaFileInfo; -class LIB_EXPORT Mp4Container : public GenericContainer +class TAG_PARSER_EXPORT Mp4Container : public GenericContainer { public: Mp4Container(MediaFileInfo &fileInfo, uint64 startOffset); diff --git a/mp4/mp4ids.cpp b/mp4/mp4ids.cpp index b300ba1..47cde57 100644 --- a/mp4/mp4ids.cpp +++ b/mp4/mp4ids.cpp @@ -1,377 +1,377 @@ -#include "./mp4ids.h" - -#include "../mediaformat.h" - -namespace Media { - -/*! - * \brief Encapsulates the most common MP4 atom IDs. - */ -namespace Mp4AtomIds { -} - -/*! - * \brief Encapsulates IDs of MP4 atoms holding tag information. - */ -namespace Mp4TagAtomIds { -} - -/*! - * \brief Encapsulates "mean values" used in iTunes style MP4 tags. - */ -namespace Mp4TagExtendedMeanIds { -const char *iTunes = "com.apple.iTunes"; -} - -/*! - * \brief Encapsulates "name values" used in iTunes style MP4 tags. - */ -namespace Mp4TagExtendedNameIds { -const char *cdec = "cdec"; -} - -/*! - * \brief Encapsulates all supported MP4 media type IDs. - */ -namespace Mp4MediaTypeIds { -} - -/*! - * \brief Encapsulates all supported MP4 media format IDs (aka "FOURCCs"). - * \sa http://wiki.multimedia.cx/?title=QuickTime_container - */ -namespace FourccIds { - -MediaFormat fourccToMediaFormat(uint32 fourccId) -{ - switch(fourccId) { - case Mpeg: - return GeneralMediaFormat::Mpeg1Video; - case Mpeg2Imx30: case Mpeg2Imx50: - return GeneralMediaFormat::Mpeg2Video; - case Mpeg4Video: - return GeneralMediaFormat::Mpeg4Video; - case Mpeg4TimedText: - return GeneralMediaFormat::Mpeg4TimedText; - case Hevc1: case Hevc2: - return MediaFormat(GeneralMediaFormat::Hevc); - case Avc1: case Avc2: case Avc3: case Avc4: case H264Decoder1: case H264Decoder2: - case H264Decoder3: case H264Decoder4: case H264Decoder5: case H264Decoder6: - return MediaFormat(GeneralMediaFormat::Avc); - case Divx4Decoder1: case Divx4Decoder2: - case H263Quicktime: case H2633GPP: case XvidDecoder1: case XvidDecoder2: - case XvidDecoder3: case XvidDecoder4: case XvidDecoder5: case Divx5Decoder: - return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg4AdvancedSimpleProfile0); - case Divx3Decoder1: case Divx3Decoder2: case Divx3Decoder3: case Divx3Decoder4: case Divx3Decoder5: - case Divx3Decoder6: case Divx3Decoder7: case Divx3Decoder8: case Divx3Decoder9: case Divx3Decoder10: - case Divx3Decoder11: case Divx3Decoder12: case Divx3Decoder13: case Divx3Decoder14: case Divx3Decoder15: - return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg4SimpleProfile0); - case Tiff: - return GeneralMediaFormat::Tiff; - case AppleTextAtsuiCodec: - return GeneralMediaFormat::TimedText; - case Raw: - return GeneralMediaFormat::UncompressedVideoFrames; - case Jpeg: - return GeneralMediaFormat::Jpeg; - case Gif: - return GeneralMediaFormat::Gif; - case Png: - return GeneralMediaFormat::Png; - case AdpcmAcm: - return GeneralMediaFormat::AdpcmAcm; - case ImaadpcmAcm: - return GeneralMediaFormat::ImaadpcmAcm; - case Mp3CbrOnly: case Mp3: - return MediaFormat(GeneralMediaFormat::Mpeg1Audio, SubFormats::Mpeg1Layer3); - case Mpeg4Audio: - return GeneralMediaFormat::Aac; - case Alac: - return GeneralMediaFormat::Alac; - case Ac3: - return GeneralMediaFormat::Ac3; - case EAc3: - return GeneralMediaFormat::EAc3; - case DolbyMpl: - return GeneralMediaFormat::DolbyMlp; - case Ac4: - return GeneralMediaFormat::Ac4; - case Rv20: case Rv30: case Rv40: - return GeneralMediaFormat::RealVideo; - case Int24: case Int32: - return MediaFormat(GeneralMediaFormat::Pcm); - case Int16Be: - return MediaFormat(GeneralMediaFormat::Pcm, SubFormats::PcmIntBe); - case Int16Le: - return MediaFormat(GeneralMediaFormat::Pcm, SubFormats::PcmIntLe); - case FloatingPoint32Bit: case FloatingPoint64Bit: - return MediaFormat(GeneralMediaFormat::Pcm, SubFormats::PcmFloatIeee); - case Amr: case AmrNarrowband: - return MediaFormat(GeneralMediaFormat::Amr); - case Dts: case DtsH: - return MediaFormat(GeneralMediaFormat::Dts); - case DtsE: - return MediaFormat(GeneralMediaFormat::Dts, SubFormats::DtsExpress); - case WindowsMediaAudio: case WindowsMediaAudio7: - case WindowsMediaAudio9Professional: case WindowsMediaAudio9Standard: - return MediaFormat(GeneralMediaFormat::WindowsMediaAudio); - case MsMpeg4V1Decoder1: case MsMpeg4V1Decoder2: case MsMpeg4V1Decoder3: - case MsMpeg4V1Decoder4: case MsMpeg4V1Decoder5: case MsMpeg4V1Decoder6: - return MediaFormat(GeneralMediaFormat::MicrosoftMpeg4, 1); - case MsMpeg4V2Decoder1: case MsMpeg4V2Decoder2: case MsMpeg4V2Decoder3: - case MsMpeg4V2Decoder4: - return MediaFormat(GeneralMediaFormat::MicrosoftMpeg4, 2); - case MsMpeg4V3Decoder1: case MsMpeg4V3Decoder2: - return MediaFormat(GeneralMediaFormat::MicrosoftMpeg4, 3); - case WindowsMediaVideoV17: - return MediaFormat(GeneralMediaFormat::WindowsMediaVideo, 1); - case WindowsMediaVideoV2: case WindowsMediaVideoV8: - return MediaFormat(GeneralMediaFormat::WindowsMediaVideo, 2); - // TODO: map more FOURCCs - default: - return GeneralMediaFormat::Unknown; - } -} - -} - -/*! - * \brief Encapsulates all supported MP4 media format description extensions. - * \sa https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html - */ -namespace Mp4FormatExtensionIds { -} - -/*! - * \brief Encapsulates all supported MPEG-4 elementary stream object IDs. - */ -namespace Mpeg4ElementaryStreamObjectIds { - -/*! - * \brief Returns the Media::MediaFormat denoted by the specified MPEG-4 stream ID. - */ -MediaFormat streamObjectTypeFormat(byte streamObjectTypeId) -{ - switch(streamObjectTypeId) { - case SystemsIso144961: return GeneralMediaFormat::Systems; - case SystemsIso144961v2: return MediaFormat(GeneralMediaFormat::Systems, 2); - case InteractionStream: return GeneralMediaFormat::InteractionStream; - case AfxStream: return GeneralMediaFormat::AfxStream; - case FontDataStream: return GeneralMediaFormat::FontDataStream; - case SynthesizedTextureStream: return GeneralMediaFormat::SynthesizedTextureStream; - case StreamingTextStream: return GeneralMediaFormat::StreamingTextStream; - case Mpeg4Visual: return GeneralMediaFormat::Mpeg4Video; - case Avc: return GeneralMediaFormat::Avc; - case ParameterSetsForAvc: return GeneralMediaFormat::Avc; - case Als: return GeneralMediaFormat::Als; - case Sa0c: return GeneralMediaFormat::Sa0c; - case Aac: return MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4LowComplexityProfile); - case Mpeg2VideoSimpleProfile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2SimpleProfile); - case Mpeg2VideoMainProfile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2SnrProfile); - case Mpeg2VideoSnrProfile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2SpatialProfile); - case Mpeg2VideoSpatialProfile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2HighProfile); - case Mpeg2VideoHighProfile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2HighProfile); - case Mpeg2Video422Profile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2SimpleProfile); - case Mpeg2AacMainProfile: return MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg2MainProfile); - case Mpeg2AacLowComplexityProfile: return MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg2LowComplexityProfile); - case Mpeg2AacScaleableSamplingRateProfile: return MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg2ScalableSamplingRateProfile); - case Mpeg2Audio: return GeneralMediaFormat::Mpeg2Audio; - case Mpeg1Video: return GeneralMediaFormat::Mpeg1Video; - case Mpeg1Audio: return GeneralMediaFormat::Mpeg1Audio; - case Jpeg: return GeneralMediaFormat::Jpeg; - case Png: return GeneralMediaFormat::Png; - case Evrc: case PrivateEvrc: return GeneralMediaFormat::Evrc; - case Smv: return GeneralMediaFormat::Smv; - case Gpp2Cmf: return GeneralMediaFormat::Gpp2Cmf; - case Vc1: return GeneralMediaFormat::Vc1; - case Dirac: return GeneralMediaFormat::Dirac; - case Ac3: case PrivateAc3: return GeneralMediaFormat::Ac3; - case EAc3: return GeneralMediaFormat::EAc3; - case Dts: case PrivateDts: return GeneralMediaFormat::Dts; - case DtsHdHighResolution: return MediaFormat(GeneralMediaFormat::DtsHd, SubFormats::DtsHdHighResolution); - case DtsHdMasterAudio: return MediaFormat(GeneralMediaFormat::DtsHd, SubFormats::DtsHdMasterAudio); - case DtsHdExpress: return MediaFormat(GeneralMediaFormat::DtsHd, SubFormats::DtsExpress); - case PrivateOgg: case PrivateOgg2: return GeneralMediaFormat::Vorbis; - case PrivateQcelp: return GeneralMediaFormat::Qcelp; - default: return MediaFormat(); - } -} - -} - -/*! - * \brief Encapsulates all known MPEG-4 descriptor IDs. - */ -namespace Mpeg4DescriptorIds { -} - -/*! - * \brief Returns the name of the stream type denoted by the specified MPEG-4 stream type ID. - */ -namespace Mpeg4ElementaryStreamTypeIds { - -/*! - * \brief Returns the name of the stream type denoted by the specified MPEG-4 stream type ID. - */ -const char *streamTypeName(byte streamTypeId) -{ - switch(streamTypeId) { - case ObjectDescriptor: return "object descriptor"; - case ClockReference: return "clock reference"; - case SceneDescriptor: return "scene descriptor"; - case Visual: return "visual"; - case Audio: return "audio"; - case Mpeg7: return "MPEG-7"; - case Ipmps: return "IMPS"; - case ObjectContentInfo: return "object content info"; - case MpegJava: return "MPEG Java"; - case Interaction: return "interaction"; - case Ipmp: return "IPMP"; - case FontData: return "font data"; - case StreamingText: return "streaming text"; - default: return ""; - } -} - -} - -/*! - * \brief Encapsulates all supported MPEG-4 audio object type IDs. - * \sa http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio - */ -namespace Mpeg4AudioObjectIds { - -LIB_EXPORT MediaFormat idToMediaFormat(byte mpeg4AudioObjectId, bool sbrPresent, bool psPresent) -{ - MediaFormat fmt; - switch(mpeg4AudioObjectId) { - case AacMain: - fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4MainProfile); - break; - case AacLc: - fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4LowComplexityProfile); - break; - case AacSsr: - fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4ScalableSamplingRateProfile); - break; - case AacLtp: - fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4LongTermPrediction); - break; - case Sbr: - fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4LowComplexityProfile, ExtensionFormats::SpectralBandReplication); - break; - case AacScalable: - fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4ScalableSamplingRateProfile); - break; - case ErAacLc: - fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4ERLowComplecityProfile); - break; - case ErAacLtp: - fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4ERLongTermPrediction); - break; - case ErAacLd: - fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4ERLowDelay); - break; - case Ps: - fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4LowComplexityProfile, ExtensionFormats::ParametricStereo); - break; - case Layer1: - fmt = MediaFormat(GeneralMediaFormat::Mpeg1Audio, SubFormats::Mpeg1Layer1); - break; - case Layer2: - fmt = MediaFormat(GeneralMediaFormat::Mpeg1Audio, SubFormats::Mpeg1Layer2); - break; - case Layer3: - fmt = MediaFormat(GeneralMediaFormat::Mpeg1Audio, SubFormats::Mpeg1Layer3); - break; - default: - ; - } - if(sbrPresent) { - fmt.extension |= ExtensionFormats::SpectralBandReplication; - } - if(psPresent) { - fmt.extension |= ExtensionFormats::ParametricStereo; - } - return fmt; -} - -} - -uint32 mpeg4SamplingFrequencyTable[] = { - 96000, 88200, 64000, 48000, 44100, 32000, - 24000, 22050, 16000, 12000, 11025, 8000, 7350 -}; - -/*! - * \brief Encapsulates all supported MPEG-4 channel configurations. - */ -namespace Mpeg4ChannelConfigs { - -/*! - * \brief Returns the string representation for the specified MPEG-4 channel config. - */ -const char *channelConfigString(byte config) -{ - switch(config) { - case AotSpecificConfig: - return "defined in AOT Specific Config"; - case FrontCenter: - return "1 channel: front-center"; - case FrontLeftFrontRight: - return "2 channels: front-left, front-right"; - case FrontCenterFrontLeftFrontRight: - return "3 channels: front-center, front-left, front-right"; - case FrontCenterFrontLeftFrontRightBackCenter: - return "4 channels: front-center, front-left, front-right, back-center"; - case FrontCenterFrontLeftFrontRightBackLeftBackRight: - return "5 channels: front-center, front-left, front-right, back-left, back-right"; - case FrontCenterFrontLeftFrontRightBackLeftBackRightLFEChannel: - return "6 channels: front-center, front-left, front-right, back-left, back-right, LFE-channel"; - case FrontCenterFrontLeftFrontRightSideLeftSideRightBackLeftBackRightLFEChannel: - return "8 channels: front-center, front-left, front-right, side-left, side-right, back-left, back-right, LFE-channel"; - default: - return nullptr; - } -} - -/*! - * \brief Returns the channel count for the specified MPEG-4 channel config. - */ -byte channelCount(byte config) -{ - switch(config) { - case FrontCenter: - return 1; - case FrontLeftFrontRight: - return 2; - case FrontCenterFrontLeftFrontRight: - return 3; - case FrontCenterFrontLeftFrontRightBackCenter: - return 4; - case FrontCenterFrontLeftFrontRightBackLeftBackRight: - return 5; - case FrontCenterFrontLeftFrontRightBackLeftBackRightLFEChannel: - return 6; - case FrontCenterFrontLeftFrontRightSideLeftSideRightBackLeftBackRightLFEChannel: - return 8; - default: - return 0; - } -} - -} - -/*! - * \brief Encapsulates MPEG-4 video (14496-2) codes. - */ -namespace Mpeg4VideoCodes { -} - -/*! - * \brief Encapsulates MPEG-2 video codes. - */ -namespace Mpeg2VideoCodes { -} - -} +#include "./mp4ids.h" + +#include "../mediaformat.h" + +namespace Media { + +/*! + * \brief Encapsulates the most common MP4 atom IDs. + */ +namespace Mp4AtomIds { +} + +/*! + * \brief Encapsulates IDs of MP4 atoms holding tag information. + */ +namespace Mp4TagAtomIds { +} + +/*! + * \brief Encapsulates "mean values" used in iTunes style MP4 tags. + */ +namespace Mp4TagExtendedMeanIds { +const char *iTunes = "com.apple.iTunes"; +} + +/*! + * \brief Encapsulates "name values" used in iTunes style MP4 tags. + */ +namespace Mp4TagExtendedNameIds { +const char *cdec = "cdec"; +} + +/*! + * \brief Encapsulates all supported MP4 media type IDs. + */ +namespace Mp4MediaTypeIds { +} + +/*! + * \brief Encapsulates all supported MP4 media format IDs (aka "FOURCCs"). + * \sa http://wiki.multimedia.cx/?title=QuickTime_container + */ +namespace FourccIds { + +MediaFormat fourccToMediaFormat(uint32 fourccId) +{ + switch(fourccId) { + case Mpeg: + return GeneralMediaFormat::Mpeg1Video; + case Mpeg2Imx30: case Mpeg2Imx50: + return GeneralMediaFormat::Mpeg2Video; + case Mpeg4Video: + return GeneralMediaFormat::Mpeg4Video; + case Mpeg4TimedText: + return GeneralMediaFormat::Mpeg4TimedText; + case Hevc1: case Hevc2: + return MediaFormat(GeneralMediaFormat::Hevc); + case Avc1: case Avc2: case Avc3: case Avc4: case H264Decoder1: case H264Decoder2: + case H264Decoder3: case H264Decoder4: case H264Decoder5: case H264Decoder6: + return MediaFormat(GeneralMediaFormat::Avc); + case Divx4Decoder1: case Divx4Decoder2: + case H263Quicktime: case H2633GPP: case XvidDecoder1: case XvidDecoder2: + case XvidDecoder3: case XvidDecoder4: case XvidDecoder5: case Divx5Decoder: + return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg4AdvancedSimpleProfile0); + case Divx3Decoder1: case Divx3Decoder2: case Divx3Decoder3: case Divx3Decoder4: case Divx3Decoder5: + case Divx3Decoder6: case Divx3Decoder7: case Divx3Decoder8: case Divx3Decoder9: case Divx3Decoder10: + case Divx3Decoder11: case Divx3Decoder12: case Divx3Decoder13: case Divx3Decoder14: case Divx3Decoder15: + return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg4SimpleProfile0); + case Tiff: + return GeneralMediaFormat::Tiff; + case AppleTextAtsuiCodec: + return GeneralMediaFormat::TimedText; + case Raw: + return GeneralMediaFormat::UncompressedVideoFrames; + case Jpeg: + return GeneralMediaFormat::Jpeg; + case Gif: + return GeneralMediaFormat::Gif; + case Png: + return GeneralMediaFormat::Png; + case AdpcmAcm: + return GeneralMediaFormat::AdpcmAcm; + case ImaadpcmAcm: + return GeneralMediaFormat::ImaadpcmAcm; + case Mp3CbrOnly: case Mp3: + return MediaFormat(GeneralMediaFormat::Mpeg1Audio, SubFormats::Mpeg1Layer3); + case Mpeg4Audio: + return GeneralMediaFormat::Aac; + case Alac: + return GeneralMediaFormat::Alac; + case Ac3: + return GeneralMediaFormat::Ac3; + case EAc3: + return GeneralMediaFormat::EAc3; + case DolbyMpl: + return GeneralMediaFormat::DolbyMlp; + case Ac4: + return GeneralMediaFormat::Ac4; + case Rv20: case Rv30: case Rv40: + return GeneralMediaFormat::RealVideo; + case Int24: case Int32: + return MediaFormat(GeneralMediaFormat::Pcm); + case Int16Be: + return MediaFormat(GeneralMediaFormat::Pcm, SubFormats::PcmIntBe); + case Int16Le: + return MediaFormat(GeneralMediaFormat::Pcm, SubFormats::PcmIntLe); + case FloatingPoint32Bit: case FloatingPoint64Bit: + return MediaFormat(GeneralMediaFormat::Pcm, SubFormats::PcmFloatIeee); + case Amr: case AmrNarrowband: + return MediaFormat(GeneralMediaFormat::Amr); + case Dts: case DtsH: + return MediaFormat(GeneralMediaFormat::Dts); + case DtsE: + return MediaFormat(GeneralMediaFormat::Dts, SubFormats::DtsExpress); + case WindowsMediaAudio: case WindowsMediaAudio7: + case WindowsMediaAudio9Professional: case WindowsMediaAudio9Standard: + return MediaFormat(GeneralMediaFormat::WindowsMediaAudio); + case MsMpeg4V1Decoder1: case MsMpeg4V1Decoder2: case MsMpeg4V1Decoder3: + case MsMpeg4V1Decoder4: case MsMpeg4V1Decoder5: case MsMpeg4V1Decoder6: + return MediaFormat(GeneralMediaFormat::MicrosoftMpeg4, 1); + case MsMpeg4V2Decoder1: case MsMpeg4V2Decoder2: case MsMpeg4V2Decoder3: + case MsMpeg4V2Decoder4: + return MediaFormat(GeneralMediaFormat::MicrosoftMpeg4, 2); + case MsMpeg4V3Decoder1: case MsMpeg4V3Decoder2: + return MediaFormat(GeneralMediaFormat::MicrosoftMpeg4, 3); + case WindowsMediaVideoV17: + return MediaFormat(GeneralMediaFormat::WindowsMediaVideo, 1); + case WindowsMediaVideoV2: case WindowsMediaVideoV8: + return MediaFormat(GeneralMediaFormat::WindowsMediaVideo, 2); + // TODO: map more FOURCCs + default: + return GeneralMediaFormat::Unknown; + } +} + +} + +/*! + * \brief Encapsulates all supported MP4 media format description extensions. + * \sa https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html + */ +namespace Mp4FormatExtensionIds { +} + +/*! + * \brief Encapsulates all supported MPEG-4 elementary stream object IDs. + */ +namespace Mpeg4ElementaryStreamObjectIds { + +/*! + * \brief Returns the Media::MediaFormat denoted by the specified MPEG-4 stream ID. + */ +MediaFormat streamObjectTypeFormat(byte streamObjectTypeId) +{ + switch(streamObjectTypeId) { + case SystemsIso144961: return GeneralMediaFormat::Systems; + case SystemsIso144961v2: return MediaFormat(GeneralMediaFormat::Systems, 2); + case InteractionStream: return GeneralMediaFormat::InteractionStream; + case AfxStream: return GeneralMediaFormat::AfxStream; + case FontDataStream: return GeneralMediaFormat::FontDataStream; + case SynthesizedTextureStream: return GeneralMediaFormat::SynthesizedTextureStream; + case StreamingTextStream: return GeneralMediaFormat::StreamingTextStream; + case Mpeg4Visual: return GeneralMediaFormat::Mpeg4Video; + case Avc: return GeneralMediaFormat::Avc; + case ParameterSetsForAvc: return GeneralMediaFormat::Avc; + case Als: return GeneralMediaFormat::Als; + case Sa0c: return GeneralMediaFormat::Sa0c; + case Aac: return MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4LowComplexityProfile); + case Mpeg2VideoSimpleProfile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2SimpleProfile); + case Mpeg2VideoMainProfile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2SnrProfile); + case Mpeg2VideoSnrProfile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2SpatialProfile); + case Mpeg2VideoSpatialProfile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2HighProfile); + case Mpeg2VideoHighProfile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2HighProfile); + case Mpeg2Video422Profile: return MediaFormat(GeneralMediaFormat::Mpeg4Video, SubFormats::Mpeg2SimpleProfile); + case Mpeg2AacMainProfile: return MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg2MainProfile); + case Mpeg2AacLowComplexityProfile: return MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg2LowComplexityProfile); + case Mpeg2AacScaleableSamplingRateProfile: return MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg2ScalableSamplingRateProfile); + case Mpeg2Audio: return GeneralMediaFormat::Mpeg2Audio; + case Mpeg1Video: return GeneralMediaFormat::Mpeg1Video; + case Mpeg1Audio: return GeneralMediaFormat::Mpeg1Audio; + case Jpeg: return GeneralMediaFormat::Jpeg; + case Png: return GeneralMediaFormat::Png; + case Evrc: case PrivateEvrc: return GeneralMediaFormat::Evrc; + case Smv: return GeneralMediaFormat::Smv; + case Gpp2Cmf: return GeneralMediaFormat::Gpp2Cmf; + case Vc1: return GeneralMediaFormat::Vc1; + case Dirac: return GeneralMediaFormat::Dirac; + case Ac3: case PrivateAc3: return GeneralMediaFormat::Ac3; + case EAc3: return GeneralMediaFormat::EAc3; + case Dts: case PrivateDts: return GeneralMediaFormat::Dts; + case DtsHdHighResolution: return MediaFormat(GeneralMediaFormat::DtsHd, SubFormats::DtsHdHighResolution); + case DtsHdMasterAudio: return MediaFormat(GeneralMediaFormat::DtsHd, SubFormats::DtsHdMasterAudio); + case DtsHdExpress: return MediaFormat(GeneralMediaFormat::DtsHd, SubFormats::DtsExpress); + case PrivateOgg: case PrivateOgg2: return GeneralMediaFormat::Vorbis; + case PrivateQcelp: return GeneralMediaFormat::Qcelp; + default: return MediaFormat(); + } +} + +} + +/*! + * \brief Encapsulates all known MPEG-4 descriptor IDs. + */ +namespace Mpeg4DescriptorIds { +} + +/*! + * \brief Returns the name of the stream type denoted by the specified MPEG-4 stream type ID. + */ +namespace Mpeg4ElementaryStreamTypeIds { + +/*! + * \brief Returns the name of the stream type denoted by the specified MPEG-4 stream type ID. + */ +const char *streamTypeName(byte streamTypeId) +{ + switch(streamTypeId) { + case ObjectDescriptor: return "object descriptor"; + case ClockReference: return "clock reference"; + case SceneDescriptor: return "scene descriptor"; + case Visual: return "visual"; + case Audio: return "audio"; + case Mpeg7: return "MPEG-7"; + case Ipmps: return "IMPS"; + case ObjectContentInfo: return "object content info"; + case MpegJava: return "MPEG Java"; + case Interaction: return "interaction"; + case Ipmp: return "IPMP"; + case FontData: return "font data"; + case StreamingText: return "streaming text"; + default: return ""; + } +} + +} + +/*! + * \brief Encapsulates all supported MPEG-4 audio object type IDs. + * \sa http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio + */ +namespace Mpeg4AudioObjectIds { + +TAG_PARSER_EXPORT MediaFormat idToMediaFormat(byte mpeg4AudioObjectId, bool sbrPresent, bool psPresent) +{ + MediaFormat fmt; + switch(mpeg4AudioObjectId) { + case AacMain: + fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4MainProfile); + break; + case AacLc: + fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4LowComplexityProfile); + break; + case AacSsr: + fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4ScalableSamplingRateProfile); + break; + case AacLtp: + fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4LongTermPrediction); + break; + case Sbr: + fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4LowComplexityProfile, ExtensionFormats::SpectralBandReplication); + break; + case AacScalable: + fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4ScalableSamplingRateProfile); + break; + case ErAacLc: + fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4ERLowComplecityProfile); + break; + case ErAacLtp: + fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4ERLongTermPrediction); + break; + case ErAacLd: + fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4ERLowDelay); + break; + case Ps: + fmt = MediaFormat(GeneralMediaFormat::Aac, SubFormats::AacMpeg4LowComplexityProfile, ExtensionFormats::ParametricStereo); + break; + case Layer1: + fmt = MediaFormat(GeneralMediaFormat::Mpeg1Audio, SubFormats::Mpeg1Layer1); + break; + case Layer2: + fmt = MediaFormat(GeneralMediaFormat::Mpeg1Audio, SubFormats::Mpeg1Layer2); + break; + case Layer3: + fmt = MediaFormat(GeneralMediaFormat::Mpeg1Audio, SubFormats::Mpeg1Layer3); + break; + default: + ; + } + if(sbrPresent) { + fmt.extension |= ExtensionFormats::SpectralBandReplication; + } + if(psPresent) { + fmt.extension |= ExtensionFormats::ParametricStereo; + } + return fmt; +} + +} + +uint32 mpeg4SamplingFrequencyTable[] = { + 96000, 88200, 64000, 48000, 44100, 32000, + 24000, 22050, 16000, 12000, 11025, 8000, 7350 +}; + +/*! + * \brief Encapsulates all supported MPEG-4 channel configurations. + */ +namespace Mpeg4ChannelConfigs { + +/*! + * \brief Returns the string representation for the specified MPEG-4 channel config. + */ +const char *channelConfigString(byte config) +{ + switch(config) { + case AotSpecificConfig: + return "defined in AOT Specific Config"; + case FrontCenter: + return "1 channel: front-center"; + case FrontLeftFrontRight: + return "2 channels: front-left, front-right"; + case FrontCenterFrontLeftFrontRight: + return "3 channels: front-center, front-left, front-right"; + case FrontCenterFrontLeftFrontRightBackCenter: + return "4 channels: front-center, front-left, front-right, back-center"; + case FrontCenterFrontLeftFrontRightBackLeftBackRight: + return "5 channels: front-center, front-left, front-right, back-left, back-right"; + case FrontCenterFrontLeftFrontRightBackLeftBackRightLFEChannel: + return "6 channels: front-center, front-left, front-right, back-left, back-right, LFE-channel"; + case FrontCenterFrontLeftFrontRightSideLeftSideRightBackLeftBackRightLFEChannel: + return "8 channels: front-center, front-left, front-right, side-left, side-right, back-left, back-right, LFE-channel"; + default: + return nullptr; + } +} + +/*! + * \brief Returns the channel count for the specified MPEG-4 channel config. + */ +byte channelCount(byte config) +{ + switch(config) { + case FrontCenter: + return 1; + case FrontLeftFrontRight: + return 2; + case FrontCenterFrontLeftFrontRight: + return 3; + case FrontCenterFrontLeftFrontRightBackCenter: + return 4; + case FrontCenterFrontLeftFrontRightBackLeftBackRight: + return 5; + case FrontCenterFrontLeftFrontRightBackLeftBackRightLFEChannel: + return 6; + case FrontCenterFrontLeftFrontRightSideLeftSideRightBackLeftBackRightLFEChannel: + return 8; + default: + return 0; + } +} + +} + +/*! + * \brief Encapsulates MPEG-4 video (14496-2) codes. + */ +namespace Mpeg4VideoCodes { +} + +/*! + * \brief Encapsulates MPEG-2 video codes. + */ +namespace Mpeg2VideoCodes { +} + +} diff --git a/mp4/mp4ids.h b/mp4/mp4ids.h index f1ec712..def9341 100644 --- a/mp4/mp4ids.h +++ b/mp4/mp4ids.h @@ -1,712 +1,713 @@ -#ifndef MP4TAGATOMNAMES_H -#define MP4TAGATOMNAMES_H - -#include -#include - -namespace Media -{ - -class MediaFormat; - -namespace Mp4AtomIds { -enum KnownValue : uint32 { - AvcConfiguration = 0x61766343, - BitrateBox = 0x62747274, - CleanAperature = 0x636c6170, - ChunkOffset64 = 0x636f3634, - CompositionTimeToSample = 0x63747473, - Data = 0x64617461, - DataInformation = 0x64696e66, - DataReference = 0x64726566, - Drms = 0x64726D73, - Edts = 0x65647473, - Edit = 0x656C7374, - Free = 0x66726565, - FileType = 0x66747970, - HandlerReference = 0x68646c72, - HintMediaHeader = 0x686D6864, - ItunesList = 0x696c7374, - MediaData = 0x6d646174, - MediaHeader = 0x6d646864, - Media = 0x6d646961, - Mean = 0x6D65616E, - MovieExtendsHeader = 0x6D656864, - Meta = 0x6d657461, - MovieFragmentHeader = 0x6D666864, - MovieFragmentRandomAccess = 0x6d667261, - MediaInformation = 0x6d696e66, - MovieFragment = 0x6d6f6f66, - Movie = 0x6d6f6f76, - MovieExtends = 0x6D766578, - MovieHeader = 0x6D766864, - Name = 0x6E616D65, - NullMediaHeaderBox = 0x6E6D6864, - PaddingBits = 0x70616462, - PixalAspectRatio = 0x70617370, - ProgressiveDownloadInformation = 0x7064696e, - SampleToGroup = 0x73626770, - IndependentAndDisposableSamples = 0x73647470, - SampleGroupDescription = 0x73677064, - Skip = 0x736b6970, - SoundMediaHeader = 0x736D6864, - SampleTable = 0x7374626c, - ChunkOffset = 0x7374636f, - DegradationPriority = 0x73746470, - SampleToChunk = 0x73747363, - SampleDescription = 0x73747364, - ShadowSyncSample = 0x73747368, - SyncSample = 0x73747373, - SampleSize = 0x7374737A, - DecodingTimeToSample = 0x73747473, - CompactSampleSize = 0x73747a32, - SubSampleInformation = 0x73756273, - TrackFragmentHeader = 0x74666864, - TrackHeader = 0x746b6864, - TrackFragment = 0x74726166, - Track = 0x7472616b, - TrackReference = 0x74726566, - TrackExtends = 0x74726578, - TrackFragmentRun = 0x7472756E, - UserData = 0x75647461, - DataEntryUrl = 0x75726C20, - DataEntryUrn = 0x75726E20, - VideoMediaHeader = 0x766D6864, - Wide = 0x77696465 -}; -} - -namespace Mp4TagAtomIds { -enum KnownValue : uint32 { - Album = 0xA9616c62, - AlbumArtist = 0x61415254, - Artist = 0xA9415254, - Bpm = 0x746d706f, - Category = 0x63617467, - Comment = 0xA9636d74, - Composer = 0xA9777274, - Copyright = 0x63707274, - Cover = 0x636f7672, - Description = 0x64657363, - DiskPosition = 0x6469736b, - Encoder = 0xA9746f6f, - EpisodeGlobalUniqueId = 0x65676964, - Extended = 0x2d2d2d2d, - GaplessPlayback = 0x70676170, - Genre = 0xA967656e, - Grouping = 0xA9677270, - Keywords = 0x6b657977, - Lyricist = 0xA9737766, - Lyrics = 0xA96c7972, - MediaType = 0x7374696B, - Performers = 0xA9707266, - Podcast = 0x70637374, - PodcastUrl = 0x7075726c, - PreDefinedGenre = 0x676e7265, - Producer = 0xA9707264, - PurchaseDate = 0x70757264, - Rating = 0x72746e67, - RecordLabel = 0xA96c6162, - Title = 0xA96e616d, - TrackPosition = 0x74726b6e, - TvEpisode = 0x74766573, - TvEpisodeName = 0x7476656e, - TvNetworkName = 0x74766e6e, - TvSeason = 0x7476736e, - TvShowName = 0x74767368, - Year = 0xA9646179 -}; -} - -namespace Mp4TagExtendedMeanIds { -extern const char *iTunes; -} - -namespace Mp4TagExtendedNameIds { -extern const char *cdec; -} - -namespace Mp4MediaTypeIds { -enum KnownValue : uint32 { - Sound = 0x736f756e, /**< Sound/Audio */ - Video = 0x76696465, /**< Video */ - Hint = 0x68696e74, /**< Hint */ - Meta = 0x6d657461 /**< Meta */ -}; -} - -namespace FourccIds { -enum KnownValue : uint32 { - Ac3 = 0x61632d33, /**< Dolby Digital */ - Ac4 = 0x61632d34, /**< ? */ - AdpcmAcm = 0x6D730002, /**< ? */ - Agsm = 0x6167736D, - Alac = 0x616C6163, /**< Apple Losless Audio Codec */ - Alaw = 0x616C6177, - Alaw21 = 0x616C6177, - AlphaCompositor = 0x626C6E64, - AlphaGain = 0x6761696E, - Amr = 0x73617762, - AmrNarrowband = 0x73616D72, - Animation = 0x726C6520, /**< Animation */ - Appl1 = 0x6476690, - Appl2 = 0x6C70630, - Apple16BitGray = 0x62313667, - Apple32BitGrayWithAlpha = 0x62333261, - Apple48BitRgb = 0x62343872, - Apple64BitArgb1 = 0x62363461, - Apple64BitArgb2 = 0x62617365, - Apple64BitArgb3 = 0x626C6974, - AppleAnimation = 0x726C6520, - AppleAvrJpeg = 0x61767220, - AppleBmp = 0x57524C45, - AppleCinepak = 0x63766964, - AppleCmyk = 0x636D796B, - AppleComponentVideoYuv422 = 0x79757632, - AppleCurve = 0x70617468, - AppleDvc = 0x64766320, - AppleDvcpro = 0x64767070, - AppleDvcpro501 = 0x6476356E, - AppleDvcpro502 = 0x64763570, - AppleDvcpro50Ntsc = 0x6476356E, - AppleDvcpro50Pal = 0x64763570, - AppleDvcproPal = 0x64767070, - AppleDvDvcproNtsc = 0x6476630, - AppleDvp = 0x64766370, - AppleDvPal = 0x64766370, - AppleFlc = 0x666C6963, - AppleGif = 0x67696620, - AppleGraphics = 0x736D630, - AppleGsm101 = 0x6167736D, - AppleH261 = 0x68323631, - AppleIntermediateCodec = 0x69636F64, - AppleLossless = 0x616C6163, - AppleMacpaint = 0x504E5447, - AppleMicrosoftVideo1 = 0x6D737663, - AppleMotionJpegA = 0x6D6A7061, - AppleMotionJpegB = 0x6D6A7062, - AppleMpeg4Compressor = 0x6D703476, - AppleMpeg4Decompressor = 0x6D703476, - AppleOpendmlJpeg = 0x646D6231, - ApplePhotoCd = 0x6B706364, - ApplePhotoJpeg = 0x6A706567, - ApplePixletVideo = 0x70786C74, - ApplePlanarRgb = 0x38425053, - ApplePng = 0x706E670, - AppleQuickdraw = 0x71647277, - AppleR408 = 0x72343038, - AppleScalingCodec = 0x7363616C, - AppleSgi = 0x2E534749, - AppleSorensonYuv9Codec = 0x73797639, - AppleTextAtsuiCodec = 0x74657874, - AppleTga = 0x7467610, - AppleTiff = 0x74696666, - AppleV408 = 0x76343038, - AppleVcH263 = 0x68323633, - AppleVideo = 0x72707A61, /**< Apple video */ - AppleYuv420Codec1 = 0x6A343230, - AppleYuv420Codec2 = 0x6D797576, - AppleYuv420Codec3 = 0x79343230, - AppleYuv422Codec2Vuy = 0x32767579, - AppleYuv422Codec4 = 0x79757678, - AppleYuv422CodecYuvs = 0x79757673, - AppleYuv422CodecYuvu = 0x79757675, - Avc0Media = 0x64726D69, - Avc1 = 0x61766331, /**< H.264/MPEG-4 AVC video */ - Avc2 = 0x61766332, /**< H.264/MPEG-4 AVC video */ - Avc3 = 0x61766333, /**< H.264/MPEG-4 AVC video */ - Avc4 = 0x61766334, /**< H.264/MPEG-4 AVC video */ - Blur = 0x626C7572, - Bps8 = 0x38627073, - BrightnessAndContrast = 0x6272636F, - ChannelCompositor = 0x6368616E, - ChromaKey = 0x636B6579, - Cinepak = 0x63766964, /**< Cinepak */ - Cloud = 0x636C6F75, - ColorStyle = 0x736F6C72, - Colorsync = 0x73796E63, - ColorTint = 0x74696E74, - CrossFade = 0x64736C76, - Cvid = 0x63766964, - Divx3Decoder1 = 0x41503431, - Divx3Decoder2 = 0x434F4C30, - Divx3Decoder3 = 0x434F4C31, - Divx3Decoder4 = 0x44495633, - Divx3Decoder5 = 0x44495634, - Divx3Decoder6 = 0x44495635, - Divx3Decoder7 = 0x44495636, - Divx3Decoder8 = 0x4D504733, - Divx3Decoder9 = 0x6D706733, - Divx3Decoder10 = 0x636F6C30, - Divx3Decoder11 = 0x636F6C31, - Divx3Decoder12 = 0x64697633, - Divx3Decoder13 = 0x64697634, - Divx3Decoder14 = 0x64697635, - Divx3Decoder15 = 0x64697636, - Divx4Decoder1 = 0x44495658, - Divx4Decoder2 = 0x64697678, - Divx5Decoder = 0x44583530, - Drms = 0x64726D73, - Drmi = 0x64726D69, - Dts = 0x6474736C, - DtsH = 0x64747368, - DtsE = 0x64747365, - Dvca = 0x64766361, - DvcPro501 = 0x64763570, - DvcPro502 = 0x6476356E, - DvcProPal = 0x64767070, - EAc3 = 0x65632D33, - EdgeDetection = 0x65646765, - Emboss = 0x656D6273, - Explode = 0x78706C6F, - FilmNoise = 0x666D6E73, - Fire = 0x66697265, - FlashPixImage = 0x66706978, - FlashScreenVideoDecoder = 0x46535631, - FloatingPoint32Bit = 0x666C3332, - FloatingPoint64Bit = 0x666C3634, - GeneralConvolution = 0x67656E6B, - Gif = 0x67696620, /**< CompuServe Graphics Interchange Format */ - Glass = 0x676C6173, - GradientWipe = 0x6D617474, - Graphics = 0x736D6320, /**< Graphics */ - H263Quicktime = 0x68323633, /**< H.263/MPEG-4 ASP video (Quicktime) */ - H2633GPP = 0x73323633, /**< H.263 (3GPP format) */ - H264Decoder1 = 0x44415643, - H264Decoder2 = 0x48323634, - H264Decoder3 = 0x56535348, - H264Decoder4 = 0x58323634, - H264Decoder5 = 0x68323634, - H264Decoder6 = 0x78323634, - Hdv3 = 0x68647633, - Hevc1 = 0x68766331, /**< H.265/High Efficiency Video Coding */ - Hevc2 = 0x68657631, /**< H.265/High Efficiency Video Coding */ - HslBalance = 0x68736C62, - Ima4 = 0x696D6134, - Ima41 = 0x696D6134, - ImaadpcmAcm = 0x6D730011, /**< ? */ - Implode = 0x6D706C6F, - Int16Be = 0x74776F73, - Int16Le = 0x736F7774, - Int24 = 0x696E3234, - Int32 = 0x696E3332, - Iris = 0x736D7032, - IvxDecoder1 = 0x33495632, - IvxDecoder2 = 0x33495644, - IvxDecoder3 = 0x33697632, - IvxDecoder4 = 0x33697664, - Jpeg = 0x6a706567, /**< JPEG */ - Jpeg2000Decoder = 0x6D6A7032, - Law21 = 0x756C6177, - LensFlare = 0x6C656E73, - Lle = 0x726C6520, - Mac3 = 0x6D616333, - Mac6 = 0x6D616336, - Mace31 = 0x4D414333, - Mace61 = 0x4D414336, - MatrixWipe = 0x736D7034, - DolbyMpl = 0x6D6C7061, - MotionJpegA = 0x6D6A7061, /**< Motion-JPEG (format A) */ - MotionJpegB = 0x6D6A7062, /**< Motion-JPEG (format B) */ - Mp3 = 0x2e6d7033, /**< MPEG-1 Layer 3 */ - Mp3CbrOnly = 0x6D730055, /**< MPEG-1 Layer 3 (constant bitrate only) */ - Mpeg = 0x4D504547, - Mpeg2Imx30 = 0x6D78336E, - Mpeg2Imx50 = 0x6D783570, - Mpeg4Audio = 0x6d703461, /**< MPEG-4 audio */ - Mpeg4Decoder1 = 0x464D5034, - Mpeg4Decoder2 = 0x53454447, - Mpeg4Decoder3 = 0x57563146, - Mpeg4Sample = 0x6d703473, /**< MPEG-4 stream (other then video/audio) */ - Mpeg4TimedText = 0x74783367, /**< MPEG-4 Timed Text / Streaming text format / Part 17 */ - Mpeg4Video = 0x6d703476, /**< MPEG-4 video */ - MsMpeg4V1Decoder1 = 0x44495631, - MsMpeg4V1Decoder2 = 0x64697631, - MsMpeg4V1Decoder3 = 0x4D504734, - MsMpeg4V1Decoder4 = 0x6D706734, - MsMpeg4V1Decoder5 = 0x4D504731, - MsMpeg4V1Decoder6 = 0x6D706731, - MsMpeg4V2Decoder1 = 0x44495632, - MsMpeg4V2Decoder2 = 0x64697632, - MsMpeg4V2Decoder3 = 0x4D503432, - MsMpeg4V2Decoder4 = 0x6D703432, - MsMpeg4V3Decoder1 = 0x4D503433, - MsMpeg4V3Decoder2 = 0x6D703433, - NtscDv25Video = 0x64766320, /**< NTSC DV-25 video */ - Oggs = 0x4F676753, - PalDv25Video = 0x64766370, /**< PAL DV-25 video */ - PdfImage = 0x70646620, - Png = 0x706E6720, /**< Portable Network Graphics */ - Push = 0x70757368, - Qclp = 0x51636C70, - QdesignMusic1Decoder = 0x51444D43, - QdesignMusic2 = 0x51444D32, - Qdmc = 0x51444D43, - Qdrw = 0x71647277, - QtvrCubicCodec = 0x63757061, - QtvrCylindricalCodec = 0x6C747061, - QualcommPurevoice = 0x51636C70, - QualcommQcelp = 0x51636C71, - Radial = 0x736D7033, - Raw = 0x72617720, /**< Uncompressed RGB */ - RgbBalance = 0x72676262, - Ripple = 0x7269706C, - Rpza = 0x72707A61, - Rv20 = 0x52563230, - Rv30 = 0x52563330, - Rv40 = 0x52563430, - Sharpen = 0x73687270, - Slide = 0x736C6964, - Smc = 0x736D6320, - SorensonH263Decoder = 0x464C5631, - SorensonVideo3Compressor = 0x53565133, - SorensonVideoDecompressor = 0x53565131, - Sowt = 0x736F7774, - SpecialEffectsAndFilters = 0x67656666, - Svq1 = 0x73767131, - Svq3 = 0x73767133, - Tiff = 0x74696666, /**< Tagged Image File Format */ - TravelingMatte = 0x74726176, - TruemotionVp6Decoder1 = 0x56503632, - TruemotionVp6Decoder2 = 0x56503646, - Twos = 0x74776F73, - Ulaw = 0x756C6177, - Ulaw21 = 0x756C6177, - VcmImageCodec = 0x4D6A7067, - Vdva = 0x76647661, - WindowsMediaAudio = 0x6F776D61, /**< ? */ - WindowsMediaAudio7 = 0x574D4131, - WindowsMediaAudio9Professional = 0x574D4133, - WindowsMediaAudio9Standard = 0x574D4132, - WindowsMediaVideoV17 = 0x574D5637, - WindowsMediaVideoV2 = 0x574D5632, - WindowsMediaVideoV8 = 0x574D5638, - Wipe = 0x736D7074, - WmvImageCodec1 = 0x4D347332, - WmvImageCodec2 = 0x4D703432, - WmvImageCodec3 = 0x4D703433, - WmvImageCodec4 = 0x4D703453, - WmvImageCodec5 = 0x574D5631, - WmvImageCodec6 = 0x574D5632, - WmvImageCodec7 = 0x574D5633, - XvidDecoder1 = 0x424C5A30, - XvidDecoder2 = 0x58564944, - XvidDecoder3 = 0x58564958, - XvidDecoder4 = 0x58766944, - XvidDecoder5 = 0x78766964, - Yuv422HardwareAccelerationCodecYuvs1 = 0x32767579, - Yuv422HardwareAccelerationCodecYuvs2 = 0x61633136, - Yuv422HardwareAccelerationCodecYuvs3 = 0x61633332, - Yuv422HardwareAccelerationCodecYuvs4 = 0x61634247, - Yuv422HardwareAccelerationCodecYuvs5 = 0x79757673, - Zoom = 0x7A6F6F6D -}; - -LIB_EXPORT MediaFormat fourccToMediaFormat(uint32 fourccId); - -} - -namespace Mp4FormatExtensionIds { -enum KnownValue : uint32 { - GammaLevel = 0x67616D61, /**< A 32-bit fixed-point number indicating the gamma level at which the image was captured. The decompressor can use this value to gamma-correct at display time. */ - FieldHandling = 0x6669656C, /**< Two 8-bit integers that define field handling. */ - DefaultQuantizationTable = 0x6D6A7174, /**< The default quantization table for a Motion-JPEG data stream. */ - DefaultHuffmanTable = 0x6D6A6874, /**< The default Huffman table for a Motion-JPEG data stream. */ - Mpeg4ElementaryStreamDescriptor = 0x65736473, /**< An MPEG-4 elementary stream descriptor atom. This extension is required for MPEG-4 video. */ - Mpeg4ElementaryStreamDescriptor2 = 0x6D346473, /**< Alternative if encoded to AVC stanard. */ - AvcConfiguration = 0x61766343, /**< An H.264 AVCConfigurationBox. This extension is required for H.264 video as defined in ISO/IEC 14496-15. */ - PixelAspectRatio = 0x70617370, /**< Pixel aspect ratio. This extension is mandatory for video formats that use non-square pixels. */ - ColorParameters = 0x636F6C72, /**< An image description extension required for all uncompressed Y´CbCr video types. */ - CleanAperature = 0x636C6170 /**< Spatial relationship of Y´CbCr components relative to a canonical image center. */ -}; -} - -namespace Mpeg4ElementaryStreamObjectIds { -enum KnownValue : byte { - SystemsIso144961 = 0x01, /**< Systems */ - SystemsIso144961v2, /**< Systems (version 2) */ - InteractionStream, /**< Interaction Stream */ - AfxStream = 0x05, /**< AFX Stream */ - FontDataStream, /**< Font Data Stream */ - SynthesizedTextureStream, /**< Synthesized Texture Stream */ - StreamingTextStream, /**< Streaming Text Stream */ - Mpeg4Visual = 0x20, /**< MPEG-4 Visual */ - Avc, /**< Advanced Video Coding */ - ParameterSetsForAvc, /**< Parameter Sets for Advanced Video Coding */ - Als = 0x24, /**< ALS */ - Sa0c = 0x2B, /**< SAOC */ - Aac = 0x40, /**< Audio ISO/IEC 14496-3 (AAC) */ - Mpeg2VideoSimpleProfile = 0x60, /**< MPEG-2 Video Simple Profile */ - Mpeg2VideoMainProfile, /**< MPEG-2 Video Main Profile */ - Mpeg2VideoSnrProfile, /**< MPEG-2 Video SNR Profile */ - Mpeg2VideoSpatialProfile, /**< MPEG-2 Video Spatial Profile */ - Mpeg2VideoHighProfile, /**< MPEG-2 Video High Profile */ - Mpeg2Video422Profile, /**< MPEG-2 Video 422 Profile */ - Mpeg2AacMainProfile, /**< Advanced Audio Coding Main Profile */ - Mpeg2AacLowComplexityProfile, /**< Advanced Audio Coding Low Complexity Profile */ - Mpeg2AacScaleableSamplingRateProfile, /**< Advanced Audio Coding Scaleable Sampling Rate Profile */ - Mpeg2Audio, /**< MPEG-2 Audio */ - Mpeg1Video, /**< MPEG-1 Video */ - Mpeg1Audio, /**< MPEG-1 Audio */ - Jpeg, /**< JPEG */ - Png, /**< PNG */ - Evrc = 0xA0, /**< EVRC */ - Smv, /**< SMV */ - Gpp2Cmf, /**< 3GPP2 Compact Multimedia Format (CMF) */ - Vc1, /**< VC-1 */ - Dirac, /**< Dirac */ - Ac3, /**< AC-3 */ - EAc3, /**< E-AC-3 */ - Dts, /**< DTS */ - DtsHdHighResolution, /**< DTS-HD High Resolution */ - DtsHdMasterAudio, /**< DTS-HD Master Audio */ - DtsHdExpress, /**< DTS-HD Express */ - PrivateEvrc = 0xD1, /**< EVRC */ - PrivateAc3 = 0xD3, /**< AC-3 */ - PrivateDts, /**< DTS */ - PrivateOgg = 0xDD, /**< Ogg */ - PrivateOgg2, /**< Ogg */ - PrivateQcelp = 0xE1 /**< QCELP */ -}; - -LIB_EXPORT MediaFormat streamObjectTypeFormat(byte streamObjectTypeId); - -} - -namespace Mpeg4ElementaryStreamTypeIds { -enum KnownValue : byte { - ObjectDescriptor = 0x01, - ClockReference, - SceneDescriptor, - Visual, - Audio, - Mpeg7, - Ipmps, - ObjectContentInfo, - MpegJava, - Interaction, - Ipmp, - FontData, - StreamingText -}; - -LIB_EXPORT const char *streamTypeName(byte streamTypeId); - -} - -namespace Mpeg4DescriptorIds { -enum KnownValue : byte { - ObjectDescr = 0x01, - InitialObjectDescr, - ElementaryStreamDescr, - DecoderConfigDescr, - DecoderSpecificInfo, - SlConfigDescr, - ContentIdentDescr, - SupplContentIdentDescr, - IpiDescPointer, - IpmpDescPointer, - IpmpDescr, - QoSDescr, - RegistrationDescr, - EsIdInc, - EsIdRef, - Mp4I0d, - Mp40d, - IplDescrPointerRef, - ExtendedProfileLevelDescr, - ProfileLevelIndicationIndexDescr, - ContentClassificationDescr = 0x40, - KeyWordDescr, - RatingDescr, - LanguageDescr, - ShortTextualDescr, - ExpandedTextualDescr, - ContentCreatorNameDescr, - ContentCreationDateDescr, - IcicCreatorDateDescr, - SmpteCameraPositionDescr, - SegmentDescr, - MediaTimeDescr, - IpmpToolsListDescr = 0x60, - IpmpToolTag, - FlexMuxTimingDescr, - FlexMuxCodeTableDescr, - ExtSlConfigDescr, - FlexMuxIdentDescr, - DependencyPointer, - DependencyMaker, - FlexMuxChannelDescr, - UserPrivate = 0xC0 -}; -} - -namespace Mpeg4AudioObjectIds { -enum KnownValue : byte { - Null = 0, - AacMain, - AacLc, /**< low complexity */ - AacSsr, /**< scalable sample rate */ - AacLtp, /**< long term prediction */ - Sbr, /**< spectral band replication */ - AacScalable, - TwinVq, - Celp, /**< code excited linear prediction */ - Hxvc, /**< harmonic vector excitation coding */ - Ttsi = 12, /**< text-to-speech interface */ - MainSynthesis, - WavetableSynthesis, - GeneralMidi, - AlgorithmicSynthesisAudioEffects, - ErAacLc, /**< error resillent AAC LC */ - ErAacLtp = 19, - ErAacScalable, - ErTwinVq, - ErBsac, - ErAacLd, - ErCelp, - ErHvxc, - ErHiln, - ErParametric, - Ssc, - Ps, - MpegSurround, - EscapeValue, - Layer1, - Layer2, - Layer3, - Dst, - Als, /**< audio lossless */ - Sls, /**< scalable lossless */ - ErAacEld, /**< enhanced low delay */ - SmrSimple, /**< symbolic music representation */ - SmrMain, - UsacNoSbr, /**< unified speech and audio coding */ - Saoc, /**< spatial audio object coding (no SBR) */ - LdMpegSurround, - Usac /**< unified speech and audio coding */ -}; - -LIB_EXPORT MediaFormat idToMediaFormat(byte mpeg4AudioObjectId, bool sbrPresent = false, bool psPresent = false); - -} - -extern uint32 mpeg4SamplingFrequencyTable[13]; - -namespace Mpeg4ChannelConfigs { -enum Mpeg4ChannelConfig : byte -{ - AotSpecificConfig = 0, - FrontCenter, - FrontLeftFrontRight, - FrontCenterFrontLeftFrontRight, - FrontCenterFrontLeftFrontRightBackCenter, - FrontCenterFrontLeftFrontRightBackLeftBackRight, - FrontCenterFrontLeftFrontRightBackLeftBackRightLFEChannel, - FrontCenterFrontLeftFrontRightSideLeftSideRightBackLeftBackRightLFEChannel -}; - -LIB_EXPORT const char *channelConfigString(byte config); -LIB_EXPORT byte channelCount(byte config); - -} - -namespace Mpeg4VideoCodes { -enum KnownValue : byte { - VideoObjectStart = 0x00, - VideoObjectLayerStart = 0x20, - VisualObjectSequenceStart = 0xB0, - VisualObjectSequendeEnd = 0xB1, - UserDataStart = 0xB2, - GroupOfVopStart = 0xB3, - VideoSessionError = 0xB4, - VisualObjectStart = 0xB5, - VopStart = 0xB6, - FbaObjectStart = 0xBA, - FbaObjectPlaneStart = 0xBB, - MeshObjectStart = 0xBC, - MeshObjectPlaneStart = 0xBD, - StillTextureObjectStart = 0xBE, - TextureSpatialLayerStart = 0xBF, - TextureSnrLayerStart = 0xC0, - TextureTitleStart = 0xC1, - TextureShapeLayerStart = 0xC2, - StuffingStart = 0xC3 -}; -} - -namespace Mpeg2VideoCodes { -enum KnownValue : byte { - Pic = 0x00, - Seq = 0xB3, - Ext = 0xB5, - Gop = 0xB8 -}; -} - -/*! - * \brief Specifies the tag type. - */ -enum class Mp4TagMediaType : byte { - Movie = 0, /**< Movie */ - Music = 1, /**< Music */ - Audiobook = 2, /**< Audiobook */ - MusicVideo = 6, /**< MusicVideo */ - Movie2 = 9, /**< Movie */ - TvShow = 10, /**< TvShow */ - Booklet = 11, /**< Booklet */ - Ringtone = 14 /**< Ringtone */ -}; - -/*! - * \brief Specifies the tag content rating. - */ -enum class Mp4TagContentRating : byte { - None = 0, /**< None */ - Clean = 2, /**< Clean */ - Explicit = 4 /**< Explicit */ -}; - -/*! - * \brief Specifies the account type. - */ -enum class AccountType : byte -{ - Itunes = 0, - Aol = 1, - Undefined = 255 -}; - -/*! - * \brief Specifies the country. - */ -enum class CountryCode -{ - Usa = 143441, - Fra = 143442, - Deu = 143443, - Gbr = 143444, - Aut = 143445, - Bel = 143446, - Fin = 143447, - Grc = 143448, - Irl = 143449, - Ita = 143450, - Lux = 143451, - Nld = 143452, - Prt = 143453, - Esp = 143454, - Can = 143455, - Swe = 143456, - Nor = 143457, - Dnk = 143458, - Che = 143459, - Aus = 143460, - Nzl = 143461, - Jpn = 143462, - Undefined = 0 -}; - -} - -#endif // MP4TAGATOMNAMES_H +#ifndef MP4TAGATOMNAMES_H +#define MP4TAGATOMNAMES_H + +#include "../global.h" + +#include + +namespace Media +{ + +class MediaFormat; + +namespace Mp4AtomIds { +enum KnownValue : uint32 { + AvcConfiguration = 0x61766343, + BitrateBox = 0x62747274, + CleanAperature = 0x636c6170, + ChunkOffset64 = 0x636f3634, + CompositionTimeToSample = 0x63747473, + Data = 0x64617461, + DataInformation = 0x64696e66, + DataReference = 0x64726566, + Drms = 0x64726D73, + Edts = 0x65647473, + Edit = 0x656C7374, + Free = 0x66726565, + FileType = 0x66747970, + HandlerReference = 0x68646c72, + HintMediaHeader = 0x686D6864, + ItunesList = 0x696c7374, + MediaData = 0x6d646174, + MediaHeader = 0x6d646864, + Media = 0x6d646961, + Mean = 0x6D65616E, + MovieExtendsHeader = 0x6D656864, + Meta = 0x6d657461, + MovieFragmentHeader = 0x6D666864, + MovieFragmentRandomAccess = 0x6d667261, + MediaInformation = 0x6d696e66, + MovieFragment = 0x6d6f6f66, + Movie = 0x6d6f6f76, + MovieExtends = 0x6D766578, + MovieHeader = 0x6D766864, + Name = 0x6E616D65, + NullMediaHeaderBox = 0x6E6D6864, + PaddingBits = 0x70616462, + PixalAspectRatio = 0x70617370, + ProgressiveDownloadInformation = 0x7064696e, + SampleToGroup = 0x73626770, + IndependentAndDisposableSamples = 0x73647470, + SampleGroupDescription = 0x73677064, + Skip = 0x736b6970, + SoundMediaHeader = 0x736D6864, + SampleTable = 0x7374626c, + ChunkOffset = 0x7374636f, + DegradationPriority = 0x73746470, + SampleToChunk = 0x73747363, + SampleDescription = 0x73747364, + ShadowSyncSample = 0x73747368, + SyncSample = 0x73747373, + SampleSize = 0x7374737A, + DecodingTimeToSample = 0x73747473, + CompactSampleSize = 0x73747a32, + SubSampleInformation = 0x73756273, + TrackFragmentHeader = 0x74666864, + TrackHeader = 0x746b6864, + TrackFragment = 0x74726166, + Track = 0x7472616b, + TrackReference = 0x74726566, + TrackExtends = 0x74726578, + TrackFragmentRun = 0x7472756E, + UserData = 0x75647461, + DataEntryUrl = 0x75726C20, + DataEntryUrn = 0x75726E20, + VideoMediaHeader = 0x766D6864, + Wide = 0x77696465 +}; +} + +namespace Mp4TagAtomIds { +enum KnownValue : uint32 { + Album = 0xA9616c62, + AlbumArtist = 0x61415254, + Artist = 0xA9415254, + Bpm = 0x746d706f, + Category = 0x63617467, + Comment = 0xA9636d74, + Composer = 0xA9777274, + Copyright = 0x63707274, + Cover = 0x636f7672, + Description = 0x64657363, + DiskPosition = 0x6469736b, + Encoder = 0xA9746f6f, + EpisodeGlobalUniqueId = 0x65676964, + Extended = 0x2d2d2d2d, + GaplessPlayback = 0x70676170, + Genre = 0xA967656e, + Grouping = 0xA9677270, + Keywords = 0x6b657977, + Lyricist = 0xA9737766, + Lyrics = 0xA96c7972, + MediaType = 0x7374696B, + Performers = 0xA9707266, + Podcast = 0x70637374, + PodcastUrl = 0x7075726c, + PreDefinedGenre = 0x676e7265, + Producer = 0xA9707264, + PurchaseDate = 0x70757264, + Rating = 0x72746e67, + RecordLabel = 0xA96c6162, + Title = 0xA96e616d, + TrackPosition = 0x74726b6e, + TvEpisode = 0x74766573, + TvEpisodeName = 0x7476656e, + TvNetworkName = 0x74766e6e, + TvSeason = 0x7476736e, + TvShowName = 0x74767368, + Year = 0xA9646179 +}; +} + +namespace Mp4TagExtendedMeanIds { +extern const char *iTunes; +} + +namespace Mp4TagExtendedNameIds { +extern const char *cdec; +} + +namespace Mp4MediaTypeIds { +enum KnownValue : uint32 { + Sound = 0x736f756e, /**< Sound/Audio */ + Video = 0x76696465, /**< Video */ + Hint = 0x68696e74, /**< Hint */ + Meta = 0x6d657461 /**< Meta */ +}; +} + +namespace FourccIds { +enum KnownValue : uint32 { + Ac3 = 0x61632d33, /**< Dolby Digital */ + Ac4 = 0x61632d34, /**< ? */ + AdpcmAcm = 0x6D730002, /**< ? */ + Agsm = 0x6167736D, + Alac = 0x616C6163, /**< Apple Losless Audio Codec */ + Alaw = 0x616C6177, + Alaw21 = 0x616C6177, + AlphaCompositor = 0x626C6E64, + AlphaGain = 0x6761696E, + Amr = 0x73617762, + AmrNarrowband = 0x73616D72, + Animation = 0x726C6520, /**< Animation */ + Appl1 = 0x6476690, + Appl2 = 0x6C70630, + Apple16BitGray = 0x62313667, + Apple32BitGrayWithAlpha = 0x62333261, + Apple48BitRgb = 0x62343872, + Apple64BitArgb1 = 0x62363461, + Apple64BitArgb2 = 0x62617365, + Apple64BitArgb3 = 0x626C6974, + AppleAnimation = 0x726C6520, + AppleAvrJpeg = 0x61767220, + AppleBmp = 0x57524C45, + AppleCinepak = 0x63766964, + AppleCmyk = 0x636D796B, + AppleComponentVideoYuv422 = 0x79757632, + AppleCurve = 0x70617468, + AppleDvc = 0x64766320, + AppleDvcpro = 0x64767070, + AppleDvcpro501 = 0x6476356E, + AppleDvcpro502 = 0x64763570, + AppleDvcpro50Ntsc = 0x6476356E, + AppleDvcpro50Pal = 0x64763570, + AppleDvcproPal = 0x64767070, + AppleDvDvcproNtsc = 0x6476630, + AppleDvp = 0x64766370, + AppleDvPal = 0x64766370, + AppleFlc = 0x666C6963, + AppleGif = 0x67696620, + AppleGraphics = 0x736D630, + AppleGsm101 = 0x6167736D, + AppleH261 = 0x68323631, + AppleIntermediateCodec = 0x69636F64, + AppleLossless = 0x616C6163, + AppleMacpaint = 0x504E5447, + AppleMicrosoftVideo1 = 0x6D737663, + AppleMotionJpegA = 0x6D6A7061, + AppleMotionJpegB = 0x6D6A7062, + AppleMpeg4Compressor = 0x6D703476, + AppleMpeg4Decompressor = 0x6D703476, + AppleOpendmlJpeg = 0x646D6231, + ApplePhotoCd = 0x6B706364, + ApplePhotoJpeg = 0x6A706567, + ApplePixletVideo = 0x70786C74, + ApplePlanarRgb = 0x38425053, + ApplePng = 0x706E670, + AppleQuickdraw = 0x71647277, + AppleR408 = 0x72343038, + AppleScalingCodec = 0x7363616C, + AppleSgi = 0x2E534749, + AppleSorensonYuv9Codec = 0x73797639, + AppleTextAtsuiCodec = 0x74657874, + AppleTga = 0x7467610, + AppleTiff = 0x74696666, + AppleV408 = 0x76343038, + AppleVcH263 = 0x68323633, + AppleVideo = 0x72707A61, /**< Apple video */ + AppleYuv420Codec1 = 0x6A343230, + AppleYuv420Codec2 = 0x6D797576, + AppleYuv420Codec3 = 0x79343230, + AppleYuv422Codec2Vuy = 0x32767579, + AppleYuv422Codec4 = 0x79757678, + AppleYuv422CodecYuvs = 0x79757673, + AppleYuv422CodecYuvu = 0x79757675, + Avc0Media = 0x64726D69, + Avc1 = 0x61766331, /**< H.264/MPEG-4 AVC video */ + Avc2 = 0x61766332, /**< H.264/MPEG-4 AVC video */ + Avc3 = 0x61766333, /**< H.264/MPEG-4 AVC video */ + Avc4 = 0x61766334, /**< H.264/MPEG-4 AVC video */ + Blur = 0x626C7572, + Bps8 = 0x38627073, + BrightnessAndContrast = 0x6272636F, + ChannelCompositor = 0x6368616E, + ChromaKey = 0x636B6579, + Cinepak = 0x63766964, /**< Cinepak */ + Cloud = 0x636C6F75, + ColorStyle = 0x736F6C72, + Colorsync = 0x73796E63, + ColorTint = 0x74696E74, + CrossFade = 0x64736C76, + Cvid = 0x63766964, + Divx3Decoder1 = 0x41503431, + Divx3Decoder2 = 0x434F4C30, + Divx3Decoder3 = 0x434F4C31, + Divx3Decoder4 = 0x44495633, + Divx3Decoder5 = 0x44495634, + Divx3Decoder6 = 0x44495635, + Divx3Decoder7 = 0x44495636, + Divx3Decoder8 = 0x4D504733, + Divx3Decoder9 = 0x6D706733, + Divx3Decoder10 = 0x636F6C30, + Divx3Decoder11 = 0x636F6C31, + Divx3Decoder12 = 0x64697633, + Divx3Decoder13 = 0x64697634, + Divx3Decoder14 = 0x64697635, + Divx3Decoder15 = 0x64697636, + Divx4Decoder1 = 0x44495658, + Divx4Decoder2 = 0x64697678, + Divx5Decoder = 0x44583530, + Drms = 0x64726D73, + Drmi = 0x64726D69, + Dts = 0x6474736C, + DtsH = 0x64747368, + DtsE = 0x64747365, + Dvca = 0x64766361, + DvcPro501 = 0x64763570, + DvcPro502 = 0x6476356E, + DvcProPal = 0x64767070, + EAc3 = 0x65632D33, + EdgeDetection = 0x65646765, + Emboss = 0x656D6273, + Explode = 0x78706C6F, + FilmNoise = 0x666D6E73, + Fire = 0x66697265, + FlashPixImage = 0x66706978, + FlashScreenVideoDecoder = 0x46535631, + FloatingPoint32Bit = 0x666C3332, + FloatingPoint64Bit = 0x666C3634, + GeneralConvolution = 0x67656E6B, + Gif = 0x67696620, /**< CompuServe Graphics Interchange Format */ + Glass = 0x676C6173, + GradientWipe = 0x6D617474, + Graphics = 0x736D6320, /**< Graphics */ + H263Quicktime = 0x68323633, /**< H.263/MPEG-4 ASP video (Quicktime) */ + H2633GPP = 0x73323633, /**< H.263 (3GPP format) */ + H264Decoder1 = 0x44415643, + H264Decoder2 = 0x48323634, + H264Decoder3 = 0x56535348, + H264Decoder4 = 0x58323634, + H264Decoder5 = 0x68323634, + H264Decoder6 = 0x78323634, + Hdv3 = 0x68647633, + Hevc1 = 0x68766331, /**< H.265/High Efficiency Video Coding */ + Hevc2 = 0x68657631, /**< H.265/High Efficiency Video Coding */ + HslBalance = 0x68736C62, + Ima4 = 0x696D6134, + Ima41 = 0x696D6134, + ImaadpcmAcm = 0x6D730011, /**< ? */ + Implode = 0x6D706C6F, + Int16Be = 0x74776F73, + Int16Le = 0x736F7774, + Int24 = 0x696E3234, + Int32 = 0x696E3332, + Iris = 0x736D7032, + IvxDecoder1 = 0x33495632, + IvxDecoder2 = 0x33495644, + IvxDecoder3 = 0x33697632, + IvxDecoder4 = 0x33697664, + Jpeg = 0x6a706567, /**< JPEG */ + Jpeg2000Decoder = 0x6D6A7032, + Law21 = 0x756C6177, + LensFlare = 0x6C656E73, + Lle = 0x726C6520, + Mac3 = 0x6D616333, + Mac6 = 0x6D616336, + Mace31 = 0x4D414333, + Mace61 = 0x4D414336, + MatrixWipe = 0x736D7034, + DolbyMpl = 0x6D6C7061, + MotionJpegA = 0x6D6A7061, /**< Motion-JPEG (format A) */ + MotionJpegB = 0x6D6A7062, /**< Motion-JPEG (format B) */ + Mp3 = 0x2e6d7033, /**< MPEG-1 Layer 3 */ + Mp3CbrOnly = 0x6D730055, /**< MPEG-1 Layer 3 (constant bitrate only) */ + Mpeg = 0x4D504547, + Mpeg2Imx30 = 0x6D78336E, + Mpeg2Imx50 = 0x6D783570, + Mpeg4Audio = 0x6d703461, /**< MPEG-4 audio */ + Mpeg4Decoder1 = 0x464D5034, + Mpeg4Decoder2 = 0x53454447, + Mpeg4Decoder3 = 0x57563146, + Mpeg4Sample = 0x6d703473, /**< MPEG-4 stream (other then video/audio) */ + Mpeg4TimedText = 0x74783367, /**< MPEG-4 Timed Text / Streaming text format / Part 17 */ + Mpeg4Video = 0x6d703476, /**< MPEG-4 video */ + MsMpeg4V1Decoder1 = 0x44495631, + MsMpeg4V1Decoder2 = 0x64697631, + MsMpeg4V1Decoder3 = 0x4D504734, + MsMpeg4V1Decoder4 = 0x6D706734, + MsMpeg4V1Decoder5 = 0x4D504731, + MsMpeg4V1Decoder6 = 0x6D706731, + MsMpeg4V2Decoder1 = 0x44495632, + MsMpeg4V2Decoder2 = 0x64697632, + MsMpeg4V2Decoder3 = 0x4D503432, + MsMpeg4V2Decoder4 = 0x6D703432, + MsMpeg4V3Decoder1 = 0x4D503433, + MsMpeg4V3Decoder2 = 0x6D703433, + NtscDv25Video = 0x64766320, /**< NTSC DV-25 video */ + Oggs = 0x4F676753, + PalDv25Video = 0x64766370, /**< PAL DV-25 video */ + PdfImage = 0x70646620, + Png = 0x706E6720, /**< Portable Network Graphics */ + Push = 0x70757368, + Qclp = 0x51636C70, + QdesignMusic1Decoder = 0x51444D43, + QdesignMusic2 = 0x51444D32, + Qdmc = 0x51444D43, + Qdrw = 0x71647277, + QtvrCubicCodec = 0x63757061, + QtvrCylindricalCodec = 0x6C747061, + QualcommPurevoice = 0x51636C70, + QualcommQcelp = 0x51636C71, + Radial = 0x736D7033, + Raw = 0x72617720, /**< Uncompressed RGB */ + RgbBalance = 0x72676262, + Ripple = 0x7269706C, + Rpza = 0x72707A61, + Rv20 = 0x52563230, + Rv30 = 0x52563330, + Rv40 = 0x52563430, + Sharpen = 0x73687270, + Slide = 0x736C6964, + Smc = 0x736D6320, + SorensonH263Decoder = 0x464C5631, + SorensonVideo3Compressor = 0x53565133, + SorensonVideoDecompressor = 0x53565131, + Sowt = 0x736F7774, + SpecialEffectsAndFilters = 0x67656666, + Svq1 = 0x73767131, + Svq3 = 0x73767133, + Tiff = 0x74696666, /**< Tagged Image File Format */ + TravelingMatte = 0x74726176, + TruemotionVp6Decoder1 = 0x56503632, + TruemotionVp6Decoder2 = 0x56503646, + Twos = 0x74776F73, + Ulaw = 0x756C6177, + Ulaw21 = 0x756C6177, + VcmImageCodec = 0x4D6A7067, + Vdva = 0x76647661, + WindowsMediaAudio = 0x6F776D61, /**< ? */ + WindowsMediaAudio7 = 0x574D4131, + WindowsMediaAudio9Professional = 0x574D4133, + WindowsMediaAudio9Standard = 0x574D4132, + WindowsMediaVideoV17 = 0x574D5637, + WindowsMediaVideoV2 = 0x574D5632, + WindowsMediaVideoV8 = 0x574D5638, + Wipe = 0x736D7074, + WmvImageCodec1 = 0x4D347332, + WmvImageCodec2 = 0x4D703432, + WmvImageCodec3 = 0x4D703433, + WmvImageCodec4 = 0x4D703453, + WmvImageCodec5 = 0x574D5631, + WmvImageCodec6 = 0x574D5632, + WmvImageCodec7 = 0x574D5633, + XvidDecoder1 = 0x424C5A30, + XvidDecoder2 = 0x58564944, + XvidDecoder3 = 0x58564958, + XvidDecoder4 = 0x58766944, + XvidDecoder5 = 0x78766964, + Yuv422HardwareAccelerationCodecYuvs1 = 0x32767579, + Yuv422HardwareAccelerationCodecYuvs2 = 0x61633136, + Yuv422HardwareAccelerationCodecYuvs3 = 0x61633332, + Yuv422HardwareAccelerationCodecYuvs4 = 0x61634247, + Yuv422HardwareAccelerationCodecYuvs5 = 0x79757673, + Zoom = 0x7A6F6F6D +}; + +TAG_PARSER_EXPORT MediaFormat fourccToMediaFormat(uint32 fourccId); + +} + +namespace Mp4FormatExtensionIds { +enum KnownValue : uint32 { + GammaLevel = 0x67616D61, /**< A 32-bit fixed-point number indicating the gamma level at which the image was captured. The decompressor can use this value to gamma-correct at display time. */ + FieldHandling = 0x6669656C, /**< Two 8-bit integers that define field handling. */ + DefaultQuantizationTable = 0x6D6A7174, /**< The default quantization table for a Motion-JPEG data stream. */ + DefaultHuffmanTable = 0x6D6A6874, /**< The default Huffman table for a Motion-JPEG data stream. */ + Mpeg4ElementaryStreamDescriptor = 0x65736473, /**< An MPEG-4 elementary stream descriptor atom. This extension is required for MPEG-4 video. */ + Mpeg4ElementaryStreamDescriptor2 = 0x6D346473, /**< Alternative if encoded to AVC stanard. */ + AvcConfiguration = 0x61766343, /**< An H.264 AVCConfigurationBox. This extension is required for H.264 video as defined in ISO/IEC 14496-15. */ + PixelAspectRatio = 0x70617370, /**< Pixel aspect ratio. This extension is mandatory for video formats that use non-square pixels. */ + ColorParameters = 0x636F6C72, /**< An image description extension required for all uncompressed Y´CbCr video types. */ + CleanAperature = 0x636C6170 /**< Spatial relationship of Y´CbCr components relative to a canonical image center. */ +}; +} + +namespace Mpeg4ElementaryStreamObjectIds { +enum KnownValue : byte { + SystemsIso144961 = 0x01, /**< Systems */ + SystemsIso144961v2, /**< Systems (version 2) */ + InteractionStream, /**< Interaction Stream */ + AfxStream = 0x05, /**< AFX Stream */ + FontDataStream, /**< Font Data Stream */ + SynthesizedTextureStream, /**< Synthesized Texture Stream */ + StreamingTextStream, /**< Streaming Text Stream */ + Mpeg4Visual = 0x20, /**< MPEG-4 Visual */ + Avc, /**< Advanced Video Coding */ + ParameterSetsForAvc, /**< Parameter Sets for Advanced Video Coding */ + Als = 0x24, /**< ALS */ + Sa0c = 0x2B, /**< SAOC */ + Aac = 0x40, /**< Audio ISO/IEC 14496-3 (AAC) */ + Mpeg2VideoSimpleProfile = 0x60, /**< MPEG-2 Video Simple Profile */ + Mpeg2VideoMainProfile, /**< MPEG-2 Video Main Profile */ + Mpeg2VideoSnrProfile, /**< MPEG-2 Video SNR Profile */ + Mpeg2VideoSpatialProfile, /**< MPEG-2 Video Spatial Profile */ + Mpeg2VideoHighProfile, /**< MPEG-2 Video High Profile */ + Mpeg2Video422Profile, /**< MPEG-2 Video 422 Profile */ + Mpeg2AacMainProfile, /**< Advanced Audio Coding Main Profile */ + Mpeg2AacLowComplexityProfile, /**< Advanced Audio Coding Low Complexity Profile */ + Mpeg2AacScaleableSamplingRateProfile, /**< Advanced Audio Coding Scaleable Sampling Rate Profile */ + Mpeg2Audio, /**< MPEG-2 Audio */ + Mpeg1Video, /**< MPEG-1 Video */ + Mpeg1Audio, /**< MPEG-1 Audio */ + Jpeg, /**< JPEG */ + Png, /**< PNG */ + Evrc = 0xA0, /**< EVRC */ + Smv, /**< SMV */ + Gpp2Cmf, /**< 3GPP2 Compact Multimedia Format (CMF) */ + Vc1, /**< VC-1 */ + Dirac, /**< Dirac */ + Ac3, /**< AC-3 */ + EAc3, /**< E-AC-3 */ + Dts, /**< DTS */ + DtsHdHighResolution, /**< DTS-HD High Resolution */ + DtsHdMasterAudio, /**< DTS-HD Master Audio */ + DtsHdExpress, /**< DTS-HD Express */ + PrivateEvrc = 0xD1, /**< EVRC */ + PrivateAc3 = 0xD3, /**< AC-3 */ + PrivateDts, /**< DTS */ + PrivateOgg = 0xDD, /**< Ogg */ + PrivateOgg2, /**< Ogg */ + PrivateQcelp = 0xE1 /**< QCELP */ +}; + +TAG_PARSER_EXPORT MediaFormat streamObjectTypeFormat(byte streamObjectTypeId); + +} + +namespace Mpeg4ElementaryStreamTypeIds { +enum KnownValue : byte { + ObjectDescriptor = 0x01, + ClockReference, + SceneDescriptor, + Visual, + Audio, + Mpeg7, + Ipmps, + ObjectContentInfo, + MpegJava, + Interaction, + Ipmp, + FontData, + StreamingText +}; + +TAG_PARSER_EXPORT const char *streamTypeName(byte streamTypeId); + +} + +namespace Mpeg4DescriptorIds { +enum KnownValue : byte { + ObjectDescr = 0x01, + InitialObjectDescr, + ElementaryStreamDescr, + DecoderConfigDescr, + DecoderSpecificInfo, + SlConfigDescr, + ContentIdentDescr, + SupplContentIdentDescr, + IpiDescPointer, + IpmpDescPointer, + IpmpDescr, + QoSDescr, + RegistrationDescr, + EsIdInc, + EsIdRef, + Mp4I0d, + Mp40d, + IplDescrPointerRef, + ExtendedProfileLevelDescr, + ProfileLevelIndicationIndexDescr, + ContentClassificationDescr = 0x40, + KeyWordDescr, + RatingDescr, + LanguageDescr, + ShortTextualDescr, + ExpandedTextualDescr, + ContentCreatorNameDescr, + ContentCreationDateDescr, + IcicCreatorDateDescr, + SmpteCameraPositionDescr, + SegmentDescr, + MediaTimeDescr, + IpmpToolsListDescr = 0x60, + IpmpToolTag, + FlexMuxTimingDescr, + FlexMuxCodeTableDescr, + ExtSlConfigDescr, + FlexMuxIdentDescr, + DependencyPointer, + DependencyMaker, + FlexMuxChannelDescr, + UserPrivate = 0xC0 +}; +} + +namespace Mpeg4AudioObjectIds { +enum KnownValue : byte { + Null = 0, + AacMain, + AacLc, /**< low complexity */ + AacSsr, /**< scalable sample rate */ + AacLtp, /**< long term prediction */ + Sbr, /**< spectral band replication */ + AacScalable, + TwinVq, + Celp, /**< code excited linear prediction */ + Hxvc, /**< harmonic vector excitation coding */ + Ttsi = 12, /**< text-to-speech interface */ + MainSynthesis, + WavetableSynthesis, + GeneralMidi, + AlgorithmicSynthesisAudioEffects, + ErAacLc, /**< error resillent AAC LC */ + ErAacLtp = 19, + ErAacScalable, + ErTwinVq, + ErBsac, + ErAacLd, + ErCelp, + ErHvxc, + ErHiln, + ErParametric, + Ssc, + Ps, + MpegSurround, + EscapeValue, + Layer1, + Layer2, + Layer3, + Dst, + Als, /**< audio lossless */ + Sls, /**< scalable lossless */ + ErAacEld, /**< enhanced low delay */ + SmrSimple, /**< symbolic music representation */ + SmrMain, + UsacNoSbr, /**< unified speech and audio coding */ + Saoc, /**< spatial audio object coding (no SBR) */ + LdMpegSurround, + Usac /**< unified speech and audio coding */ +}; + +TAG_PARSER_EXPORT MediaFormat idToMediaFormat(byte mpeg4AudioObjectId, bool sbrPresent = false, bool psPresent = false); + +} + +extern uint32 mpeg4SamplingFrequencyTable[13]; + +namespace Mpeg4ChannelConfigs { +enum Mpeg4ChannelConfig : byte +{ + AotSpecificConfig = 0, + FrontCenter, + FrontLeftFrontRight, + FrontCenterFrontLeftFrontRight, + FrontCenterFrontLeftFrontRightBackCenter, + FrontCenterFrontLeftFrontRightBackLeftBackRight, + FrontCenterFrontLeftFrontRightBackLeftBackRightLFEChannel, + FrontCenterFrontLeftFrontRightSideLeftSideRightBackLeftBackRightLFEChannel +}; + +TAG_PARSER_EXPORT const char *channelConfigString(byte config); +TAG_PARSER_EXPORT byte channelCount(byte config); + +} + +namespace Mpeg4VideoCodes { +enum KnownValue : byte { + VideoObjectStart = 0x00, + VideoObjectLayerStart = 0x20, + VisualObjectSequenceStart = 0xB0, + VisualObjectSequendeEnd = 0xB1, + UserDataStart = 0xB2, + GroupOfVopStart = 0xB3, + VideoSessionError = 0xB4, + VisualObjectStart = 0xB5, + VopStart = 0xB6, + FbaObjectStart = 0xBA, + FbaObjectPlaneStart = 0xBB, + MeshObjectStart = 0xBC, + MeshObjectPlaneStart = 0xBD, + StillTextureObjectStart = 0xBE, + TextureSpatialLayerStart = 0xBF, + TextureSnrLayerStart = 0xC0, + TextureTitleStart = 0xC1, + TextureShapeLayerStart = 0xC2, + StuffingStart = 0xC3 +}; +} + +namespace Mpeg2VideoCodes { +enum KnownValue : byte { + Pic = 0x00, + Seq = 0xB3, + Ext = 0xB5, + Gop = 0xB8 +}; +} + +/*! + * \brief Specifies the tag type. + */ +enum class Mp4TagMediaType : byte { + Movie = 0, /**< Movie */ + Music = 1, /**< Music */ + Audiobook = 2, /**< Audiobook */ + MusicVideo = 6, /**< MusicVideo */ + Movie2 = 9, /**< Movie */ + TvShow = 10, /**< TvShow */ + Booklet = 11, /**< Booklet */ + Ringtone = 14 /**< Ringtone */ +}; + +/*! + * \brief Specifies the tag content rating. + */ +enum class Mp4TagContentRating : byte { + None = 0, /**< None */ + Clean = 2, /**< Clean */ + Explicit = 4 /**< Explicit */ +}; + +/*! + * \brief Specifies the account type. + */ +enum class AccountType : byte +{ + Itunes = 0, + Aol = 1, + Undefined = 255 +}; + +/*! + * \brief Specifies the country. + */ +enum class CountryCode +{ + Usa = 143441, + Fra = 143442, + Deu = 143443, + Gbr = 143444, + Aut = 143445, + Bel = 143446, + Fin = 143447, + Grc = 143448, + Irl = 143449, + Ita = 143450, + Lux = 143451, + Nld = 143452, + Prt = 143453, + Esp = 143454, + Can = 143455, + Swe = 143456, + Nor = 143457, + Dnk = 143458, + Che = 143459, + Aus = 143460, + Nzl = 143461, + Jpn = 143462, + Undefined = 0 +}; + +} + +#endif // MP4TAGATOMNAMES_H diff --git a/mp4/mp4tag.h b/mp4/mp4tag.h index 7c32531..d0f3efa 100644 --- a/mp4/mp4tag.h +++ b/mp4/mp4tag.h @@ -11,7 +11,7 @@ namespace Media class Mp4Atom; class Mp4Tag; -class LIB_EXPORT Mp4TagMaker +class TAG_PARSER_EXPORT Mp4TagMaker { friend class Mp4Tag; @@ -46,7 +46,7 @@ inline uint64 Mp4TagMaker::requiredSize() const return m_metaSize; } -class LIB_EXPORT Mp4Tag : public FieldMapBasedTag +class TAG_PARSER_EXPORT Mp4Tag : public FieldMapBasedTag { public: Mp4Tag(); diff --git a/mp4/mp4tagfield.h b/mp4/mp4tagfield.h index f99b70c..2768e6e 100644 --- a/mp4/mp4tagfield.h +++ b/mp4/mp4tagfield.h @@ -53,7 +53,7 @@ class Mp4TagField; * \brief Defines traits for the TagField implementation of the Mp4TagField class. */ template <> -class LIB_EXPORT TagFieldTraits +class TAG_PARSER_EXPORT TagFieldTraits { public: /*! @@ -74,7 +74,7 @@ public: class Mp4Atom; -class LIB_EXPORT Mp4TagFieldMaker +class TAG_PARSER_EXPORT Mp4TagFieldMaker { friend class Mp4TagField; @@ -110,7 +110,7 @@ inline uint64 Mp4TagFieldMaker::requiredSize() const return m_totalSize; } -class LIB_EXPORT Mp4TagField : public TagField, public StatusProvider +class TAG_PARSER_EXPORT Mp4TagField : public TagField, public StatusProvider { friend class TagField; diff --git a/mp4/mp4track.h b/mp4/mp4track.h index ac701ba..84c4a3c 100644 --- a/mp4/mp4track.h +++ b/mp4/mp4track.h @@ -13,7 +13,7 @@ class Mp4Atom; class Mpeg4Descriptor; class AvcConfiguration; -class LIB_EXPORT Mpeg4AudioSpecificConfig +class TAG_PARSER_EXPORT Mpeg4AudioSpecificConfig { public: Mpeg4AudioSpecificConfig(); @@ -39,7 +39,7 @@ public: byte epConfig; }; -class LIB_EXPORT Mpeg4VideoSpecificConfig +class TAG_PARSER_EXPORT Mpeg4VideoSpecificConfig { public: Mpeg4VideoSpecificConfig(); @@ -48,7 +48,7 @@ public: std::string userData; }; -class LIB_EXPORT Mpeg4ElementaryStreamInfo +class TAG_PARSER_EXPORT Mpeg4ElementaryStreamInfo { public: Mpeg4ElementaryStreamInfo(); @@ -116,7 +116,7 @@ inline bool Mpeg4ElementaryStreamInfo::upstream() const return decCfgDescFlags & 0x02; } -class LIB_EXPORT Mp4Track : public AbstractTrack +class TAG_PARSER_EXPORT Mp4Track : public AbstractTrack { public: Mp4Track(Mp4Atom &trakAtom); diff --git a/mp4/mpeg4descriptor.h b/mp4/mpeg4descriptor.h index efc2b87..58c2a2a 100644 --- a/mp4/mpeg4descriptor.h +++ b/mp4/mpeg4descriptor.h @@ -14,7 +14,7 @@ class Mpeg4Descriptor; * \brief Defines traits for the GenericFileElement implementation Mpeg4Descriptor. */ template <> -class LIB_EXPORT FileElementTraits +class TAG_PARSER_EXPORT FileElementTraits { public: /*! @@ -46,7 +46,7 @@ public: } }; -class LIB_EXPORT Mpeg4Descriptor : public GenericFileElement +class TAG_PARSER_EXPORT Mpeg4Descriptor : public GenericFileElement { friend class GenericFileElement; diff --git a/mpegaudio/mpegaudioframe.h b/mpegaudio/mpegaudioframe.h index bc73e7e..1ab3897 100644 --- a/mpegaudio/mpegaudioframe.h +++ b/mpegaudio/mpegaudioframe.h @@ -1,8 +1,9 @@ #ifndef MP3FRAMEAUDIOSTREAM_H #define MP3FRAMEAUDIOSTREAM_H +#include "../global.h" + #include -#include #include @@ -25,7 +26,7 @@ enum class MpegChannelMode Unspecifed /**< used to indicate that the channel mode is unknown */ }; -LIB_EXPORT const char *mpegChannelModeString(MpegChannelMode channelMode); +TAG_PARSER_EXPORT const char *mpegChannelModeString(MpegChannelMode channelMode); enum class XingHeaderFlags { @@ -36,7 +37,7 @@ enum class XingHeaderFlags HasQualityIndicator = 0x8u /**< Xing quality indicator is present */ }; -class LIB_EXPORT MpegAudioFrame +class TAG_PARSER_EXPORT MpegAudioFrame { public: MpegAudioFrame(); diff --git a/mpegaudio/mpegaudioframestream.h b/mpegaudio/mpegaudioframestream.h index 266725b..dee6413 100644 --- a/mpegaudio/mpegaudioframestream.h +++ b/mpegaudio/mpegaudioframestream.h @@ -10,7 +10,7 @@ namespace Media { -class LIB_EXPORT MpegAudioFrameStream : public AbstractTrack +class TAG_PARSER_EXPORT MpegAudioFrameStream : public AbstractTrack { public: MpegAudioFrameStream(std::iostream &stream, uint64 startOffset); diff --git a/notification.h b/notification.h index fbcc16a..3f21c53 100644 --- a/notification.h +++ b/notification.h @@ -1,6 +1,8 @@ #ifndef NOTIFICATION_H #define NOTIFICATION_H +#include "./global.h" + #include #include @@ -38,7 +40,7 @@ class Notification; typedef std::list NotificationList; -class LIB_EXPORT Notification +class TAG_PARSER_EXPORT Notification { public: Notification(NotificationType type, const std::string &message, const std::string &context); diff --git a/ogg/oggcontainer.h b/ogg/oggcontainer.h index 9afeec5..fd6d097 100644 --- a/ogg/oggcontainer.h +++ b/ogg/oggcontainer.h @@ -25,7 +25,7 @@ class OggContainer; /*! * \brief The OggParameter struct holds the OGG parameter for a VorbisComment. */ -struct LIB_EXPORT OggParameter +struct TAG_PARSER_EXPORT OggParameter { OggParameter(); void set(std::size_t pageIndex, std::size_t segmentIndex, bool lastMetaDataBlock, GeneralMediaFormat streamFormat = GeneralMediaFormat::Vorbis); @@ -65,7 +65,7 @@ inline void OggParameter::set(std::size_t pageIndex, std::size_t segmentIndex, b this->streamFormat = streamFormat; } -class LIB_EXPORT OggVorbisComment : public VorbisComment +class TAG_PARSER_EXPORT OggVorbisComment : public VorbisComment { friend class OggContainer; @@ -124,7 +124,7 @@ inline const OggParameter &OggVorbisComment::oggParams() const return m_oggParams; } -class LIB_EXPORT OggContainer : public GenericContainer +class TAG_PARSER_EXPORT OggContainer : public GenericContainer { friend class OggStream; diff --git a/ogg/oggiterator.h b/ogg/oggiterator.h index 2dd98c2..475ea9d 100644 --- a/ogg/oggiterator.h +++ b/ogg/oggiterator.h @@ -8,7 +8,7 @@ namespace Media { -class LIB_EXPORT OggIterator +class TAG_PARSER_EXPORT OggIterator { public: OggIterator(std::istream &stream, uint64 startOffset, uint64 streamSize); diff --git a/ogg/oggpage.h b/ogg/oggpage.h index a58cf65..a07c769 100644 --- a/ogg/oggpage.h +++ b/ogg/oggpage.h @@ -1,8 +1,9 @@ #ifndef OGGPAGE_H #define OGGPAGE_H +#include "../global.h" + #include -#include #include #include @@ -10,7 +11,7 @@ namespace Media { -class LIB_EXPORT OggPage +class TAG_PARSER_EXPORT OggPage { public: OggPage(); diff --git a/ogg/oggstream.h b/ogg/oggstream.h index a4f0d54..c6e6f5d 100644 --- a/ogg/oggstream.h +++ b/ogg/oggstream.h @@ -10,7 +10,7 @@ namespace Media { class OggContainer; class OggIterator; -class LIB_EXPORT OggStream : public AbstractTrack +class TAG_PARSER_EXPORT OggStream : public AbstractTrack { friend class OggContainer; diff --git a/opus/opusidentificationheader.h b/opus/opusidentificationheader.h index 1ed63e4..6cf56a1 100644 --- a/opus/opusidentificationheader.h +++ b/opus/opusidentificationheader.h @@ -1,14 +1,15 @@ #ifndef MEDIA_OPUSIDENTIFICATIONHEADER_H #define MEDIA_OPUSIDENTIFICATIONHEADER_H -#include +#include "../global.h" + #include namespace Media { class OggIterator; -class LIB_EXPORT OpusIdentificationHeader +class TAG_PARSER_EXPORT OpusIdentificationHeader { public: OpusIdentificationHeader(); diff --git a/positioninset.h b/positioninset.h index 0fb0ffd..947e1b6 100644 --- a/positioninset.h +++ b/positioninset.h @@ -1,7 +1,8 @@ #ifndef POSITIONINSET_H #define POSITIONINSET_H -#include +#include "./global.h" + #include #include @@ -16,7 +17,7 @@ namespace Media { * This class is used to parse and store values like "9/11" which are used * by some tag formats to denote track positions. */ -class LIB_EXPORT PositionInSet +class TAG_PARSER_EXPORT PositionInSet { public: constexpr PositionInSet(int32 position = 0, int32 total = 0); diff --git a/signature.h b/signature.h index a8b7959..88024dc 100644 --- a/signature.h +++ b/signature.h @@ -4,7 +4,6 @@ #include "./mediaformat.h" #include -#include namespace Media { @@ -62,13 +61,13 @@ enum class ContainerFormat Zip /**< ZIP archive */ }; -LIB_EXPORT ContainerFormat parseSignature(const char *buffer, int bufferSize); -LIB_EXPORT const char *containerFormatName(ContainerFormat containerFormat); -LIB_EXPORT const char *containerFormatAbbreviation(ContainerFormat containerFormat, MediaType mediaType = MediaType::Unknown, unsigned int version = 0); -LIB_EXPORT const char *containerFormatSubversion(ContainerFormat containerFormat); -LIB_EXPORT const char *containerMimeType(ContainerFormat containerFormat, MediaType mediaType = MediaType::Unknown); -LIB_EXPORT TagTargetLevel containerTargetLevel(ContainerFormat containerFormat, uint64 targetLevelValue); -LIB_EXPORT uint64 containerTargetLevelValue(ContainerFormat containerFormat, TagTargetLevel targetLevel); +TAG_PARSER_EXPORT ContainerFormat parseSignature(const char *buffer, int bufferSize); +TAG_PARSER_EXPORT const char *containerFormatName(ContainerFormat containerFormat); +TAG_PARSER_EXPORT const char *containerFormatAbbreviation(ContainerFormat containerFormat, MediaType mediaType = MediaType::Unknown, unsigned int version = 0); +TAG_PARSER_EXPORT const char *containerFormatSubversion(ContainerFormat containerFormat); +TAG_PARSER_EXPORT const char *containerMimeType(ContainerFormat containerFormat, MediaType mediaType = MediaType::Unknown); +TAG_PARSER_EXPORT TagTargetLevel containerTargetLevel(ContainerFormat containerFormat, uint64 targetLevelValue); +TAG_PARSER_EXPORT uint64 containerTargetLevelValue(ContainerFormat containerFormat, TagTargetLevel targetLevel); } diff --git a/size.h b/size.h index 609f905..7977a64 100644 --- a/size.h +++ b/size.h @@ -1,7 +1,8 @@ #ifndef SIZE_H #define SIZE_H -#include +#include "./global.h" + #include #include @@ -12,7 +13,7 @@ namespace Media { /*! * \brief The Size class defines the size of a two-dimensional object using integer point precision. */ -class LIB_EXPORT Size +class TAG_PARSER_EXPORT Size { public: constexpr Size(); diff --git a/statusprovider.h b/statusprovider.h index 08df578..c35cee7 100644 --- a/statusprovider.h +++ b/statusprovider.h @@ -8,7 +8,7 @@ namespace Media { -class LIB_EXPORT StatusProvider +class TAG_PARSER_EXPORT StatusProvider { public: typedef std::function CallbackFunction; diff --git a/tag.h b/tag.h index a18e140..25103bb 100644 --- a/tag.h +++ b/tag.h @@ -96,7 +96,7 @@ constexpr KnownField nextKnownField(KnownField field) return field == lastKnownField ? KnownField::Invalid : static_cast(static_cast(field) + 1); } -class LIB_EXPORT Tag : public StatusProvider +class TAG_PARSER_EXPORT Tag : public StatusProvider { public: virtual ~Tag(); diff --git a/tagtarget.h b/tagtarget.h index 58bd712..9158313 100644 --- a/tagtarget.h +++ b/tagtarget.h @@ -1,7 +1,8 @@ #ifndef MEDIA_TAGTARGET_H #define MEDIA_TAGTARGET_H -#include +#include "./global.h" + #include #include @@ -25,9 +26,9 @@ enum class TagTargetLevel : unsigned char Collection }; -LIB_EXPORT const char *tagTargetLevelName(TagTargetLevel tagTargetLevel); +TAG_PARSER_EXPORT const char *tagTargetLevelName(TagTargetLevel tagTargetLevel); -class LIB_EXPORT TagTarget +class TAG_PARSER_EXPORT TagTarget { public: typedef uint64 IdType; diff --git a/tagvalue.h b/tagvalue.h index b219a15..fa5762c 100644 --- a/tagvalue.h +++ b/tagvalue.h @@ -61,7 +61,7 @@ enum class TagDataType : unsigned int Undefined /**< undefined/invalid data type */ }; -class LIB_EXPORT TagValue +class TAG_PARSER_EXPORT TagValue { public: // constructor, destructor diff --git a/vorbis/vorbiscomment.h b/vorbis/vorbiscomment.h index 8e8068b..6902fa9 100644 --- a/vorbis/vorbiscomment.h +++ b/vorbis/vorbiscomment.h @@ -12,7 +12,7 @@ namespace Media { class OggIterator; class VorbisComment; -class LIB_EXPORT VorbisComment : public FieldMapBasedTag +class TAG_PARSER_EXPORT VorbisComment : public FieldMapBasedTag { public: VorbisComment(); diff --git a/vorbis/vorbiscommentfield.h b/vorbis/vorbiscommentfield.h index b596713..518956d 100644 --- a/vorbis/vorbiscommentfield.h +++ b/vorbis/vorbiscommentfield.h @@ -38,7 +38,7 @@ class VorbisCommentField; * \brief Defines traits for the TagField implementation of the VorbisCommentField class. */ template <> -class LIB_EXPORT TagFieldTraits +class TAG_PARSER_EXPORT TagFieldTraits { public: /*! @@ -57,7 +57,7 @@ public: class OggIterator; -class LIB_EXPORT VorbisCommentField : public TagField, public StatusProvider +class TAG_PARSER_EXPORT VorbisCommentField : public TagField, public StatusProvider { friend class TagField; diff --git a/vorbis/vorbiscommentids.h b/vorbis/vorbiscommentids.h index 078a83d..0ae4a0e 100644 --- a/vorbis/vorbiscommentids.h +++ b/vorbis/vorbiscommentids.h @@ -1,7 +1,7 @@ #ifndef MEDIA_VORBISCOMMENTIDS_H #define MEDIA_VORBISCOMMENTIDS_H -#include +#include "../global.h" namespace Media { @@ -10,112 +10,112 @@ namespace Media { */ namespace VorbisCommentIds { -inline LIB_EXPORT const char *trackNumber() { +inline TAG_PARSER_EXPORT const char *trackNumber() { return "TRACKNUMBER"; } -inline LIB_EXPORT const char *diskNumber() { +inline TAG_PARSER_EXPORT const char *diskNumber() { return "DISCNUMBER"; } -inline LIB_EXPORT const char *part() { +inline TAG_PARSER_EXPORT const char *part() { return "PART"; } -inline LIB_EXPORT const char *partNumber() { +inline TAG_PARSER_EXPORT const char *partNumber() { return "PARTNUMBER"; } -inline LIB_EXPORT const char *title() { +inline TAG_PARSER_EXPORT const char *title() { return "TITLE"; } -inline LIB_EXPORT const char *version() { +inline TAG_PARSER_EXPORT const char *version() { return "VERSION"; } -inline LIB_EXPORT const char *artist() { +inline TAG_PARSER_EXPORT const char *artist() { return "ARTIST"; } -inline LIB_EXPORT const char *album() { +inline TAG_PARSER_EXPORT const char *album() { return "ALBUM"; } -inline LIB_EXPORT const char *label() { +inline TAG_PARSER_EXPORT const char *label() { return "LABEL"; } -inline LIB_EXPORT const char *labelNo() { +inline TAG_PARSER_EXPORT const char *labelNo() { return "LABELNO"; } -inline LIB_EXPORT const char *language() { +inline TAG_PARSER_EXPORT const char *language() { return "LANGUAGE"; } -inline LIB_EXPORT const char *performer() { +inline TAG_PARSER_EXPORT const char *performer() { return "PERFORMER"; } -inline LIB_EXPORT const char *composer() { +inline TAG_PARSER_EXPORT const char *composer() { return "COMPOSER"; } -inline LIB_EXPORT const char *ensemble() { +inline TAG_PARSER_EXPORT const char *ensemble() { return "ENSEMBLE"; } -inline LIB_EXPORT const char *arranger() { +inline TAG_PARSER_EXPORT const char *arranger() { return "ARRANGER"; } -inline LIB_EXPORT const char *lyricist() { +inline TAG_PARSER_EXPORT const char *lyricist() { return "LYRICIST"; } -inline LIB_EXPORT const char *author() { +inline TAG_PARSER_EXPORT const char *author() { return "AUTHOR"; } -inline LIB_EXPORT const char *conductor() { +inline TAG_PARSER_EXPORT const char *conductor() { return "CONDUCTOR"; } -inline LIB_EXPORT const char *encoder() { +inline TAG_PARSER_EXPORT const char *encoder() { return "ENCODER"; } -inline LIB_EXPORT const char *publisher() { +inline TAG_PARSER_EXPORT const char *publisher() { return "PUBLISHER"; } -inline LIB_EXPORT const char *genre() { +inline TAG_PARSER_EXPORT const char *genre() { return "GENRE"; } -inline LIB_EXPORT const char *originalMediaType() { +inline TAG_PARSER_EXPORT const char *originalMediaType() { return "ORIGINAL_MEDIA_TYPE"; } -inline LIB_EXPORT const char *contentType() { +inline TAG_PARSER_EXPORT const char *contentType() { return "CONTENT_TYPE"; } -inline LIB_EXPORT const char *subject() { +inline TAG_PARSER_EXPORT const char *subject() { return "SUBJECT"; } -inline LIB_EXPORT const char *description() { +inline TAG_PARSER_EXPORT const char *description() { return "DESCRIPTION"; } -inline LIB_EXPORT const char *isrc() { +inline TAG_PARSER_EXPORT const char *isrc() { return "ISRC"; } -inline LIB_EXPORT const char *eanupn() { +inline TAG_PARSER_EXPORT const char *eanupn() { return "EAN/UPN"; } -inline LIB_EXPORT const char *comment() { +inline TAG_PARSER_EXPORT const char *comment() { return "COMMENT"; } -inline LIB_EXPORT const char *encoderSettings() { +inline TAG_PARSER_EXPORT const char *encoderSettings() { return "ENCODING"; } -inline LIB_EXPORT const char *date() { +inline TAG_PARSER_EXPORT const char *date() { return "DATE"; } -inline LIB_EXPORT const char *location() { +inline TAG_PARSER_EXPORT const char *location() { return "LOCATION"; } -inline LIB_EXPORT const char *license() { +inline TAG_PARSER_EXPORT const char *license() { return "LICENSE"; } -inline LIB_EXPORT const char *copyright() { +inline TAG_PARSER_EXPORT const char *copyright() { return "COPYRIGHT"; } -inline LIB_EXPORT const char *opus() { +inline TAG_PARSER_EXPORT const char *opus() { return "OPUS"; } -inline LIB_EXPORT const char *sourceMedia() { +inline TAG_PARSER_EXPORT const char *sourceMedia() { return "SOURCEMEDIA"; } -inline LIB_EXPORT const char *cover() { +inline TAG_PARSER_EXPORT const char *cover() { return "METADATA_BLOCK_PICTURE"; } diff --git a/vorbis/vorbisidentificationheader.h b/vorbis/vorbisidentificationheader.h index 0e4225f..51b8fca 100644 --- a/vorbis/vorbisidentificationheader.h +++ b/vorbis/vorbisidentificationheader.h @@ -1,14 +1,15 @@ #ifndef MEDIA_VORBISIDENTIFICATIONHEADER_H #define MEDIA_VORBISIDENTIFICATIONHEADER_H -#include +#include "../global.h" + #include namespace Media { class OggIterator; -class LIB_EXPORT VorbisIdentificationHeader +class TAG_PARSER_EXPORT VorbisIdentificationHeader { public: VorbisIdentificationHeader(); diff --git a/wav/waveaudiostream.h b/wav/waveaudiostream.h index ac0e01f..66403d6 100644 --- a/wav/waveaudiostream.h +++ b/wav/waveaudiostream.h @@ -8,7 +8,7 @@ namespace Media { -class LIB_EXPORT WaveFormatHeader +class TAG_PARSER_EXPORT WaveFormatHeader { public: WaveFormatHeader(); @@ -33,7 +33,7 @@ inline uint32 WaveFormatHeader::bitrate() const return bitsPerSample * sampleRate * channelCount; } -class LIB_EXPORT WaveAudioStream : public AbstractTrack +class TAG_PARSER_EXPORT WaveAudioStream : public AbstractTrack { public: WaveAudioStream(std::iostream &stream, uint64 startOffset);