From: Steve Lhomme Date: Mon, 15 Mar 2010 16:19:18 +0000 (+0000) Subject: update the copyright notice to 2010 X-Git-Tag: release-0.9.0~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99cfc345c2698c5b57d8d3104b7088c47675b829;p=libmatroska update the copyright notice to 2010 git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libmatroska@18 a6f86f6d-0131-4f8e-9e7b-e335508773d5 --- diff --git a/matroska/FileKax.h b/matroska/FileKax.h index 8ac7393..3d60d07 100644 --- a/matroska/FileKax.h +++ b/matroska/FileKax.h @@ -1,152 +1,152 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: FileKax.h,v 1.5 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_FILE_H -#define LIBMATROSKA_FILE_H - -//#include - -#include "matroska/KaxTypes.h" -#include "ebml/IOCallback.h" -//#include "MainHeader.h" -//#include "TrackType.h" -//#include "StreamInfo.h" -//#include "Cluster.h" -//#include "CodecHeader.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -//class Track; -//class Frame; - -/*! - \class MATROSKA_DLL_API FileMatroska - \brief General container of all the parameters and data of an Matroska file - \todo Handle the filename and next filename - \todo Handle the IOCallback selection/type -*/ -class MATROSKA_DLL_API FileMatroska { - public: - FileMatroska(IOCallback & output); - ~FileMatroska(); -#ifdef OLD - uint32 RenderHead(const std::string & aEncoderApp); - uint32 ReadHead(); - uint32 ReadTracks(); - uint32 ReadCodec(); - void Close(const uint32 aTimeLength); - - inline void type_SetInfo(const std::string & aStr) {myMainHeader.type_SetInfo(aStr);} - inline void type_SetAds(const std::string & aStr) {myMainHeader.type_SetAds(aStr);} - inline void type_SetSize(const std::string & aStr) {myMainHeader.type_SetSize(aStr);} - inline void type_SetSize(uint64 aSize) {myMainHeader.type_SetSize(aSize);} - - inline uint8 GetTrackNumber() const { return myTracks.size(); } - - void track_SetName(Track * aTrack, const std::string & aName); - void track_SetLaced(Track * aTrack, bool bLaced = true); - - Track * CreateTrack(const track_type aType); - inline Track * GetTrack(const uint8 aTrackNb) const - { - if (aTrackNb > myTracks.size()) - return NULL; - else - return myTracks[aTrackNb-1]; - } - - void Track_GetInfo(const Track * aTrack, TrackInfo & aTrackInfo) const; - - void Track_SetInfo_Audio(Track * aTrack, const TrackInfoAudio & aTrackInfo); - void Track_GetInfo_Audio(const Track * aTrack, TrackInfoAudio & aTrackInfo) const; - - void Track_SetInfo_Video(Track * aTrack, const TrackInfoVideo & aTrackInfo); - void Track_GetInfo_Video(const Track * aTrack, TrackInfoVideo & aTrackInfo) const; - - void SelectReadingTrack(Track * aTrack, bool select = true); - - /*! - \return wether the frame has been added or not - */ - bool AddFrame(Track * aTrack, const uint32 aTimecode, const binary *aFrame, const uint32 aFrameSize, - bool aKeyFrame = true, bool aBFrame = false); - - /*! - \return wether the frame has been read or not - */ - bool ReadFrame(Track * & aTrack, uint32 & aTimecode, const binary * & aFrame, uint32 & aFrameSize, - bool & aKeyFrame, bool & aBFrame); - - /* - Render the pending cluster to file - */ - void Flush(); - - void SetMaxClusterSize(const uint32 value); - void SetMinClusterSize(const uint32 value) {myMinClusterSize = value;} - - protected: - MainHeader myMainHeader; - - std::vector myTracks; - std::vector mySelectedTracks; - -// Track *findTrack(Track * aTrack) const; - - Cluster myCurrWriteCluster; /// \todo merge with the write one ? - uint32 myReadBlockNumber; - Cluster myCurrReadCluster; - binary * myCurrReadBlock; ///< The buffer containing the current read block - uint32 myCurrReadBlockSize; ///< The size of the buffer containing the current read block - uint8 myCurrReadBlockTrack; ///< The track number of the current track to read - - uint32 myMaxClusterSize; - uint32 myMinClusterSize; - - StreamInfo myStreamInfo; - - CodecHeader myCodecHeader; - - inline bool IsMyTrack(const Track * aTrack) const; - inline bool IsReadingTrack(const uint8 aTrackNum) const; -#endif // OLD - IOCallback & myFile; - -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // FILE_KAX_HPP +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: FileKax.h,v 1.5 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_FILE_H +#define LIBMATROSKA_FILE_H + +//#include + +#include "matroska/KaxTypes.h" +#include "ebml/IOCallback.h" +//#include "MainHeader.h" +//#include "TrackType.h" +//#include "StreamInfo.h" +//#include "Cluster.h" +//#include "CodecHeader.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +//class Track; +//class Frame; + +/*! + \class MATROSKA_DLL_API FileMatroska + \brief General container of all the parameters and data of an Matroska file + \todo Handle the filename and next filename + \todo Handle the IOCallback selection/type +*/ +class MATROSKA_DLL_API FileMatroska { + public: + FileMatroska(IOCallback & output); + ~FileMatroska(); +#ifdef OLD + uint32 RenderHead(const std::string & aEncoderApp); + uint32 ReadHead(); + uint32 ReadTracks(); + uint32 ReadCodec(); + void Close(const uint32 aTimeLength); + + inline void type_SetInfo(const std::string & aStr) {myMainHeader.type_SetInfo(aStr);} + inline void type_SetAds(const std::string & aStr) {myMainHeader.type_SetAds(aStr);} + inline void type_SetSize(const std::string & aStr) {myMainHeader.type_SetSize(aStr);} + inline void type_SetSize(uint64 aSize) {myMainHeader.type_SetSize(aSize);} + + inline uint8 GetTrackNumber() const { return myTracks.size(); } + + void track_SetName(Track * aTrack, const std::string & aName); + void track_SetLaced(Track * aTrack, bool bLaced = true); + + Track * CreateTrack(const track_type aType); + inline Track * GetTrack(const uint8 aTrackNb) const + { + if (aTrackNb > myTracks.size()) + return NULL; + else + return myTracks[aTrackNb-1]; + } + + void Track_GetInfo(const Track * aTrack, TrackInfo & aTrackInfo) const; + + void Track_SetInfo_Audio(Track * aTrack, const TrackInfoAudio & aTrackInfo); + void Track_GetInfo_Audio(const Track * aTrack, TrackInfoAudio & aTrackInfo) const; + + void Track_SetInfo_Video(Track * aTrack, const TrackInfoVideo & aTrackInfo); + void Track_GetInfo_Video(const Track * aTrack, TrackInfoVideo & aTrackInfo) const; + + void SelectReadingTrack(Track * aTrack, bool select = true); + + /*! + \return wether the frame has been added or not + */ + bool AddFrame(Track * aTrack, const uint32 aTimecode, const binary *aFrame, const uint32 aFrameSize, + bool aKeyFrame = true, bool aBFrame = false); + + /*! + \return wether the frame has been read or not + */ + bool ReadFrame(Track * & aTrack, uint32 & aTimecode, const binary * & aFrame, uint32 & aFrameSize, + bool & aKeyFrame, bool & aBFrame); + + /* + Render the pending cluster to file + */ + void Flush(); + + void SetMaxClusterSize(const uint32 value); + void SetMinClusterSize(const uint32 value) {myMinClusterSize = value;} + + protected: + MainHeader myMainHeader; + + std::vector myTracks; + std::vector mySelectedTracks; + +// Track *findTrack(Track * aTrack) const; + + Cluster myCurrWriteCluster; /// \todo merge with the write one ? + uint32 myReadBlockNumber; + Cluster myCurrReadCluster; + binary * myCurrReadBlock; ///< The buffer containing the current read block + uint32 myCurrReadBlockSize; ///< The size of the buffer containing the current read block + uint8 myCurrReadBlockTrack; ///< The track number of the current track to read + + uint32 myMaxClusterSize; + uint32 myMinClusterSize; + + StreamInfo myStreamInfo; + + CodecHeader myCodecHeader; + + inline bool IsMyTrack(const Track * aTrack) const; + inline bool IsReadingTrack(const uint8 aTrackNum) const; +#endif // OLD + IOCallback & myFile; + +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // FILE_KAX_HPP diff --git a/matroska/KaxAttached.h b/matroska/KaxAttached.h index e2a1743..9b60f96 100644 --- a/matroska/KaxAttached.h +++ b/matroska/KaxAttached.h @@ -1,110 +1,110 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxAttached.h,v 1.8 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_ATTACHED_H -#define LIBMATROSKA_ATTACHED_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlUnicodeString.h" -#include "ebml/EbmlString.h" -#include "ebml/EbmlBinary.h" -#include "ebml/EbmlUInteger.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxAttached : public EbmlMaster { - public: - KaxAttached(); - KaxAttached(const KaxAttached & ElementToClone) : EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxAttached) -}; - -class MATROSKA_DLL_API KaxFileDescription : public EbmlUnicodeString { - public: - KaxFileDescription() {} - KaxFileDescription(const KaxFileDescription & ElementToClone) : EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxFileDescription) -}; - -class MATROSKA_DLL_API KaxFileName : public EbmlUnicodeString { - public: - KaxFileName() {} - KaxFileName(const KaxFileName & ElementToClone) : EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxFileName) -}; - -class MATROSKA_DLL_API KaxMimeType : public EbmlString { - public: - KaxMimeType() {} - KaxMimeType(const KaxMimeType & ElementToClone) : EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxMimeType) -}; - -class MATROSKA_DLL_API KaxFileData : public EbmlBinary { - public: - KaxFileData() {} - KaxFileData(const KaxFileData & ElementToClone) :EbmlBinary(ElementToClone){} - - bool ValidateSize() const {return true;} // we don't mind about what's inside - - EBML_CONCRETE_CLASS(KaxFileData) -}; - -class MATROSKA_DLL_API KaxFileReferral : public EbmlBinary { - public: - KaxFileReferral() {} - KaxFileReferral(const KaxFileReferral & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return true;} // we don't mind about what's inside - - EBML_CONCRETE_CLASS(KaxFileReferral) -}; - -class MATROSKA_DLL_API KaxFileUID : public EbmlUInteger { - public: - KaxFileUID() {} - KaxFileUID(const KaxFileUID & ElementToClone) : EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxFileUID) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_ATTACHED_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxAttached.h,v 1.8 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_ATTACHED_H +#define LIBMATROSKA_ATTACHED_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlUnicodeString.h" +#include "ebml/EbmlString.h" +#include "ebml/EbmlBinary.h" +#include "ebml/EbmlUInteger.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxAttached : public EbmlMaster { + public: + KaxAttached(); + KaxAttached(const KaxAttached & ElementToClone) : EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxAttached) +}; + +class MATROSKA_DLL_API KaxFileDescription : public EbmlUnicodeString { + public: + KaxFileDescription() {} + KaxFileDescription(const KaxFileDescription & ElementToClone) : EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxFileDescription) +}; + +class MATROSKA_DLL_API KaxFileName : public EbmlUnicodeString { + public: + KaxFileName() {} + KaxFileName(const KaxFileName & ElementToClone) : EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxFileName) +}; + +class MATROSKA_DLL_API KaxMimeType : public EbmlString { + public: + KaxMimeType() {} + KaxMimeType(const KaxMimeType & ElementToClone) : EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxMimeType) +}; + +class MATROSKA_DLL_API KaxFileData : public EbmlBinary { + public: + KaxFileData() {} + KaxFileData(const KaxFileData & ElementToClone) :EbmlBinary(ElementToClone){} + + bool ValidateSize() const {return true;} // we don't mind about what's inside + + EBML_CONCRETE_CLASS(KaxFileData) +}; + +class MATROSKA_DLL_API KaxFileReferral : public EbmlBinary { + public: + KaxFileReferral() {} + KaxFileReferral(const KaxFileReferral & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return true;} // we don't mind about what's inside + + EBML_CONCRETE_CLASS(KaxFileReferral) +}; + +class MATROSKA_DLL_API KaxFileUID : public EbmlUInteger { + public: + KaxFileUID() {} + KaxFileUID(const KaxFileUID & ElementToClone) : EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxFileUID) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_ATTACHED_H diff --git a/matroska/KaxAttachments.h b/matroska/KaxAttachments.h index aded54e..15458ba 100644 --- a/matroska/KaxAttachments.h +++ b/matroska/KaxAttachments.h @@ -1,55 +1,55 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxAttachments.h,v 1.8 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_ATTACHEMENTS_H -#define LIBMATROSKA_ATTACHEMENTS_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxAttachments : public EbmlMaster { - public: - KaxAttachments(); - KaxAttachments(const KaxAttachments & ElementToClone) : EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxAttachments) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_ATTACHEMENTS_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxAttachments.h,v 1.8 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_ATTACHEMENTS_H +#define LIBMATROSKA_ATTACHEMENTS_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxAttachments : public EbmlMaster { + public: + KaxAttachments(); + KaxAttachments(const KaxAttachments & ElementToClone) : EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxAttachments) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_ATTACHEMENTS_H diff --git a/matroska/KaxBlock.h b/matroska/KaxBlock.h index f48c472..d11ed7b 100644 --- a/matroska/KaxBlock.h +++ b/matroska/KaxBlock.h @@ -1,423 +1,423 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \todo add a PureBlock class to group functionalities between Block and BlockVirtual - \version \$Id: KaxBlock.h,v 1.24 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme - \author Julien Coloos -*/ -#ifndef LIBMATROSKA_BLOCK_H -#define LIBMATROSKA_BLOCK_H - -#include - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlBinary.h" -#include "ebml/EbmlMaster.h" -#include "matroska/KaxTracks.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class KaxCluster; -class KaxReferenceBlock; -class KaxInternalBlock; -class KaxBlockBlob; - -class MATROSKA_DLL_API DataBuffer { - protected: - binary * myBuffer; - uint32 mySize; - bool bValidValue; - bool (*myFreeBuffer)(const DataBuffer & aBuffer); // method to free the internal buffer - - public: - DataBuffer(binary * aBuffer, uint32 aSize, bool (*aFreeBuffer)(const DataBuffer & aBuffer) = NULL) - :myBuffer(aBuffer) - ,mySize(aSize) - ,bValidValue(true) - ,myFreeBuffer(aFreeBuffer) - {} - virtual ~DataBuffer() {} - virtual binary * Buffer() {return myBuffer;} - virtual uint32 & Size() {return mySize;}; - virtual const binary * Buffer() const {return myBuffer;} - virtual const uint32 Size() const {return mySize;}; - bool FreeBuffer(const DataBuffer & aBuffer) { - bool bResult = true; - if (myBuffer != NULL && myFreeBuffer != NULL && bValidValue) { - bResult = myFreeBuffer(aBuffer); - myBuffer = NULL; - bValidValue = false; - } - return bResult; - } - - virtual DataBuffer * Clone(); -}; - -class MATROSKA_DLL_API SimpleDataBuffer : public DataBuffer { - public: - SimpleDataBuffer(binary * aBuffer, uint32 aSize, uint32 aOffset, bool (*aFreeBuffer)(const DataBuffer & aBuffer) = myFreeBuffer) - :DataBuffer(aBuffer + aOffset, aSize, aFreeBuffer) - ,Offset(aOffset) - ,BaseBuffer(aBuffer) - {} - virtual ~SimpleDataBuffer() {} - - DataBuffer * Clone() {return new SimpleDataBuffer(*this);} - - protected: - uint32 Offset; - binary * BaseBuffer; - - static bool myFreeBuffer(const DataBuffer & aBuffer) - { - binary *_Buffer = static_cast(&aBuffer)->BaseBuffer; - if (_Buffer != NULL) - free(_Buffer); - return true; - } - - SimpleDataBuffer(const SimpleDataBuffer & ToClone); -}; - -/*! - \note the data is copied locally, it can be freed right away -* / -class MATROSKA_DLL_API NotSoSimpleDataBuffer : public SimpleDataBuffer { - public: - NotSoSimpleDataBuffer(binary * aBuffer, uint32 aSize, uint32 aOffset) - :SimpleDataBuffer(new binary[aSize - aOffset], aSize, 0) - { - memcpy(BaseBuffer, aBuffer + aOffset, aSize - aOffset); - } -}; -*/ - -class MATROSKA_DLL_API KaxBlockGroup : public EbmlMaster { - public: - KaxBlockGroup(); - KaxBlockGroup(const KaxBlockGroup & ElementToClone) :EbmlMaster(ElementToClone) {} - - ~KaxBlockGroup(); - - /*! - \brief Addition of a frame without references - */ - bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing = LACING_AUTO); - /*! - \brief Addition of a frame with a backward reference (P frame) - */ - bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockGroup & PastBlock, LacingType lacing = LACING_AUTO); - - /*! - \brief Addition of a frame with a backward+forward reference (B frame) - */ - bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing = LACING_AUTO); - bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockBlob * PastBlock, const KaxBlockBlob * ForwBlock, LacingType lacing = LACING_AUTO); - - void SetParent(KaxCluster & aParentCluster); - - void SetParentTrack(const KaxTrackEntry & aParentTrack) { - ParentTrack = &aParentTrack; - } - - /*! - \brief Set the duration of the contained frame(s) (for the total number of frames) - */ - void SetBlockDuration(uint64 TimeLength); - bool GetBlockDuration(uint64 &TheTimecode) const; - - /*! - \return the global timecode of this Block (not just the delta to the Cluster) - */ - uint64 GlobalTimecode() const; - uint64 GlobalTimecodeScale() const { - assert(ParentTrack != NULL); - return ParentTrack->GlobalTimecodeScale(); - } - - uint16 TrackNumber() const; - - uint64 ClusterPosition() const; - - /*! - \return the number of references to other frames - */ - unsigned int ReferenceCount() const; - const KaxReferenceBlock & Reference(unsigned int Index) const; - - /*! - \brief release all the frames of all Blocks - */ - void ReleaseFrames(); - - operator KaxInternalBlock &(); - - const KaxCluster *GetParentCluster() const { return ParentCluster; } - - protected: - KaxCluster * ParentCluster; - const KaxTrackEntry * ParentTrack; - - EBML_CONCRETE_CLASS(KaxBlockGroup) -}; - -class KaxInternalBlock : public EbmlBinary { - public: - KaxInternalBlock( bool bSimple ) :bLocalTimecodeUsed(false), mLacing(LACING_AUTO), mInvisible(false) - ,ParentCluster(NULL), bIsSimple(bSimple), bIsKeyframe(true), bIsDiscardable(false) - {} - KaxInternalBlock(const KaxInternalBlock & ElementToClone); - ~KaxInternalBlock(); - bool ValidateSize() const; - - uint16 TrackNum() const {return TrackNumber;} - /*! - \todo !!!! This method needs to be changes ! - */ - uint64 GlobalTimecode() const {return Timecode;} - - /*! - \note override this function to generate the Data/Size on the fly, unlike the usual binary elements - */ - uint64 UpdateSize(bool bSaveDefault = false, bool bForceRender = false); - uint64 ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA); - - /*! - \brief Only read the head of the Block (not internal data) - \note convenient when you are parsing the file quickly - */ - uint64 ReadInternalHead(IOCallback & input); - - unsigned int NumberFrames() const { return SizeList.size();} - DataBuffer & GetBuffer(unsigned int iIndex) {return *myBuffers[iIndex];} - - bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing = LACING_AUTO, bool invisible = false); - - /*! - \brief release all the frames of all Blocks - */ - void ReleaseFrames(); - - void SetParent(KaxCluster & aParentCluster); - - /*! - \return Returns the lacing type that produces the smallest footprint. - */ - LacingType GetBestLacingType() const; - - /*! - \param FrameNumber 0 for the first frame - \return the position in the stream for a given frame - \note return -1 if the position doesn't exist - */ - int64 GetDataPosition(size_t FrameNumber = 0); - - /*! - \param FrameNumber 0 for the first frame - \return the size of a given frame - \note return -1 if the position doesn't exist - */ - int64 GetFrameSize(size_t FrameNumber = 0); - - bool IsInvisible() const { return mInvisible; } - - uint64 ClusterPosition() const; - - protected: - std::vector myBuffers; - std::vector SizeList; - uint64 Timecode; // temporary timecode of the first frame, non scaled - int16 LocalTimecode; - bool bLocalTimecodeUsed; - uint16 TrackNumber; - LacingType mLacing; - bool mInvisible; - uint64 FirstFrameLocation; - - uint32 RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault = false); - - KaxCluster * ParentCluster; - bool bIsSimple; - bool bIsKeyframe; - bool bIsDiscardable; -}; - -class MATROSKA_DLL_API KaxBlock : public KaxInternalBlock { - public: - KaxBlock() :KaxInternalBlock(false) {} - - EBML_CONCRETE_CLASS(KaxBlock) -}; - -#if MATROSKA_VERSION >= 2 -class MATROSKA_DLL_API KaxSimpleBlock : public KaxInternalBlock { - public: - KaxSimpleBlock() :KaxInternalBlock(true) {} - - void SetKeyframe(bool b_keyframe) { bIsKeyframe = b_keyframe; } - void SetDiscardable(bool b_discard) { bIsDiscardable = b_discard; } - - bool IsKeyframe() const { return bIsKeyframe; } - bool IsDiscardable() const { return bIsDiscardable; } - - operator KaxInternalBlock &() { return *this; } - - EBML_CONCRETE_CLASS(KaxSimpleBlock) -}; -#endif // MATROSKA_VERSION - -class MATROSKA_DLL_API KaxBlockBlob { -public: - KaxBlockBlob(BlockBlobType sblock_mode) :ParentCluster(NULL), SimpleBlockMode(sblock_mode) { - bUseSimpleBlock = (sblock_mode != BLOCK_BLOB_NO_SIMPLE); - Block.group = NULL; - } - - ~KaxBlockBlob() { -#if MATROSKA_VERSION >= 2 - if (bUseSimpleBlock) - delete Block.simpleblock; - else -#endif // MATROSKA_VERSION - delete Block.group; - } - - operator KaxBlockGroup &(); - operator const KaxBlockGroup &() const; -#if MATROSKA_VERSION >= 2 - operator KaxSimpleBlock &(); -#endif - operator KaxInternalBlock &(); - operator const KaxInternalBlock &() const; - - void SetBlockGroup( KaxBlockGroup &BlockRef ); - - void SetBlockDuration(uint64 TimeLength); - - void SetParent(KaxCluster & aParentCluster); - bool AddFrameAuto(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing = LACING_AUTO, const KaxBlockBlob * PastBlock = NULL, const KaxBlockBlob * ForwBlock = NULL); - - bool IsSimpleBlock() const {return bUseSimpleBlock;} - - bool ReplaceSimpleByGroup(); -protected: - KaxCluster * ParentCluster; - union { - KaxBlockGroup *group; -#if MATROSKA_VERSION >= 2 - KaxSimpleBlock *simpleblock; -#endif // MATROSKA_VERSION - } Block; - bool bUseSimpleBlock; - BlockBlobType SimpleBlockMode; -}; - -class MATROSKA_DLL_API KaxBlockDuration : public EbmlUInteger { - public: - KaxBlockDuration() {} - KaxBlockDuration(const KaxBlockDuration & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxBlockDuration) -}; - -#if MATROSKA_VERSION >= 2 -class MATROSKA_DLL_API KaxBlockVirtual : public EbmlBinary { - public: - KaxBlockVirtual() :ParentCluster(NULL) {SetBuffer(DataBlock,sizeof(DataBlock)); SetValueIsSet(false);} - KaxBlockVirtual(const KaxBlockVirtual & ElementToClone); - bool ValidateSize() const {return true;} - - /*! - \note override this function to generate the Data/Size on the fly, unlike the usual binary elements - */ - uint64 UpdateSize(bool bSaveDefault = false, bool bForceRender = false); - - void SetParent(const KaxCluster & aParentCluster) {ParentCluster = &aParentCluster;} - - protected: - uint64 Timecode; // temporary timecode of the first frame if there are more than one - uint16 TrackNumber; - binary DataBlock[5]; - - const KaxCluster * ParentCluster; - - EBML_CONCRETE_CLASS(KaxBlockVirtual) -}; -#endif // MATROSKA_VERSION - -class MATROSKA_DLL_API KaxBlockAdditional : public EbmlBinary { - public: - KaxBlockAdditional() {} - KaxBlockAdditional(const KaxBlockAdditional & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return true;} - - EBML_CONCRETE_CLASS(KaxBlockAdditional) -}; - -class MATROSKA_DLL_API KaxBlockAdditions : public EbmlMaster { - public: - KaxBlockAdditions(); - KaxBlockAdditions(const KaxBlockAdditions & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxBlockAdditions) -}; - -class MATROSKA_DLL_API KaxBlockMore : public EbmlMaster { - public: - KaxBlockMore(); - KaxBlockMore(const KaxBlockMore & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxBlockMore) -}; - -class MATROSKA_DLL_API KaxBlockAddID : public EbmlUInteger { - public: - KaxBlockAddID() :EbmlUInteger(1) {} - KaxBlockAddID(const KaxBlockAddID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxBlockAddID) -}; - -class MATROSKA_DLL_API KaxCodecState : public EbmlBinary { - public: - KaxCodecState() {} - KaxCodecState(const KaxCodecState & ElementToClone) :EbmlBinary(ElementToClone){} - - bool ValidateSize() const {return true;} - - EBML_CONCRETE_CLASS(KaxCodecState) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_BLOCK_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \todo add a PureBlock class to group functionalities between Block and BlockVirtual + \version \$Id: KaxBlock.h,v 1.24 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme + \author Julien Coloos +*/ +#ifndef LIBMATROSKA_BLOCK_H +#define LIBMATROSKA_BLOCK_H + +#include + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlBinary.h" +#include "ebml/EbmlMaster.h" +#include "matroska/KaxTracks.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class KaxCluster; +class KaxReferenceBlock; +class KaxInternalBlock; +class KaxBlockBlob; + +class MATROSKA_DLL_API DataBuffer { + protected: + binary * myBuffer; + uint32 mySize; + bool bValidValue; + bool (*myFreeBuffer)(const DataBuffer & aBuffer); // method to free the internal buffer + + public: + DataBuffer(binary * aBuffer, uint32 aSize, bool (*aFreeBuffer)(const DataBuffer & aBuffer) = NULL) + :myBuffer(aBuffer) + ,mySize(aSize) + ,bValidValue(true) + ,myFreeBuffer(aFreeBuffer) + {} + virtual ~DataBuffer() {} + virtual binary * Buffer() {return myBuffer;} + virtual uint32 & Size() {return mySize;}; + virtual const binary * Buffer() const {return myBuffer;} + virtual const uint32 Size() const {return mySize;}; + bool FreeBuffer(const DataBuffer & aBuffer) { + bool bResult = true; + if (myBuffer != NULL && myFreeBuffer != NULL && bValidValue) { + bResult = myFreeBuffer(aBuffer); + myBuffer = NULL; + bValidValue = false; + } + return bResult; + } + + virtual DataBuffer * Clone(); +}; + +class MATROSKA_DLL_API SimpleDataBuffer : public DataBuffer { + public: + SimpleDataBuffer(binary * aBuffer, uint32 aSize, uint32 aOffset, bool (*aFreeBuffer)(const DataBuffer & aBuffer) = myFreeBuffer) + :DataBuffer(aBuffer + aOffset, aSize, aFreeBuffer) + ,Offset(aOffset) + ,BaseBuffer(aBuffer) + {} + virtual ~SimpleDataBuffer() {} + + DataBuffer * Clone() {return new SimpleDataBuffer(*this);} + + protected: + uint32 Offset; + binary * BaseBuffer; + + static bool myFreeBuffer(const DataBuffer & aBuffer) + { + binary *_Buffer = static_cast(&aBuffer)->BaseBuffer; + if (_Buffer != NULL) + free(_Buffer); + return true; + } + + SimpleDataBuffer(const SimpleDataBuffer & ToClone); +}; + +/*! + \note the data is copied locally, it can be freed right away +* / +class MATROSKA_DLL_API NotSoSimpleDataBuffer : public SimpleDataBuffer { + public: + NotSoSimpleDataBuffer(binary * aBuffer, uint32 aSize, uint32 aOffset) + :SimpleDataBuffer(new binary[aSize - aOffset], aSize, 0) + { + memcpy(BaseBuffer, aBuffer + aOffset, aSize - aOffset); + } +}; +*/ + +class MATROSKA_DLL_API KaxBlockGroup : public EbmlMaster { + public: + KaxBlockGroup(); + KaxBlockGroup(const KaxBlockGroup & ElementToClone) :EbmlMaster(ElementToClone) {} + + ~KaxBlockGroup(); + + /*! + \brief Addition of a frame without references + */ + bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing = LACING_AUTO); + /*! + \brief Addition of a frame with a backward reference (P frame) + */ + bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockGroup & PastBlock, LacingType lacing = LACING_AUTO); + + /*! + \brief Addition of a frame with a backward+forward reference (B frame) + */ + bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing = LACING_AUTO); + bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockBlob * PastBlock, const KaxBlockBlob * ForwBlock, LacingType lacing = LACING_AUTO); + + void SetParent(KaxCluster & aParentCluster); + + void SetParentTrack(const KaxTrackEntry & aParentTrack) { + ParentTrack = &aParentTrack; + } + + /*! + \brief Set the duration of the contained frame(s) (for the total number of frames) + */ + void SetBlockDuration(uint64 TimeLength); + bool GetBlockDuration(uint64 &TheTimecode) const; + + /*! + \return the global timecode of this Block (not just the delta to the Cluster) + */ + uint64 GlobalTimecode() const; + uint64 GlobalTimecodeScale() const { + assert(ParentTrack != NULL); + return ParentTrack->GlobalTimecodeScale(); + } + + uint16 TrackNumber() const; + + uint64 ClusterPosition() const; + + /*! + \return the number of references to other frames + */ + unsigned int ReferenceCount() const; + const KaxReferenceBlock & Reference(unsigned int Index) const; + + /*! + \brief release all the frames of all Blocks + */ + void ReleaseFrames(); + + operator KaxInternalBlock &(); + + const KaxCluster *GetParentCluster() const { return ParentCluster; } + + protected: + KaxCluster * ParentCluster; + const KaxTrackEntry * ParentTrack; + + EBML_CONCRETE_CLASS(KaxBlockGroup) +}; + +class KaxInternalBlock : public EbmlBinary { + public: + KaxInternalBlock( bool bSimple ) :bLocalTimecodeUsed(false), mLacing(LACING_AUTO), mInvisible(false) + ,ParentCluster(NULL), bIsSimple(bSimple), bIsKeyframe(true), bIsDiscardable(false) + {} + KaxInternalBlock(const KaxInternalBlock & ElementToClone); + ~KaxInternalBlock(); + bool ValidateSize() const; + + uint16 TrackNum() const {return TrackNumber;} + /*! + \todo !!!! This method needs to be changes ! + */ + uint64 GlobalTimecode() const {return Timecode;} + + /*! + \note override this function to generate the Data/Size on the fly, unlike the usual binary elements + */ + uint64 UpdateSize(bool bSaveDefault = false, bool bForceRender = false); + uint64 ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA); + + /*! + \brief Only read the head of the Block (not internal data) + \note convenient when you are parsing the file quickly + */ + uint64 ReadInternalHead(IOCallback & input); + + unsigned int NumberFrames() const { return SizeList.size();} + DataBuffer & GetBuffer(unsigned int iIndex) {return *myBuffers[iIndex];} + + bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing = LACING_AUTO, bool invisible = false); + + /*! + \brief release all the frames of all Blocks + */ + void ReleaseFrames(); + + void SetParent(KaxCluster & aParentCluster); + + /*! + \return Returns the lacing type that produces the smallest footprint. + */ + LacingType GetBestLacingType() const; + + /*! + \param FrameNumber 0 for the first frame + \return the position in the stream for a given frame + \note return -1 if the position doesn't exist + */ + int64 GetDataPosition(size_t FrameNumber = 0); + + /*! + \param FrameNumber 0 for the first frame + \return the size of a given frame + \note return -1 if the position doesn't exist + */ + int64 GetFrameSize(size_t FrameNumber = 0); + + bool IsInvisible() const { return mInvisible; } + + uint64 ClusterPosition() const; + + protected: + std::vector myBuffers; + std::vector SizeList; + uint64 Timecode; // temporary timecode of the first frame, non scaled + int16 LocalTimecode; + bool bLocalTimecodeUsed; + uint16 TrackNumber; + LacingType mLacing; + bool mInvisible; + uint64 FirstFrameLocation; + + uint32 RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault = false); + + KaxCluster * ParentCluster; + bool bIsSimple; + bool bIsKeyframe; + bool bIsDiscardable; +}; + +class MATROSKA_DLL_API KaxBlock : public KaxInternalBlock { + public: + KaxBlock() :KaxInternalBlock(false) {} + + EBML_CONCRETE_CLASS(KaxBlock) +}; + +#if MATROSKA_VERSION >= 2 +class MATROSKA_DLL_API KaxSimpleBlock : public KaxInternalBlock { + public: + KaxSimpleBlock() :KaxInternalBlock(true) {} + + void SetKeyframe(bool b_keyframe) { bIsKeyframe = b_keyframe; } + void SetDiscardable(bool b_discard) { bIsDiscardable = b_discard; } + + bool IsKeyframe() const { return bIsKeyframe; } + bool IsDiscardable() const { return bIsDiscardable; } + + operator KaxInternalBlock &() { return *this; } + + EBML_CONCRETE_CLASS(KaxSimpleBlock) +}; +#endif // MATROSKA_VERSION + +class MATROSKA_DLL_API KaxBlockBlob { +public: + KaxBlockBlob(BlockBlobType sblock_mode) :ParentCluster(NULL), SimpleBlockMode(sblock_mode) { + bUseSimpleBlock = (sblock_mode != BLOCK_BLOB_NO_SIMPLE); + Block.group = NULL; + } + + ~KaxBlockBlob() { +#if MATROSKA_VERSION >= 2 + if (bUseSimpleBlock) + delete Block.simpleblock; + else +#endif // MATROSKA_VERSION + delete Block.group; + } + + operator KaxBlockGroup &(); + operator const KaxBlockGroup &() const; +#if MATROSKA_VERSION >= 2 + operator KaxSimpleBlock &(); +#endif + operator KaxInternalBlock &(); + operator const KaxInternalBlock &() const; + + void SetBlockGroup( KaxBlockGroup &BlockRef ); + + void SetBlockDuration(uint64 TimeLength); + + void SetParent(KaxCluster & aParentCluster); + bool AddFrameAuto(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing = LACING_AUTO, const KaxBlockBlob * PastBlock = NULL, const KaxBlockBlob * ForwBlock = NULL); + + bool IsSimpleBlock() const {return bUseSimpleBlock;} + + bool ReplaceSimpleByGroup(); +protected: + KaxCluster * ParentCluster; + union { + KaxBlockGroup *group; +#if MATROSKA_VERSION >= 2 + KaxSimpleBlock *simpleblock; +#endif // MATROSKA_VERSION + } Block; + bool bUseSimpleBlock; + BlockBlobType SimpleBlockMode; +}; + +class MATROSKA_DLL_API KaxBlockDuration : public EbmlUInteger { + public: + KaxBlockDuration() {} + KaxBlockDuration(const KaxBlockDuration & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxBlockDuration) +}; + +#if MATROSKA_VERSION >= 2 +class MATROSKA_DLL_API KaxBlockVirtual : public EbmlBinary { + public: + KaxBlockVirtual() :ParentCluster(NULL) {SetBuffer(DataBlock,sizeof(DataBlock)); SetValueIsSet(false);} + KaxBlockVirtual(const KaxBlockVirtual & ElementToClone); + bool ValidateSize() const {return true;} + + /*! + \note override this function to generate the Data/Size on the fly, unlike the usual binary elements + */ + uint64 UpdateSize(bool bSaveDefault = false, bool bForceRender = false); + + void SetParent(const KaxCluster & aParentCluster) {ParentCluster = &aParentCluster;} + + protected: + uint64 Timecode; // temporary timecode of the first frame if there are more than one + uint16 TrackNumber; + binary DataBlock[5]; + + const KaxCluster * ParentCluster; + + EBML_CONCRETE_CLASS(KaxBlockVirtual) +}; +#endif // MATROSKA_VERSION + +class MATROSKA_DLL_API KaxBlockAdditional : public EbmlBinary { + public: + KaxBlockAdditional() {} + KaxBlockAdditional(const KaxBlockAdditional & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return true;} + + EBML_CONCRETE_CLASS(KaxBlockAdditional) +}; + +class MATROSKA_DLL_API KaxBlockAdditions : public EbmlMaster { + public: + KaxBlockAdditions(); + KaxBlockAdditions(const KaxBlockAdditions & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxBlockAdditions) +}; + +class MATROSKA_DLL_API KaxBlockMore : public EbmlMaster { + public: + KaxBlockMore(); + KaxBlockMore(const KaxBlockMore & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxBlockMore) +}; + +class MATROSKA_DLL_API KaxBlockAddID : public EbmlUInteger { + public: + KaxBlockAddID() :EbmlUInteger(1) {} + KaxBlockAddID(const KaxBlockAddID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxBlockAddID) +}; + +class MATROSKA_DLL_API KaxCodecState : public EbmlBinary { + public: + KaxCodecState() {} + KaxCodecState(const KaxCodecState & ElementToClone) :EbmlBinary(ElementToClone){} + + bool ValidateSize() const {return true;} + + EBML_CONCRETE_CLASS(KaxCodecState) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_BLOCK_H diff --git a/matroska/KaxBlockData.h b/matroska/KaxBlockData.h index f209993..38a5706 100644 --- a/matroska/KaxBlockData.h +++ b/matroska/KaxBlockData.h @@ -1,152 +1,152 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxBlockData.h,v 1.10 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_BLOCK_ADDITIONAL_H -#define LIBMATROSKA_BLOCK_ADDITIONAL_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlUInteger.h" -#include "ebml/EbmlSInteger.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class KaxReferenceBlock; -class KaxBlockGroup; -class KaxBlockBlob; - -class MATROSKA_DLL_API KaxReferencePriority : public EbmlUInteger { - public: - KaxReferencePriority() :EbmlUInteger(0) {} - KaxReferencePriority(const KaxReferencePriority & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxReferencePriority) -}; - -/*! - \brief element used for B frame-likes -*/ -class MATROSKA_DLL_API KaxReferenceBlock : public EbmlSInteger { - public: - KaxReferenceBlock() :RefdBlock(NULL), ParentBlock(NULL) {bTimecodeSet = false;} - KaxReferenceBlock(const KaxReferenceBlock & ElementToClone) :EbmlSInteger(ElementToClone), bTimecodeSet(ElementToClone.bTimecodeSet) {} - - /*! - \brief override this method to compute the timecode value - */ - virtual uint64 UpdateSize(bool bSaveDefault = false, bool bForceRender = false); - - const KaxBlockBlob & RefBlock() const; - void SetReferencedBlock(const KaxBlockBlob * aRefdBlock); - void SetReferencedBlock(const KaxBlockGroup & aRefdBlock); - void SetParentBlock(const KaxBlockGroup & aParentBlock) {ParentBlock = &aParentBlock;} - - protected: - const KaxBlockBlob * RefdBlock; - const KaxBlockGroup * ParentBlock; - void SetReferencedTimecode(int64 refTimecode) {*static_cast(this) = refTimecode; bTimecodeSet = true;}; - bool bTimecodeSet; - - EBML_CONCRETE_CLASS(KaxReferenceBlock) -}; - -#if MATROSKA_VERSION >= 2 -class MATROSKA_DLL_API KaxReferenceVirtual : public EbmlSInteger { - public: - KaxReferenceVirtual() {} - KaxReferenceVirtual(const KaxReferenceVirtual & ElementToClone) :EbmlSInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxReferenceVirtual) -}; -#endif // MATROSKA_VERSION - -class MATROSKA_DLL_API KaxTimeSlice : public EbmlMaster { - public: - KaxTimeSlice(); - KaxTimeSlice(const KaxTimeSlice & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTimeSlice) -}; - -class MATROSKA_DLL_API KaxSlices : public EbmlMaster { - public: - KaxSlices(); - KaxSlices(const KaxSlices & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxSlices) -}; - -class MATROSKA_DLL_API KaxSliceLaceNumber : public EbmlUInteger { - public: - KaxSliceLaceNumber() :EbmlUInteger(0) {} - KaxSliceLaceNumber(const KaxSliceLaceNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxSliceLaceNumber) -}; - -class MATROSKA_DLL_API KaxSliceFrameNumber : public EbmlUInteger { - public: - KaxSliceFrameNumber() :EbmlUInteger(0) {} - KaxSliceFrameNumber(const KaxSliceFrameNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxSliceFrameNumber) -}; - -class MATROSKA_DLL_API KaxSliceBlockAddID : public EbmlUInteger { - public: - KaxSliceBlockAddID() :EbmlUInteger(0) {} - KaxSliceBlockAddID(const KaxSliceBlockAddID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxSliceBlockAddID) -}; - -class MATROSKA_DLL_API KaxSliceDelay : public EbmlUInteger { - public: - KaxSliceDelay() :EbmlUInteger(0) {} - KaxSliceDelay(const KaxSliceDelay & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxSliceDelay) -}; - -class MATROSKA_DLL_API KaxSliceDuration : public EbmlUInteger { - public: - KaxSliceDuration() {} - KaxSliceDuration(const KaxSliceDuration & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxSliceDuration) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_BLOCK_ADDITIONAL_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxBlockData.h,v 1.10 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_BLOCK_ADDITIONAL_H +#define LIBMATROSKA_BLOCK_ADDITIONAL_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlUInteger.h" +#include "ebml/EbmlSInteger.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class KaxReferenceBlock; +class KaxBlockGroup; +class KaxBlockBlob; + +class MATROSKA_DLL_API KaxReferencePriority : public EbmlUInteger { + public: + KaxReferencePriority() :EbmlUInteger(0) {} + KaxReferencePriority(const KaxReferencePriority & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxReferencePriority) +}; + +/*! + \brief element used for B frame-likes +*/ +class MATROSKA_DLL_API KaxReferenceBlock : public EbmlSInteger { + public: + KaxReferenceBlock() :RefdBlock(NULL), ParentBlock(NULL) {bTimecodeSet = false;} + KaxReferenceBlock(const KaxReferenceBlock & ElementToClone) :EbmlSInteger(ElementToClone), bTimecodeSet(ElementToClone.bTimecodeSet) {} + + /*! + \brief override this method to compute the timecode value + */ + virtual uint64 UpdateSize(bool bSaveDefault = false, bool bForceRender = false); + + const KaxBlockBlob & RefBlock() const; + void SetReferencedBlock(const KaxBlockBlob * aRefdBlock); + void SetReferencedBlock(const KaxBlockGroup & aRefdBlock); + void SetParentBlock(const KaxBlockGroup & aParentBlock) {ParentBlock = &aParentBlock;} + + protected: + const KaxBlockBlob * RefdBlock; + const KaxBlockGroup * ParentBlock; + void SetReferencedTimecode(int64 refTimecode) {*static_cast(this) = refTimecode; bTimecodeSet = true;}; + bool bTimecodeSet; + + EBML_CONCRETE_CLASS(KaxReferenceBlock) +}; + +#if MATROSKA_VERSION >= 2 +class MATROSKA_DLL_API KaxReferenceVirtual : public EbmlSInteger { + public: + KaxReferenceVirtual() {} + KaxReferenceVirtual(const KaxReferenceVirtual & ElementToClone) :EbmlSInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxReferenceVirtual) +}; +#endif // MATROSKA_VERSION + +class MATROSKA_DLL_API KaxTimeSlice : public EbmlMaster { + public: + KaxTimeSlice(); + KaxTimeSlice(const KaxTimeSlice & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTimeSlice) +}; + +class MATROSKA_DLL_API KaxSlices : public EbmlMaster { + public: + KaxSlices(); + KaxSlices(const KaxSlices & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxSlices) +}; + +class MATROSKA_DLL_API KaxSliceLaceNumber : public EbmlUInteger { + public: + KaxSliceLaceNumber() :EbmlUInteger(0) {} + KaxSliceLaceNumber(const KaxSliceLaceNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxSliceLaceNumber) +}; + +class MATROSKA_DLL_API KaxSliceFrameNumber : public EbmlUInteger { + public: + KaxSliceFrameNumber() :EbmlUInteger(0) {} + KaxSliceFrameNumber(const KaxSliceFrameNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxSliceFrameNumber) +}; + +class MATROSKA_DLL_API KaxSliceBlockAddID : public EbmlUInteger { + public: + KaxSliceBlockAddID() :EbmlUInteger(0) {} + KaxSliceBlockAddID(const KaxSliceBlockAddID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxSliceBlockAddID) +}; + +class MATROSKA_DLL_API KaxSliceDelay : public EbmlUInteger { + public: + KaxSliceDelay() :EbmlUInteger(0) {} + KaxSliceDelay(const KaxSliceDelay & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxSliceDelay) +}; + +class MATROSKA_DLL_API KaxSliceDuration : public EbmlUInteger { + public: + KaxSliceDuration() {} + KaxSliceDuration(const KaxSliceDuration & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxSliceDuration) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_BLOCK_ADDITIONAL_H diff --git a/matroska/KaxChapters.h b/matroska/KaxChapters.h index 2c27697..1f1f720 100644 --- a/matroska/KaxChapters.h +++ b/matroska/KaxChapters.h @@ -1,271 +1,271 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxChapters.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_CHAPTERS_H -#define LIBMATROSKA_CHAPTERS_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlUInteger.h" -#include "ebml/EbmlUnicodeString.h" -#include "ebml/EbmlString.h" -#include "ebml/EbmlBinary.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxChapters : public EbmlMaster { - public: - KaxChapters(); - KaxChapters(const KaxChapters & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapters) -}; - -class MATROSKA_DLL_API KaxEditionEntry : public EbmlMaster { - public: - KaxEditionEntry(); - KaxEditionEntry(const KaxEditionEntry & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxEditionEntry) -}; - -class MATROSKA_DLL_API KaxEditionUID : public EbmlUInteger { - public: - KaxEditionUID() {} - KaxEditionUID(const KaxEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxEditionUID) -}; - -class MATROSKA_DLL_API KaxEditionFlagHidden : public EbmlUInteger { - public: - KaxEditionFlagHidden(): EbmlUInteger(0) {} - KaxEditionFlagHidden(const KaxEditionFlagHidden & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxEditionFlagHidden) -}; - -class MATROSKA_DLL_API KaxEditionFlagDefault : public EbmlUInteger { - public: - KaxEditionFlagDefault(): EbmlUInteger(0) {} - KaxEditionFlagDefault(const KaxEditionFlagDefault & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxEditionFlagDefault) -}; - -class MATROSKA_DLL_API KaxEditionFlagOrdered : public EbmlUInteger { - public: - KaxEditionFlagOrdered(): EbmlUInteger(0) {} - KaxEditionFlagOrdered(const KaxEditionFlagOrdered & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxEditionFlagOrdered) -}; - -class MATROSKA_DLL_API KaxChapterAtom : public EbmlMaster { - public: - KaxChapterAtom(); - KaxChapterAtom(const KaxChapterAtom & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterAtom) -}; - -class MATROSKA_DLL_API KaxChapterUID : public EbmlUInteger { - public: - KaxChapterUID() {} - KaxChapterUID(const KaxChapterUID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterUID) -}; - -class MATROSKA_DLL_API KaxChapterTimeStart : public EbmlUInteger { - public: - KaxChapterTimeStart() {} - KaxChapterTimeStart(const KaxChapterTimeStart & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterTimeStart) -}; - -class MATROSKA_DLL_API KaxChapterTimeEnd : public EbmlUInteger { - public: - KaxChapterTimeEnd() {} - KaxChapterTimeEnd(const KaxChapterTimeEnd & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterTimeEnd) -}; - -class MATROSKA_DLL_API KaxChapterFlagHidden : public EbmlUInteger { - public: - KaxChapterFlagHidden(): EbmlUInteger(0) {} - KaxChapterFlagHidden(const KaxChapterFlagHidden & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterFlagHidden) -}; - -class MATROSKA_DLL_API KaxChapterFlagEnabled : public EbmlUInteger { - public: - KaxChapterFlagEnabled(): EbmlUInteger(1) {} - KaxChapterFlagEnabled(const KaxChapterFlagEnabled & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterFlagEnabled) -}; - -class MATROSKA_DLL_API KaxChapterSegmentUID : public EbmlBinary { - public: - KaxChapterSegmentUID() {} - KaxChapterSegmentUID(const KaxChapterSegmentUID & ElementToClone) :EbmlBinary(ElementToClone) {} - bool ValidateSize() const { return (GetSize() == 16);} - - EBML_CONCRETE_CLASS(KaxChapterSegmentUID) -}; - -class MATROSKA_DLL_API KaxChapterSegmentEditionUID : public EbmlBinary { - public: - KaxChapterSegmentEditionUID() {} - KaxChapterSegmentEditionUID(const KaxChapterSegmentEditionUID & ElementToClone) :EbmlBinary(ElementToClone) {} - bool ValidateSize() const { return (GetSize() == 16);} - - EBML_CONCRETE_CLASS(KaxChapterSegmentEditionUID) -}; - -class MATROSKA_DLL_API KaxChapterPhysicalEquiv : public EbmlUInteger { - public: - KaxChapterPhysicalEquiv(): EbmlUInteger() {} - KaxChapterPhysicalEquiv(const KaxChapterPhysicalEquiv & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterPhysicalEquiv) -}; - -class MATROSKA_DLL_API KaxChapterTrack : public EbmlMaster { - public: - KaxChapterTrack(); - KaxChapterTrack(const KaxChapterTrack & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterTrack) -}; - -class MATROSKA_DLL_API KaxChapterTrackNumber : public EbmlUInteger { - public: - KaxChapterTrackNumber() {} - KaxChapterTrackNumber(const KaxChapterTrackNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterTrackNumber) -}; - -class MATROSKA_DLL_API KaxChapterDisplay : public EbmlMaster { - public: - KaxChapterDisplay(); - KaxChapterDisplay(const KaxChapterDisplay & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterDisplay) -}; - -class MATROSKA_DLL_API KaxChapterString : public EbmlUnicodeString { - public: - KaxChapterString() {} - KaxChapterString(const KaxChapterString & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterString) -}; - -class MATROSKA_DLL_API KaxChapterLanguage : public EbmlString { - public: - KaxChapterLanguage() :EbmlString("eng") {} - KaxChapterLanguage(const KaxChapterLanguage & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterLanguage) -}; - -class MATROSKA_DLL_API KaxChapterCountry : public EbmlString { - public: - KaxChapterCountry() :EbmlString() {} - KaxChapterCountry(const KaxChapterCountry & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterCountry) -}; - -class MATROSKA_DLL_API KaxChapterProcess : public EbmlMaster { - public: - KaxChapterProcess(); - KaxChapterProcess(const KaxChapterProcess & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterProcess) -}; - -class MATROSKA_DLL_API KaxChapterProcessCodecID : public EbmlUInteger { - public: - KaxChapterProcessCodecID() :EbmlUInteger(0) {} - KaxChapterProcessCodecID(const KaxChapterProcessCodecID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterProcessCodecID) -}; - -class MATROSKA_DLL_API KaxChapterProcessPrivate : public EbmlBinary { - public: - KaxChapterProcessPrivate() {} - KaxChapterProcessPrivate(const KaxChapterProcessPrivate & ElementToClone) :EbmlBinary(ElementToClone) {} - bool ValidateSize() const {return true;} - - EBML_CONCRETE_CLASS(KaxChapterProcessPrivate) -}; - -class MATROSKA_DLL_API KaxChapterProcessCommand : public EbmlMaster { - public: - KaxChapterProcessCommand(); - KaxChapterProcessCommand(const KaxChapterProcessCommand & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterProcessCommand) -}; - -class MATROSKA_DLL_API KaxChapterProcessTime : public EbmlUInteger { - public: - KaxChapterProcessTime() {} - KaxChapterProcessTime(const KaxChapterProcessTime & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterProcessTime) -}; - -class MATROSKA_DLL_API KaxChapterProcessData : public EbmlBinary { - public: - KaxChapterProcessData() {} - KaxChapterProcessData(const KaxChapterProcessData & ElementToClone) :EbmlBinary(ElementToClone) {} - bool ValidateSize() const {return true;} - - EBML_CONCRETE_CLASS(KaxChapterProcessData) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_CHAPTERS_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxChapters.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_CHAPTERS_H +#define LIBMATROSKA_CHAPTERS_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlUInteger.h" +#include "ebml/EbmlUnicodeString.h" +#include "ebml/EbmlString.h" +#include "ebml/EbmlBinary.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxChapters : public EbmlMaster { + public: + KaxChapters(); + KaxChapters(const KaxChapters & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapters) +}; + +class MATROSKA_DLL_API KaxEditionEntry : public EbmlMaster { + public: + KaxEditionEntry(); + KaxEditionEntry(const KaxEditionEntry & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxEditionEntry) +}; + +class MATROSKA_DLL_API KaxEditionUID : public EbmlUInteger { + public: + KaxEditionUID() {} + KaxEditionUID(const KaxEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxEditionUID) +}; + +class MATROSKA_DLL_API KaxEditionFlagHidden : public EbmlUInteger { + public: + KaxEditionFlagHidden(): EbmlUInteger(0) {} + KaxEditionFlagHidden(const KaxEditionFlagHidden & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxEditionFlagHidden) +}; + +class MATROSKA_DLL_API KaxEditionFlagDefault : public EbmlUInteger { + public: + KaxEditionFlagDefault(): EbmlUInteger(0) {} + KaxEditionFlagDefault(const KaxEditionFlagDefault & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxEditionFlagDefault) +}; + +class MATROSKA_DLL_API KaxEditionFlagOrdered : public EbmlUInteger { + public: + KaxEditionFlagOrdered(): EbmlUInteger(0) {} + KaxEditionFlagOrdered(const KaxEditionFlagOrdered & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxEditionFlagOrdered) +}; + +class MATROSKA_DLL_API KaxChapterAtom : public EbmlMaster { + public: + KaxChapterAtom(); + KaxChapterAtom(const KaxChapterAtom & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterAtom) +}; + +class MATROSKA_DLL_API KaxChapterUID : public EbmlUInteger { + public: + KaxChapterUID() {} + KaxChapterUID(const KaxChapterUID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterUID) +}; + +class MATROSKA_DLL_API KaxChapterTimeStart : public EbmlUInteger { + public: + KaxChapterTimeStart() {} + KaxChapterTimeStart(const KaxChapterTimeStart & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterTimeStart) +}; + +class MATROSKA_DLL_API KaxChapterTimeEnd : public EbmlUInteger { + public: + KaxChapterTimeEnd() {} + KaxChapterTimeEnd(const KaxChapterTimeEnd & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterTimeEnd) +}; + +class MATROSKA_DLL_API KaxChapterFlagHidden : public EbmlUInteger { + public: + KaxChapterFlagHidden(): EbmlUInteger(0) {} + KaxChapterFlagHidden(const KaxChapterFlagHidden & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterFlagHidden) +}; + +class MATROSKA_DLL_API KaxChapterFlagEnabled : public EbmlUInteger { + public: + KaxChapterFlagEnabled(): EbmlUInteger(1) {} + KaxChapterFlagEnabled(const KaxChapterFlagEnabled & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterFlagEnabled) +}; + +class MATROSKA_DLL_API KaxChapterSegmentUID : public EbmlBinary { + public: + KaxChapterSegmentUID() {} + KaxChapterSegmentUID(const KaxChapterSegmentUID & ElementToClone) :EbmlBinary(ElementToClone) {} + bool ValidateSize() const { return (GetSize() == 16);} + + EBML_CONCRETE_CLASS(KaxChapterSegmentUID) +}; + +class MATROSKA_DLL_API KaxChapterSegmentEditionUID : public EbmlBinary { + public: + KaxChapterSegmentEditionUID() {} + KaxChapterSegmentEditionUID(const KaxChapterSegmentEditionUID & ElementToClone) :EbmlBinary(ElementToClone) {} + bool ValidateSize() const { return (GetSize() == 16);} + + EBML_CONCRETE_CLASS(KaxChapterSegmentEditionUID) +}; + +class MATROSKA_DLL_API KaxChapterPhysicalEquiv : public EbmlUInteger { + public: + KaxChapterPhysicalEquiv(): EbmlUInteger() {} + KaxChapterPhysicalEquiv(const KaxChapterPhysicalEquiv & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterPhysicalEquiv) +}; + +class MATROSKA_DLL_API KaxChapterTrack : public EbmlMaster { + public: + KaxChapterTrack(); + KaxChapterTrack(const KaxChapterTrack & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterTrack) +}; + +class MATROSKA_DLL_API KaxChapterTrackNumber : public EbmlUInteger { + public: + KaxChapterTrackNumber() {} + KaxChapterTrackNumber(const KaxChapterTrackNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterTrackNumber) +}; + +class MATROSKA_DLL_API KaxChapterDisplay : public EbmlMaster { + public: + KaxChapterDisplay(); + KaxChapterDisplay(const KaxChapterDisplay & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterDisplay) +}; + +class MATROSKA_DLL_API KaxChapterString : public EbmlUnicodeString { + public: + KaxChapterString() {} + KaxChapterString(const KaxChapterString & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterString) +}; + +class MATROSKA_DLL_API KaxChapterLanguage : public EbmlString { + public: + KaxChapterLanguage() :EbmlString("eng") {} + KaxChapterLanguage(const KaxChapterLanguage & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterLanguage) +}; + +class MATROSKA_DLL_API KaxChapterCountry : public EbmlString { + public: + KaxChapterCountry() :EbmlString() {} + KaxChapterCountry(const KaxChapterCountry & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterCountry) +}; + +class MATROSKA_DLL_API KaxChapterProcess : public EbmlMaster { + public: + KaxChapterProcess(); + KaxChapterProcess(const KaxChapterProcess & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterProcess) +}; + +class MATROSKA_DLL_API KaxChapterProcessCodecID : public EbmlUInteger { + public: + KaxChapterProcessCodecID() :EbmlUInteger(0) {} + KaxChapterProcessCodecID(const KaxChapterProcessCodecID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterProcessCodecID) +}; + +class MATROSKA_DLL_API KaxChapterProcessPrivate : public EbmlBinary { + public: + KaxChapterProcessPrivate() {} + KaxChapterProcessPrivate(const KaxChapterProcessPrivate & ElementToClone) :EbmlBinary(ElementToClone) {} + bool ValidateSize() const {return true;} + + EBML_CONCRETE_CLASS(KaxChapterProcessPrivate) +}; + +class MATROSKA_DLL_API KaxChapterProcessCommand : public EbmlMaster { + public: + KaxChapterProcessCommand(); + KaxChapterProcessCommand(const KaxChapterProcessCommand & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterProcessCommand) +}; + +class MATROSKA_DLL_API KaxChapterProcessTime : public EbmlUInteger { + public: + KaxChapterProcessTime() {} + KaxChapterProcessTime(const KaxChapterProcessTime & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterProcessTime) +}; + +class MATROSKA_DLL_API KaxChapterProcessData : public EbmlBinary { + public: + KaxChapterProcessData() {} + KaxChapterProcessData(const KaxChapterProcessData & ElementToClone) :EbmlBinary(ElementToClone) {} + bool ValidateSize() const {return true;} + + EBML_CONCRETE_CLASS(KaxChapterProcessData) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_CHAPTERS_H diff --git a/matroska/KaxCluster.h b/matroska/KaxCluster.h index 4c84d22..edd62af 100644 --- a/matroska/KaxCluster.h +++ b/matroska/KaxCluster.h @@ -1,164 +1,164 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxCluster.h,v 1.10 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme - \author Julien Coloos - -*/ -#ifndef LIBMATROSKA_CLUSTER_H -#define LIBMATROSKA_CLUSTER_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "matroska/KaxTracks.h" -#include "matroska/KaxBlock.h" -#include "matroska/KaxCues.h" -#include "matroska/KaxClusterData.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class KaxSegment; - -class MATROSKA_DLL_API KaxCluster : public EbmlMaster { - public: - KaxCluster(); - KaxCluster(const KaxCluster & ElementToClone); - - /*! - \brief Addition of a frame without references - - \param the timecode is expressed in nanoseconds, relative to the beggining of the Segment - */ - bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, LacingType lacing = LACING_AUTO); - /*! - \brief Addition of a frame with a backward reference (P frame) - \param the timecode is expressed in nanoseconds, relative to the beggining of the Segment - - */ - bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, LacingType lacing = LACING_AUTO); - - /*! - \brief Addition of a frame with a backward+forward reference (B frame) - \param the timecode is expressed in nanoseconds, relative to the beggining of the Segment - - */ - bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing = LACING_AUTO); - - /*! - \brief Render the data to the stream and retrieve the position of BlockGroups for later cue entries - */ - uint32 Render(IOCallback & output, KaxCues & CueToUpdate, bool bSaveDefault = false); - - /*! - \return the global timecode of this Cluster - */ - uint64 GlobalTimecode() const; - - KaxBlockGroup & GetNewBlock(); - - /*! - \brief release all the frames of all Blocks - \note this is a convenience to be able to keep Clusters+Blocks in memory (for future reference) withouht being a memory hog - */ - void ReleaseFrames(); - - /*! - \brief return the position offset compared to the beggining of the Segment - */ - uint64 GetPosition() const; - - void SetParent(const KaxSegment & aParentSegment) {ParentSegment = &aParentSegment;} - - void SetPreviousTimecode(uint64 aPreviousTimecode, int64 aTimecodeScale) { - bPreviousTimecodeIsSet = true; - PreviousTimecode = aPreviousTimecode; - SetGlobalTimecodeScale(aTimecodeScale); - } - - /*! - \note dirty hack to get the mandatory data back after reading - \todo there should be a better way to get mandatory data - */ - void InitTimecode(uint64 aTimecode, int64 aTimecodeScale) { - SetGlobalTimecodeScale(aTimecodeScale); - MinTimecode = MaxTimecode = PreviousTimecode = aTimecode * TimecodeScale; - bFirstFrameInside = bPreviousTimecodeIsSet = true; - } - - int16 GetBlockLocalTimecode(uint64 GlobalTimecode) const; - - uint64 GetBlockGlobalTimecode(int16 LocalTimecode); - - void SetGlobalTimecodeScale(uint64 aGlobalTimecodeScale) { - TimecodeScale = aGlobalTimecodeScale; - bTimecodeScaleIsSet = true; - } - uint64 GlobalTimecodeScale() const { - assert(bTimecodeScaleIsSet); - return TimecodeScale; - } - - bool SetSilentTrackUsed() - { - bSilentTracksUsed = true; - return FindFirstElt(EBML_INFO(KaxClusterSilentTracks), true) != NULL; - } - - bool AddBlockBlob(KaxBlockBlob * NewBlob); - - const KaxSegment *GetParentSegment() const { return ParentSegment; } - - protected: - KaxBlockBlob * currentNewBlob; - std::vector Blobs; - KaxBlockGroup * currentNewBlock; - const KaxSegment * ParentSegment; - - uint64 MinTimecode, MaxTimecode, PreviousTimecode; - int64 TimecodeScale; - - bool bFirstFrameInside; // used to speed research - bool bPreviousTimecodeIsSet; - bool bTimecodeScaleIsSet; - bool bSilentTracksUsed; - - /*! - \note method used internally - */ - bool AddFrameInternal(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup * PastBlock, const KaxBlockGroup * ForwBlock, LacingType lacing); - - EBML_CONCRETE_CLASS(KaxCluster) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_CLUSTER_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxCluster.h,v 1.10 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme + \author Julien Coloos + +*/ +#ifndef LIBMATROSKA_CLUSTER_H +#define LIBMATROSKA_CLUSTER_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "matroska/KaxTracks.h" +#include "matroska/KaxBlock.h" +#include "matroska/KaxCues.h" +#include "matroska/KaxClusterData.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class KaxSegment; + +class MATROSKA_DLL_API KaxCluster : public EbmlMaster { + public: + KaxCluster(); + KaxCluster(const KaxCluster & ElementToClone); + + /*! + \brief Addition of a frame without references + + \param the timecode is expressed in nanoseconds, relative to the beggining of the Segment + */ + bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, LacingType lacing = LACING_AUTO); + /*! + \brief Addition of a frame with a backward reference (P frame) + \param the timecode is expressed in nanoseconds, relative to the beggining of the Segment + + */ + bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, LacingType lacing = LACING_AUTO); + + /*! + \brief Addition of a frame with a backward+forward reference (B frame) + \param the timecode is expressed in nanoseconds, relative to the beggining of the Segment + + */ + bool AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing = LACING_AUTO); + + /*! + \brief Render the data to the stream and retrieve the position of BlockGroups for later cue entries + */ + uint32 Render(IOCallback & output, KaxCues & CueToUpdate, bool bSaveDefault = false); + + /*! + \return the global timecode of this Cluster + */ + uint64 GlobalTimecode() const; + + KaxBlockGroup & GetNewBlock(); + + /*! + \brief release all the frames of all Blocks + \note this is a convenience to be able to keep Clusters+Blocks in memory (for future reference) withouht being a memory hog + */ + void ReleaseFrames(); + + /*! + \brief return the position offset compared to the beggining of the Segment + */ + uint64 GetPosition() const; + + void SetParent(const KaxSegment & aParentSegment) {ParentSegment = &aParentSegment;} + + void SetPreviousTimecode(uint64 aPreviousTimecode, int64 aTimecodeScale) { + bPreviousTimecodeIsSet = true; + PreviousTimecode = aPreviousTimecode; + SetGlobalTimecodeScale(aTimecodeScale); + } + + /*! + \note dirty hack to get the mandatory data back after reading + \todo there should be a better way to get mandatory data + */ + void InitTimecode(uint64 aTimecode, int64 aTimecodeScale) { + SetGlobalTimecodeScale(aTimecodeScale); + MinTimecode = MaxTimecode = PreviousTimecode = aTimecode * TimecodeScale; + bFirstFrameInside = bPreviousTimecodeIsSet = true; + } + + int16 GetBlockLocalTimecode(uint64 GlobalTimecode) const; + + uint64 GetBlockGlobalTimecode(int16 LocalTimecode); + + void SetGlobalTimecodeScale(uint64 aGlobalTimecodeScale) { + TimecodeScale = aGlobalTimecodeScale; + bTimecodeScaleIsSet = true; + } + uint64 GlobalTimecodeScale() const { + assert(bTimecodeScaleIsSet); + return TimecodeScale; + } + + bool SetSilentTrackUsed() + { + bSilentTracksUsed = true; + return FindFirstElt(EBML_INFO(KaxClusterSilentTracks), true) != NULL; + } + + bool AddBlockBlob(KaxBlockBlob * NewBlob); + + const KaxSegment *GetParentSegment() const { return ParentSegment; } + + protected: + KaxBlockBlob * currentNewBlob; + std::vector Blobs; + KaxBlockGroup * currentNewBlock; + const KaxSegment * ParentSegment; + + uint64 MinTimecode, MaxTimecode, PreviousTimecode; + int64 TimecodeScale; + + bool bFirstFrameInside; // used to speed research + bool bPreviousTimecodeIsSet; + bool bTimecodeScaleIsSet; + bool bSilentTracksUsed; + + /*! + \note method used internally + */ + bool AddFrameInternal(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup * PastBlock, const KaxBlockGroup * ForwBlock, LacingType lacing); + + EBML_CONCRETE_CLASS(KaxCluster) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_CLUSTER_H diff --git a/matroska/KaxClusterData.h b/matroska/KaxClusterData.h index d6e9f7b..32b14e6 100644 --- a/matroska/KaxClusterData.h +++ b/matroska/KaxClusterData.h @@ -1,88 +1,88 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxClusterData.h,v 1.9 2004/04/21 19:50:10 mosu Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_CLUSTER_DATA_H -#define LIBMATROSKA_CLUSTER_DATA_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlUInteger.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxClusterTimecode : public EbmlUInteger { - public: - KaxClusterTimecode() {} - KaxClusterTimecode(const KaxClusterTimecode & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxClusterTimecode) -}; - -class MATROSKA_DLL_API KaxClusterSilentTracks : public EbmlMaster { - public: - KaxClusterSilentTracks(); - KaxClusterSilentTracks(const KaxClusterSilentTracks & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxClusterSilentTracks) -}; - -class MATROSKA_DLL_API KaxClusterSilentTrackNumber : public EbmlUInteger { - public: - KaxClusterSilentTrackNumber() {} - KaxClusterSilentTrackNumber(const KaxClusterSilentTrackNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxClusterSilentTrackNumber) -}; - -class MATROSKA_DLL_API KaxClusterPosition : public EbmlUInteger { - public: - KaxClusterPosition() {} - KaxClusterPosition(const KaxClusterPosition & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxClusterPosition) -}; - -class MATROSKA_DLL_API KaxClusterPrevSize : public EbmlUInteger { - public: - KaxClusterPrevSize() {} - KaxClusterPrevSize(const KaxClusterPrevSize & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxClusterPrevSize) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_CLUSTER_DATA_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxClusterData.h,v 1.9 2004/04/21 19:50:10 mosu Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_CLUSTER_DATA_H +#define LIBMATROSKA_CLUSTER_DATA_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlUInteger.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxClusterTimecode : public EbmlUInteger { + public: + KaxClusterTimecode() {} + KaxClusterTimecode(const KaxClusterTimecode & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxClusterTimecode) +}; + +class MATROSKA_DLL_API KaxClusterSilentTracks : public EbmlMaster { + public: + KaxClusterSilentTracks(); + KaxClusterSilentTracks(const KaxClusterSilentTracks & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxClusterSilentTracks) +}; + +class MATROSKA_DLL_API KaxClusterSilentTrackNumber : public EbmlUInteger { + public: + KaxClusterSilentTrackNumber() {} + KaxClusterSilentTrackNumber(const KaxClusterSilentTrackNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxClusterSilentTrackNumber) +}; + +class MATROSKA_DLL_API KaxClusterPosition : public EbmlUInteger { + public: + KaxClusterPosition() {} + KaxClusterPosition(const KaxClusterPosition & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxClusterPosition) +}; + +class MATROSKA_DLL_API KaxClusterPrevSize : public EbmlUInteger { + public: + KaxClusterPrevSize() {} + KaxClusterPrevSize(const KaxClusterPrevSize & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxClusterPrevSize) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_CLUSTER_DATA_H diff --git a/matroska/KaxConfig.h b/matroska/KaxConfig.h index 2896978..b1b419a 100644 --- a/matroska/KaxConfig.h +++ b/matroska/KaxConfig.h @@ -1,70 +1,70 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxConfig.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme - \author Moritz Bunkus -*/ -#ifndef LIBMATROSKA_CONFIG_H -#define LIBMATROSKA_CONFIG_H - -#define LIBMATROSKA_NAMESPACE libmatroska - -#if defined(NO_NAMESPACE) // for older GCC -# define START_LIBMATROSKA_NAMESPACE -# define END_LIBMATROSKA_NAMESPACE -#else // NO_NAMESPACE -# define START_LIBMATROSKA_NAMESPACE namespace LIBMATROSKA_NAMESPACE { -# define END_LIBMATROSKA_NAMESPACE }; -#endif // NO_NAMESPACE - -// There are special implementations for certain platforms. For example on Windows -// we use the Win32 file API. here we set the appropriate macros. -#if defined(_WIN32)||defined(WIN32) - -# if defined(MATROSKA_DLL) -# if defined(MATROSKA_DLL_EXPORT) -# define MATROSKA_DLL_API __declspec(dllexport) -# else // MATROSKA_DLL_EXPORT -# define MATROSKA_DLL_API __declspec(dllimport) -# endif // MATROSKA_DLL_EXPORT -# else // MATROSKA_DLL -# define MATROSKA_DLL_API -# endif // MATROSKA_DLL - -#else -# define MATROSKA_DLL_API -#endif - -#if !defined(MATROSKA_VERSION) -#define MATROSKA_VERSION 2 -#endif // MATROSKA_VERSION - - -#endif // LIBMATROSKA_CONFIG_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxConfig.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme + \author Moritz Bunkus +*/ +#ifndef LIBMATROSKA_CONFIG_H +#define LIBMATROSKA_CONFIG_H + +#define LIBMATROSKA_NAMESPACE libmatroska + +#if defined(NO_NAMESPACE) // for older GCC +# define START_LIBMATROSKA_NAMESPACE +# define END_LIBMATROSKA_NAMESPACE +#else // NO_NAMESPACE +# define START_LIBMATROSKA_NAMESPACE namespace LIBMATROSKA_NAMESPACE { +# define END_LIBMATROSKA_NAMESPACE }; +#endif // NO_NAMESPACE + +// There are special implementations for certain platforms. For example on Windows +// we use the Win32 file API. here we set the appropriate macros. +#if defined(_WIN32)||defined(WIN32) + +# if defined(MATROSKA_DLL) +# if defined(MATROSKA_DLL_EXPORT) +# define MATROSKA_DLL_API __declspec(dllexport) +# else // MATROSKA_DLL_EXPORT +# define MATROSKA_DLL_API __declspec(dllimport) +# endif // MATROSKA_DLL_EXPORT +# else // MATROSKA_DLL +# define MATROSKA_DLL_API +# endif // MATROSKA_DLL + +#else +# define MATROSKA_DLL_API +#endif + +#if !defined(MATROSKA_VERSION) +#define MATROSKA_VERSION 2 +#endif // MATROSKA_VERSION + + +#endif // LIBMATROSKA_CONFIG_H diff --git a/matroska/KaxContentEncoding.h b/matroska/KaxContentEncoding.h index b6e3d2d..d508743 100644 --- a/matroska/KaxContentEncoding.h +++ b/matroska/KaxContentEncoding.h @@ -1,188 +1,188 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxContentEncoding.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ - \author Moritz Bunkus -*/ -#ifndef LIBMATROSKA_CONTENT_ENCODING_H -#define LIBMATROSKA_CONTENT_ENCODING_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlUInteger.h" -#include "ebml/EbmlBinary.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxContentEncodings: public EbmlMaster { - public: - KaxContentEncodings(); - KaxContentEncodings(const KaxContentEncodings &ElementToClone): - EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxContentEncodings) -}; - -class MATROSKA_DLL_API KaxContentEncoding: public EbmlMaster { - public: - KaxContentEncoding(); - KaxContentEncoding(const KaxContentEncoding &ElementToClone): - EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxContentEncoding) -}; - -class MATROSKA_DLL_API KaxContentEncodingOrder: public EbmlUInteger { - public: - KaxContentEncodingOrder(): EbmlUInteger(0) {} - KaxContentEncodingOrder(const KaxContentEncodingOrder &ElementToClone): - EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxContentEncodingOrder) -}; - -class MATROSKA_DLL_API KaxContentEncodingScope: public EbmlUInteger { - public: - KaxContentEncodingScope(): EbmlUInteger(1) {} - KaxContentEncodingScope(const KaxContentEncodingScope &ElementToClone): - EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxContentEncodingScope) -}; - -class MATROSKA_DLL_API KaxContentEncodingType: public EbmlUInteger { - public: - KaxContentEncodingType(): EbmlUInteger(0) {} - KaxContentEncodingType(const KaxContentEncodingType &ElementToClone): - EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxContentEncodingType) -}; - -class MATROSKA_DLL_API KaxContentCompression: public EbmlMaster { - public: - KaxContentCompression(); - KaxContentCompression(const KaxContentCompression &ElementToClone): - EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxContentCompression) -}; - -class MATROSKA_DLL_API KaxContentCompAlgo: public EbmlUInteger { - public: - KaxContentCompAlgo(): EbmlUInteger(0) {} - KaxContentCompAlgo(const KaxContentCompAlgo &ElementToClone): - EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxContentCompAlgo) -}; - -class MATROSKA_DLL_API KaxContentCompSettings: public EbmlBinary { - public: - KaxContentCompSettings() {} - KaxContentCompSettings(const KaxContentCompSettings &ElementToClone): - EbmlBinary(ElementToClone) {} - bool ValidateSize(void) const { return true; } - - EBML_CONCRETE_CLASS(KaxContentCompSettings) -}; - -class MATROSKA_DLL_API KaxContentEncryption: public EbmlMaster { - public: - KaxContentEncryption(); - KaxContentEncryption(const KaxContentEncryption &ElementToClone): - EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxContentEncryption) -}; - -class MATROSKA_DLL_API KaxContentEncAlgo: public EbmlUInteger { - public: - KaxContentEncAlgo(): EbmlUInteger(0) {} - KaxContentEncAlgo(const KaxContentEncAlgo &ElementToClone): - EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxContentEncAlgo) -}; - -class MATROSKA_DLL_API KaxContentEncKeyID: public EbmlBinary { - public: - KaxContentEncKeyID() {} - KaxContentEncKeyID(const KaxContentEncKeyID &ElementToClone): - EbmlBinary(ElementToClone) {} - bool ValidateSize(void) const { return true; } - - EBML_CONCRETE_CLASS(KaxContentEncKeyID) -}; - -class MATROSKA_DLL_API KaxContentSignature: public EbmlBinary { - public: - KaxContentSignature() {} - KaxContentSignature(const KaxContentSignature &ElementToClone): - EbmlBinary(ElementToClone) {} - bool ValidateSize(void) const { return true; } - - EBML_CONCRETE_CLASS(KaxContentSignature) -}; - -class MATROSKA_DLL_API KaxContentSigKeyID: public EbmlBinary { - public: - KaxContentSigKeyID() {} - KaxContentSigKeyID(const KaxContentSigKeyID &ElementToClone): - EbmlBinary(ElementToClone) {} - bool ValidateSize(void) const { return true; } - - EBML_CONCRETE_CLASS(KaxContentSigKeyID) -}; - -class MATROSKA_DLL_API KaxContentSigAlgo: public EbmlUInteger { - public: - KaxContentSigAlgo() {} - KaxContentSigAlgo(const KaxContentSigAlgo &ElementToClone): - EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxContentSigAlgo) -}; - -class MATROSKA_DLL_API KaxContentSigHashAlgo: public EbmlUInteger { - public: - KaxContentSigHashAlgo() {} - KaxContentSigHashAlgo(const KaxContentSigHashAlgo &ElementToClone): - EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxContentSigHashAlgo) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_CONTENT_ENCODING_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxContentEncoding.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ + \author Moritz Bunkus +*/ +#ifndef LIBMATROSKA_CONTENT_ENCODING_H +#define LIBMATROSKA_CONTENT_ENCODING_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlUInteger.h" +#include "ebml/EbmlBinary.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxContentEncodings: public EbmlMaster { + public: + KaxContentEncodings(); + KaxContentEncodings(const KaxContentEncodings &ElementToClone): + EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxContentEncodings) +}; + +class MATROSKA_DLL_API KaxContentEncoding: public EbmlMaster { + public: + KaxContentEncoding(); + KaxContentEncoding(const KaxContentEncoding &ElementToClone): + EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxContentEncoding) +}; + +class MATROSKA_DLL_API KaxContentEncodingOrder: public EbmlUInteger { + public: + KaxContentEncodingOrder(): EbmlUInteger(0) {} + KaxContentEncodingOrder(const KaxContentEncodingOrder &ElementToClone): + EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxContentEncodingOrder) +}; + +class MATROSKA_DLL_API KaxContentEncodingScope: public EbmlUInteger { + public: + KaxContentEncodingScope(): EbmlUInteger(1) {} + KaxContentEncodingScope(const KaxContentEncodingScope &ElementToClone): + EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxContentEncodingScope) +}; + +class MATROSKA_DLL_API KaxContentEncodingType: public EbmlUInteger { + public: + KaxContentEncodingType(): EbmlUInteger(0) {} + KaxContentEncodingType(const KaxContentEncodingType &ElementToClone): + EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxContentEncodingType) +}; + +class MATROSKA_DLL_API KaxContentCompression: public EbmlMaster { + public: + KaxContentCompression(); + KaxContentCompression(const KaxContentCompression &ElementToClone): + EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxContentCompression) +}; + +class MATROSKA_DLL_API KaxContentCompAlgo: public EbmlUInteger { + public: + KaxContentCompAlgo(): EbmlUInteger(0) {} + KaxContentCompAlgo(const KaxContentCompAlgo &ElementToClone): + EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxContentCompAlgo) +}; + +class MATROSKA_DLL_API KaxContentCompSettings: public EbmlBinary { + public: + KaxContentCompSettings() {} + KaxContentCompSettings(const KaxContentCompSettings &ElementToClone): + EbmlBinary(ElementToClone) {} + bool ValidateSize(void) const { return true; } + + EBML_CONCRETE_CLASS(KaxContentCompSettings) +}; + +class MATROSKA_DLL_API KaxContentEncryption: public EbmlMaster { + public: + KaxContentEncryption(); + KaxContentEncryption(const KaxContentEncryption &ElementToClone): + EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxContentEncryption) +}; + +class MATROSKA_DLL_API KaxContentEncAlgo: public EbmlUInteger { + public: + KaxContentEncAlgo(): EbmlUInteger(0) {} + KaxContentEncAlgo(const KaxContentEncAlgo &ElementToClone): + EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxContentEncAlgo) +}; + +class MATROSKA_DLL_API KaxContentEncKeyID: public EbmlBinary { + public: + KaxContentEncKeyID() {} + KaxContentEncKeyID(const KaxContentEncKeyID &ElementToClone): + EbmlBinary(ElementToClone) {} + bool ValidateSize(void) const { return true; } + + EBML_CONCRETE_CLASS(KaxContentEncKeyID) +}; + +class MATROSKA_DLL_API KaxContentSignature: public EbmlBinary { + public: + KaxContentSignature() {} + KaxContentSignature(const KaxContentSignature &ElementToClone): + EbmlBinary(ElementToClone) {} + bool ValidateSize(void) const { return true; } + + EBML_CONCRETE_CLASS(KaxContentSignature) +}; + +class MATROSKA_DLL_API KaxContentSigKeyID: public EbmlBinary { + public: + KaxContentSigKeyID() {} + KaxContentSigKeyID(const KaxContentSigKeyID &ElementToClone): + EbmlBinary(ElementToClone) {} + bool ValidateSize(void) const { return true; } + + EBML_CONCRETE_CLASS(KaxContentSigKeyID) +}; + +class MATROSKA_DLL_API KaxContentSigAlgo: public EbmlUInteger { + public: + KaxContentSigAlgo() {} + KaxContentSigAlgo(const KaxContentSigAlgo &ElementToClone): + EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxContentSigAlgo) +}; + +class MATROSKA_DLL_API KaxContentSigHashAlgo: public EbmlUInteger { + public: + KaxContentSigHashAlgo() {} + KaxContentSigHashAlgo(const KaxContentSigHashAlgo &ElementToClone): + EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxContentSigHashAlgo) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_CONTENT_ENCODING_H diff --git a/matroska/KaxContexts.h b/matroska/KaxContexts.h index ced7740..2624c54 100644 --- a/matroska/KaxContexts.h +++ b/matroska/KaxContexts.h @@ -1,87 +1,87 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxContexts.h,v 1.6 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_CONTEXTS_H -#define LIBMATROSKA_CONTEXTS_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlElement.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -extern const EbmlSemanticContext MATROSKA_DLL_API KaxMatroska_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxSegment_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxAttachments_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxAttached_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxFileDescription_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxFileName_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxMimeType_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxFileData_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxChapters_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCluster_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTags_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTag_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxBlockGroup_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxReferencePriority_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxReferenceBlock_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxReferenceVirtual_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCues_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxInfo_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxSeekHead_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTracks_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackEntry_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackNumber_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackType_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackFlagEnabled_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackFlagDefault_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackFlagLacing_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackName_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackLanguage_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecID_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecPrivate_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecName_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecSettings_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecInfoURL_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecDownloadURL_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecDecodeAll_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackOverlay_Context; - -extern const EbmlSemanticContext & MATROSKA_DLL_API GetKaxGlobal_Context(); -extern const EbmlSemanticContext & MATROSKA_DLL_API GetKaxTagsGlobal_Context(); - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_CONTEXTS_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxContexts.h,v 1.6 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_CONTEXTS_H +#define LIBMATROSKA_CONTEXTS_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlElement.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +extern const EbmlSemanticContext MATROSKA_DLL_API KaxMatroska_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxSegment_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxAttachments_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxAttached_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxFileDescription_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxFileName_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxMimeType_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxFileData_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxChapters_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxCluster_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTags_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTag_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxBlockGroup_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxReferencePriority_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxReferenceBlock_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxReferenceVirtual_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxCues_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxInfo_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxSeekHead_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTracks_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackEntry_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackNumber_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackType_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackFlagEnabled_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackFlagDefault_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackFlagLacing_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackName_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackLanguage_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecID_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecPrivate_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecName_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecSettings_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecInfoURL_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecDownloadURL_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecDecodeAll_Context; +extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackOverlay_Context; + +extern const EbmlSemanticContext & MATROSKA_DLL_API GetKaxGlobal_Context(); +extern const EbmlSemanticContext & MATROSKA_DLL_API GetKaxTagsGlobal_Context(); + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_CONTEXTS_H diff --git a/matroska/KaxCues.h b/matroska/KaxCues.h index 92d2f88..fe7459f 100644 --- a/matroska/KaxCues.h +++ b/matroska/KaxCues.h @@ -1,95 +1,95 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxCues.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_CUES_H -#define LIBMATROSKA_CUES_H - -#include - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "matroska/KaxBlock.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class KaxCuePoint; - -class MATROSKA_DLL_API KaxCues : public EbmlMaster { - public: - KaxCues(); - KaxCues(const KaxCues & ElementToClone) :EbmlMaster(ElementToClone) {} - ~KaxCues(); - - bool AddBlockGroup(const KaxBlockGroup & BlockReference); - bool AddBlockBlob(const KaxBlockBlob & BlockReference); - - /*! - \brief Indicate that the position for this Block is set - */ - void PositionSet(const KaxBlockGroup & BlockReference); - void PositionSet(const KaxBlockBlob & BlockReference); - - /*! - \brief override to sort by timecode/track - */ - uint32 Render(IOCallback & output, bool bSaveDefault = false) { - Sort(); - return EbmlMaster::Render(output, bSaveDefault); - } - - uint64 GetTimecodePosition(uint64 aTimecode) const; - const KaxCuePoint * GetTimecodePoint(uint64 aTimecode) const; - - void SetGlobalTimecodeScale(uint64 aGlobalTimecodeScale) { - mGlobalTimecodeScale = aGlobalTimecodeScale; - bGlobalTimecodeScaleIsSet = true; - } - uint64 GlobalTimecodeScale() const { - assert(bGlobalTimecodeScaleIsSet); - return mGlobalTimecodeScale; - } - - protected: - std::vector myTempReferences; - bool bGlobalTimecodeScaleIsSet; - uint64 mGlobalTimecodeScale; - - EBML_CONCRETE_CLASS(KaxCues) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_CUES_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxCues.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_CUES_H +#define LIBMATROSKA_CUES_H + +#include + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "matroska/KaxBlock.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class KaxCuePoint; + +class MATROSKA_DLL_API KaxCues : public EbmlMaster { + public: + KaxCues(); + KaxCues(const KaxCues & ElementToClone) :EbmlMaster(ElementToClone) {} + ~KaxCues(); + + bool AddBlockGroup(const KaxBlockGroup & BlockReference); + bool AddBlockBlob(const KaxBlockBlob & BlockReference); + + /*! + \brief Indicate that the position for this Block is set + */ + void PositionSet(const KaxBlockGroup & BlockReference); + void PositionSet(const KaxBlockBlob & BlockReference); + + /*! + \brief override to sort by timecode/track + */ + uint32 Render(IOCallback & output, bool bSaveDefault = false) { + Sort(); + return EbmlMaster::Render(output, bSaveDefault); + } + + uint64 GetTimecodePosition(uint64 aTimecode) const; + const KaxCuePoint * GetTimecodePoint(uint64 aTimecode) const; + + void SetGlobalTimecodeScale(uint64 aGlobalTimecodeScale) { + mGlobalTimecodeScale = aGlobalTimecodeScale; + bGlobalTimecodeScaleIsSet = true; + } + uint64 GlobalTimecodeScale() const { + assert(bGlobalTimecodeScaleIsSet); + return mGlobalTimecodeScale; + } + + protected: + std::vector myTempReferences; + bool bGlobalTimecodeScaleIsSet; + uint64 mGlobalTimecodeScale; + + EBML_CONCRETE_CLASS(KaxCues) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_CUES_H diff --git a/matroska/KaxCuesData.h b/matroska/KaxCuesData.h index 86d3c21..51d3594 100644 --- a/matroska/KaxCuesData.h +++ b/matroska/KaxCuesData.h @@ -1,162 +1,162 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxCuesData.h,v 1.8 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_CUES_DATA_H -#define LIBMATROSKA_CUES_DATA_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlUInteger.h" -#include "ebml/EbmlMaster.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class KaxBlockGroup; -class KaxBlockBlob; -class KaxCueTrackPositions; -class KaxInternalBlock; - -class MATROSKA_DLL_API KaxCuePoint : public EbmlMaster { - public: - KaxCuePoint(); - KaxCuePoint(const KaxCuePoint & ElementToClone) :EbmlMaster(ElementToClone) {} - void PositionSet(const KaxBlockGroup & BlockReference, uint64 GlobalTimecodeScale); - void PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalTimecodeScale); - - bool operator<(const EbmlElement & EltB) const; - - const KaxCueTrackPositions * GetSeekPosition() const; - bool Timecode(uint64 & aTimecode, uint64 GlobalTimecodeScale) const; - - EBML_CONCRETE_CLASS(KaxCuePoint) -}; - -class MATROSKA_DLL_API KaxCueTime : public EbmlUInteger { - public: - KaxCueTime() {} - KaxCueTime(const KaxCueTime & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCueTime) -}; - -class MATROSKA_DLL_API KaxCueTrackPositions : public EbmlMaster { - public: - KaxCueTrackPositions(); - KaxCueTrackPositions(const KaxCueTrackPositions & ElementToClone) :EbmlMaster(ElementToClone) {} - - uint64 ClusterPosition() const; - uint16 TrackNumber() const; - - EBML_CONCRETE_CLASS(KaxCueTrackPositions) -}; - -class MATROSKA_DLL_API KaxCueTrack : public EbmlUInteger { - public: - KaxCueTrack() {} - KaxCueTrack(const KaxCueTrack & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCueTrack) -}; - -class MATROSKA_DLL_API KaxCueClusterPosition : public EbmlUInteger { - public: - KaxCueClusterPosition() {} - KaxCueClusterPosition(const KaxCueClusterPosition & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCueClusterPosition) -}; - -class MATROSKA_DLL_API KaxCueBlockNumber : public EbmlUInteger { - public: - KaxCueBlockNumber() :EbmlUInteger(1) {} - KaxCueBlockNumber(const KaxCueBlockNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCueBlockNumber) -}; - -#if MATROSKA_VERSION >= 2 -class MATROSKA_DLL_API KaxCueCodecState : public EbmlUInteger { - public: - KaxCueCodecState() :EbmlUInteger(0) {} - KaxCueCodecState(const KaxCueCodecState & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCueCodecState) -}; - -class MATROSKA_DLL_API KaxCueReference : public EbmlMaster { - public: - KaxCueReference(); - KaxCueReference(const KaxCueReference & ElementToClone) :EbmlMaster(ElementToClone) {} - - void AddReference(const KaxBlockGroup & BlockReferenced, uint64 GlobalTimecodeScale); - void AddReference(const KaxBlockBlob & BlockReferenced, uint64 GlobalTimecodeScale); - - EBML_CONCRETE_CLASS(KaxCueReference) -}; - -class MATROSKA_DLL_API KaxCueRefTime : public EbmlUInteger { - public: - KaxCueRefTime() {} - KaxCueRefTime(const KaxCueRefTime & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCueRefTime) -}; - -class MATROSKA_DLL_API KaxCueRefCluster : public EbmlUInteger { - public: - KaxCueRefCluster() {} - KaxCueRefCluster(const KaxCueRefCluster & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCueRefCluster) -}; - -class MATROSKA_DLL_API KaxCueRefNumber : public EbmlUInteger { - public: - KaxCueRefNumber() :EbmlUInteger(1) {} - KaxCueRefNumber(const KaxCueRefNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCueRefNumber) -}; - -class MATROSKA_DLL_API KaxCueRefCodecState : public EbmlUInteger { - public: - KaxCueRefCodecState() :EbmlUInteger(0) {} - KaxCueRefCodecState(const KaxCueRefCodecState & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCueRefCodecState) -}; -#endif // MATROSKA_VERSION - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_CUES_DATA_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxCuesData.h,v 1.8 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_CUES_DATA_H +#define LIBMATROSKA_CUES_DATA_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlUInteger.h" +#include "ebml/EbmlMaster.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class KaxBlockGroup; +class KaxBlockBlob; +class KaxCueTrackPositions; +class KaxInternalBlock; + +class MATROSKA_DLL_API KaxCuePoint : public EbmlMaster { + public: + KaxCuePoint(); + KaxCuePoint(const KaxCuePoint & ElementToClone) :EbmlMaster(ElementToClone) {} + void PositionSet(const KaxBlockGroup & BlockReference, uint64 GlobalTimecodeScale); + void PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalTimecodeScale); + + bool operator<(const EbmlElement & EltB) const; + + const KaxCueTrackPositions * GetSeekPosition() const; + bool Timecode(uint64 & aTimecode, uint64 GlobalTimecodeScale) const; + + EBML_CONCRETE_CLASS(KaxCuePoint) +}; + +class MATROSKA_DLL_API KaxCueTime : public EbmlUInteger { + public: + KaxCueTime() {} + KaxCueTime(const KaxCueTime & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCueTime) +}; + +class MATROSKA_DLL_API KaxCueTrackPositions : public EbmlMaster { + public: + KaxCueTrackPositions(); + KaxCueTrackPositions(const KaxCueTrackPositions & ElementToClone) :EbmlMaster(ElementToClone) {} + + uint64 ClusterPosition() const; + uint16 TrackNumber() const; + + EBML_CONCRETE_CLASS(KaxCueTrackPositions) +}; + +class MATROSKA_DLL_API KaxCueTrack : public EbmlUInteger { + public: + KaxCueTrack() {} + KaxCueTrack(const KaxCueTrack & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCueTrack) +}; + +class MATROSKA_DLL_API KaxCueClusterPosition : public EbmlUInteger { + public: + KaxCueClusterPosition() {} + KaxCueClusterPosition(const KaxCueClusterPosition & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCueClusterPosition) +}; + +class MATROSKA_DLL_API KaxCueBlockNumber : public EbmlUInteger { + public: + KaxCueBlockNumber() :EbmlUInteger(1) {} + KaxCueBlockNumber(const KaxCueBlockNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCueBlockNumber) +}; + +#if MATROSKA_VERSION >= 2 +class MATROSKA_DLL_API KaxCueCodecState : public EbmlUInteger { + public: + KaxCueCodecState() :EbmlUInteger(0) {} + KaxCueCodecState(const KaxCueCodecState & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCueCodecState) +}; + +class MATROSKA_DLL_API KaxCueReference : public EbmlMaster { + public: + KaxCueReference(); + KaxCueReference(const KaxCueReference & ElementToClone) :EbmlMaster(ElementToClone) {} + + void AddReference(const KaxBlockGroup & BlockReferenced, uint64 GlobalTimecodeScale); + void AddReference(const KaxBlockBlob & BlockReferenced, uint64 GlobalTimecodeScale); + + EBML_CONCRETE_CLASS(KaxCueReference) +}; + +class MATROSKA_DLL_API KaxCueRefTime : public EbmlUInteger { + public: + KaxCueRefTime() {} + KaxCueRefTime(const KaxCueRefTime & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCueRefTime) +}; + +class MATROSKA_DLL_API KaxCueRefCluster : public EbmlUInteger { + public: + KaxCueRefCluster() {} + KaxCueRefCluster(const KaxCueRefCluster & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCueRefCluster) +}; + +class MATROSKA_DLL_API KaxCueRefNumber : public EbmlUInteger { + public: + KaxCueRefNumber() :EbmlUInteger(1) {} + KaxCueRefNumber(const KaxCueRefNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCueRefNumber) +}; + +class MATROSKA_DLL_API KaxCueRefCodecState : public EbmlUInteger { + public: + KaxCueRefCodecState() :EbmlUInteger(0) {} + KaxCueRefCodecState(const KaxCueRefCodecState & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCueRefCodecState) +}; +#endif // MATROSKA_VERSION + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_CUES_DATA_H diff --git a/matroska/KaxInfo.h b/matroska/KaxInfo.h index 8c422cf..e15d7ff 100644 --- a/matroska/KaxInfo.h +++ b/matroska/KaxInfo.h @@ -1,72 +1,72 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxInfo.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_INFO_H -#define LIBMATROSKA_INFO_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlUnicodeString.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxInfo : public EbmlMaster { - public: - KaxInfo(); - KaxInfo(const KaxInfo & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxInfo) -}; - -class MATROSKA_DLL_API KaxMuxingApp : public EbmlUnicodeString { - public: - KaxMuxingApp() {} - KaxMuxingApp(const KaxMuxingApp & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxMuxingApp) -}; - -class MATROSKA_DLL_API KaxWritingApp : public EbmlUnicodeString { - public: - KaxWritingApp() {} - KaxWritingApp(const KaxWritingApp & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxWritingApp) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_INFO_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxInfo.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_INFO_H +#define LIBMATROSKA_INFO_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlUnicodeString.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxInfo : public EbmlMaster { + public: + KaxInfo(); + KaxInfo(const KaxInfo & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxInfo) +}; + +class MATROSKA_DLL_API KaxMuxingApp : public EbmlUnicodeString { + public: + KaxMuxingApp() {} + KaxMuxingApp(const KaxMuxingApp & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxMuxingApp) +}; + +class MATROSKA_DLL_API KaxWritingApp : public EbmlUnicodeString { + public: + KaxWritingApp() {} + KaxWritingApp(const KaxWritingApp & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxWritingApp) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_INFO_H diff --git a/matroska/KaxInfoData.h b/matroska/KaxInfoData.h index 99c287d..69ef67e 100644 --- a/matroska/KaxInfoData.h +++ b/matroska/KaxInfoData.h @@ -1,179 +1,179 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxInfoData.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme - \author John Cannon - \author Moritz Bunkus -*/ -#ifndef LIBMATROSKA_INFO_DATA_H -#define LIBMATROSKA_INFO_DATA_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlUInteger.h" -#include "ebml/EbmlFloat.h" -#include "ebml/EbmlUnicodeString.h" -#include "ebml/EbmlBinary.h" -#include "ebml/EbmlDate.h" -#include "ebml/EbmlMaster.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxSegmentUID : public EbmlBinary { - public: - KaxSegmentUID() {} - KaxSegmentUID(const KaxSegmentUID & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const { return (GetSize() == 16);} - - EBML_CONCRETE_CLASS(KaxSegmentUID) -}; - -class MATROSKA_DLL_API KaxSegmentFilename : public EbmlUnicodeString { - public: - KaxSegmentFilename() {} - KaxSegmentFilename(const KaxSegmentFilename & ElementToClone) :EbmlUnicodeString(ElementToClone){} - - EBML_CONCRETE_CLASS(KaxSegmentFilename) -}; - -class MATROSKA_DLL_API KaxPrevUID : public KaxSegmentUID { - public: - KaxPrevUID() {} - KaxPrevUID(const KaxPrevUID & ElementToClone) :KaxSegmentUID(ElementToClone){} - bool ValidateSize() const { return (GetSize() == 16);} - - EBML_CONCRETE_CLASS(KaxPrevUID) -}; - -class MATROSKA_DLL_API KaxPrevFilename : public EbmlUnicodeString { - public: - KaxPrevFilename() :EbmlUnicodeString() {} - KaxPrevFilename(const KaxPrevFilename & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxPrevFilename) -}; - -class MATROSKA_DLL_API KaxNextUID : public KaxSegmentUID { - public: - KaxNextUID() {} - KaxNextUID(const KaxNextUID & ElementToClone) :KaxSegmentUID(ElementToClone){} - bool ValidateSize() const { return (GetSize() == 16);} - - EBML_CONCRETE_CLASS(KaxNextUID) -}; - -class MATROSKA_DLL_API KaxNextFilename : public EbmlUnicodeString { - public: - KaxNextFilename() {} - KaxNextFilename(const KaxNextFilename & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxNextFilename) -}; - -class MATROSKA_DLL_API KaxSegmentFamily : public EbmlBinary { - public: - KaxSegmentFamily() {} - KaxSegmentFamily(const KaxSegmentFamily & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const { return (GetSize() == 16);} - - EBML_CONCRETE_CLASS(KaxSegmentFamily) -}; - -class MATROSKA_DLL_API KaxChapterTranslate : public EbmlMaster { - public: - KaxChapterTranslate(); - KaxChapterTranslate(const KaxChapterTranslate & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterTranslate) -}; - -class MATROSKA_DLL_API KaxChapterTranslateCodec : public EbmlUInteger { - public: - KaxChapterTranslateCodec() {} - KaxChapterTranslateCodec(const KaxChapterTranslateCodec & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterTranslateCodec) -}; - -class MATROSKA_DLL_API KaxChapterTranslateEditionUID : public EbmlUInteger { - public: - KaxChapterTranslateEditionUID() {} - KaxChapterTranslateEditionUID(const KaxChapterTranslateEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxChapterTranslateEditionUID) -}; - -class MATROSKA_DLL_API KaxChapterTranslateID : public EbmlBinary { - public: - KaxChapterTranslateID() {} - KaxChapterTranslateID(const KaxChapterTranslateID & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const { return true;} - - EBML_CONCRETE_CLASS(KaxChapterTranslateID) -}; - -class MATROSKA_DLL_API KaxTimecodeScale : public EbmlUInteger { - public: - KaxTimecodeScale() :EbmlUInteger(1000000) {} - KaxTimecodeScale(const KaxTimecodeScale & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTimecodeScale) -}; - -class MATROSKA_DLL_API KaxDuration : public EbmlFloat { - public: - KaxDuration(): EbmlFloat(FLOAT_64) {} - KaxDuration(const KaxDuration & ElementToClone) :EbmlFloat(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxDuration) -}; - -class MATROSKA_DLL_API KaxDateUTC : public EbmlDate { - public: - KaxDateUTC() {} - KaxDateUTC(const KaxDateUTC & ElementToClone) :EbmlDate(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxDateUTC) -}; - -class MATROSKA_DLL_API KaxTitle : public EbmlUnicodeString { - public: - KaxTitle() {} - KaxTitle(const KaxTitle & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTitle) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_INFO_DATA_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxInfoData.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme + \author John Cannon + \author Moritz Bunkus +*/ +#ifndef LIBMATROSKA_INFO_DATA_H +#define LIBMATROSKA_INFO_DATA_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlUInteger.h" +#include "ebml/EbmlFloat.h" +#include "ebml/EbmlUnicodeString.h" +#include "ebml/EbmlBinary.h" +#include "ebml/EbmlDate.h" +#include "ebml/EbmlMaster.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxSegmentUID : public EbmlBinary { + public: + KaxSegmentUID() {} + KaxSegmentUID(const KaxSegmentUID & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const { return (GetSize() == 16);} + + EBML_CONCRETE_CLASS(KaxSegmentUID) +}; + +class MATROSKA_DLL_API KaxSegmentFilename : public EbmlUnicodeString { + public: + KaxSegmentFilename() {} + KaxSegmentFilename(const KaxSegmentFilename & ElementToClone) :EbmlUnicodeString(ElementToClone){} + + EBML_CONCRETE_CLASS(KaxSegmentFilename) +}; + +class MATROSKA_DLL_API KaxPrevUID : public KaxSegmentUID { + public: + KaxPrevUID() {} + KaxPrevUID(const KaxPrevUID & ElementToClone) :KaxSegmentUID(ElementToClone){} + bool ValidateSize() const { return (GetSize() == 16);} + + EBML_CONCRETE_CLASS(KaxPrevUID) +}; + +class MATROSKA_DLL_API KaxPrevFilename : public EbmlUnicodeString { + public: + KaxPrevFilename() :EbmlUnicodeString() {} + KaxPrevFilename(const KaxPrevFilename & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxPrevFilename) +}; + +class MATROSKA_DLL_API KaxNextUID : public KaxSegmentUID { + public: + KaxNextUID() {} + KaxNextUID(const KaxNextUID & ElementToClone) :KaxSegmentUID(ElementToClone){} + bool ValidateSize() const { return (GetSize() == 16);} + + EBML_CONCRETE_CLASS(KaxNextUID) +}; + +class MATROSKA_DLL_API KaxNextFilename : public EbmlUnicodeString { + public: + KaxNextFilename() {} + KaxNextFilename(const KaxNextFilename & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxNextFilename) +}; + +class MATROSKA_DLL_API KaxSegmentFamily : public EbmlBinary { + public: + KaxSegmentFamily() {} + KaxSegmentFamily(const KaxSegmentFamily & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const { return (GetSize() == 16);} + + EBML_CONCRETE_CLASS(KaxSegmentFamily) +}; + +class MATROSKA_DLL_API KaxChapterTranslate : public EbmlMaster { + public: + KaxChapterTranslate(); + KaxChapterTranslate(const KaxChapterTranslate & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterTranslate) +}; + +class MATROSKA_DLL_API KaxChapterTranslateCodec : public EbmlUInteger { + public: + KaxChapterTranslateCodec() {} + KaxChapterTranslateCodec(const KaxChapterTranslateCodec & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterTranslateCodec) +}; + +class MATROSKA_DLL_API KaxChapterTranslateEditionUID : public EbmlUInteger { + public: + KaxChapterTranslateEditionUID() {} + KaxChapterTranslateEditionUID(const KaxChapterTranslateEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxChapterTranslateEditionUID) +}; + +class MATROSKA_DLL_API KaxChapterTranslateID : public EbmlBinary { + public: + KaxChapterTranslateID() {} + KaxChapterTranslateID(const KaxChapterTranslateID & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const { return true;} + + EBML_CONCRETE_CLASS(KaxChapterTranslateID) +}; + +class MATROSKA_DLL_API KaxTimecodeScale : public EbmlUInteger { + public: + KaxTimecodeScale() :EbmlUInteger(1000000) {} + KaxTimecodeScale(const KaxTimecodeScale & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTimecodeScale) +}; + +class MATROSKA_DLL_API KaxDuration : public EbmlFloat { + public: + KaxDuration(): EbmlFloat(FLOAT_64) {} + KaxDuration(const KaxDuration & ElementToClone) :EbmlFloat(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxDuration) +}; + +class MATROSKA_DLL_API KaxDateUTC : public EbmlDate { + public: + KaxDateUTC() {} + KaxDateUTC(const KaxDateUTC & ElementToClone) :EbmlDate(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxDateUTC) +}; + +class MATROSKA_DLL_API KaxTitle : public EbmlUnicodeString { + public: + KaxTitle() {} + KaxTitle(const KaxTitle & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTitle) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_INFO_DATA_H diff --git a/matroska/KaxSeekHead.h b/matroska/KaxSeekHead.h index 1382855..29e4126 100644 --- a/matroska/KaxSeekHead.h +++ b/matroska/KaxSeekHead.h @@ -1,98 +1,98 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxSeekHead.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_SEEK_HEAD_H -#define LIBMATROSKA_SEEK_HEAD_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlBinary.h" -#include "ebml/EbmlUInteger.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class KaxSegment; -class KaxSeek; - -class MATROSKA_DLL_API KaxSeekHead : public EbmlMaster { - public: - KaxSeekHead(); - KaxSeekHead(const KaxSeekHead & ElementToClone) :EbmlMaster(ElementToClone) {} - - /*! - \brief add an element to index in the Meta Seek data - \note the element should already be written in the file - */ - void IndexThis(const EbmlElement & aElt, const KaxSegment & ParentSegment); - - KaxSeek * FindFirstOf(const EbmlCallbacks & Callbacks) const; - KaxSeek * FindNextOf(const KaxSeek &aPrev) const; - - EBML_CONCRETE_CLASS(KaxSeekHead) -}; - -class MATROSKA_DLL_API KaxSeek : public EbmlMaster { - public: - KaxSeek(); - KaxSeek(const KaxSeek & ElementToClone) :EbmlMaster(ElementToClone) {} - - int64 Location() const; - bool IsEbmlId(const EbmlId & aId) const; - bool IsEbmlId(const KaxSeek & aPoint) const; - - EBML_CONCRETE_CLASS(KaxSeek) -}; - -class MATROSKA_DLL_API KaxSeekID : public EbmlBinary { - public: - KaxSeekID() {} - KaxSeekID(const KaxSeekID & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return GetSize() <= 4;} - - EBML_CONCRETE_CLASS(KaxSeekID) -}; - -class MATROSKA_DLL_API KaxSeekPosition : public EbmlUInteger { - public: - KaxSeekPosition() {} - KaxSeekPosition(const KaxSeekPosition & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxSeekPosition) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_SEEK_HEAD_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxSeekHead.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_SEEK_HEAD_H +#define LIBMATROSKA_SEEK_HEAD_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlBinary.h" +#include "ebml/EbmlUInteger.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class KaxSegment; +class KaxSeek; + +class MATROSKA_DLL_API KaxSeekHead : public EbmlMaster { + public: + KaxSeekHead(); + KaxSeekHead(const KaxSeekHead & ElementToClone) :EbmlMaster(ElementToClone) {} + + /*! + \brief add an element to index in the Meta Seek data + \note the element should already be written in the file + */ + void IndexThis(const EbmlElement & aElt, const KaxSegment & ParentSegment); + + KaxSeek * FindFirstOf(const EbmlCallbacks & Callbacks) const; + KaxSeek * FindNextOf(const KaxSeek &aPrev) const; + + EBML_CONCRETE_CLASS(KaxSeekHead) +}; + +class MATROSKA_DLL_API KaxSeek : public EbmlMaster { + public: + KaxSeek(); + KaxSeek(const KaxSeek & ElementToClone) :EbmlMaster(ElementToClone) {} + + int64 Location() const; + bool IsEbmlId(const EbmlId & aId) const; + bool IsEbmlId(const KaxSeek & aPoint) const; + + EBML_CONCRETE_CLASS(KaxSeek) +}; + +class MATROSKA_DLL_API KaxSeekID : public EbmlBinary { + public: + KaxSeekID() {} + KaxSeekID(const KaxSeekID & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return GetSize() <= 4;} + + EBML_CONCRETE_CLASS(KaxSeekID) +}; + +class MATROSKA_DLL_API KaxSeekPosition : public EbmlUInteger { + public: + KaxSeekPosition() {} + KaxSeekPosition(const KaxSeekPosition & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxSeekPosition) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_SEEK_HEAD_H diff --git a/matroska/KaxSegment.h b/matroska/KaxSegment.h index cad6be9..adf2bac 100644 --- a/matroska/KaxSegment.h +++ b/matroska/KaxSegment.h @@ -1,66 +1,66 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxSegment.h,v 1.8 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_SEGMENT_H -#define LIBMATROSKA_SEGMENT_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxSegment : public EbmlMaster { - public: - KaxSegment(); - KaxSegment(const KaxSegment & ElementToClone); - - /*! - \brief give the position of the element in the segment - */ - uint64 GetRelativePosition(const EbmlElement & Elt) const; - uint64 GetRelativePosition(uint64 aGlobalPosition) const; - - /*! - \brief give the position of the element in the file - */ - uint64 GetGlobalPosition(uint64 aRelativePosition) const; - - EBML_CONCRETE_CLASS(KaxSegment) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_SEGMENT_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxSegment.h,v 1.8 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_SEGMENT_H +#define LIBMATROSKA_SEGMENT_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxSegment : public EbmlMaster { + public: + KaxSegment(); + KaxSegment(const KaxSegment & ElementToClone); + + /*! + \brief give the position of the element in the segment + */ + uint64 GetRelativePosition(const EbmlElement & Elt) const; + uint64 GetRelativePosition(uint64 aGlobalPosition) const; + + /*! + \brief give the position of the element in the file + */ + uint64 GetGlobalPosition(uint64 aRelativePosition) const; + + EBML_CONCRETE_CLASS(KaxSegment) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_SEGMENT_H diff --git a/matroska/KaxTag.h b/matroska/KaxTag.h index 9572ff7..2ad4018 100644 --- a/matroska/KaxTag.h +++ b/matroska/KaxTag.h @@ -1,525 +1,525 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTag.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $ - \author Jory Stone - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_TAG_H -#define LIBMATROSKA_TAG_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlFloat.h" -#include "ebml/EbmlSInteger.h" -#include "ebml/EbmlUInteger.h" -#include "ebml/EbmlString.h" -#include "ebml/EbmlUnicodeString.h" -#include "ebml/EbmlBinary.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxTag : public EbmlMaster { - public: - KaxTag(); - KaxTag(const KaxTag & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTag) -}; - -class MATROSKA_DLL_API KaxTagTargets : public EbmlMaster { - public: - KaxTagTargets(); - KaxTagTargets(const KaxTagTargets & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagTargets) -}; - -class MATROSKA_DLL_API KaxTagGeneral : public EbmlMaster { - public: - KaxTagGeneral(); - KaxTagGeneral(const KaxTagGeneral & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagGeneral) -}; - -class MATROSKA_DLL_API KaxTagGenres : public EbmlMaster { - public: - KaxTagGenres(); - KaxTagGenres(const KaxTagGenres & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagGenres) -}; - -class MATROSKA_DLL_API KaxTagAudioSpecific : public EbmlMaster { - public: - KaxTagAudioSpecific(); - KaxTagAudioSpecific(const KaxTagAudioSpecific & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagAudioSpecific) -}; - -class MATROSKA_DLL_API KaxTagImageSpecific : public EbmlMaster { - public: - KaxTagImageSpecific(); - KaxTagImageSpecific(const KaxTagImageSpecific & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagImageSpecific) -}; - -class MATROSKA_DLL_API KaxTagTargetTypeValue : public EbmlUInteger { - public: - KaxTagTargetTypeValue() :EbmlUInteger(50) {} - KaxTagTargetTypeValue(const KaxTagTargetTypeValue & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagTargetTypeValue) -}; - -class MATROSKA_DLL_API KaxTagTargetType : public EbmlString { - public: - KaxTagTargetType() {} - KaxTagTargetType(const KaxTagTargetType & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagTargetType) -}; - -class MATROSKA_DLL_API KaxTagTrackUID : public EbmlUInteger { - public: - KaxTagTrackUID() :EbmlUInteger(0) {} - KaxTagTrackUID(const KaxTagTrackUID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagTrackUID) -}; - -class MATROSKA_DLL_API KaxTagEditionUID : public EbmlUInteger { - public: - KaxTagEditionUID() :EbmlUInteger(0) {} - KaxTagEditionUID(const KaxTagEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagEditionUID) -}; - -class MATROSKA_DLL_API KaxTagChapterUID : public EbmlUInteger { - public: - KaxTagChapterUID() :EbmlUInteger(0) {} - KaxTagChapterUID(const KaxTagChapterUID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagChapterUID) -}; - -class MATROSKA_DLL_API KaxTagAttachmentUID : public EbmlUInteger { - public: - KaxTagAttachmentUID() :EbmlUInteger(0) {} - KaxTagAttachmentUID(const KaxTagAttachmentUID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagAttachmentUID) -}; - -class MATROSKA_DLL_API KaxTagArchivalLocation : public EbmlUnicodeString { - public: - KaxTagArchivalLocation() {} - KaxTagArchivalLocation(const KaxTagArchivalLocation & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagArchivalLocation) -}; - -class MATROSKA_DLL_API KaxTagAudioEncryption : public EbmlBinary { - public: - KaxTagAudioEncryption() {} - KaxTagAudioEncryption(const KaxTagAudioEncryption & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return true;} // we don't mind about what's inside - - EBML_CONCRETE_CLASS(KaxTagAudioEncryption) -}; - -class MATROSKA_DLL_API KaxTagAudioGain : public EbmlFloat { - public: - KaxTagAudioGain() {} - KaxTagAudioGain(const KaxTagAudioGain & ElementToClone) :EbmlFloat(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagAudioGain) -}; - -class MATROSKA_DLL_API KaxTagAudioGenre : public EbmlString { - public: - KaxTagAudioGenre() {} - KaxTagAudioGenre(const KaxTagAudioGenre & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagAudioGenre) -}; - -class MATROSKA_DLL_API KaxTagAudioPeak : public EbmlFloat { - public: - KaxTagAudioPeak() {} - KaxTagAudioPeak(const KaxTagAudioPeak & ElementToClone) :EbmlFloat(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagAudioPeak) -}; - -class MATROSKA_DLL_API KaxTagBibliography : public EbmlUnicodeString { - public: - KaxTagBibliography() {} - KaxTagBibliography(const KaxTagBibliography & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagBibliography) -}; - -class MATROSKA_DLL_API KaxTagBPM : public EbmlFloat { - public: - KaxTagBPM() {} - KaxTagBPM(const KaxTagBPM & ElementToClone) :EbmlFloat(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagBPM) -}; - -class MATROSKA_DLL_API KaxTagCaptureDPI : public EbmlUInteger { - public: - KaxTagCaptureDPI() {} - KaxTagCaptureDPI(const KaxTagCaptureDPI & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagCaptureDPI) -}; - -class MATROSKA_DLL_API KaxTagCaptureLightness : public EbmlBinary { - public: - KaxTagCaptureLightness() {} - KaxTagCaptureLightness(const KaxTagCaptureLightness & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return true;} // we don't mind about what's inside - - EBML_CONCRETE_CLASS(KaxTagCaptureLightness) -}; - -class MATROSKA_DLL_API KaxTagCapturePaletteSetting : public EbmlUInteger { - public: - KaxTagCapturePaletteSetting() {} - KaxTagCapturePaletteSetting(const KaxTagCapturePaletteSetting & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagCapturePaletteSetting) -}; - -class MATROSKA_DLL_API KaxTagCaptureSharpness : public EbmlBinary { - public: - KaxTagCaptureSharpness() {} - KaxTagCaptureSharpness(const KaxTagCaptureSharpness & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return true;} // we don't mind about what's inside - - EBML_CONCRETE_CLASS(KaxTagCaptureSharpness) -}; - -class MATROSKA_DLL_API KaxTagCropped : public EbmlUnicodeString { - public: - KaxTagCropped() {} - KaxTagCropped(const KaxTagCropped & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagCropped) -}; - -class MATROSKA_DLL_API KaxTagDiscTrack : public EbmlUInteger { - public: - KaxTagDiscTrack() {} - KaxTagDiscTrack(const KaxTagDiscTrack & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagDiscTrack) -}; - -class MATROSKA_DLL_API KaxTagEncoder : public EbmlUnicodeString { - public: - KaxTagEncoder() {} - KaxTagEncoder(const KaxTagEncoder & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagEncoder) -}; - -class MATROSKA_DLL_API KaxTagEncodeSettings : public EbmlUnicodeString { - public: - KaxTagEncodeSettings() {} - KaxTagEncodeSettings(const KaxTagEncodeSettings & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagEncodeSettings) -}; - -class MATROSKA_DLL_API KaxTagEqualisation : public EbmlBinary { - public: - KaxTagEqualisation() {} - KaxTagEqualisation(const KaxTagEqualisation & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return true;} // we don't mind about what's inside - - EBML_CONCRETE_CLASS(KaxTagEqualisation) -}; - -class MATROSKA_DLL_API KaxTagFile : public EbmlUnicodeString { - public: - KaxTagFile() {} - KaxTagFile(const KaxTagFile & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagFile) -}; - -class MATROSKA_DLL_API KaxTagInitialKey : public EbmlString { - public: - KaxTagInitialKey() {} - KaxTagInitialKey(const KaxTagInitialKey & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagInitialKey) -}; - -class MATROSKA_DLL_API KaxTagKeywords : public EbmlUnicodeString { - public: - KaxTagKeywords() {} - KaxTagKeywords(const KaxTagKeywords & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagKeywords) -}; - -class MATROSKA_DLL_API KaxTagLanguage : public EbmlString { - public: - KaxTagLanguage() {} - KaxTagLanguage(const KaxTagLanguage & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagLanguage) -}; - -class MATROSKA_DLL_API KaxTagLength : public EbmlUInteger { - public: - KaxTagLength() {} - KaxTagLength(const KaxTagLength & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagLength) -}; - -class MATROSKA_DLL_API KaxTagMood : public EbmlUnicodeString { - public: - KaxTagMood() {} - KaxTagMood(const KaxTagMood & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMood) -}; - -class MATROSKA_DLL_API KaxTagOfficialAudioFileURL : public EbmlString { - public: - KaxTagOfficialAudioFileURL() {} - KaxTagOfficialAudioFileURL(const KaxTagOfficialAudioFileURL & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagOfficialAudioFileURL) -}; - -class MATROSKA_DLL_API KaxTagOfficialAudioSourceURL : public EbmlString { - public: - KaxTagOfficialAudioSourceURL() {} - KaxTagOfficialAudioSourceURL(const KaxTagOfficialAudioSourceURL & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagOfficialAudioSourceURL) -}; - -class MATROSKA_DLL_API KaxTagOriginalDimensions : public EbmlString { - public: - KaxTagOriginalDimensions() {} - KaxTagOriginalDimensions(const KaxTagOriginalDimensions & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagOriginalDimensions) -}; - -class MATROSKA_DLL_API KaxTagOriginalMediaType : public EbmlUnicodeString { - public: - KaxTagOriginalMediaType() {} - KaxTagOriginalMediaType(const KaxTagOriginalMediaType & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagOriginalMediaType) -}; - -class MATROSKA_DLL_API KaxTagPlayCounter : public EbmlUInteger { - public: - KaxTagPlayCounter() {} - KaxTagPlayCounter(const KaxTagPlayCounter & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagPlayCounter) -}; - -class MATROSKA_DLL_API KaxTagPlaylistDelay : public EbmlUInteger { - public: - KaxTagPlaylistDelay() {} - KaxTagPlaylistDelay(const KaxTagPlaylistDelay & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagPlaylistDelay) -}; - -class MATROSKA_DLL_API KaxTagPopularimeter : public EbmlSInteger { - public: - KaxTagPopularimeter() {} - KaxTagPopularimeter(const KaxTagPopularimeter & ElementToClone) :EbmlSInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagPopularimeter) -}; - -class MATROSKA_DLL_API KaxTagProduct : public EbmlUnicodeString { - public: - KaxTagProduct() {} - KaxTagProduct(const KaxTagProduct & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagProduct) -}; - -class MATROSKA_DLL_API KaxTagRating : public EbmlBinary { - public: - KaxTagRating() {} - KaxTagRating(const KaxTagRating & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return true;} // we don't mind about what's inside - - EBML_CONCRETE_CLASS(KaxTagRating) -}; - -class MATROSKA_DLL_API KaxTagRecordLocation : public EbmlString { - public: - KaxTagRecordLocation() {} - KaxTagRecordLocation(const KaxTagRecordLocation & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagRecordLocation) -}; - -class MATROSKA_DLL_API KaxTagSetPart : public EbmlUInteger { - public: - KaxTagSetPart() {} - KaxTagSetPart(const KaxTagSetPart & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagSetPart) -}; - -class MATROSKA_DLL_API KaxTagSource : public EbmlUnicodeString { - public: - KaxTagSource() {} - KaxTagSource(const KaxTagSource & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagSource) -}; - -class MATROSKA_DLL_API KaxTagSourceForm : public EbmlUnicodeString { - public: - KaxTagSourceForm() {} - KaxTagSourceForm(const KaxTagSourceForm & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagSourceForm) -}; - -class MATROSKA_DLL_API KaxTagSubGenre : public EbmlString { - public: - KaxTagSubGenre() {} - KaxTagSubGenre(const KaxTagSubGenre & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagSubGenre) -}; - -class MATROSKA_DLL_API KaxTagSubject : public EbmlUnicodeString { - public: - KaxTagSubject() {} - KaxTagSubject(const KaxTagSubject & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagSubject) -}; - -class MATROSKA_DLL_API KaxTagUnsynchronisedText : public EbmlUnicodeString { - public: - KaxTagUnsynchronisedText() {} - KaxTagUnsynchronisedText(const KaxTagUnsynchronisedText & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagUnsynchronisedText) -}; - -class MATROSKA_DLL_API KaxTagUserDefinedURL : public EbmlString { - public: - KaxTagUserDefinedURL() {} - KaxTagUserDefinedURL(const KaxTagUserDefinedURL & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagUserDefinedURL) -}; - -class MATROSKA_DLL_API KaxTagVideoGenre : public EbmlBinary { - public: - KaxTagVideoGenre() {} - KaxTagVideoGenre(const KaxTagVideoGenre & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return (GetSize() >= 2);} - - EBML_CONCRETE_CLASS(KaxTagVideoGenre) -}; - -class MATROSKA_DLL_API KaxTagSimple : public EbmlMaster { - public: - KaxTagSimple(); - KaxTagSimple(const KaxTagSimple & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagSimple) -}; - -class MATROSKA_DLL_API KaxTagName : public EbmlUnicodeString { - public: - KaxTagName() {} - KaxTagName(const KaxTagName & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagName) -}; - -class MATROSKA_DLL_API KaxTagLangue : public EbmlString { - public: - KaxTagLangue(): EbmlString("und") {} - KaxTagLangue(const KaxTagLangue & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagLangue) -}; - -class MATROSKA_DLL_API KaxTagDefault : public EbmlUInteger { - public: - KaxTagDefault() :EbmlUInteger(1) {} - KaxTagDefault(const KaxTagTrackUID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagDefault) -}; - -class MATROSKA_DLL_API KaxTagString : public EbmlUnicodeString { - public: - KaxTagString() {} - KaxTagString(const KaxTagString & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagString) -}; - -class MATROSKA_DLL_API KaxTagBinary : public EbmlBinary { - public: - KaxTagBinary() {} - KaxTagBinary(const KaxTagBinary & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return true;} // {return (GetSize() >= 0);} - - EBML_CONCRETE_CLASS(KaxTagBinary) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_TAG_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTag.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $ + \author Jory Stone + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_TAG_H +#define LIBMATROSKA_TAG_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlFloat.h" +#include "ebml/EbmlSInteger.h" +#include "ebml/EbmlUInteger.h" +#include "ebml/EbmlString.h" +#include "ebml/EbmlUnicodeString.h" +#include "ebml/EbmlBinary.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxTag : public EbmlMaster { + public: + KaxTag(); + KaxTag(const KaxTag & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTag) +}; + +class MATROSKA_DLL_API KaxTagTargets : public EbmlMaster { + public: + KaxTagTargets(); + KaxTagTargets(const KaxTagTargets & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagTargets) +}; + +class MATROSKA_DLL_API KaxTagGeneral : public EbmlMaster { + public: + KaxTagGeneral(); + KaxTagGeneral(const KaxTagGeneral & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagGeneral) +}; + +class MATROSKA_DLL_API KaxTagGenres : public EbmlMaster { + public: + KaxTagGenres(); + KaxTagGenres(const KaxTagGenres & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagGenres) +}; + +class MATROSKA_DLL_API KaxTagAudioSpecific : public EbmlMaster { + public: + KaxTagAudioSpecific(); + KaxTagAudioSpecific(const KaxTagAudioSpecific & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagAudioSpecific) +}; + +class MATROSKA_DLL_API KaxTagImageSpecific : public EbmlMaster { + public: + KaxTagImageSpecific(); + KaxTagImageSpecific(const KaxTagImageSpecific & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagImageSpecific) +}; + +class MATROSKA_DLL_API KaxTagTargetTypeValue : public EbmlUInteger { + public: + KaxTagTargetTypeValue() :EbmlUInteger(50) {} + KaxTagTargetTypeValue(const KaxTagTargetTypeValue & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagTargetTypeValue) +}; + +class MATROSKA_DLL_API KaxTagTargetType : public EbmlString { + public: + KaxTagTargetType() {} + KaxTagTargetType(const KaxTagTargetType & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagTargetType) +}; + +class MATROSKA_DLL_API KaxTagTrackUID : public EbmlUInteger { + public: + KaxTagTrackUID() :EbmlUInteger(0) {} + KaxTagTrackUID(const KaxTagTrackUID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagTrackUID) +}; + +class MATROSKA_DLL_API KaxTagEditionUID : public EbmlUInteger { + public: + KaxTagEditionUID() :EbmlUInteger(0) {} + KaxTagEditionUID(const KaxTagEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagEditionUID) +}; + +class MATROSKA_DLL_API KaxTagChapterUID : public EbmlUInteger { + public: + KaxTagChapterUID() :EbmlUInteger(0) {} + KaxTagChapterUID(const KaxTagChapterUID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagChapterUID) +}; + +class MATROSKA_DLL_API KaxTagAttachmentUID : public EbmlUInteger { + public: + KaxTagAttachmentUID() :EbmlUInteger(0) {} + KaxTagAttachmentUID(const KaxTagAttachmentUID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagAttachmentUID) +}; + +class MATROSKA_DLL_API KaxTagArchivalLocation : public EbmlUnicodeString { + public: + KaxTagArchivalLocation() {} + KaxTagArchivalLocation(const KaxTagArchivalLocation & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagArchivalLocation) +}; + +class MATROSKA_DLL_API KaxTagAudioEncryption : public EbmlBinary { + public: + KaxTagAudioEncryption() {} + KaxTagAudioEncryption(const KaxTagAudioEncryption & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return true;} // we don't mind about what's inside + + EBML_CONCRETE_CLASS(KaxTagAudioEncryption) +}; + +class MATROSKA_DLL_API KaxTagAudioGain : public EbmlFloat { + public: + KaxTagAudioGain() {} + KaxTagAudioGain(const KaxTagAudioGain & ElementToClone) :EbmlFloat(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagAudioGain) +}; + +class MATROSKA_DLL_API KaxTagAudioGenre : public EbmlString { + public: + KaxTagAudioGenre() {} + KaxTagAudioGenre(const KaxTagAudioGenre & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagAudioGenre) +}; + +class MATROSKA_DLL_API KaxTagAudioPeak : public EbmlFloat { + public: + KaxTagAudioPeak() {} + KaxTagAudioPeak(const KaxTagAudioPeak & ElementToClone) :EbmlFloat(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagAudioPeak) +}; + +class MATROSKA_DLL_API KaxTagBibliography : public EbmlUnicodeString { + public: + KaxTagBibliography() {} + KaxTagBibliography(const KaxTagBibliography & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagBibliography) +}; + +class MATROSKA_DLL_API KaxTagBPM : public EbmlFloat { + public: + KaxTagBPM() {} + KaxTagBPM(const KaxTagBPM & ElementToClone) :EbmlFloat(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagBPM) +}; + +class MATROSKA_DLL_API KaxTagCaptureDPI : public EbmlUInteger { + public: + KaxTagCaptureDPI() {} + KaxTagCaptureDPI(const KaxTagCaptureDPI & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagCaptureDPI) +}; + +class MATROSKA_DLL_API KaxTagCaptureLightness : public EbmlBinary { + public: + KaxTagCaptureLightness() {} + KaxTagCaptureLightness(const KaxTagCaptureLightness & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return true;} // we don't mind about what's inside + + EBML_CONCRETE_CLASS(KaxTagCaptureLightness) +}; + +class MATROSKA_DLL_API KaxTagCapturePaletteSetting : public EbmlUInteger { + public: + KaxTagCapturePaletteSetting() {} + KaxTagCapturePaletteSetting(const KaxTagCapturePaletteSetting & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagCapturePaletteSetting) +}; + +class MATROSKA_DLL_API KaxTagCaptureSharpness : public EbmlBinary { + public: + KaxTagCaptureSharpness() {} + KaxTagCaptureSharpness(const KaxTagCaptureSharpness & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return true;} // we don't mind about what's inside + + EBML_CONCRETE_CLASS(KaxTagCaptureSharpness) +}; + +class MATROSKA_DLL_API KaxTagCropped : public EbmlUnicodeString { + public: + KaxTagCropped() {} + KaxTagCropped(const KaxTagCropped & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagCropped) +}; + +class MATROSKA_DLL_API KaxTagDiscTrack : public EbmlUInteger { + public: + KaxTagDiscTrack() {} + KaxTagDiscTrack(const KaxTagDiscTrack & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagDiscTrack) +}; + +class MATROSKA_DLL_API KaxTagEncoder : public EbmlUnicodeString { + public: + KaxTagEncoder() {} + KaxTagEncoder(const KaxTagEncoder & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagEncoder) +}; + +class MATROSKA_DLL_API KaxTagEncodeSettings : public EbmlUnicodeString { + public: + KaxTagEncodeSettings() {} + KaxTagEncodeSettings(const KaxTagEncodeSettings & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagEncodeSettings) +}; + +class MATROSKA_DLL_API KaxTagEqualisation : public EbmlBinary { + public: + KaxTagEqualisation() {} + KaxTagEqualisation(const KaxTagEqualisation & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return true;} // we don't mind about what's inside + + EBML_CONCRETE_CLASS(KaxTagEqualisation) +}; + +class MATROSKA_DLL_API KaxTagFile : public EbmlUnicodeString { + public: + KaxTagFile() {} + KaxTagFile(const KaxTagFile & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagFile) +}; + +class MATROSKA_DLL_API KaxTagInitialKey : public EbmlString { + public: + KaxTagInitialKey() {} + KaxTagInitialKey(const KaxTagInitialKey & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagInitialKey) +}; + +class MATROSKA_DLL_API KaxTagKeywords : public EbmlUnicodeString { + public: + KaxTagKeywords() {} + KaxTagKeywords(const KaxTagKeywords & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagKeywords) +}; + +class MATROSKA_DLL_API KaxTagLanguage : public EbmlString { + public: + KaxTagLanguage() {} + KaxTagLanguage(const KaxTagLanguage & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagLanguage) +}; + +class MATROSKA_DLL_API KaxTagLength : public EbmlUInteger { + public: + KaxTagLength() {} + KaxTagLength(const KaxTagLength & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagLength) +}; + +class MATROSKA_DLL_API KaxTagMood : public EbmlUnicodeString { + public: + KaxTagMood() {} + KaxTagMood(const KaxTagMood & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMood) +}; + +class MATROSKA_DLL_API KaxTagOfficialAudioFileURL : public EbmlString { + public: + KaxTagOfficialAudioFileURL() {} + KaxTagOfficialAudioFileURL(const KaxTagOfficialAudioFileURL & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagOfficialAudioFileURL) +}; + +class MATROSKA_DLL_API KaxTagOfficialAudioSourceURL : public EbmlString { + public: + KaxTagOfficialAudioSourceURL() {} + KaxTagOfficialAudioSourceURL(const KaxTagOfficialAudioSourceURL & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagOfficialAudioSourceURL) +}; + +class MATROSKA_DLL_API KaxTagOriginalDimensions : public EbmlString { + public: + KaxTagOriginalDimensions() {} + KaxTagOriginalDimensions(const KaxTagOriginalDimensions & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagOriginalDimensions) +}; + +class MATROSKA_DLL_API KaxTagOriginalMediaType : public EbmlUnicodeString { + public: + KaxTagOriginalMediaType() {} + KaxTagOriginalMediaType(const KaxTagOriginalMediaType & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagOriginalMediaType) +}; + +class MATROSKA_DLL_API KaxTagPlayCounter : public EbmlUInteger { + public: + KaxTagPlayCounter() {} + KaxTagPlayCounter(const KaxTagPlayCounter & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagPlayCounter) +}; + +class MATROSKA_DLL_API KaxTagPlaylistDelay : public EbmlUInteger { + public: + KaxTagPlaylistDelay() {} + KaxTagPlaylistDelay(const KaxTagPlaylistDelay & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagPlaylistDelay) +}; + +class MATROSKA_DLL_API KaxTagPopularimeter : public EbmlSInteger { + public: + KaxTagPopularimeter() {} + KaxTagPopularimeter(const KaxTagPopularimeter & ElementToClone) :EbmlSInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagPopularimeter) +}; + +class MATROSKA_DLL_API KaxTagProduct : public EbmlUnicodeString { + public: + KaxTagProduct() {} + KaxTagProduct(const KaxTagProduct & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagProduct) +}; + +class MATROSKA_DLL_API KaxTagRating : public EbmlBinary { + public: + KaxTagRating() {} + KaxTagRating(const KaxTagRating & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return true;} // we don't mind about what's inside + + EBML_CONCRETE_CLASS(KaxTagRating) +}; + +class MATROSKA_DLL_API KaxTagRecordLocation : public EbmlString { + public: + KaxTagRecordLocation() {} + KaxTagRecordLocation(const KaxTagRecordLocation & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagRecordLocation) +}; + +class MATROSKA_DLL_API KaxTagSetPart : public EbmlUInteger { + public: + KaxTagSetPart() {} + KaxTagSetPart(const KaxTagSetPart & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagSetPart) +}; + +class MATROSKA_DLL_API KaxTagSource : public EbmlUnicodeString { + public: + KaxTagSource() {} + KaxTagSource(const KaxTagSource & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagSource) +}; + +class MATROSKA_DLL_API KaxTagSourceForm : public EbmlUnicodeString { + public: + KaxTagSourceForm() {} + KaxTagSourceForm(const KaxTagSourceForm & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagSourceForm) +}; + +class MATROSKA_DLL_API KaxTagSubGenre : public EbmlString { + public: + KaxTagSubGenre() {} + KaxTagSubGenre(const KaxTagSubGenre & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagSubGenre) +}; + +class MATROSKA_DLL_API KaxTagSubject : public EbmlUnicodeString { + public: + KaxTagSubject() {} + KaxTagSubject(const KaxTagSubject & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagSubject) +}; + +class MATROSKA_DLL_API KaxTagUnsynchronisedText : public EbmlUnicodeString { + public: + KaxTagUnsynchronisedText() {} + KaxTagUnsynchronisedText(const KaxTagUnsynchronisedText & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagUnsynchronisedText) +}; + +class MATROSKA_DLL_API KaxTagUserDefinedURL : public EbmlString { + public: + KaxTagUserDefinedURL() {} + KaxTagUserDefinedURL(const KaxTagUserDefinedURL & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagUserDefinedURL) +}; + +class MATROSKA_DLL_API KaxTagVideoGenre : public EbmlBinary { + public: + KaxTagVideoGenre() {} + KaxTagVideoGenre(const KaxTagVideoGenre & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return (GetSize() >= 2);} + + EBML_CONCRETE_CLASS(KaxTagVideoGenre) +}; + +class MATROSKA_DLL_API KaxTagSimple : public EbmlMaster { + public: + KaxTagSimple(); + KaxTagSimple(const KaxTagSimple & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagSimple) +}; + +class MATROSKA_DLL_API KaxTagName : public EbmlUnicodeString { + public: + KaxTagName() {} + KaxTagName(const KaxTagName & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagName) +}; + +class MATROSKA_DLL_API KaxTagLangue : public EbmlString { + public: + KaxTagLangue(): EbmlString("und") {} + KaxTagLangue(const KaxTagLangue & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagLangue) +}; + +class MATROSKA_DLL_API KaxTagDefault : public EbmlUInteger { + public: + KaxTagDefault() :EbmlUInteger(1) {} + KaxTagDefault(const KaxTagTrackUID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagDefault) +}; + +class MATROSKA_DLL_API KaxTagString : public EbmlUnicodeString { + public: + KaxTagString() {} + KaxTagString(const KaxTagString & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagString) +}; + +class MATROSKA_DLL_API KaxTagBinary : public EbmlBinary { + public: + KaxTagBinary() {} + KaxTagBinary(const KaxTagBinary & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return true;} // {return (GetSize() >= 0);} + + EBML_CONCRETE_CLASS(KaxTagBinary) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_TAG_H diff --git a/matroska/KaxTagMulti.h b/matroska/KaxTagMulti.h index 09cd3a0..83ef460 100644 --- a/matroska/KaxTagMulti.h +++ b/matroska/KaxTagMulti.h @@ -1,582 +1,582 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTagMulti.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $ - \author Jory Stone - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_TAGMULTI_H -#define LIBMATROSKA_TAGMULTI_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlDate.h" -#include "ebml/EbmlFloat.h" -#include "ebml/EbmlSInteger.h" -#include "ebml/EbmlUInteger.h" -#include "ebml/EbmlString.h" -#include "ebml/EbmlUnicodeString.h" -#include "ebml/EbmlBinary.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -enum KaxTagMultiCommercialTypes { - KaxTagMultiCommercialType_FilePurchase = 1, //Information on where to purchase this file. This is akin to the WPAY tag in ID3. - KaxTagMultiCommercialType_ItemPurchase, //Information on where to purchase this album. This is akin to the WCOM tag in ID3. - KaxTagMultiCommercialType_Owner //Information on the purchase that occurred for this file. This is akin to the OWNE tag in ID3. -}; -enum KaxTagMultiDateTypes { - KaxTagMultiDateType_EncodingDate = 1, //The time that the encoding of this item was completed. This is akin to the TDEN tag in ID3. - KaxTagMultiDateType_RecordingDate, //The time that the recording began, and finished. This is akin to the TDRC tag in ID3. - KaxTagMultiDateType_ReleaseDate, //The time that the item was originaly released. This is akin to the TDRL tag in ID3. - KaxTagMultiDateType_OriginalReleaseDate, //The time that the item was originaly released if it is a remake. This is akin to the TDOR tag in ID3. - KaxTagMultiDateType_TaggingDate, //The time that the tags were done for this item. This is akin to the TDTG tag in ID3. - KaxTagMultiDateType_DigitizingDate //The time that the item was tranfered to a digital medium. This is akin to the IDIT tag in RIFF -}; -enum KaxTagMultiEntitiesTypes { - KaxTagMultiEntitiesType_LyricistTextWriter = 1, //The person that wrote the words/script for this item. This is akin to the TEXT tag in ID3. - KaxTagMultiEntitiesType_Composer, //The name of the composer of this item. This is akin to the TCOM tag in ID3. - KaxTagMultiEntitiesType_LeadPerformerSoloist, //This is akin to the TPE1 tag in ID3. - KaxTagMultiEntitiesType_BandOrchestraAccompaniment, //This is akin to the TPE2 tag in ID3. - KaxTagMultiEntitiesType_OriginalLyricistTextWriter, //This is akin to the TOLY tag in ID3. - KaxTagMultiEntitiesType_OriginalArtistPerformer, //This is akin to the TOPE tag in ID3. - KaxTagMultiEntitiesType_OriginalAlbumMovieShowTitle, //This is akin to the TOAL tag in ID3. - KaxTagMultiEntitiesType_ConductorPerformerRefinement, //This is akin to the TPE3 tag in ID3. - KaxTagMultiEntitiesType_InterpretedRemixedBy, //This is akin to the TPE4 tag in ID3. - KaxTagMultiEntitiesType_Director, //This is akin to the IART tag in RIFF - KaxTagMultiEntitiesType_ProducedBy, //This is akin to the IPRO tag in Extended RIFF - KaxTagMultiEntitiesType_Cinematographer, //This is akin to the ICNM tag in Extended RIFF - KaxTagMultiEntitiesType_ProductionDesigner, //This is akin to the IPDS tag in Extended RIFF - KaxTagMultiEntitiesType_CostumeDesigner, //This is akin to the ICDS tag in Extended RIFF - KaxTagMultiEntitiesType_ProductionStudio, //This is akin to the ISTD tag in Extended RIFF - KaxTagMultiEntitiesType_DistributedBy, //This is akin to the IDST tag in Extended RIFF - KaxTagMultiEntitiesType_CommissionedBy, //This is akin to the ICMS tag in RIFF - KaxTagMultiEntitiesType_Engineer, //This is akin to the IENG tag in RIFF - KaxTagMultiEntitiesType_EditedBy, //This is akin to the IEDT tag in Extended RIFF - KaxTagMultiEntitiesType_EncodedBy, //This is akin to the TENC tag in ID3. - KaxTagMultiEntitiesType_RippedBy, //This is akin to the IRIP tag in Extended RIFF - KaxTagMultiEntitiesType_InvolvedPeopleList, //A very general tag for everyone else that wants to be listed. This is akin to the TMCL tag in ID3. - KaxTagMultiEntitiesType_InternetRadioStationName, //This is akin to the TSRN tag in ID3. - KaxTagMultiEntitiesType_Publisher //This is akin to the TPUB tag in ID3. -}; - -enum KaxTagMultiIdentifierTypes { - KaxTagMultiIdentifierType_ISRC = 1, //String, The International Standard Recording Code - KaxTagMultiIdentifierType_CDIdentifier, //Binary, This is a binary dump of the TOC of the CDROM that this item was taken from. This holds the same information as the MCDI in ID3. - KaxTagMultiIdentifierType_ISBN, //String, International Standard Book Number - KaxTagMultiIdentifierType_Catalog, //String, sometimes the EAN/UPC, often some letters followed by some numbers - KaxTagMultiIdentifierType_EAN, //String, EAN-13 bar code identifier - KaxTagMultiIdentifierType_UPC, //String, UPC-A bar code identifier - KaxTagMultiIdentifierType_LabelCode, //String, Typically printed as ________ (LC) xxxx) ~~~~~~~~ or _________ (LC) 0xxxx) ~~~~~~~~~ on CDs medias or covers, where xxxx is a 4-digit number. - KaxTagMultiIdentifierType_LCCN, //String, Library of Congress Control Number - KaxTagMultiIdentifierType_UniqueFileIdentifier, //Binary, This used for a dump of the UFID field in ID3. This field would only be used if the item was pulled from an MP3. - CDROM_CD_TEXT_PACK_TOC_INFO2 //Binary -}; - -enum KaxTagMultiLegalTypes { - KaxTagMultiLegalType_Copyright = 1, //The copyright information as per the copyright holder. This is akin to the TCOP tag in ID3. - KaxTagMultiLegalType_ProductionCopyright, //The copyright information as per the production copyright holder. This is akin to the TPRO tag in ID3. - KaxTagMultiLegalType_TermsOfUse //The terms of use for this item. This is akin to the USER tag in ID3. -}; - -enum KaxTagMultiTitleTypes { - KaxTagMultiTitleType_TrackTitle = 1, - //The title of this item. In the case of a track, the Name element should be identical to the Name element. - //For example, for music you might label this "Canon in D", or for video's audio track you might use "English 5.1" This is akin to the TIT2 tag in ID3. - KaxTagMultiTitleType_AlbumMovieShowTitle, - //This is the name given to a grouping of tracks and/or chapters. - //For example, all video, audio, and subtitle tracks for a movie would be grouped under this and be given the name of the movie. - //All tracks for a particular CD would be grouped together under the title of the CD, or if all tracks for a CD were recorded as a single track, seperated by chapters, the same would apply. - //You could use this to label episode 3 of The Simpsons. This is akin to the TALB tag in ID3. - KaxTagMultiTitleType_SetTitle, //This would be used to label a set of ID 2. For example, season 13 of The Simpsons. - KaxTagMultiTitleType_Series //This would be used to label a set of ID 3. For example, The Simpsons. -}; - -class MATROSKA_DLL_API KaxTagMultiComment : public EbmlMaster { - public: - KaxTagMultiComment(); - KaxTagMultiComment(const KaxTagMultiComment & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiComment) -}; - -class MATROSKA_DLL_API KaxTagMultiCommentName : public EbmlString { - public: - KaxTagMultiCommentName() {} - KaxTagMultiCommentName(const KaxTagMultiCommentName & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiCommentName) -}; - -class MATROSKA_DLL_API KaxTagMultiCommentComments : public EbmlUnicodeString { - public: - KaxTagMultiCommentComments() {} - KaxTagMultiCommentComments(const KaxTagMultiCommentComments & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiCommentComments) -}; - -class MATROSKA_DLL_API KaxTagMultiCommentLanguage : public EbmlString { - public: - KaxTagMultiCommentLanguage() {} - KaxTagMultiCommentLanguage(const KaxTagMultiCommentLanguage & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiCommentLanguage) -}; - -class MATROSKA_DLL_API KaxTagMultiCommercial : public EbmlMaster { - public: - KaxTagMultiCommercial(); - KaxTagMultiCommercial(const KaxTagMultiCommercial & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiCommercial) -}; - -class MATROSKA_DLL_API KaxTagCommercial : public EbmlMaster { - public: - KaxTagCommercial(); - KaxTagCommercial(const KaxTagCommercial & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagCommercial) -}; - -class MATROSKA_DLL_API KaxTagMultiCommercialType : public EbmlUInteger { - public: - KaxTagMultiCommercialType() {} - KaxTagMultiCommercialType(const KaxTagMultiCommercialType & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiCommercialType) -}; - -class MATROSKA_DLL_API KaxTagMultiCommercialAddress : public EbmlUnicodeString { - public: - KaxTagMultiCommercialAddress() {} - KaxTagMultiCommercialAddress(const KaxTagMultiCommercialAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiCommercialAddress) -}; - -class MATROSKA_DLL_API KaxTagMultiCommercialURL : public EbmlString { - public: - KaxTagMultiCommercialURL() {} - KaxTagMultiCommercialURL(const KaxTagMultiCommercialURL & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiCommercialURL) -}; - -class MATROSKA_DLL_API KaxTagMultiCommercialEmail : public EbmlString { - public: - KaxTagMultiCommercialEmail() {} - KaxTagMultiCommercialEmail(const KaxTagMultiCommercialEmail & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiCommercialEmail) -}; - -class MATROSKA_DLL_API KaxTagMultiPrice : public EbmlMaster { - public: - KaxTagMultiPrice(); - KaxTagMultiPrice(const KaxTagMultiPrice & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiPrice) -}; - -class MATROSKA_DLL_API KaxTagMultiPriceCurrency : public EbmlString { - public: - KaxTagMultiPriceCurrency() {} - KaxTagMultiPriceCurrency(const KaxTagMultiPriceCurrency & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiPriceCurrency) -}; - -class MATROSKA_DLL_API KaxTagMultiPriceAmount : public EbmlFloat { - public: - KaxTagMultiPriceAmount() :EbmlFloat() {} - KaxTagMultiPriceAmount(const KaxTagMultiPriceAmount & ElementToClone) :EbmlFloat(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiPriceAmount) -}; - -class MATROSKA_DLL_API KaxTagMultiPricePriceDate : public EbmlDate { - public: - KaxTagMultiPricePriceDate() :EbmlDate() {} - KaxTagMultiPricePriceDate(const KaxTagMultiPricePriceDate & ElementToClone) :EbmlDate(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiPricePriceDate) -}; - -class MATROSKA_DLL_API KaxTagMultiDate : public EbmlMaster { - public: - KaxTagMultiDate(); - KaxTagMultiDate(const KaxTagMultiDate & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiDate) -}; - -class MATROSKA_DLL_API KaxTagDate : public EbmlMaster { - public: - KaxTagDate(); - KaxTagDate(const KaxTagDate & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagDate) -}; - -class MATROSKA_DLL_API KaxTagMultiDateType : public EbmlUInteger { - public: - KaxTagMultiDateType() {} - KaxTagMultiDateType(const KaxTagMultiDateType & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiDateType) -}; - -class MATROSKA_DLL_API KaxTagMultiDateDateBegin : public EbmlDate { - public: - KaxTagMultiDateDateBegin() :EbmlDate() {} - KaxTagMultiDateDateBegin(const KaxTagMultiDateDateBegin & ElementToClone) :EbmlDate(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiDateDateBegin) -}; - -class MATROSKA_DLL_API KaxTagMultiDateDateEnd : public EbmlDate { - public: - KaxTagMultiDateDateEnd() :EbmlDate() {} - KaxTagMultiDateDateEnd(const KaxTagMultiDateDateEnd & ElementToClone) :EbmlDate(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiDateDateEnd) -}; - -class MATROSKA_DLL_API KaxTagMultiEntity : public EbmlMaster { - public: - KaxTagMultiEntity(); - KaxTagMultiEntity(const KaxTagMultiEntity & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiEntity) -}; - -class MATROSKA_DLL_API KaxTagEntity : public EbmlMaster { - public: - KaxTagEntity(); - KaxTagEntity(const KaxTagEntity & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagEntity) -}; - -class MATROSKA_DLL_API KaxTagMultiEntityType : public EbmlUInteger { - public: - KaxTagMultiEntityType() {} - KaxTagMultiEntityType(const KaxTagMultiEntityType & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiEntityType) -}; - -class MATROSKA_DLL_API KaxTagMultiEntityName : public EbmlUnicodeString { - public: - KaxTagMultiEntityName() {} - KaxTagMultiEntityName(const KaxTagMultiEntityName & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiEntityName) -}; - -class MATROSKA_DLL_API KaxTagMultiEntityAddress : public EbmlUnicodeString { - public: - KaxTagMultiEntityAddress() {} - KaxTagMultiEntityAddress(const KaxTagMultiEntityAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiEntityAddress) -}; - -class MATROSKA_DLL_API KaxTagMultiEntityURL : public EbmlString { - public: - KaxTagMultiEntityURL() {} - KaxTagMultiEntityURL(const KaxTagMultiEntityURL & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiEntityURL) -}; - -class MATROSKA_DLL_API KaxTagMultiEntityEmail : public EbmlString { - public: - KaxTagMultiEntityEmail() {} - KaxTagMultiEntityEmail(const KaxTagMultiEntityEmail & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiEntityEmail) -}; - -class MATROSKA_DLL_API KaxTagMultiIdentifier : public EbmlMaster { - public: - KaxTagMultiIdentifier(); - KaxTagMultiIdentifier(const KaxTagMultiIdentifier & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiIdentifier) -}; - -class MATROSKA_DLL_API KaxTagIdentifier : public EbmlMaster { - public: - KaxTagIdentifier(); - KaxTagIdentifier(const KaxTagIdentifier & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagIdentifier) -}; - -class MATROSKA_DLL_API KaxTagMultiIdentifierType : public EbmlUInteger { - public: - KaxTagMultiIdentifierType() {} - KaxTagMultiIdentifierType(const KaxTagMultiIdentifierType & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiIdentifierType) -}; - -class MATROSKA_DLL_API KaxTagMultiIdentifierBinary : public EbmlBinary { - public: - KaxTagMultiIdentifierBinary() {} - KaxTagMultiIdentifierBinary(const KaxTagMultiIdentifierBinary & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return true;} // we don't mind about what's inside - - EBML_CONCRETE_CLASS(KaxTagMultiIdentifierBinary) -}; - -class MATROSKA_DLL_API KaxTagMultiIdentifierString : public EbmlUnicodeString { - public: - KaxTagMultiIdentifierString() {} - KaxTagMultiIdentifierString(const KaxTagMultiIdentifierString & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiIdentifierString) -}; - -class MATROSKA_DLL_API KaxTagMultiLegal : public EbmlMaster { - public: - KaxTagMultiLegal(); - KaxTagMultiLegal(const KaxTagMultiLegal & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiLegal) -}; - -class MATROSKA_DLL_API KaxTagLegal : public EbmlMaster { - public: - KaxTagLegal(); - KaxTagLegal(const KaxTagLegal & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagLegal) -}; - -class MATROSKA_DLL_API KaxTagMultiLegalType : public EbmlUInteger { - public: - KaxTagMultiLegalType() {} - KaxTagMultiLegalType(const KaxTagMultiLegalType & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiLegalType) -}; - -class MATROSKA_DLL_API KaxTagMultiLegalContent : public EbmlUnicodeString { - public: - KaxTagMultiLegalContent() {} - KaxTagMultiLegalContent(const KaxTagMultiLegalContent & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiLegalContent) -}; - -class MATROSKA_DLL_API KaxTagMultiLegalURL : public EbmlString { - public: - KaxTagMultiLegalURL() {} - KaxTagMultiLegalURL(const KaxTagMultiLegalURL & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiLegalURL) -}; - -class MATROSKA_DLL_API KaxTagMultiLegalAddress : public EbmlUnicodeString { - public: - KaxTagMultiLegalAddress() {} - KaxTagMultiLegalAddress(const KaxTagMultiLegalAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiLegalAddress) -}; - -class MATROSKA_DLL_API KaxTagMultiTitle : public EbmlMaster { - public: - KaxTagMultiTitle(); - KaxTagMultiTitle(const KaxTagMultiTitle & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiTitle) -}; - -class MATROSKA_DLL_API KaxTagTitle : public EbmlMaster { - public: - KaxTagTitle(); - KaxTagTitle(const KaxTagTitle & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagTitle) -}; - -class MATROSKA_DLL_API KaxTagMultiTitleType : public EbmlUInteger { - public: - KaxTagMultiTitleType() {} - KaxTagMultiTitleType(const KaxTagMultiTitleType & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiTitleType) -}; - - -class MATROSKA_DLL_API KaxTagMultiTitleName : public EbmlUnicodeString { - public: - KaxTagMultiTitleName() {} - KaxTagMultiTitleName(const KaxTagMultiTitleName & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiTitleName) -}; - -class MATROSKA_DLL_API KaxTagMultiTitleSubTitle : public EbmlUnicodeString { - public: - KaxTagMultiTitleSubTitle() {} - KaxTagMultiTitleSubTitle(const KaxTagMultiTitleSubTitle & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiTitleSubTitle) -}; - -class MATROSKA_DLL_API KaxTagMultiTitleEdition : public EbmlUnicodeString { - public: - KaxTagMultiTitleEdition() {} - KaxTagMultiTitleEdition(const KaxTagMultiTitleEdition & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiTitleEdition) -}; - -class MATROSKA_DLL_API KaxTagMultiTitleAddress : public EbmlUnicodeString { - public: - KaxTagMultiTitleAddress() {} - KaxTagMultiTitleAddress(const KaxTagMultiTitleAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiTitleAddress) -}; - -class MATROSKA_DLL_API KaxTagMultiTitleURL : public EbmlString { - public: - KaxTagMultiTitleURL() {} - KaxTagMultiTitleURL(const KaxTagMultiTitleURL & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiTitleURL) -}; - -class MATROSKA_DLL_API KaxTagMultiTitleEmail : public EbmlString { - public: - KaxTagMultiTitleEmail() {} - KaxTagMultiTitleEmail(const KaxTagMultiTitleEmail & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiTitleEmail) -}; - -class MATROSKA_DLL_API KaxTagMultiTitleLanguage : public EbmlString { - public: - KaxTagMultiTitleLanguage() {} - KaxTagMultiTitleLanguage(const KaxTagMultiTitleLanguage & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiTitleLanguage) -}; - -class MATROSKA_DLL_API KaxTagMultiAttachment : public EbmlMaster { - public: - KaxTagMultiAttachment(); - KaxTagMultiAttachment(const KaxTagMultiAttachment & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagMultiAttachment) -}; - -class MATROSKA_DLL_API KaxTagAttachment : public EbmlMaster { - public: - KaxTagAttachment(); - KaxTagAttachment(const KaxTagAttachment & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagAttachment) -}; - -class MATROSKA_DLL_API KaxTagAttachmentID : public EbmlUInteger { - public: - KaxTagAttachmentID() {} - KaxTagAttachmentID(const KaxTagAttachmentID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTagAttachmentID) -}; - -#if 0 -class MATROSKA_DLL_API KaxTagBPM : public EbmlFloat { - public: - KaxTagBPM() :EbmlFloat() {} - - EBML_CONCRETE_CLASS(KaxTagBPM) -}; - -class MATROSKA_DLL_API KaxTagPopularimeter : public EbmlSInteger { - public: - KaxTagPopularimeter() {} - - EBML_CONCRETE_CLASS(KaxTagPopularimeter) -}; - -class MATROSKA_DLL_API KaxTagRating : public EbmlBinary { - public: - KaxTagRating() {} - bool ValidateSize() const {return true;} // we don't mind about what's inside - - EBML_CONCRETE_CLASS(KaxTagRating) -}; - -class MATROSKA_DLL_API KaxTagSetPart : public EbmlUInteger { - public: - KaxTagSetPart() {} - - EBML_CONCRETE_CLASS(KaxTagSetPart) -}; - -class MATROSKA_DLL_API KaxTagUserDefinedURL : public EbmlString { - public: - KaxTagUserDefinedURL() {} - - EBML_CONCRETE_CLASS(KaxTagUserDefinedURL) -}; - -class MATROSKA_DLL_API KaxTagVideoSecondaryGenre : public EbmlBinary { - public: - KaxTagVideoSecondaryGenre() {} - bool ValidateSize() const {return (Size >= 4);} - - EBML_CONCRETE_CLASS(KaxTagVideoSecondaryGenre) -}; - -class MATROSKA_DLL_API KaxWritingApp : public EbmlUnicodeString { - public: - KaxWritingApp() {} - - EBML_CONCRETE_CLASS(KaxWritingApp) -}; -#endif - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_TAGMULTI_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTagMulti.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $ + \author Jory Stone + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_TAGMULTI_H +#define LIBMATROSKA_TAGMULTI_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlDate.h" +#include "ebml/EbmlFloat.h" +#include "ebml/EbmlSInteger.h" +#include "ebml/EbmlUInteger.h" +#include "ebml/EbmlString.h" +#include "ebml/EbmlUnicodeString.h" +#include "ebml/EbmlBinary.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +enum KaxTagMultiCommercialTypes { + KaxTagMultiCommercialType_FilePurchase = 1, //Information on where to purchase this file. This is akin to the WPAY tag in ID3. + KaxTagMultiCommercialType_ItemPurchase, //Information on where to purchase this album. This is akin to the WCOM tag in ID3. + KaxTagMultiCommercialType_Owner //Information on the purchase that occurred for this file. This is akin to the OWNE tag in ID3. +}; +enum KaxTagMultiDateTypes { + KaxTagMultiDateType_EncodingDate = 1, //The time that the encoding of this item was completed. This is akin to the TDEN tag in ID3. + KaxTagMultiDateType_RecordingDate, //The time that the recording began, and finished. This is akin to the TDRC tag in ID3. + KaxTagMultiDateType_ReleaseDate, //The time that the item was originaly released. This is akin to the TDRL tag in ID3. + KaxTagMultiDateType_OriginalReleaseDate, //The time that the item was originaly released if it is a remake. This is akin to the TDOR tag in ID3. + KaxTagMultiDateType_TaggingDate, //The time that the tags were done for this item. This is akin to the TDTG tag in ID3. + KaxTagMultiDateType_DigitizingDate //The time that the item was tranfered to a digital medium. This is akin to the IDIT tag in RIFF +}; +enum KaxTagMultiEntitiesTypes { + KaxTagMultiEntitiesType_LyricistTextWriter = 1, //The person that wrote the words/script for this item. This is akin to the TEXT tag in ID3. + KaxTagMultiEntitiesType_Composer, //The name of the composer of this item. This is akin to the TCOM tag in ID3. + KaxTagMultiEntitiesType_LeadPerformerSoloist, //This is akin to the TPE1 tag in ID3. + KaxTagMultiEntitiesType_BandOrchestraAccompaniment, //This is akin to the TPE2 tag in ID3. + KaxTagMultiEntitiesType_OriginalLyricistTextWriter, //This is akin to the TOLY tag in ID3. + KaxTagMultiEntitiesType_OriginalArtistPerformer, //This is akin to the TOPE tag in ID3. + KaxTagMultiEntitiesType_OriginalAlbumMovieShowTitle, //This is akin to the TOAL tag in ID3. + KaxTagMultiEntitiesType_ConductorPerformerRefinement, //This is akin to the TPE3 tag in ID3. + KaxTagMultiEntitiesType_InterpretedRemixedBy, //This is akin to the TPE4 tag in ID3. + KaxTagMultiEntitiesType_Director, //This is akin to the IART tag in RIFF + KaxTagMultiEntitiesType_ProducedBy, //This is akin to the IPRO tag in Extended RIFF + KaxTagMultiEntitiesType_Cinematographer, //This is akin to the ICNM tag in Extended RIFF + KaxTagMultiEntitiesType_ProductionDesigner, //This is akin to the IPDS tag in Extended RIFF + KaxTagMultiEntitiesType_CostumeDesigner, //This is akin to the ICDS tag in Extended RIFF + KaxTagMultiEntitiesType_ProductionStudio, //This is akin to the ISTD tag in Extended RIFF + KaxTagMultiEntitiesType_DistributedBy, //This is akin to the IDST tag in Extended RIFF + KaxTagMultiEntitiesType_CommissionedBy, //This is akin to the ICMS tag in RIFF + KaxTagMultiEntitiesType_Engineer, //This is akin to the IENG tag in RIFF + KaxTagMultiEntitiesType_EditedBy, //This is akin to the IEDT tag in Extended RIFF + KaxTagMultiEntitiesType_EncodedBy, //This is akin to the TENC tag in ID3. + KaxTagMultiEntitiesType_RippedBy, //This is akin to the IRIP tag in Extended RIFF + KaxTagMultiEntitiesType_InvolvedPeopleList, //A very general tag for everyone else that wants to be listed. This is akin to the TMCL tag in ID3. + KaxTagMultiEntitiesType_InternetRadioStationName, //This is akin to the TSRN tag in ID3. + KaxTagMultiEntitiesType_Publisher //This is akin to the TPUB tag in ID3. +}; + +enum KaxTagMultiIdentifierTypes { + KaxTagMultiIdentifierType_ISRC = 1, //String, The International Standard Recording Code + KaxTagMultiIdentifierType_CDIdentifier, //Binary, This is a binary dump of the TOC of the CDROM that this item was taken from. This holds the same information as the MCDI in ID3. + KaxTagMultiIdentifierType_ISBN, //String, International Standard Book Number + KaxTagMultiIdentifierType_Catalog, //String, sometimes the EAN/UPC, often some letters followed by some numbers + KaxTagMultiIdentifierType_EAN, //String, EAN-13 bar code identifier + KaxTagMultiIdentifierType_UPC, //String, UPC-A bar code identifier + KaxTagMultiIdentifierType_LabelCode, //String, Typically printed as ________ (LC) xxxx) ~~~~~~~~ or _________ (LC) 0xxxx) ~~~~~~~~~ on CDs medias or covers, where xxxx is a 4-digit number. + KaxTagMultiIdentifierType_LCCN, //String, Library of Congress Control Number + KaxTagMultiIdentifierType_UniqueFileIdentifier, //Binary, This used for a dump of the UFID field in ID3. This field would only be used if the item was pulled from an MP3. + CDROM_CD_TEXT_PACK_TOC_INFO2 //Binary +}; + +enum KaxTagMultiLegalTypes { + KaxTagMultiLegalType_Copyright = 1, //The copyright information as per the copyright holder. This is akin to the TCOP tag in ID3. + KaxTagMultiLegalType_ProductionCopyright, //The copyright information as per the production copyright holder. This is akin to the TPRO tag in ID3. + KaxTagMultiLegalType_TermsOfUse //The terms of use for this item. This is akin to the USER tag in ID3. +}; + +enum KaxTagMultiTitleTypes { + KaxTagMultiTitleType_TrackTitle = 1, + //The title of this item. In the case of a track, the Name element should be identical to the Name element. + //For example, for music you might label this "Canon in D", or for video's audio track you might use "English 5.1" This is akin to the TIT2 tag in ID3. + KaxTagMultiTitleType_AlbumMovieShowTitle, + //This is the name given to a grouping of tracks and/or chapters. + //For example, all video, audio, and subtitle tracks for a movie would be grouped under this and be given the name of the movie. + //All tracks for a particular CD would be grouped together under the title of the CD, or if all tracks for a CD were recorded as a single track, seperated by chapters, the same would apply. + //You could use this to label episode 3 of The Simpsons. This is akin to the TALB tag in ID3. + KaxTagMultiTitleType_SetTitle, //This would be used to label a set of ID 2. For example, season 13 of The Simpsons. + KaxTagMultiTitleType_Series //This would be used to label a set of ID 3. For example, The Simpsons. +}; + +class MATROSKA_DLL_API KaxTagMultiComment : public EbmlMaster { + public: + KaxTagMultiComment(); + KaxTagMultiComment(const KaxTagMultiComment & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiComment) +}; + +class MATROSKA_DLL_API KaxTagMultiCommentName : public EbmlString { + public: + KaxTagMultiCommentName() {} + KaxTagMultiCommentName(const KaxTagMultiCommentName & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiCommentName) +}; + +class MATROSKA_DLL_API KaxTagMultiCommentComments : public EbmlUnicodeString { + public: + KaxTagMultiCommentComments() {} + KaxTagMultiCommentComments(const KaxTagMultiCommentComments & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiCommentComments) +}; + +class MATROSKA_DLL_API KaxTagMultiCommentLanguage : public EbmlString { + public: + KaxTagMultiCommentLanguage() {} + KaxTagMultiCommentLanguage(const KaxTagMultiCommentLanguage & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiCommentLanguage) +}; + +class MATROSKA_DLL_API KaxTagMultiCommercial : public EbmlMaster { + public: + KaxTagMultiCommercial(); + KaxTagMultiCommercial(const KaxTagMultiCommercial & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiCommercial) +}; + +class MATROSKA_DLL_API KaxTagCommercial : public EbmlMaster { + public: + KaxTagCommercial(); + KaxTagCommercial(const KaxTagCommercial & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagCommercial) +}; + +class MATROSKA_DLL_API KaxTagMultiCommercialType : public EbmlUInteger { + public: + KaxTagMultiCommercialType() {} + KaxTagMultiCommercialType(const KaxTagMultiCommercialType & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiCommercialType) +}; + +class MATROSKA_DLL_API KaxTagMultiCommercialAddress : public EbmlUnicodeString { + public: + KaxTagMultiCommercialAddress() {} + KaxTagMultiCommercialAddress(const KaxTagMultiCommercialAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiCommercialAddress) +}; + +class MATROSKA_DLL_API KaxTagMultiCommercialURL : public EbmlString { + public: + KaxTagMultiCommercialURL() {} + KaxTagMultiCommercialURL(const KaxTagMultiCommercialURL & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiCommercialURL) +}; + +class MATROSKA_DLL_API KaxTagMultiCommercialEmail : public EbmlString { + public: + KaxTagMultiCommercialEmail() {} + KaxTagMultiCommercialEmail(const KaxTagMultiCommercialEmail & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiCommercialEmail) +}; + +class MATROSKA_DLL_API KaxTagMultiPrice : public EbmlMaster { + public: + KaxTagMultiPrice(); + KaxTagMultiPrice(const KaxTagMultiPrice & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiPrice) +}; + +class MATROSKA_DLL_API KaxTagMultiPriceCurrency : public EbmlString { + public: + KaxTagMultiPriceCurrency() {} + KaxTagMultiPriceCurrency(const KaxTagMultiPriceCurrency & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiPriceCurrency) +}; + +class MATROSKA_DLL_API KaxTagMultiPriceAmount : public EbmlFloat { + public: + KaxTagMultiPriceAmount() :EbmlFloat() {} + KaxTagMultiPriceAmount(const KaxTagMultiPriceAmount & ElementToClone) :EbmlFloat(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiPriceAmount) +}; + +class MATROSKA_DLL_API KaxTagMultiPricePriceDate : public EbmlDate { + public: + KaxTagMultiPricePriceDate() :EbmlDate() {} + KaxTagMultiPricePriceDate(const KaxTagMultiPricePriceDate & ElementToClone) :EbmlDate(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiPricePriceDate) +}; + +class MATROSKA_DLL_API KaxTagMultiDate : public EbmlMaster { + public: + KaxTagMultiDate(); + KaxTagMultiDate(const KaxTagMultiDate & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiDate) +}; + +class MATROSKA_DLL_API KaxTagDate : public EbmlMaster { + public: + KaxTagDate(); + KaxTagDate(const KaxTagDate & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagDate) +}; + +class MATROSKA_DLL_API KaxTagMultiDateType : public EbmlUInteger { + public: + KaxTagMultiDateType() {} + KaxTagMultiDateType(const KaxTagMultiDateType & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiDateType) +}; + +class MATROSKA_DLL_API KaxTagMultiDateDateBegin : public EbmlDate { + public: + KaxTagMultiDateDateBegin() :EbmlDate() {} + KaxTagMultiDateDateBegin(const KaxTagMultiDateDateBegin & ElementToClone) :EbmlDate(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiDateDateBegin) +}; + +class MATROSKA_DLL_API KaxTagMultiDateDateEnd : public EbmlDate { + public: + KaxTagMultiDateDateEnd() :EbmlDate() {} + KaxTagMultiDateDateEnd(const KaxTagMultiDateDateEnd & ElementToClone) :EbmlDate(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiDateDateEnd) +}; + +class MATROSKA_DLL_API KaxTagMultiEntity : public EbmlMaster { + public: + KaxTagMultiEntity(); + KaxTagMultiEntity(const KaxTagMultiEntity & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiEntity) +}; + +class MATROSKA_DLL_API KaxTagEntity : public EbmlMaster { + public: + KaxTagEntity(); + KaxTagEntity(const KaxTagEntity & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagEntity) +}; + +class MATROSKA_DLL_API KaxTagMultiEntityType : public EbmlUInteger { + public: + KaxTagMultiEntityType() {} + KaxTagMultiEntityType(const KaxTagMultiEntityType & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiEntityType) +}; + +class MATROSKA_DLL_API KaxTagMultiEntityName : public EbmlUnicodeString { + public: + KaxTagMultiEntityName() {} + KaxTagMultiEntityName(const KaxTagMultiEntityName & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiEntityName) +}; + +class MATROSKA_DLL_API KaxTagMultiEntityAddress : public EbmlUnicodeString { + public: + KaxTagMultiEntityAddress() {} + KaxTagMultiEntityAddress(const KaxTagMultiEntityAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiEntityAddress) +}; + +class MATROSKA_DLL_API KaxTagMultiEntityURL : public EbmlString { + public: + KaxTagMultiEntityURL() {} + KaxTagMultiEntityURL(const KaxTagMultiEntityURL & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiEntityURL) +}; + +class MATROSKA_DLL_API KaxTagMultiEntityEmail : public EbmlString { + public: + KaxTagMultiEntityEmail() {} + KaxTagMultiEntityEmail(const KaxTagMultiEntityEmail & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiEntityEmail) +}; + +class MATROSKA_DLL_API KaxTagMultiIdentifier : public EbmlMaster { + public: + KaxTagMultiIdentifier(); + KaxTagMultiIdentifier(const KaxTagMultiIdentifier & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiIdentifier) +}; + +class MATROSKA_DLL_API KaxTagIdentifier : public EbmlMaster { + public: + KaxTagIdentifier(); + KaxTagIdentifier(const KaxTagIdentifier & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagIdentifier) +}; + +class MATROSKA_DLL_API KaxTagMultiIdentifierType : public EbmlUInteger { + public: + KaxTagMultiIdentifierType() {} + KaxTagMultiIdentifierType(const KaxTagMultiIdentifierType & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiIdentifierType) +}; + +class MATROSKA_DLL_API KaxTagMultiIdentifierBinary : public EbmlBinary { + public: + KaxTagMultiIdentifierBinary() {} + KaxTagMultiIdentifierBinary(const KaxTagMultiIdentifierBinary & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return true;} // we don't mind about what's inside + + EBML_CONCRETE_CLASS(KaxTagMultiIdentifierBinary) +}; + +class MATROSKA_DLL_API KaxTagMultiIdentifierString : public EbmlUnicodeString { + public: + KaxTagMultiIdentifierString() {} + KaxTagMultiIdentifierString(const KaxTagMultiIdentifierString & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiIdentifierString) +}; + +class MATROSKA_DLL_API KaxTagMultiLegal : public EbmlMaster { + public: + KaxTagMultiLegal(); + KaxTagMultiLegal(const KaxTagMultiLegal & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiLegal) +}; + +class MATROSKA_DLL_API KaxTagLegal : public EbmlMaster { + public: + KaxTagLegal(); + KaxTagLegal(const KaxTagLegal & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagLegal) +}; + +class MATROSKA_DLL_API KaxTagMultiLegalType : public EbmlUInteger { + public: + KaxTagMultiLegalType() {} + KaxTagMultiLegalType(const KaxTagMultiLegalType & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiLegalType) +}; + +class MATROSKA_DLL_API KaxTagMultiLegalContent : public EbmlUnicodeString { + public: + KaxTagMultiLegalContent() {} + KaxTagMultiLegalContent(const KaxTagMultiLegalContent & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiLegalContent) +}; + +class MATROSKA_DLL_API KaxTagMultiLegalURL : public EbmlString { + public: + KaxTagMultiLegalURL() {} + KaxTagMultiLegalURL(const KaxTagMultiLegalURL & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiLegalURL) +}; + +class MATROSKA_DLL_API KaxTagMultiLegalAddress : public EbmlUnicodeString { + public: + KaxTagMultiLegalAddress() {} + KaxTagMultiLegalAddress(const KaxTagMultiLegalAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiLegalAddress) +}; + +class MATROSKA_DLL_API KaxTagMultiTitle : public EbmlMaster { + public: + KaxTagMultiTitle(); + KaxTagMultiTitle(const KaxTagMultiTitle & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiTitle) +}; + +class MATROSKA_DLL_API KaxTagTitle : public EbmlMaster { + public: + KaxTagTitle(); + KaxTagTitle(const KaxTagTitle & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagTitle) +}; + +class MATROSKA_DLL_API KaxTagMultiTitleType : public EbmlUInteger { + public: + KaxTagMultiTitleType() {} + KaxTagMultiTitleType(const KaxTagMultiTitleType & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiTitleType) +}; + + +class MATROSKA_DLL_API KaxTagMultiTitleName : public EbmlUnicodeString { + public: + KaxTagMultiTitleName() {} + KaxTagMultiTitleName(const KaxTagMultiTitleName & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiTitleName) +}; + +class MATROSKA_DLL_API KaxTagMultiTitleSubTitle : public EbmlUnicodeString { + public: + KaxTagMultiTitleSubTitle() {} + KaxTagMultiTitleSubTitle(const KaxTagMultiTitleSubTitle & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiTitleSubTitle) +}; + +class MATROSKA_DLL_API KaxTagMultiTitleEdition : public EbmlUnicodeString { + public: + KaxTagMultiTitleEdition() {} + KaxTagMultiTitleEdition(const KaxTagMultiTitleEdition & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiTitleEdition) +}; + +class MATROSKA_DLL_API KaxTagMultiTitleAddress : public EbmlUnicodeString { + public: + KaxTagMultiTitleAddress() {} + KaxTagMultiTitleAddress(const KaxTagMultiTitleAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiTitleAddress) +}; + +class MATROSKA_DLL_API KaxTagMultiTitleURL : public EbmlString { + public: + KaxTagMultiTitleURL() {} + KaxTagMultiTitleURL(const KaxTagMultiTitleURL & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiTitleURL) +}; + +class MATROSKA_DLL_API KaxTagMultiTitleEmail : public EbmlString { + public: + KaxTagMultiTitleEmail() {} + KaxTagMultiTitleEmail(const KaxTagMultiTitleEmail & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiTitleEmail) +}; + +class MATROSKA_DLL_API KaxTagMultiTitleLanguage : public EbmlString { + public: + KaxTagMultiTitleLanguage() {} + KaxTagMultiTitleLanguage(const KaxTagMultiTitleLanguage & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiTitleLanguage) +}; + +class MATROSKA_DLL_API KaxTagMultiAttachment : public EbmlMaster { + public: + KaxTagMultiAttachment(); + KaxTagMultiAttachment(const KaxTagMultiAttachment & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagMultiAttachment) +}; + +class MATROSKA_DLL_API KaxTagAttachment : public EbmlMaster { + public: + KaxTagAttachment(); + KaxTagAttachment(const KaxTagAttachment & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagAttachment) +}; + +class MATROSKA_DLL_API KaxTagAttachmentID : public EbmlUInteger { + public: + KaxTagAttachmentID() {} + KaxTagAttachmentID(const KaxTagAttachmentID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTagAttachmentID) +}; + +#if 0 +class MATROSKA_DLL_API KaxTagBPM : public EbmlFloat { + public: + KaxTagBPM() :EbmlFloat() {} + + EBML_CONCRETE_CLASS(KaxTagBPM) +}; + +class MATROSKA_DLL_API KaxTagPopularimeter : public EbmlSInteger { + public: + KaxTagPopularimeter() {} + + EBML_CONCRETE_CLASS(KaxTagPopularimeter) +}; + +class MATROSKA_DLL_API KaxTagRating : public EbmlBinary { + public: + KaxTagRating() {} + bool ValidateSize() const {return true;} // we don't mind about what's inside + + EBML_CONCRETE_CLASS(KaxTagRating) +}; + +class MATROSKA_DLL_API KaxTagSetPart : public EbmlUInteger { + public: + KaxTagSetPart() {} + + EBML_CONCRETE_CLASS(KaxTagSetPart) +}; + +class MATROSKA_DLL_API KaxTagUserDefinedURL : public EbmlString { + public: + KaxTagUserDefinedURL() {} + + EBML_CONCRETE_CLASS(KaxTagUserDefinedURL) +}; + +class MATROSKA_DLL_API KaxTagVideoSecondaryGenre : public EbmlBinary { + public: + KaxTagVideoSecondaryGenre() {} + bool ValidateSize() const {return (Size >= 4);} + + EBML_CONCRETE_CLASS(KaxTagVideoSecondaryGenre) +}; + +class MATROSKA_DLL_API KaxWritingApp : public EbmlUnicodeString { + public: + KaxWritingApp() {} + + EBML_CONCRETE_CLASS(KaxWritingApp) +}; +#endif + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_TAGMULTI_H diff --git a/matroska/KaxTags.h b/matroska/KaxTags.h index 87acaae..1801ba0 100644 --- a/matroska/KaxTags.h +++ b/matroska/KaxTags.h @@ -1,55 +1,55 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTags.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_TAGS_H -#define LIBMATROSKA_TAGS_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxTags : public EbmlMaster { - public: - KaxTags(); - KaxTags(const KaxTags & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTags) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_TAGS_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTags.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_TAGS_H +#define LIBMATROSKA_TAGS_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxTags : public EbmlMaster { + public: + KaxTags(); + KaxTags(const KaxTags & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTags) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_TAGS_H diff --git a/matroska/KaxTrackAudio.h b/matroska/KaxTrackAudio.h index 7c02a1f..e2ace45 100644 --- a/matroska/KaxTrackAudio.h +++ b/matroska/KaxTrackAudio.h @@ -1,101 +1,101 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTrackAudio.h,v 1.11 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_TRACK_AUDIO_H -#define LIBMATROSKA_TRACK_AUDIO_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlFloat.h" -#include "ebml/EbmlUInteger.h" -#include "ebml/EbmlBinary.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxTrackAudio : public EbmlMaster { - public: - KaxTrackAudio(); - KaxTrackAudio(const KaxTrackAudio & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackAudio) -}; - -class MATROSKA_DLL_API KaxAudioSamplingFreq : public EbmlFloat { - public: - KaxAudioSamplingFreq() :EbmlFloat(8000.0) {} - KaxAudioSamplingFreq(const KaxAudioSamplingFreq & ElementToClone) :EbmlFloat(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxAudioSamplingFreq) -}; - -class MATROSKA_DLL_API KaxAudioOutputSamplingFreq : public EbmlFloat { - public: - KaxAudioOutputSamplingFreq() :EbmlFloat() {} - KaxAudioOutputSamplingFreq(const KaxAudioOutputSamplingFreq & ElementToClone) :EbmlFloat(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxAudioOutputSamplingFreq) -}; - -class MATROSKA_DLL_API KaxAudioChannels : public EbmlUInteger { - public: - KaxAudioChannels() :EbmlUInteger(1) {} - KaxAudioChannels(const KaxAudioChannels & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxAudioChannels) -}; - -#if MATROSKA_VERSION >= 2 -class MATROSKA_DLL_API KaxAudioPosition : public EbmlBinary { - public: - KaxAudioPosition() {} - KaxAudioPosition(const KaxAudioPosition & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize(void) const {return true;} - - EBML_CONCRETE_CLASS(KaxAudioPosition) -}; -#endif // MATROSKA_VERSION - -class MATROSKA_DLL_API KaxAudioBitDepth : public EbmlUInteger { - public: - KaxAudioBitDepth() {} - KaxAudioBitDepth(const KaxAudioBitDepth & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxAudioBitDepth) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_TRACK_AUDIO_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTrackAudio.h,v 1.11 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_TRACK_AUDIO_H +#define LIBMATROSKA_TRACK_AUDIO_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlFloat.h" +#include "ebml/EbmlUInteger.h" +#include "ebml/EbmlBinary.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxTrackAudio : public EbmlMaster { + public: + KaxTrackAudio(); + KaxTrackAudio(const KaxTrackAudio & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackAudio) +}; + +class MATROSKA_DLL_API KaxAudioSamplingFreq : public EbmlFloat { + public: + KaxAudioSamplingFreq() :EbmlFloat(8000.0) {} + KaxAudioSamplingFreq(const KaxAudioSamplingFreq & ElementToClone) :EbmlFloat(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxAudioSamplingFreq) +}; + +class MATROSKA_DLL_API KaxAudioOutputSamplingFreq : public EbmlFloat { + public: + KaxAudioOutputSamplingFreq() :EbmlFloat() {} + KaxAudioOutputSamplingFreq(const KaxAudioOutputSamplingFreq & ElementToClone) :EbmlFloat(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxAudioOutputSamplingFreq) +}; + +class MATROSKA_DLL_API KaxAudioChannels : public EbmlUInteger { + public: + KaxAudioChannels() :EbmlUInteger(1) {} + KaxAudioChannels(const KaxAudioChannels & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxAudioChannels) +}; + +#if MATROSKA_VERSION >= 2 +class MATROSKA_DLL_API KaxAudioPosition : public EbmlBinary { + public: + KaxAudioPosition() {} + KaxAudioPosition(const KaxAudioPosition & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize(void) const {return true;} + + EBML_CONCRETE_CLASS(KaxAudioPosition) +}; +#endif // MATROSKA_VERSION + +class MATROSKA_DLL_API KaxAudioBitDepth : public EbmlUInteger { + public: + KaxAudioBitDepth() {} + KaxAudioBitDepth(const KaxAudioBitDepth & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxAudioBitDepth) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_TRACK_AUDIO_H diff --git a/matroska/KaxTrackEntryData.h b/matroska/KaxTrackEntryData.h index 155fa0e..53c22df 100644 --- a/matroska/KaxTrackEntryData.h +++ b/matroska/KaxTrackEntryData.h @@ -1,276 +1,276 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTrackEntryData.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme - \author John Cannon -*/ -#ifndef LIBMATROSKA_TRACK_ENTRY_DATA_H -#define LIBMATROSKA_TRACK_ENTRY_DATA_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlUInteger.h" -#include "ebml/EbmlFloat.h" -#include "ebml/EbmlString.h" -#include "ebml/EbmlUnicodeString.h" -#include "ebml/EbmlBinary.h" -#include "ebml/EbmlMaster.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxTrackNumber : public EbmlUInteger { - public: - KaxTrackNumber() {} - KaxTrackNumber(const KaxTrackNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackNumber) -}; - -class MATROSKA_DLL_API KaxTrackUID : public EbmlUInteger { - public: - KaxTrackUID() {} - KaxTrackUID(const KaxTrackUID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackUID) -}; - -class MATROSKA_DLL_API KaxTrackType : public EbmlUInteger { - public: - KaxTrackType() {} - KaxTrackType(const KaxTrackType & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackType) -}; - -#if MATROSKA_VERSION >= 2 -class MATROSKA_DLL_API KaxTrackFlagEnabled : public EbmlUInteger { - public: - KaxTrackFlagEnabled() :EbmlUInteger(1) {} - KaxTrackFlagEnabled(const KaxTrackFlagEnabled & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackFlagEnabled) -}; -#endif // MATROSKA_VERSION - -class MATROSKA_DLL_API KaxTrackFlagDefault : public EbmlUInteger { - public: - KaxTrackFlagDefault() :EbmlUInteger(1) {} - KaxTrackFlagDefault(const KaxTrackFlagDefault & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackFlagDefault) -}; - -class MATROSKA_DLL_API KaxTrackFlagForced : public EbmlUInteger { - public: - KaxTrackFlagForced() :EbmlUInteger(0) {} - KaxTrackFlagForced(const KaxTrackFlagForced & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackFlagForced) -}; - -class MATROSKA_DLL_API KaxTrackFlagLacing : public EbmlUInteger { - public: - KaxTrackFlagLacing() :EbmlUInteger(1) {} - KaxTrackFlagLacing(const KaxTrackFlagLacing & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackFlagLacing) -}; - -class MATROSKA_DLL_API KaxTrackMinCache : public EbmlUInteger { - public: - KaxTrackMinCache() :EbmlUInteger(0) {} - KaxTrackMinCache(const KaxTrackMinCache & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackMinCache) -}; - -class MATROSKA_DLL_API KaxTrackMaxCache : public EbmlUInteger { - public: - KaxTrackMaxCache() {} - KaxTrackMaxCache(const KaxTrackMaxCache & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackMaxCache) -}; - -class MATROSKA_DLL_API KaxTrackDefaultDuration : public EbmlUInteger { - public: - KaxTrackDefaultDuration() {} - KaxTrackDefaultDuration(const KaxTrackDefaultDuration & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackDefaultDuration) -}; - -class MATROSKA_DLL_API KaxTrackTimecodeScale : public EbmlFloat { - public: - KaxTrackTimecodeScale() :EbmlFloat(1.0) {} - KaxTrackTimecodeScale(const KaxTrackTimecodeScale & ElementToClone) :EbmlFloat(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackTimecodeScale) -}; - -class MATROSKA_DLL_API KaxMaxBlockAdditionID : public EbmlUInteger { - public: - KaxMaxBlockAdditionID() :EbmlUInteger(0) {} - KaxMaxBlockAdditionID(const KaxMaxBlockAdditionID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxMaxBlockAdditionID) -}; - -class MATROSKA_DLL_API KaxTrackName : public EbmlUnicodeString { - public: - KaxTrackName() {} - KaxTrackName(const KaxTrackName & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackName) -}; - -class MATROSKA_DLL_API KaxTrackLanguage : public EbmlString { - public: - KaxTrackLanguage() :EbmlString("eng") {} - KaxTrackLanguage(const KaxTrackLanguage & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackLanguage) -}; - -class MATROSKA_DLL_API KaxCodecID : public EbmlString { - public: - KaxCodecID() {} - KaxCodecID(const KaxCodecID & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCodecID) -}; - -class MATROSKA_DLL_API KaxCodecPrivate : public EbmlBinary { - public: - KaxCodecPrivate() {} - KaxCodecPrivate(const KaxCodecPrivate & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return true;} // we don't mind about what's inside - - EBML_CONCRETE_CLASS(KaxCodecPrivate) -}; - -class MATROSKA_DLL_API KaxCodecName : public EbmlUnicodeString { - public: - KaxCodecName() {} - KaxCodecName(const KaxCodecName & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCodecName) -}; - -class MATROSKA_DLL_API KaxTrackAttachmentLink : public EbmlBinary { - public: - KaxTrackAttachmentLink() {} - KaxTrackAttachmentLink(const KaxTrackAttachmentLink & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const {return true;} // we don't mind about what's inside - - EBML_CONCRETE_CLASS(KaxTrackAttachmentLink) -}; - -class MATROSKA_DLL_API KaxTrackOverlay : public EbmlUInteger { - public: - KaxTrackOverlay() {} - KaxTrackOverlay(const KaxTrackOverlay & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackOverlay) -}; - -class MATROSKA_DLL_API KaxTrackTranslate : public EbmlMaster { - public: - KaxTrackTranslate(); - KaxTrackTranslate(const KaxTrackTranslate & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackTranslate) -}; - -class MATROSKA_DLL_API KaxTrackTranslateCodec : public EbmlUInteger { - public: - KaxTrackTranslateCodec() {} - KaxTrackTranslateCodec(const KaxTrackTranslateCodec & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackTranslateCodec) -}; - -class MATROSKA_DLL_API KaxTrackTranslateEditionUID : public EbmlUInteger { - public: - KaxTrackTranslateEditionUID() {} - KaxTrackTranslateEditionUID(const KaxTrackTranslateEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackTranslateEditionUID) -}; - -class MATROSKA_DLL_API KaxTrackTranslateTrackID : public EbmlBinary { - public: - KaxTrackTranslateTrackID() {} - KaxTrackTranslateTrackID(const KaxTrackTranslateTrackID & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize() const { return true;} - - EBML_CONCRETE_CLASS(KaxTrackTranslateTrackID) -}; - -#if MATROSKA_VERSION >= 2 -class MATROSKA_DLL_API KaxCodecSettings : public EbmlUnicodeString { - public: - KaxCodecSettings() {} - KaxCodecSettings(const KaxCodecSettings & ElementToClone) :EbmlUnicodeString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCodecSettings) -}; - -class MATROSKA_DLL_API KaxCodecInfoURL : public EbmlString { - public: - KaxCodecInfoURL() {} - KaxCodecInfoURL(const KaxCodecInfoURL & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCodecInfoURL) -}; - -class MATROSKA_DLL_API KaxCodecDownloadURL : public EbmlString { - public: - KaxCodecDownloadURL() {} - KaxCodecDownloadURL(const KaxCodecDownloadURL & ElementToClone) :EbmlString(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCodecDownloadURL) -}; - -class MATROSKA_DLL_API KaxCodecDecodeAll : public EbmlUInteger { - public: - KaxCodecDecodeAll() :EbmlUInteger(1) {} - KaxCodecDecodeAll(const KaxCodecDecodeAll & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxCodecDecodeAll) -}; -#endif // MATROSKA_VERSION - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_TRACK_ENTRY_DATA_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTrackEntryData.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme + \author John Cannon +*/ +#ifndef LIBMATROSKA_TRACK_ENTRY_DATA_H +#define LIBMATROSKA_TRACK_ENTRY_DATA_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlUInteger.h" +#include "ebml/EbmlFloat.h" +#include "ebml/EbmlString.h" +#include "ebml/EbmlUnicodeString.h" +#include "ebml/EbmlBinary.h" +#include "ebml/EbmlMaster.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxTrackNumber : public EbmlUInteger { + public: + KaxTrackNumber() {} + KaxTrackNumber(const KaxTrackNumber & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackNumber) +}; + +class MATROSKA_DLL_API KaxTrackUID : public EbmlUInteger { + public: + KaxTrackUID() {} + KaxTrackUID(const KaxTrackUID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackUID) +}; + +class MATROSKA_DLL_API KaxTrackType : public EbmlUInteger { + public: + KaxTrackType() {} + KaxTrackType(const KaxTrackType & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackType) +}; + +#if MATROSKA_VERSION >= 2 +class MATROSKA_DLL_API KaxTrackFlagEnabled : public EbmlUInteger { + public: + KaxTrackFlagEnabled() :EbmlUInteger(1) {} + KaxTrackFlagEnabled(const KaxTrackFlagEnabled & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackFlagEnabled) +}; +#endif // MATROSKA_VERSION + +class MATROSKA_DLL_API KaxTrackFlagDefault : public EbmlUInteger { + public: + KaxTrackFlagDefault() :EbmlUInteger(1) {} + KaxTrackFlagDefault(const KaxTrackFlagDefault & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackFlagDefault) +}; + +class MATROSKA_DLL_API KaxTrackFlagForced : public EbmlUInteger { + public: + KaxTrackFlagForced() :EbmlUInteger(0) {} + KaxTrackFlagForced(const KaxTrackFlagForced & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackFlagForced) +}; + +class MATROSKA_DLL_API KaxTrackFlagLacing : public EbmlUInteger { + public: + KaxTrackFlagLacing() :EbmlUInteger(1) {} + KaxTrackFlagLacing(const KaxTrackFlagLacing & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackFlagLacing) +}; + +class MATROSKA_DLL_API KaxTrackMinCache : public EbmlUInteger { + public: + KaxTrackMinCache() :EbmlUInteger(0) {} + KaxTrackMinCache(const KaxTrackMinCache & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackMinCache) +}; + +class MATROSKA_DLL_API KaxTrackMaxCache : public EbmlUInteger { + public: + KaxTrackMaxCache() {} + KaxTrackMaxCache(const KaxTrackMaxCache & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackMaxCache) +}; + +class MATROSKA_DLL_API KaxTrackDefaultDuration : public EbmlUInteger { + public: + KaxTrackDefaultDuration() {} + KaxTrackDefaultDuration(const KaxTrackDefaultDuration & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackDefaultDuration) +}; + +class MATROSKA_DLL_API KaxTrackTimecodeScale : public EbmlFloat { + public: + KaxTrackTimecodeScale() :EbmlFloat(1.0) {} + KaxTrackTimecodeScale(const KaxTrackTimecodeScale & ElementToClone) :EbmlFloat(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackTimecodeScale) +}; + +class MATROSKA_DLL_API KaxMaxBlockAdditionID : public EbmlUInteger { + public: + KaxMaxBlockAdditionID() :EbmlUInteger(0) {} + KaxMaxBlockAdditionID(const KaxMaxBlockAdditionID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxMaxBlockAdditionID) +}; + +class MATROSKA_DLL_API KaxTrackName : public EbmlUnicodeString { + public: + KaxTrackName() {} + KaxTrackName(const KaxTrackName & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackName) +}; + +class MATROSKA_DLL_API KaxTrackLanguage : public EbmlString { + public: + KaxTrackLanguage() :EbmlString("eng") {} + KaxTrackLanguage(const KaxTrackLanguage & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackLanguage) +}; + +class MATROSKA_DLL_API KaxCodecID : public EbmlString { + public: + KaxCodecID() {} + KaxCodecID(const KaxCodecID & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCodecID) +}; + +class MATROSKA_DLL_API KaxCodecPrivate : public EbmlBinary { + public: + KaxCodecPrivate() {} + KaxCodecPrivate(const KaxCodecPrivate & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return true;} // we don't mind about what's inside + + EBML_CONCRETE_CLASS(KaxCodecPrivate) +}; + +class MATROSKA_DLL_API KaxCodecName : public EbmlUnicodeString { + public: + KaxCodecName() {} + KaxCodecName(const KaxCodecName & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCodecName) +}; + +class MATROSKA_DLL_API KaxTrackAttachmentLink : public EbmlBinary { + public: + KaxTrackAttachmentLink() {} + KaxTrackAttachmentLink(const KaxTrackAttachmentLink & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const {return true;} // we don't mind about what's inside + + EBML_CONCRETE_CLASS(KaxTrackAttachmentLink) +}; + +class MATROSKA_DLL_API KaxTrackOverlay : public EbmlUInteger { + public: + KaxTrackOverlay() {} + KaxTrackOverlay(const KaxTrackOverlay & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackOverlay) +}; + +class MATROSKA_DLL_API KaxTrackTranslate : public EbmlMaster { + public: + KaxTrackTranslate(); + KaxTrackTranslate(const KaxTrackTranslate & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackTranslate) +}; + +class MATROSKA_DLL_API KaxTrackTranslateCodec : public EbmlUInteger { + public: + KaxTrackTranslateCodec() {} + KaxTrackTranslateCodec(const KaxTrackTranslateCodec & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackTranslateCodec) +}; + +class MATROSKA_DLL_API KaxTrackTranslateEditionUID : public EbmlUInteger { + public: + KaxTrackTranslateEditionUID() {} + KaxTrackTranslateEditionUID(const KaxTrackTranslateEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackTranslateEditionUID) +}; + +class MATROSKA_DLL_API KaxTrackTranslateTrackID : public EbmlBinary { + public: + KaxTrackTranslateTrackID() {} + KaxTrackTranslateTrackID(const KaxTrackTranslateTrackID & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize() const { return true;} + + EBML_CONCRETE_CLASS(KaxTrackTranslateTrackID) +}; + +#if MATROSKA_VERSION >= 2 +class MATROSKA_DLL_API KaxCodecSettings : public EbmlUnicodeString { + public: + KaxCodecSettings() {} + KaxCodecSettings(const KaxCodecSettings & ElementToClone) :EbmlUnicodeString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCodecSettings) +}; + +class MATROSKA_DLL_API KaxCodecInfoURL : public EbmlString { + public: + KaxCodecInfoURL() {} + KaxCodecInfoURL(const KaxCodecInfoURL & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCodecInfoURL) +}; + +class MATROSKA_DLL_API KaxCodecDownloadURL : public EbmlString { + public: + KaxCodecDownloadURL() {} + KaxCodecDownloadURL(const KaxCodecDownloadURL & ElementToClone) :EbmlString(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCodecDownloadURL) +}; + +class MATROSKA_DLL_API KaxCodecDecodeAll : public EbmlUInteger { + public: + KaxCodecDecodeAll() :EbmlUInteger(1) {} + KaxCodecDecodeAll(const KaxCodecDecodeAll & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxCodecDecodeAll) +}; +#endif // MATROSKA_VERSION + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_TRACK_ENTRY_DATA_H diff --git a/matroska/KaxTrackVideo.h b/matroska/KaxTrackVideo.h index e50d2fb..9d5edb8 100644 --- a/matroska/KaxTrackVideo.h +++ b/matroska/KaxTrackVideo.h @@ -1,187 +1,187 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTrackVideo.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_TRACK_VIDEO_H -#define LIBMATROSKA_TRACK_VIDEO_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlUInteger.h" -#include "ebml/EbmlBinary.h" -#include "ebml/EbmlFloat.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxTrackVideo : public EbmlMaster { - public: - KaxTrackVideo(); - KaxTrackVideo(const KaxTrackVideo & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTrackVideo) -}; - -#if MATROSKA_VERSION >= 2 -class MATROSKA_DLL_API KaxVideoFlagInterlaced : public EbmlUInteger { - public: - KaxVideoFlagInterlaced() :EbmlUInteger(0) {} - KaxVideoFlagInterlaced(const KaxVideoFlagInterlaced & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoFlagInterlaced) -}; - -class MATROSKA_DLL_API KaxVideoStereoMode : public EbmlUInteger { - public: - KaxVideoStereoMode() :EbmlUInteger(0) {} - KaxVideoStereoMode(const KaxVideoStereoMode & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoStereoMode) -}; -#endif // MATROSKA_VERSION - -class MATROSKA_DLL_API KaxVideoPixelWidth : public EbmlUInteger { - public: - KaxVideoPixelWidth() {} - KaxVideoPixelWidth(const KaxVideoPixelWidth & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoPixelWidth) -}; - -class MATROSKA_DLL_API KaxVideoPixelHeight : public EbmlUInteger { - public: - KaxVideoPixelHeight() {} - KaxVideoPixelHeight(const KaxVideoPixelHeight & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoPixelHeight) -}; - -class MATROSKA_DLL_API KaxVideoPixelCropBottom : public EbmlUInteger { - public: - KaxVideoPixelCropBottom(): EbmlUInteger(0) {} - KaxVideoPixelCropBottom(const KaxVideoPixelCropBottom & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoPixelCropBottom) -}; - -class MATROSKA_DLL_API KaxVideoPixelCropTop : public EbmlUInteger { - public: - KaxVideoPixelCropTop(): EbmlUInteger(0) {} - KaxVideoPixelCropTop(const KaxVideoPixelCropTop & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoPixelCropTop) -}; - -class MATROSKA_DLL_API KaxVideoPixelCropLeft : public EbmlUInteger { - public: - KaxVideoPixelCropLeft(): EbmlUInteger(0) {} - KaxVideoPixelCropLeft(const KaxVideoPixelCropLeft & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoPixelCropLeft) -}; - -class MATROSKA_DLL_API KaxVideoPixelCropRight : public EbmlUInteger { - public: - KaxVideoPixelCropRight(): EbmlUInteger(0) {} - KaxVideoPixelCropRight(const KaxVideoPixelCropRight & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoPixelCropRight) -}; - -class MATROSKA_DLL_API KaxVideoDisplayWidth : public EbmlUInteger { - public: - KaxVideoDisplayWidth() {} - KaxVideoDisplayWidth(const KaxVideoDisplayWidth & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoDisplayWidth) -}; - -class MATROSKA_DLL_API KaxVideoDisplayHeight : public EbmlUInteger { - public: - KaxVideoDisplayHeight() {} - KaxVideoDisplayHeight(const KaxVideoDisplayHeight & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoDisplayHeight) -}; - -#if MATROSKA_VERSION >= 2 -class MATROSKA_DLL_API KaxVideoDisplayUnit : public EbmlUInteger { - public: - KaxVideoDisplayUnit() {} - KaxVideoDisplayUnit(const KaxVideoDisplayUnit & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoDisplayUnit) -}; - -class MATROSKA_DLL_API KaxVideoAspectRatio : public EbmlUInteger { - public: - KaxVideoAspectRatio() {} - KaxVideoAspectRatio(const KaxVideoAspectRatio & ElementToClone) :EbmlUInteger(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoAspectRatio) -}; -#endif // MATROSKA_VERSION - -class MATROSKA_DLL_API KaxVideoColourSpace : public EbmlBinary { - public: - KaxVideoColourSpace() {} - KaxVideoColourSpace(const KaxVideoColourSpace & ElementToClone) :EbmlBinary(ElementToClone){} - bool ValidateSize(void) const {return (GetSize() == 4);} - - EBML_CONCRETE_CLASS(KaxVideoColourSpace) -}; - -#if MATROSKA_VERSION >= 2 -class MATROSKA_DLL_API KaxVideoGamma : public EbmlFloat { - public: - KaxVideoGamma() {} - KaxVideoGamma(const KaxVideoGamma & ElementToClone) :EbmlFloat(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxVideoGamma) -}; -#endif // MATROSKA_VERSION - -class MATROSKA_DLL_API KaxVideoFrameRate : public EbmlFloat { - public: - KaxVideoFrameRate() {} - KaxVideoFrameRate(const KaxVideoFrameRate & ElementToClone) :EbmlFloat(ElementToClone) {} - uint32 RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault); - - EBML_CONCRETE_CLASS(KaxVideoFrameRate) -}; - - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_TRACK_VIDEO_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTrackVideo.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_TRACK_VIDEO_H +#define LIBMATROSKA_TRACK_VIDEO_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlUInteger.h" +#include "ebml/EbmlBinary.h" +#include "ebml/EbmlFloat.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxTrackVideo : public EbmlMaster { + public: + KaxTrackVideo(); + KaxTrackVideo(const KaxTrackVideo & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTrackVideo) +}; + +#if MATROSKA_VERSION >= 2 +class MATROSKA_DLL_API KaxVideoFlagInterlaced : public EbmlUInteger { + public: + KaxVideoFlagInterlaced() :EbmlUInteger(0) {} + KaxVideoFlagInterlaced(const KaxVideoFlagInterlaced & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoFlagInterlaced) +}; + +class MATROSKA_DLL_API KaxVideoStereoMode : public EbmlUInteger { + public: + KaxVideoStereoMode() :EbmlUInteger(0) {} + KaxVideoStereoMode(const KaxVideoStereoMode & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoStereoMode) +}; +#endif // MATROSKA_VERSION + +class MATROSKA_DLL_API KaxVideoPixelWidth : public EbmlUInteger { + public: + KaxVideoPixelWidth() {} + KaxVideoPixelWidth(const KaxVideoPixelWidth & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoPixelWidth) +}; + +class MATROSKA_DLL_API KaxVideoPixelHeight : public EbmlUInteger { + public: + KaxVideoPixelHeight() {} + KaxVideoPixelHeight(const KaxVideoPixelHeight & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoPixelHeight) +}; + +class MATROSKA_DLL_API KaxVideoPixelCropBottom : public EbmlUInteger { + public: + KaxVideoPixelCropBottom(): EbmlUInteger(0) {} + KaxVideoPixelCropBottom(const KaxVideoPixelCropBottom & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoPixelCropBottom) +}; + +class MATROSKA_DLL_API KaxVideoPixelCropTop : public EbmlUInteger { + public: + KaxVideoPixelCropTop(): EbmlUInteger(0) {} + KaxVideoPixelCropTop(const KaxVideoPixelCropTop & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoPixelCropTop) +}; + +class MATROSKA_DLL_API KaxVideoPixelCropLeft : public EbmlUInteger { + public: + KaxVideoPixelCropLeft(): EbmlUInteger(0) {} + KaxVideoPixelCropLeft(const KaxVideoPixelCropLeft & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoPixelCropLeft) +}; + +class MATROSKA_DLL_API KaxVideoPixelCropRight : public EbmlUInteger { + public: + KaxVideoPixelCropRight(): EbmlUInteger(0) {} + KaxVideoPixelCropRight(const KaxVideoPixelCropRight & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoPixelCropRight) +}; + +class MATROSKA_DLL_API KaxVideoDisplayWidth : public EbmlUInteger { + public: + KaxVideoDisplayWidth() {} + KaxVideoDisplayWidth(const KaxVideoDisplayWidth & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoDisplayWidth) +}; + +class MATROSKA_DLL_API KaxVideoDisplayHeight : public EbmlUInteger { + public: + KaxVideoDisplayHeight() {} + KaxVideoDisplayHeight(const KaxVideoDisplayHeight & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoDisplayHeight) +}; + +#if MATROSKA_VERSION >= 2 +class MATROSKA_DLL_API KaxVideoDisplayUnit : public EbmlUInteger { + public: + KaxVideoDisplayUnit() {} + KaxVideoDisplayUnit(const KaxVideoDisplayUnit & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoDisplayUnit) +}; + +class MATROSKA_DLL_API KaxVideoAspectRatio : public EbmlUInteger { + public: + KaxVideoAspectRatio() {} + KaxVideoAspectRatio(const KaxVideoAspectRatio & ElementToClone) :EbmlUInteger(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoAspectRatio) +}; +#endif // MATROSKA_VERSION + +class MATROSKA_DLL_API KaxVideoColourSpace : public EbmlBinary { + public: + KaxVideoColourSpace() {} + KaxVideoColourSpace(const KaxVideoColourSpace & ElementToClone) :EbmlBinary(ElementToClone){} + bool ValidateSize(void) const {return (GetSize() == 4);} + + EBML_CONCRETE_CLASS(KaxVideoColourSpace) +}; + +#if MATROSKA_VERSION >= 2 +class MATROSKA_DLL_API KaxVideoGamma : public EbmlFloat { + public: + KaxVideoGamma() {} + KaxVideoGamma(const KaxVideoGamma & ElementToClone) :EbmlFloat(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxVideoGamma) +}; +#endif // MATROSKA_VERSION + +class MATROSKA_DLL_API KaxVideoFrameRate : public EbmlFloat { + public: + KaxVideoFrameRate() {} + KaxVideoFrameRate(const KaxVideoFrameRate & ElementToClone) :EbmlFloat(ElementToClone) {} + uint32 RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault); + + EBML_CONCRETE_CLASS(KaxVideoFrameRate) +}; + + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_TRACK_VIDEO_H diff --git a/matroska/KaxTracks.h b/matroska/KaxTracks.h index 3b52524..b1294cc 100644 --- a/matroska/KaxTracks.h +++ b/matroska/KaxTracks.h @@ -1,90 +1,90 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTracks.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_TRACKS_H -#define LIBMATROSKA_TRACKS_H - -#include "matroska/KaxTypes.h" -#include "ebml/EbmlMaster.h" -#include "ebml/EbmlUInteger.h" -#include "matroska/KaxTrackEntryData.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -class MATROSKA_DLL_API KaxTracks : public EbmlMaster { - public: - KaxTracks(); - KaxTracks(const KaxTracks & ElementToClone) :EbmlMaster(ElementToClone) {} - - EBML_CONCRETE_CLASS(KaxTracks) -}; - -class MATROSKA_DLL_API KaxTrackEntry : public EbmlMaster { - public: - KaxTrackEntry(); - KaxTrackEntry(const KaxTrackEntry & ElementToClone) :EbmlMaster(ElementToClone) {} - - EbmlUInteger & TrackNumber() const { return *(static_cast(FindElt(EBML_INFO(KaxTrackNumber)))); } - - void EnableLacing(bool bEnable = true); - - /*! - \note lacing set by default - */ - inline bool LacingEnabled() const { - KaxTrackFlagLacing * myLacing = static_cast(FindFirstElt(EBML_INFO(KaxTrackFlagLacing))); - return((myLacing == NULL) || (uint8(*myLacing) != 0)); - } - - void SetGlobalTimecodeScale(uint64 aGlobalTimecodeScale) { - mGlobalTimecodeScale = aGlobalTimecodeScale; - bGlobalTimecodeScaleIsSet = true; - } - uint64 GlobalTimecodeScale() const { - assert(bGlobalTimecodeScaleIsSet); - return mGlobalTimecodeScale; - } - - protected: - bool bGlobalTimecodeScaleIsSet; - uint64 mGlobalTimecodeScale; - - EBML_CONCRETE_CLASS(KaxTrackEntry) -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_TRACKS_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTracks.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_TRACKS_H +#define LIBMATROSKA_TRACKS_H + +#include "matroska/KaxTypes.h" +#include "ebml/EbmlMaster.h" +#include "ebml/EbmlUInteger.h" +#include "matroska/KaxTrackEntryData.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +class MATROSKA_DLL_API KaxTracks : public EbmlMaster { + public: + KaxTracks(); + KaxTracks(const KaxTracks & ElementToClone) :EbmlMaster(ElementToClone) {} + + EBML_CONCRETE_CLASS(KaxTracks) +}; + +class MATROSKA_DLL_API KaxTrackEntry : public EbmlMaster { + public: + KaxTrackEntry(); + KaxTrackEntry(const KaxTrackEntry & ElementToClone) :EbmlMaster(ElementToClone) {} + + EbmlUInteger & TrackNumber() const { return *(static_cast(FindElt(EBML_INFO(KaxTrackNumber)))); } + + void EnableLacing(bool bEnable = true); + + /*! + \note lacing set by default + */ + inline bool LacingEnabled() const { + KaxTrackFlagLacing * myLacing = static_cast(FindFirstElt(EBML_INFO(KaxTrackFlagLacing))); + return((myLacing == NULL) || (uint8(*myLacing) != 0)); + } + + void SetGlobalTimecodeScale(uint64 aGlobalTimecodeScale) { + mGlobalTimecodeScale = aGlobalTimecodeScale; + bGlobalTimecodeScaleIsSet = true; + } + uint64 GlobalTimecodeScale() const { + assert(bGlobalTimecodeScaleIsSet); + return mGlobalTimecodeScale; + } + + protected: + bool bGlobalTimecodeScaleIsSet; + uint64 mGlobalTimecodeScale; + + EBML_CONCRETE_CLASS(KaxTrackEntry) +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_TRACKS_H diff --git a/matroska/KaxTypes.h b/matroska/KaxTypes.h index cbb90b9..4fbcb0b 100644 --- a/matroska/KaxTypes.h +++ b/matroska/KaxTypes.h @@ -1,59 +1,59 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTypes.h,v 1.4 2004/04/14 23:26:17 robux4 Exp $ -*/ -#ifndef LIBMATROSKA_TYPES_H -#define LIBMATROSKA_TYPES_H - -#include "matroska/KaxConfig.h" -#include "ebml/EbmlTypes.h" -#include "matroska/c/libmatroska_t.h" - -START_LIBMATROSKA_NAMESPACE - -enum LacingType { - LACING_NONE = 0, - LACING_XIPH, - LACING_FIXED, - LACING_EBML, - LACING_AUTO -}; - -enum BlockBlobType { - BLOCK_BLOB_NO_SIMPLE = 0, - BLOCK_BLOB_SIMPLE_AUTO, - BLOCK_BLOB_ALWAYS_SIMPLE, -}; - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_TYPES_H +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTypes.h,v 1.4 2004/04/14 23:26:17 robux4 Exp $ +*/ +#ifndef LIBMATROSKA_TYPES_H +#define LIBMATROSKA_TYPES_H + +#include "matroska/KaxConfig.h" +#include "ebml/EbmlTypes.h" +#include "matroska/c/libmatroska_t.h" + +START_LIBMATROSKA_NAMESPACE + +enum LacingType { + LACING_NONE = 0, + LACING_XIPH, + LACING_FIXED, + LACING_EBML, + LACING_AUTO +}; + +enum BlockBlobType { + BLOCK_BLOB_NO_SIMPLE = 0, + BLOCK_BLOB_SIMPLE_AUTO, + BLOCK_BLOB_ALWAYS_SIMPLE, +}; + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_TYPES_H diff --git a/matroska/KaxVersion.h b/matroska/KaxVersion.h index 9e7d618..e877330 100644 --- a/matroska/KaxVersion.h +++ b/matroska/KaxVersion.h @@ -1,54 +1,54 @@ -/**************************************************************************** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxVersion.h,v 1.13 2004/04/23 16:46:07 mosu Exp $ - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_VERSION_H -#define LIBMATROSKA_VERSION_H - -#include - -#include "ebml/EbmlConfig.h" -#include "matroska/KaxConfig.h" - -START_LIBMATROSKA_NAMESPACE - -#define LIBMATROSKA_VERSION 0x000900 - -static const std::string KaxCodeVersion = "0.9.0"; -static const std::string KaxCodeDate = __TIMESTAMP__; - -/*! - \todo Improve the CRC/ECC system (backward and forward possible ?) to fit streaming/live writing/simple reading -*/ - -END_LIBMATROSKA_NAMESPACE - -#endif // LIBMATROSKA_VERSION_H +/**************************************************************************** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxVersion.h,v 1.13 2004/04/23 16:46:07 mosu Exp $ + \author Steve Lhomme +*/ +#ifndef LIBMATROSKA_VERSION_H +#define LIBMATROSKA_VERSION_H + +#include + +#include "ebml/EbmlConfig.h" +#include "matroska/KaxConfig.h" + +START_LIBMATROSKA_NAMESPACE + +#define LIBMATROSKA_VERSION 0x000900 + +static const std::string KaxCodeVersion = "0.9.0"; +static const std::string KaxCodeDate = __TIMESTAMP__; + +/*! + \todo Improve the CRC/ECC system (backward and forward possible ?) to fit streaming/live writing/simple reading +*/ + +END_LIBMATROSKA_NAMESPACE + +#endif // LIBMATROSKA_VERSION_H diff --git a/src/KaxAttached.cpp b/src/KaxAttached.cpp index 03ecc4c..69fb1ba 100644 --- a/src/KaxAttached.cpp +++ b/src/KaxAttached.cpp @@ -1,96 +1,96 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxAttached.cpp 1202 2005-08-30 14:39:01Z robux4 $ - \author Steve Lhomme -*/ -#include "matroska/KaxAttached.h" -#include "matroska/KaxContexts.h" - -// sub elements - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -#if MATROSKA_VERSION == 1 -EbmlSemantic KaxAttached_ContextList[5] = -#else // MATROSKA_VERSION -EbmlSemantic KaxAttached_ContextList[6] = -#endif // MATROSKA_VERSION -{ - EbmlSemantic(true, true, EBML_INFO(KaxFileName)), - EbmlSemantic(true, true, EBML_INFO(KaxMimeType)), - EbmlSemantic(true, true, EBML_INFO(KaxFileData)), - EbmlSemantic(false, true, EBML_INFO(KaxFileDescription)), - EbmlSemantic(true, true, EBML_INFO(KaxFileUID)), -#if MATROSKA_VERSION >= 2 - EbmlSemantic(false, true, EBML_INFO(KaxFileReferral)), -#endif // MATROSKA_VERSION -}; - -EbmlId KaxAttached_TheId (0x61A7, 2); -EbmlId KaxFileDescription_TheId(0x467E, 2); -EbmlId KaxFileName_TheId (0x466E, 2); -EbmlId KaxMimeType_TheId (0x4660, 2); -EbmlId KaxFileData_TheId (0x465C, 2); -EbmlId KaxFileUID_TheId (0x46AE, 2); -#if MATROSKA_VERSION >= 2 -EbmlId KaxFileReferral_TheId (0x4675, 2); -#endif // MATROSKA_VERSION - -const EbmlSemanticContext KaxAttached_Context = EbmlSemanticContext(countof(KaxAttached_ContextList), KaxAttached_ContextList, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAttached)); -const EbmlSemanticContext KaxFileDescription_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxFileDescription)); -const EbmlSemanticContext KaxFileName_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxFileName)); -const EbmlSemanticContext KaxMimeType_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxMimeType)); -const EbmlSemanticContext KaxFileData_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxFileData)); -const EbmlSemanticContext KaxFileUID_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxFileUID)); -#if MATROSKA_VERSION >= 2 -const EbmlSemanticContext KaxFileReferral_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxFileReferral)); -#endif // MATROSKA_VERSION - -const EbmlCallbacks KaxAttached::ClassInfos(KaxAttached::Create, KaxAttached_TheId, "AttachedFile", KaxAttached_Context); -const EbmlCallbacks KaxFileDescription::ClassInfos(KaxFileDescription::Create, KaxFileDescription_TheId, "FileDescription", KaxFileDescription_Context); -const EbmlCallbacks KaxFileName::ClassInfos(KaxFileName::Create, KaxFileName_TheId, "FileName", KaxFileName_Context); -const EbmlCallbacks KaxMimeType::ClassInfos(KaxMimeType::Create, KaxMimeType_TheId, "FileMimeType", KaxMimeType_Context); -const EbmlCallbacks KaxFileData::ClassInfos(KaxFileData::Create, KaxFileData_TheId, "FileData", KaxFileData_Context); -const EbmlCallbacks KaxFileUID::ClassInfos(KaxFileUID::Create, KaxFileUID_TheId, "FileUID", KaxFileUID_Context); -#if MATROSKA_VERSION >= 2 -const EbmlCallbacks KaxFileReferral::ClassInfos(KaxFileReferral::Create, KaxFileReferral_TheId, "FileReferral", KaxFileReferral_Context); -#endif // MATROSKA_VERSION - -KaxAttached::KaxAttached() - :EbmlMaster(KaxAttached_Context) -{ - SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko) -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxAttached.cpp 1202 2005-08-30 14:39:01Z robux4 $ + \author Steve Lhomme +*/ +#include "matroska/KaxAttached.h" +#include "matroska/KaxContexts.h" + +// sub elements + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +#if MATROSKA_VERSION == 1 +EbmlSemantic KaxAttached_ContextList[5] = +#else // MATROSKA_VERSION +EbmlSemantic KaxAttached_ContextList[6] = +#endif // MATROSKA_VERSION +{ + EbmlSemantic(true, true, EBML_INFO(KaxFileName)), + EbmlSemantic(true, true, EBML_INFO(KaxMimeType)), + EbmlSemantic(true, true, EBML_INFO(KaxFileData)), + EbmlSemantic(false, true, EBML_INFO(KaxFileDescription)), + EbmlSemantic(true, true, EBML_INFO(KaxFileUID)), +#if MATROSKA_VERSION >= 2 + EbmlSemantic(false, true, EBML_INFO(KaxFileReferral)), +#endif // MATROSKA_VERSION +}; + +EbmlId KaxAttached_TheId (0x61A7, 2); +EbmlId KaxFileDescription_TheId(0x467E, 2); +EbmlId KaxFileName_TheId (0x466E, 2); +EbmlId KaxMimeType_TheId (0x4660, 2); +EbmlId KaxFileData_TheId (0x465C, 2); +EbmlId KaxFileUID_TheId (0x46AE, 2); +#if MATROSKA_VERSION >= 2 +EbmlId KaxFileReferral_TheId (0x4675, 2); +#endif // MATROSKA_VERSION + +const EbmlSemanticContext KaxAttached_Context = EbmlSemanticContext(countof(KaxAttached_ContextList), KaxAttached_ContextList, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAttached)); +const EbmlSemanticContext KaxFileDescription_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxFileDescription)); +const EbmlSemanticContext KaxFileName_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxFileName)); +const EbmlSemanticContext KaxMimeType_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxMimeType)); +const EbmlSemanticContext KaxFileData_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxFileData)); +const EbmlSemanticContext KaxFileUID_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxFileUID)); +#if MATROSKA_VERSION >= 2 +const EbmlSemanticContext KaxFileReferral_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxFileReferral)); +#endif // MATROSKA_VERSION + +const EbmlCallbacks KaxAttached::ClassInfos(KaxAttached::Create, KaxAttached_TheId, "AttachedFile", KaxAttached_Context); +const EbmlCallbacks KaxFileDescription::ClassInfos(KaxFileDescription::Create, KaxFileDescription_TheId, "FileDescription", KaxFileDescription_Context); +const EbmlCallbacks KaxFileName::ClassInfos(KaxFileName::Create, KaxFileName_TheId, "FileName", KaxFileName_Context); +const EbmlCallbacks KaxMimeType::ClassInfos(KaxMimeType::Create, KaxMimeType_TheId, "FileMimeType", KaxMimeType_Context); +const EbmlCallbacks KaxFileData::ClassInfos(KaxFileData::Create, KaxFileData_TheId, "FileData", KaxFileData_Context); +const EbmlCallbacks KaxFileUID::ClassInfos(KaxFileUID::Create, KaxFileUID_TheId, "FileUID", KaxFileUID_Context); +#if MATROSKA_VERSION >= 2 +const EbmlCallbacks KaxFileReferral::ClassInfos(KaxFileReferral::Create, KaxFileReferral_TheId, "FileReferral", KaxFileReferral_Context); +#endif // MATROSKA_VERSION + +KaxAttached::KaxAttached() + :EbmlMaster(KaxAttached_Context) +{ + SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko) +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxAttachments.cpp b/src/KaxAttachments.cpp index 2dca49e..6d69f02 100644 --- a/src/KaxAttachments.cpp +++ b/src/KaxAttachments.cpp @@ -1,60 +1,60 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxAttachments.cpp 640 2004-07-09 21:05:36Z mosu $ - \author Steve Lhomme -*/ -#include "matroska/KaxAttachments.h" -#include "matroska/KaxAttached.h" -#include "matroska/KaxContexts.h" - -using namespace LIBEBML_NAMESPACE; - -// sub elements -START_LIBMATROSKA_NAMESPACE - -EbmlSemantic KaxAttachments_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxAttached)), ///< EBMLVersion -}; - -const EbmlSemanticContext KaxAttachments_Context = EbmlSemanticContext(countof(KaxAttachments_ContextList), KaxAttachments_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAttachments)); - -EbmlId KaxAttachments_TheId(0x1941A469, 4); -const EbmlCallbacks KaxAttachments::ClassInfos(KaxAttachments::Create, KaxAttachments_TheId, "Attachments", KaxAttachments_Context); - -KaxAttachments::KaxAttachments() - :EbmlMaster(KaxAttachments_Context) -{ - SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko) -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxAttachments.cpp 640 2004-07-09 21:05:36Z mosu $ + \author Steve Lhomme +*/ +#include "matroska/KaxAttachments.h" +#include "matroska/KaxAttached.h" +#include "matroska/KaxContexts.h" + +using namespace LIBEBML_NAMESPACE; + +// sub elements +START_LIBMATROSKA_NAMESPACE + +EbmlSemantic KaxAttachments_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxAttached)), ///< EBMLVersion +}; + +const EbmlSemanticContext KaxAttachments_Context = EbmlSemanticContext(countof(KaxAttachments_ContextList), KaxAttachments_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAttachments)); + +EbmlId KaxAttachments_TheId(0x1941A469, 4); +const EbmlCallbacks KaxAttachments::ClassInfos(KaxAttachments::Create, KaxAttachments_TheId, "Attachments", KaxAttachments_Context); + +KaxAttachments::KaxAttachments() + :EbmlMaster(KaxAttachments_Context) +{ + SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko) +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp index 33c8be3..81a9f0c 100644 --- a/src/KaxBlock.cpp +++ b/src/KaxBlock.cpp @@ -1,1096 +1,1096 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxBlock.cpp 1265 2007-01-14 17:20:35Z mosu $ - \author Steve Lhomme - \author Julien Coloos -*/ -#include - -//#include - -#include "matroska/KaxBlock.h" -#include "matroska/KaxContexts.h" -#include "matroska/KaxBlockData.h" -#include "matroska/KaxCluster.h" - -START_LIBMATROSKA_NAMESPACE - -#if MATROSKA_VERSION == 1 -const EbmlSemantic KaxBlockGroup_ContextList[6] = -#else // MATROSKA_VERSION -const EbmlSemantic KaxBlockGroup_ContextList[9] = -#endif // MATROSKA_VERSION -{ - EbmlSemantic(true, true, EBML_INFO(KaxBlock)), -#if MATROSKA_VERSION >= 2 - EbmlSemantic(false, true, EBML_INFO(KaxBlockVirtual)), -#endif // MATROSKA_VERSION - EbmlSemantic(false, true, EBML_INFO(KaxBlockDuration)), - EbmlSemantic(false, true, EBML_INFO(KaxSlices)), - EbmlSemantic(true, true, EBML_INFO(KaxReferencePriority)), - EbmlSemantic(false, false, EBML_INFO(KaxReferenceBlock)), -#if MATROSKA_VERSION >= 2 - EbmlSemantic(false, true, EBML_INFO(KaxReferenceVirtual)), - EbmlSemantic(false, true, EBML_INFO(KaxCodecState)), -#endif // MATROSKA_VERSION - EbmlSemantic(false, true, EBML_INFO(KaxBlockAdditions)), -}; - -const EbmlSemantic KaxBlockAdditions_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxBlockMore)) -}; - -const EbmlSemantic KaxBlockMore_ContextList[2] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxBlockAddID)), - EbmlSemantic(true, true, EBML_INFO(KaxBlockAdditional)) -}; - -EbmlId KaxBlockGroup_TheId (0xA0, 1); -EbmlId KaxBlock_TheId (0xA1, 1); -EbmlId KaxSimpleBlock_TheId (0xA3, 1); -EbmlId KaxBlockDuration_TheId (0x9B, 1); -#if MATROSKA_VERSION >= 2 -EbmlId KaxBlockVirtual_TheId (0xA2, 1); -EbmlId KaxCodecState_TheId (0xA4, 1); -#endif // MATROSKA_VERSION -EbmlId KaxBlockAdditions_TheId (0x75A1, 2); -EbmlId KaxBlockMore_TheId (0xA6, 1); -EbmlId KaxBlockAddID_TheId (0xEE, 1); -EbmlId KaxBlockAdditional_TheId(0xA5, 1); - -const EbmlSemanticContext KaxBlockGroup_Context = EbmlSemanticContext(countof(KaxBlockGroup_ContextList), KaxBlockGroup_ContextList, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockGroup)); -const EbmlSemanticContext KaxBlock_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlock)); -const EbmlSemanticContext KaxBlockDuration_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockDuration)); -#if MATROSKA_VERSION >= 2 -const EbmlSemanticContext KaxSimpleBlock_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSimpleBlock)); -const EbmlSemanticContext KaxBlockVirtual_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockVirtual)); -const EbmlSemanticContext KaxCodecState_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecState)); -#endif // MATROSKA_VERSION -const EbmlSemanticContext KaxBlockAdditions_Context = EbmlSemanticContext(countof(KaxBlockAdditions_ContextList), KaxBlockAdditions_ContextList, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockAdditions)); -const EbmlSemanticContext KaxBlockMore_Context = EbmlSemanticContext(countof(KaxBlockMore_ContextList), KaxBlockMore_ContextList, &KaxBlockAdditions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockMore)); -const EbmlSemanticContext KaxBlockAddID_Context = EbmlSemanticContext(0, NULL, &KaxBlockMore_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockAddID)); -const EbmlSemanticContext KaxBlockAdditional_Context = EbmlSemanticContext(0, NULL, &KaxBlockMore_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockAdditional)); - -const EbmlCallbacks KaxBlockGroup::ClassInfos(KaxBlockGroup::Create, KaxBlockGroup_TheId, "BlockGroup", KaxBlockGroup_Context); -const EbmlCallbacks KaxBlock::ClassInfos(KaxBlock::Create, KaxBlock_TheId, "Block", KaxBlock_Context); -const EbmlCallbacks KaxBlockDuration::ClassInfos(KaxBlockDuration::Create, KaxBlockDuration_TheId, "BlockDuration", KaxBlockDuration_Context); -#if MATROSKA_VERSION >= 2 -const EbmlCallbacks KaxSimpleBlock::ClassInfos(KaxSimpleBlock::Create, KaxSimpleBlock_TheId, "SimpleBlock", KaxSimpleBlock_Context); -const EbmlCallbacks KaxBlockVirtual::ClassInfos(KaxBlockVirtual::Create, KaxBlockVirtual_TheId, "BlockVirtual", KaxBlockVirtual_Context); -const EbmlCallbacks KaxCodecState::ClassInfos(KaxCodecState::Create, KaxCodecState_TheId, "CodecState", KaxCodecState_Context); -#endif // MATROSKA_VERSION -const EbmlCallbacks KaxBlockAdditions::ClassInfos(KaxBlockAdditions::Create, KaxBlockAdditions_TheId, "BlockAdditions", KaxBlockAdditions_Context); -const EbmlCallbacks KaxBlockMore::ClassInfos(KaxBlockMore::Create, KaxBlockMore_TheId, "BlockMore", KaxBlockMore_Context); -const EbmlCallbacks KaxBlockAddID::ClassInfos(KaxBlockAddID::Create, KaxBlockAddID_TheId, "BlockAddID", KaxBlockAddID_Context); -const EbmlCallbacks KaxBlockAdditional::ClassInfos(KaxBlockAdditional::Create, KaxBlockAdditional_TheId, "BlockAdditional", KaxBlockAdditional_Context); - -DataBuffer * DataBuffer::Clone() -{ - binary *ClonedData = (binary *)malloc(mySize * sizeof(binary)); - assert(ClonedData != NULL); - memcpy(ClonedData, myBuffer ,mySize ); - - SimpleDataBuffer * result = new SimpleDataBuffer(ClonedData, mySize, 0); - result->bValidValue = bValidValue; - return result; -} - -SimpleDataBuffer::SimpleDataBuffer(const SimpleDataBuffer & ToClone) - :DataBuffer((binary *)malloc(ToClone.mySize * sizeof(binary)), ToClone.mySize, myFreeBuffer) -{ - assert(myBuffer != NULL); - memcpy(myBuffer, ToClone.myBuffer ,mySize ); - bValidValue = ToClone.bValidValue; -} - -bool KaxInternalBlock::ValidateSize() const -{ - return (GetSize() >= 4); /// for the moment -} - -KaxInternalBlock::~KaxInternalBlock() -{ - ReleaseFrames(); -} - -KaxInternalBlock::KaxInternalBlock(const KaxInternalBlock & ElementToClone) - :EbmlBinary(ElementToClone) - ,myBuffers(ElementToClone.myBuffers.size()) - ,Timecode(ElementToClone.Timecode) - ,LocalTimecode(ElementToClone.LocalTimecode) - ,bLocalTimecodeUsed(ElementToClone.bLocalTimecodeUsed) - ,TrackNumber(ElementToClone.TrackNumber) - ,ParentCluster(ElementToClone.ParentCluster) ///< \todo not exactly -{ - // add a clone of the list - std::vector::const_iterator Itr = ElementToClone.myBuffers.begin(); - std::vector::iterator myItr = myBuffers.begin(); - while (Itr != ElementToClone.myBuffers.end()) - { - *myItr = (*Itr)->Clone(); - Itr++; myItr++; - } -} - - -KaxBlockGroup::~KaxBlockGroup() -{ -//NOTE("KaxBlockGroup::~KaxBlockGroup"); -} - -KaxBlockGroup::KaxBlockGroup() - :EbmlMaster(KaxBlockGroup_Context) - ,ParentCluster(NULL) - ,ParentTrack(NULL) -{} - -KaxBlockAdditions::KaxBlockAdditions() - :EbmlMaster(KaxBlockAdditions_Context) -{} - -KaxBlockMore::KaxBlockMore() - :EbmlMaster(KaxBlockMore_Context) -{} - -/*! - \todo handle flags - \todo hardcoded limit of the number of frames in a lace should be a parameter - \return true if more frames can be added to this Block -*/ -bool KaxInternalBlock::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing, bool invisible) -{ - SetValueIsSet(); - if (myBuffers.size() == 0) { - // first frame - Timecode = timecode; - TrackNumber = track.TrackNumber(); - mInvisible = invisible; - mLacing = lacing; - } - myBuffers.push_back(&buffer); - - // we don't allow more than 8 frames in a Block because the overhead improvement is minimal - if (myBuffers.size() >= 8 || lacing == LACING_NONE) - return false; - - if (lacing == LACING_XIPH) - // decide wether a new frame can be added or not - // a frame in a lace is not efficient when the place necessary to code it in a lace is bigger - // than the size of a simple Block. That means more than 6 bytes (4 in struct + 2 for EBML) to code the size - return (buffer.Size() < 6*0xFF); - else - return true; -} - -/*! - \return Returns the lacing type that produces the smallest footprint. -*/ -LacingType KaxInternalBlock::GetBestLacingType() const { - int XiphLacingSize, EbmlLacingSize, i; - bool SameSize = true; - - if (myBuffers.size() <= 1) - return LACING_NONE; - - XiphLacingSize = 1; // Number of laces is stored in 1 byte. - EbmlLacingSize = 1; - for (i = 0; i < (int)myBuffers.size() - 1; i++) { - if (myBuffers[i]->Size() != myBuffers[i + 1]->Size()) - SameSize = false; - XiphLacingSize += myBuffers[i]->Size() / 255 + 1; - } - EbmlLacingSize += CodedSizeLength(myBuffers[0]->Size(), 0, IsFiniteSize()); - for (i = 1; i < (int)myBuffers.size() - 1; i++) - EbmlLacingSize += CodedSizeLengthSigned(int64(myBuffers[i]->Size()) - int64(myBuffers[i - 1]->Size()), 0); - if (SameSize) - return LACING_FIXED; - else if (XiphLacingSize < EbmlLacingSize) - return LACING_XIPH; - else - return LACING_EBML; -} - -uint64 KaxInternalBlock::UpdateSize(bool bSaveDefault, bool bForceRender) -{ - LacingType LacingHere; - assert(GetData() == NULL); // Data is not used for KaxInternalBlock - assert(TrackNumber < 0x4000); // no more allowed for the moment - unsigned int i; - - // compute the final size of the data - switch (myBuffers.size()) { - case 0: - SetSize_(0); - break; - case 1: - SetSize_(4 + myBuffers[0]->Size()); - break; - default: - SetSize_(4 + 1); // 1 for the lacing head - if (mLacing == LACING_AUTO) - LacingHere = GetBestLacingType(); - else - LacingHere = mLacing; - switch (LacingHere) - { - case LACING_XIPH: - for (i=0; iSize() + (myBuffers[i]->Size() / 0xFF + 1)); - } - break; - case LACING_EBML: - SetSize_(GetSize() + myBuffers[0]->Size() + CodedSizeLength(myBuffers[0]->Size(), 0, IsFiniteSize())); - for (i=1; iSize() + CodedSizeLengthSigned(int64(myBuffers[i]->Size()) - int64(myBuffers[i-1]->Size()), 0)); - } - break; - case LACING_FIXED: - for (i=0; iSize()); - } - break; - default: - assert(0); - } - // Size of the last frame (not in lace) - SetSize_(GetSize() + myBuffers[i]->Size()); - break; - } - - if (TrackNumber >= 0x80) - SetSize_(GetSize() + 1); // the size will be coded with one more octet - - return GetSize(); -} - -#if MATROSKA_VERSION >= 2 -KaxBlockVirtual::KaxBlockVirtual(const KaxBlockVirtual & ElementToClone) - :EbmlBinary(ElementToClone) - ,Timecode(ElementToClone.Timecode) - ,TrackNumber(ElementToClone.TrackNumber) - ,ParentCluster(ElementToClone.ParentCluster) ///< \todo not exactly -{ - SetBuffer(DataBlock,sizeof(DataBlock)); - SetValueIsSet(false); -} - -uint64 KaxBlockVirtual::UpdateSize(bool bSaveDefault, bool bForceRender) -{ - assert(TrackNumber < 0x4000); - binary *cursor = GetData(); - // fill data - if (TrackNumber < 0x80) { - *cursor++ = TrackNumber | 0x80; // set the first bit to 1 - } else { - *cursor++ = (TrackNumber >> 8) | 0x40; // set the second bit to 1 - *cursor++ = TrackNumber & 0xFF; - } - - assert(ParentCluster != NULL); - int16 ActualTimecode = ParentCluster->GetBlockLocalTimecode(Timecode); - big_int16 b16(ActualTimecode); - b16.Fill(cursor); - cursor += 2; - - *cursor++ = 0; // flags - - return GetSize(); -} -#endif // MATROSKA_VERSION - -/*! - \todo more optimisation is possible (render the Block head and don't copy the buffer in memory, care should be taken with the allocation of Data) - \todo the actual timecode to write should be retrieved from the Cluster from here -*/ -uint32 KaxInternalBlock::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) -{ - if (myBuffers.size() == 0) { - return 0; - } else { - assert(TrackNumber < 0x4000); - binary BlockHead[5], *cursor = BlockHead; - unsigned int i; - - if (myBuffers.size() == 1) { - SetSize_(4); - mLacing = LACING_NONE; - } else { - if (mLacing == LACING_NONE) - mLacing = LACING_EBML; // supposedly the best of all - SetSize_(4 + 1); // 1 for the lacing head (number of laced elements) - } - if (TrackNumber > 0x80) - SetSize_(GetSize() + 1); - - // write Block Head - if (TrackNumber < 0x80) { - *cursor++ = TrackNumber | 0x80; // set the first bit to 1 - } else { - *cursor++ = (TrackNumber >> 8) | 0x40; // set the second bit to 1 - *cursor++ = TrackNumber & 0xFF; - } - - assert(ParentCluster != NULL); - int16 ActualTimecode = ParentCluster->GetBlockLocalTimecode(Timecode); - big_int16 b16(ActualTimecode); - b16.Fill(cursor); - cursor += 2; - - *cursor = 0; // flags - - if (mLacing == LACING_AUTO) { - mLacing = GetBestLacingType(); - } - - // invisible flag - if (mInvisible) - *cursor = 0x08; - - if (bIsSimple) { - if (bIsKeyframe) - *cursor |= 0x80; - if (bIsDiscardable) - *cursor |= 0x01; - } - - // lacing flag - switch (mLacing) - { - case LACING_XIPH: - *cursor++ |= 0x02; - break; - case LACING_EBML: - *cursor++ |= 0x06; - break; - case LACING_FIXED: - *cursor++ |= 0x04; - break; - case LACING_NONE: - break; - default: - assert(0); - } - - output.writeFully(BlockHead, 4 + ((TrackNumber > 0x80) ? 1 : 0)); - - binary tmpValue; - switch (mLacing) - { - case LACING_XIPH: - // number of laces - tmpValue = myBuffers.size()-1; - output.writeFully(&tmpValue, 1); - - // set the size of each member in the lace - for (i=0; iSize(); - while (tmpSize >= 0xFF) { - output.writeFully(&tmpValue, 1); - SetSize_(GetSize() + 1); - tmpSize -= 0xFF; - } - tmpValue = binary(tmpSize); - output.writeFully(&tmpValue, 1); - SetSize_(GetSize() + 1); - } - break; - case LACING_EBML: - // number of laces - tmpValue = myBuffers.size()-1; - output.writeFully(&tmpValue, 1); - - { - int64 _Size; - int _CodedSize; - binary _FinalHead[8]; // 64 bits max coded size - - _Size = myBuffers[0]->Size(); - - _CodedSize = CodedSizeLength(_Size, 0, IsFiniteSize()); - - // first size in the lace is not a signed - CodedValueLength(_Size, _CodedSize, _FinalHead); - output.writeFully(_FinalHead, _CodedSize); - SetSize_(GetSize() + _CodedSize); - - // set the size of each member in the lace - for (i=1; iSize()) - int64(myBuffers[i-1]->Size()); - _CodedSize = CodedSizeLengthSigned(_Size, 0); - CodedValueLengthSigned(_Size, _CodedSize, _FinalHead); - output.writeFully(_FinalHead, _CodedSize); - SetSize_(GetSize() + _CodedSize); - } - } - break; - case LACING_FIXED: - // number of laces - tmpValue = myBuffers.size()-1; - output.writeFully(&tmpValue, 1); - break; - case LACING_NONE: - break; - default: - assert(0); - } - - // put the data of each frame - for (i=0; iBuffer(), myBuffers[i]->Size()); - SetSize_(GetSize() + myBuffers[i]->Size()); - } - } - - return GetSize(); -} - -uint64 KaxInternalBlock::ReadInternalHead(IOCallback & input) -{ - binary Buffer[5], *cursor = Buffer; - uint64 Result = input.read(cursor, 4); - if (Result != 4) - return Result; - - // update internal values - TrackNumber = *cursor++; - if ((TrackNumber & 0x80) == 0) { - // there is extra data - if ((TrackNumber & 0x40) == 0) { - // We don't support track numbers that large ! - return Result; - } - Result += input.read(&Buffer[4], 1); - TrackNumber = (TrackNumber & 0x3F) << 8; - TrackNumber += *cursor++; - } else { - TrackNumber &= 0x7F; - } - - - big_int16 b16; - b16.Eval(cursor); - assert(ParentCluster != NULL); - Timecode = ParentCluster->GetBlockGlobalTimecode(int16(b16)); - bLocalTimecodeUsed = false; - cursor += 2; - - return Result; -} - -/*! - \todo better zero copy handling -*/ -uint64 KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully) -{ - uint64 Result; - - FirstFrameLocation = input.getFilePointer(); // will be updated accordingly below - - if (ReadFully == SCOPE_ALL_DATA) - { - Result = EbmlBinary::ReadData(input, ReadFully); - binary *cursor = GetData(); - uint8 BlockHeadSize = 4; - - // update internal values - TrackNumber = *cursor++; - if ((TrackNumber & 0x80) == 0) { - // there is extra data - if ((TrackNumber & 0x40) == 0) { - // We don't support track numbers that large ! - return Result; - } - TrackNumber = (TrackNumber & 0x3F) << 8; - TrackNumber += *cursor++; - BlockHeadSize++; - } else { - TrackNumber &= 0x7F; - } - - big_int16 b16; - b16.Eval(cursor); - LocalTimecode = int16(b16); - bLocalTimecodeUsed = true; - cursor += 2; - - if (EbmlId(*this) == EBML_ID(KaxSimpleBlock)) { - bIsKeyframe = (*cursor & 0x80) != 0; - bIsDiscardable = (*cursor & 0x01) != 0; - } - mInvisible = (*cursor & 0x08) >> 3; - mLacing = LacingType((*cursor++ & 0x06) >> 1); - - // put all Frames in the list - if (mLacing == LACING_NONE) { - FirstFrameLocation += cursor - GetData(); - DataBuffer * soloFrame = new DataBuffer(cursor, GetSize() - BlockHeadSize); - myBuffers.push_back(soloFrame); - SizeList.resize(1); - SizeList[0] = GetSize() - BlockHeadSize; - } else { - // read the number of frames in the lace - uint32 LastBufferSize = GetSize() - BlockHeadSize - 1; // 1 for number of frame - uint8 FrameNum = *cursor++; // number of frames in the lace - 1 - // read the list of frame sizes - uint8 Index; - int32 FrameSize; - uint32 SizeRead; - uint64 SizeUnknown; - - SizeList.resize(FrameNum + 1); - - switch (mLacing) - { - case LACING_XIPH: - for (Index=0; Index> 3; - mLacing = LacingType((*cursor++ & 0x06) >> 1); - if (cursor == &_TempHead[4]) - { - _TempHead[0] = _TempHead[4]; - } else { - Result += input.read(_TempHead, 1); - } - - FirstFrameLocation += cursor - _TempHead; - - // put all Frames in the list - if (mLacing != LACING_NONE) { - // read the number of frames in the lace - uint32 LastBufferSize = GetSize() - BlockHeadSize - 1; // 1 for number of frame - uint8 FrameNum = _TempHead[0]; // number of frames in the lace - 1 - // read the list of frame sizes - uint8 Index; - int32 FrameSize; - uint32 SizeRead; - uint64 SizeUnknown; - - SizeList.resize(FrameNum + 1); - - switch (mLacing) - { - case LACING_XIPH: - for (Index=0; Index(*this); - assert(ParentCluster != NULL); - theBlock.SetParent(*ParentCluster); - ParentTrack = &track; - return theBlock.AddFrame(track, timecode, buffer, lacing); -} - -bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockGroup & PastBlock, LacingType lacing) -{ -// assert(past_timecode < 0); - - KaxBlock & theBlock = GetChild(*this); - assert(ParentCluster != NULL); - theBlock.SetParent(*ParentCluster); - ParentTrack = &track; - bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing); - - KaxReferenceBlock & thePastRef = GetChild(*this); - thePastRef.SetReferencedBlock(PastBlock); - thePastRef.SetParentBlock(*this); - - return bRes; -} - -bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing) -{ -// assert(past_timecode < 0); - -// assert(forw_timecode > 0); - - KaxBlock & theBlock = GetChild(*this); - assert(ParentCluster != NULL); - theBlock.SetParent(*ParentCluster); - ParentTrack = &track; - bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing); - - KaxReferenceBlock & thePastRef = GetChild(*this); - thePastRef.SetReferencedBlock(PastBlock); - thePastRef.SetParentBlock(*this); - - KaxReferenceBlock & theFutureRef = AddNewChild(*this); - theFutureRef.SetReferencedBlock(ForwBlock); - theFutureRef.SetParentBlock(*this); - - return bRes; -} - -bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockBlob * PastBlock, const KaxBlockBlob * ForwBlock, LacingType lacing) -{ - KaxBlock & theBlock = GetChild(*this); - assert(ParentCluster != NULL); - theBlock.SetParent(*ParentCluster); - ParentTrack = &track; - bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing); - - if (PastBlock != NULL) - { - KaxReferenceBlock & thePastRef = GetChild(*this); - thePastRef.SetReferencedBlock(PastBlock); - thePastRef.SetParentBlock(*this); - } - - if (ForwBlock != NULL) - { - KaxReferenceBlock & theFutureRef = AddNewChild(*this); - theFutureRef.SetReferencedBlock(ForwBlock); - theFutureRef.SetParentBlock(*this); - } - - return bRes; -} - -/*! - \todo we may cache the reference to the timecode block -*/ -uint64 KaxBlockGroup::GlobalTimecode() const -{ - assert(ParentCluster != NULL); // impossible otherwise - KaxInternalBlock & MyBlock = *static_cast(this->FindElt(EBML_INFO(KaxBlock))); - return MyBlock.GlobalTimecode(); - -} - -uint16 KaxBlockGroup::TrackNumber() const -{ - KaxInternalBlock & MyBlock = *static_cast(this->FindElt(EBML_INFO(KaxBlock))); - return MyBlock.TrackNum(); -} - -uint64 KaxBlockGroup::ClusterPosition() const -{ - assert(ParentCluster != NULL); // impossible otherwise - return ParentCluster->GetPosition(); -} - -uint64 KaxInternalBlock::ClusterPosition() const -{ - assert(ParentCluster != NULL); // impossible otherwise - return ParentCluster->GetPosition(); -} - -unsigned int KaxBlockGroup::ReferenceCount() const -{ - unsigned int Result = 0; - KaxReferenceBlock * MyBlockAdds = static_cast(FindFirstElt(EBML_INFO(KaxReferenceBlock))); - if (MyBlockAdds != NULL) { - Result++; - while ((MyBlockAdds = static_cast(FindNextElt(*MyBlockAdds))) != NULL) - { - Result++; - } - } - return Result; -} - -const KaxReferenceBlock & KaxBlockGroup::Reference(unsigned int Index) const -{ - KaxReferenceBlock * MyBlockAdds = static_cast(FindFirstElt(EBML_INFO(KaxReferenceBlock))); - assert(MyBlockAdds != NULL); // call of a non existing reference - - while (Index != 0) { - MyBlockAdds = static_cast(FindNextElt(*MyBlockAdds)); - assert(MyBlockAdds != NULL); - Index--; - } - return *MyBlockAdds; -} - -void KaxBlockGroup::ReleaseFrames() -{ - KaxInternalBlock & MyBlock = *static_cast(this->FindElt(EBML_INFO(KaxBlock))); - MyBlock.ReleaseFrames(); -} - -void KaxInternalBlock::ReleaseFrames() -{ - // free the allocated Frames - int i; - for (i=myBuffers.size()-1; i>=0; i--) { - if (myBuffers[i] != NULL) { - myBuffers[i]->FreeBuffer(*myBuffers[i]); - delete myBuffers[i]; - myBuffers[i] = NULL; - } - } -} - -void KaxBlockGroup::SetBlockDuration(uint64 TimeLength) -{ - assert(ParentTrack != NULL); - int64 scale = ParentTrack->GlobalTimecodeScale(); - KaxBlockDuration & myDuration = *static_cast(FindFirstElt(EBML_INFO(KaxBlockDuration), true)); - *(static_cast(&myDuration)) = TimeLength / uint64(scale); -} - -bool KaxBlockGroup::GetBlockDuration(uint64 &TheTimecode) const -{ - KaxBlockDuration * myDuration = static_cast(FindElt(EBML_INFO(KaxBlockDuration))); - if (myDuration == NULL) { - return false; - } - - assert(ParentTrack != NULL); - TheTimecode = uint64(*myDuration) * ParentTrack->GlobalTimecodeScale(); - return true; -} - -KaxBlockGroup::operator KaxInternalBlock &() { - KaxBlock & theBlock = GetChild(*this); - return theBlock; -} - -void KaxBlockGroup::SetParent(KaxCluster & aParentCluster) { - ParentCluster = &aParentCluster; - KaxBlock & theBlock = GetChild(*this); - theBlock.SetParent( aParentCluster ); -} - -void KaxInternalBlock::SetParent(KaxCluster & aParentCluster) -{ - ParentCluster = &aParentCluster; - if (bLocalTimecodeUsed) { - Timecode = aParentCluster.GetBlockGlobalTimecode(LocalTimecode); - bLocalTimecodeUsed = false; - } -} - -int64 KaxInternalBlock::GetDataPosition(size_t FrameNumber) -{ - int64 _Result = -1; - - if (ValueIsSet() && FrameNumber < SizeList.size()) - { - _Result = FirstFrameLocation; - - size_t _Idx = 0; - while(FrameNumber--) - { - _Result += SizeList[_Idx++]; - } - } - - return _Result; -} - -int64 KaxInternalBlock::GetFrameSize(size_t FrameNumber) -{ - int64 _Result = -1; - - if (/*bValueIsSet &&*/ FrameNumber < SizeList.size()) - { - _Result = SizeList[FrameNumber]; - } - - return _Result; -} - -KaxBlockBlob::operator KaxBlockGroup &() -{ - assert(!bUseSimpleBlock); - assert(Block.group); - return *Block.group; -} - -KaxBlockBlob::operator const KaxBlockGroup &() const -{ - assert(!bUseSimpleBlock); - assert(Block.group); - return *Block.group; -} - -KaxBlockBlob::operator KaxInternalBlock &() -{ - assert(Block.group); -#if MATROSKA_VERSION >= 2 - if (bUseSimpleBlock) - return *Block.simpleblock; - else -#endif - return *Block.group; -} - -KaxBlockBlob::operator const KaxInternalBlock &() const -{ - assert(Block.group); -#if MATROSKA_VERSION >= 2 - if (bUseSimpleBlock) - return *Block.simpleblock; - else -#endif - return *Block.group; -} - -#if MATROSKA_VERSION >= 2 -KaxBlockBlob::operator KaxSimpleBlock &() -{ - assert(bUseSimpleBlock); - assert(Block.simpleblock); - return *Block.simpleblock; -} -#endif - -bool KaxBlockBlob::AddFrameAuto(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing, const KaxBlockBlob * PastBlock, const KaxBlockBlob * ForwBlock) -{ - bool bResult = false; -#if MATROSKA_VERSION >= 2 - if ((SimpleBlockMode == BLOCK_BLOB_ALWAYS_SIMPLE) || (SimpleBlockMode == BLOCK_BLOB_SIMPLE_AUTO && PastBlock == NULL && ForwBlock == NULL)) { - assert(bUseSimpleBlock == true); - if (Block.simpleblock == NULL) { - Block.simpleblock = new KaxSimpleBlock(); - Block.simpleblock->SetParent(*ParentCluster); - } - - bResult = Block.simpleblock->AddFrame(track, timecode, buffer, lacing); - if (PastBlock == NULL && ForwBlock == NULL) { - Block.simpleblock->SetKeyframe(true); - Block.simpleblock->SetDiscardable(false); - } else { - Block.simpleblock->SetKeyframe(false); - if ((ForwBlock == NULL || ((const KaxInternalBlock &)*ForwBlock).GlobalTimecode() <= timecode) && - (PastBlock == NULL || ((const KaxInternalBlock &)*PastBlock).GlobalTimecode() <= timecode)) - Block.simpleblock->SetDiscardable(false); - else - Block.simpleblock->SetDiscardable(true); - } - } - else -#endif - { - if (ReplaceSimpleByGroup()) { - bResult = Block.group->AddFrame(track, timecode, buffer, PastBlock, ForwBlock, lacing); - } - } - - return bResult; -} - -void KaxBlockBlob::SetParent(KaxCluster & parent_clust) -{ - ParentCluster = &parent_clust; -} - -void KaxBlockBlob::SetBlockDuration(uint64 TimeLength) -{ - if (ReplaceSimpleByGroup()) - Block.group->SetBlockDuration(TimeLength); -} - -bool KaxBlockBlob::ReplaceSimpleByGroup() -{ - if (SimpleBlockMode== BLOCK_BLOB_ALWAYS_SIMPLE) - return false; - - if (!bUseSimpleBlock) { - if (Block.group == NULL) { - Block.group = new KaxBlockGroup(); - } - } -#if MATROSKA_VERSION >= 2 - else - { - - if (Block.simpleblock != NULL) { - KaxSimpleBlock *old_simpleblock = Block.simpleblock; - Block.group = new KaxBlockGroup(); - // _TODO_ : move all the data to the blockgroup - assert(false); - // -> while(frame) AddFrame(myBuffer) - delete old_simpleblock; - } else { - Block.group = new KaxBlockGroup(); - } - } -#endif - if (ParentCluster != NULL) - Block.group->SetParent(*ParentCluster); - - bUseSimpleBlock = false; - return true; -} - -void KaxBlockBlob::SetBlockGroup( KaxBlockGroup &BlockRef ) -{ - assert(!bUseSimpleBlock); - Block.group = &BlockRef; -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxBlock.cpp 1265 2007-01-14 17:20:35Z mosu $ + \author Steve Lhomme + \author Julien Coloos +*/ +#include + +//#include + +#include "matroska/KaxBlock.h" +#include "matroska/KaxContexts.h" +#include "matroska/KaxBlockData.h" +#include "matroska/KaxCluster.h" + +START_LIBMATROSKA_NAMESPACE + +#if MATROSKA_VERSION == 1 +const EbmlSemantic KaxBlockGroup_ContextList[6] = +#else // MATROSKA_VERSION +const EbmlSemantic KaxBlockGroup_ContextList[9] = +#endif // MATROSKA_VERSION +{ + EbmlSemantic(true, true, EBML_INFO(KaxBlock)), +#if MATROSKA_VERSION >= 2 + EbmlSemantic(false, true, EBML_INFO(KaxBlockVirtual)), +#endif // MATROSKA_VERSION + EbmlSemantic(false, true, EBML_INFO(KaxBlockDuration)), + EbmlSemantic(false, true, EBML_INFO(KaxSlices)), + EbmlSemantic(true, true, EBML_INFO(KaxReferencePriority)), + EbmlSemantic(false, false, EBML_INFO(KaxReferenceBlock)), +#if MATROSKA_VERSION >= 2 + EbmlSemantic(false, true, EBML_INFO(KaxReferenceVirtual)), + EbmlSemantic(false, true, EBML_INFO(KaxCodecState)), +#endif // MATROSKA_VERSION + EbmlSemantic(false, true, EBML_INFO(KaxBlockAdditions)), +}; + +const EbmlSemantic KaxBlockAdditions_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxBlockMore)) +}; + +const EbmlSemantic KaxBlockMore_ContextList[2] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxBlockAddID)), + EbmlSemantic(true, true, EBML_INFO(KaxBlockAdditional)) +}; + +EbmlId KaxBlockGroup_TheId (0xA0, 1); +EbmlId KaxBlock_TheId (0xA1, 1); +EbmlId KaxSimpleBlock_TheId (0xA3, 1); +EbmlId KaxBlockDuration_TheId (0x9B, 1); +#if MATROSKA_VERSION >= 2 +EbmlId KaxBlockVirtual_TheId (0xA2, 1); +EbmlId KaxCodecState_TheId (0xA4, 1); +#endif // MATROSKA_VERSION +EbmlId KaxBlockAdditions_TheId (0x75A1, 2); +EbmlId KaxBlockMore_TheId (0xA6, 1); +EbmlId KaxBlockAddID_TheId (0xEE, 1); +EbmlId KaxBlockAdditional_TheId(0xA5, 1); + +const EbmlSemanticContext KaxBlockGroup_Context = EbmlSemanticContext(countof(KaxBlockGroup_ContextList), KaxBlockGroup_ContextList, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockGroup)); +const EbmlSemanticContext KaxBlock_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlock)); +const EbmlSemanticContext KaxBlockDuration_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockDuration)); +#if MATROSKA_VERSION >= 2 +const EbmlSemanticContext KaxSimpleBlock_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSimpleBlock)); +const EbmlSemanticContext KaxBlockVirtual_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockVirtual)); +const EbmlSemanticContext KaxCodecState_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecState)); +#endif // MATROSKA_VERSION +const EbmlSemanticContext KaxBlockAdditions_Context = EbmlSemanticContext(countof(KaxBlockAdditions_ContextList), KaxBlockAdditions_ContextList, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockAdditions)); +const EbmlSemanticContext KaxBlockMore_Context = EbmlSemanticContext(countof(KaxBlockMore_ContextList), KaxBlockMore_ContextList, &KaxBlockAdditions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockMore)); +const EbmlSemanticContext KaxBlockAddID_Context = EbmlSemanticContext(0, NULL, &KaxBlockMore_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockAddID)); +const EbmlSemanticContext KaxBlockAdditional_Context = EbmlSemanticContext(0, NULL, &KaxBlockMore_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxBlockAdditional)); + +const EbmlCallbacks KaxBlockGroup::ClassInfos(KaxBlockGroup::Create, KaxBlockGroup_TheId, "BlockGroup", KaxBlockGroup_Context); +const EbmlCallbacks KaxBlock::ClassInfos(KaxBlock::Create, KaxBlock_TheId, "Block", KaxBlock_Context); +const EbmlCallbacks KaxBlockDuration::ClassInfos(KaxBlockDuration::Create, KaxBlockDuration_TheId, "BlockDuration", KaxBlockDuration_Context); +#if MATROSKA_VERSION >= 2 +const EbmlCallbacks KaxSimpleBlock::ClassInfos(KaxSimpleBlock::Create, KaxSimpleBlock_TheId, "SimpleBlock", KaxSimpleBlock_Context); +const EbmlCallbacks KaxBlockVirtual::ClassInfos(KaxBlockVirtual::Create, KaxBlockVirtual_TheId, "BlockVirtual", KaxBlockVirtual_Context); +const EbmlCallbacks KaxCodecState::ClassInfos(KaxCodecState::Create, KaxCodecState_TheId, "CodecState", KaxCodecState_Context); +#endif // MATROSKA_VERSION +const EbmlCallbacks KaxBlockAdditions::ClassInfos(KaxBlockAdditions::Create, KaxBlockAdditions_TheId, "BlockAdditions", KaxBlockAdditions_Context); +const EbmlCallbacks KaxBlockMore::ClassInfos(KaxBlockMore::Create, KaxBlockMore_TheId, "BlockMore", KaxBlockMore_Context); +const EbmlCallbacks KaxBlockAddID::ClassInfos(KaxBlockAddID::Create, KaxBlockAddID_TheId, "BlockAddID", KaxBlockAddID_Context); +const EbmlCallbacks KaxBlockAdditional::ClassInfos(KaxBlockAdditional::Create, KaxBlockAdditional_TheId, "BlockAdditional", KaxBlockAdditional_Context); + +DataBuffer * DataBuffer::Clone() +{ + binary *ClonedData = (binary *)malloc(mySize * sizeof(binary)); + assert(ClonedData != NULL); + memcpy(ClonedData, myBuffer ,mySize ); + + SimpleDataBuffer * result = new SimpleDataBuffer(ClonedData, mySize, 0); + result->bValidValue = bValidValue; + return result; +} + +SimpleDataBuffer::SimpleDataBuffer(const SimpleDataBuffer & ToClone) + :DataBuffer((binary *)malloc(ToClone.mySize * sizeof(binary)), ToClone.mySize, myFreeBuffer) +{ + assert(myBuffer != NULL); + memcpy(myBuffer, ToClone.myBuffer ,mySize ); + bValidValue = ToClone.bValidValue; +} + +bool KaxInternalBlock::ValidateSize() const +{ + return (GetSize() >= 4); /// for the moment +} + +KaxInternalBlock::~KaxInternalBlock() +{ + ReleaseFrames(); +} + +KaxInternalBlock::KaxInternalBlock(const KaxInternalBlock & ElementToClone) + :EbmlBinary(ElementToClone) + ,myBuffers(ElementToClone.myBuffers.size()) + ,Timecode(ElementToClone.Timecode) + ,LocalTimecode(ElementToClone.LocalTimecode) + ,bLocalTimecodeUsed(ElementToClone.bLocalTimecodeUsed) + ,TrackNumber(ElementToClone.TrackNumber) + ,ParentCluster(ElementToClone.ParentCluster) ///< \todo not exactly +{ + // add a clone of the list + std::vector::const_iterator Itr = ElementToClone.myBuffers.begin(); + std::vector::iterator myItr = myBuffers.begin(); + while (Itr != ElementToClone.myBuffers.end()) + { + *myItr = (*Itr)->Clone(); + Itr++; myItr++; + } +} + + +KaxBlockGroup::~KaxBlockGroup() +{ +//NOTE("KaxBlockGroup::~KaxBlockGroup"); +} + +KaxBlockGroup::KaxBlockGroup() + :EbmlMaster(KaxBlockGroup_Context) + ,ParentCluster(NULL) + ,ParentTrack(NULL) +{} + +KaxBlockAdditions::KaxBlockAdditions() + :EbmlMaster(KaxBlockAdditions_Context) +{} + +KaxBlockMore::KaxBlockMore() + :EbmlMaster(KaxBlockMore_Context) +{} + +/*! + \todo handle flags + \todo hardcoded limit of the number of frames in a lace should be a parameter + \return true if more frames can be added to this Block +*/ +bool KaxInternalBlock::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing, bool invisible) +{ + SetValueIsSet(); + if (myBuffers.size() == 0) { + // first frame + Timecode = timecode; + TrackNumber = track.TrackNumber(); + mInvisible = invisible; + mLacing = lacing; + } + myBuffers.push_back(&buffer); + + // we don't allow more than 8 frames in a Block because the overhead improvement is minimal + if (myBuffers.size() >= 8 || lacing == LACING_NONE) + return false; + + if (lacing == LACING_XIPH) + // decide wether a new frame can be added or not + // a frame in a lace is not efficient when the place necessary to code it in a lace is bigger + // than the size of a simple Block. That means more than 6 bytes (4 in struct + 2 for EBML) to code the size + return (buffer.Size() < 6*0xFF); + else + return true; +} + +/*! + \return Returns the lacing type that produces the smallest footprint. +*/ +LacingType KaxInternalBlock::GetBestLacingType() const { + int XiphLacingSize, EbmlLacingSize, i; + bool SameSize = true; + + if (myBuffers.size() <= 1) + return LACING_NONE; + + XiphLacingSize = 1; // Number of laces is stored in 1 byte. + EbmlLacingSize = 1; + for (i = 0; i < (int)myBuffers.size() - 1; i++) { + if (myBuffers[i]->Size() != myBuffers[i + 1]->Size()) + SameSize = false; + XiphLacingSize += myBuffers[i]->Size() / 255 + 1; + } + EbmlLacingSize += CodedSizeLength(myBuffers[0]->Size(), 0, IsFiniteSize()); + for (i = 1; i < (int)myBuffers.size() - 1; i++) + EbmlLacingSize += CodedSizeLengthSigned(int64(myBuffers[i]->Size()) - int64(myBuffers[i - 1]->Size()), 0); + if (SameSize) + return LACING_FIXED; + else if (XiphLacingSize < EbmlLacingSize) + return LACING_XIPH; + else + return LACING_EBML; +} + +uint64 KaxInternalBlock::UpdateSize(bool bSaveDefault, bool bForceRender) +{ + LacingType LacingHere; + assert(GetData() == NULL); // Data is not used for KaxInternalBlock + assert(TrackNumber < 0x4000); // no more allowed for the moment + unsigned int i; + + // compute the final size of the data + switch (myBuffers.size()) { + case 0: + SetSize_(0); + break; + case 1: + SetSize_(4 + myBuffers[0]->Size()); + break; + default: + SetSize_(4 + 1); // 1 for the lacing head + if (mLacing == LACING_AUTO) + LacingHere = GetBestLacingType(); + else + LacingHere = mLacing; + switch (LacingHere) + { + case LACING_XIPH: + for (i=0; iSize() + (myBuffers[i]->Size() / 0xFF + 1)); + } + break; + case LACING_EBML: + SetSize_(GetSize() + myBuffers[0]->Size() + CodedSizeLength(myBuffers[0]->Size(), 0, IsFiniteSize())); + for (i=1; iSize() + CodedSizeLengthSigned(int64(myBuffers[i]->Size()) - int64(myBuffers[i-1]->Size()), 0)); + } + break; + case LACING_FIXED: + for (i=0; iSize()); + } + break; + default: + assert(0); + } + // Size of the last frame (not in lace) + SetSize_(GetSize() + myBuffers[i]->Size()); + break; + } + + if (TrackNumber >= 0x80) + SetSize_(GetSize() + 1); // the size will be coded with one more octet + + return GetSize(); +} + +#if MATROSKA_VERSION >= 2 +KaxBlockVirtual::KaxBlockVirtual(const KaxBlockVirtual & ElementToClone) + :EbmlBinary(ElementToClone) + ,Timecode(ElementToClone.Timecode) + ,TrackNumber(ElementToClone.TrackNumber) + ,ParentCluster(ElementToClone.ParentCluster) ///< \todo not exactly +{ + SetBuffer(DataBlock,sizeof(DataBlock)); + SetValueIsSet(false); +} + +uint64 KaxBlockVirtual::UpdateSize(bool bSaveDefault, bool bForceRender) +{ + assert(TrackNumber < 0x4000); + binary *cursor = GetData(); + // fill data + if (TrackNumber < 0x80) { + *cursor++ = TrackNumber | 0x80; // set the first bit to 1 + } else { + *cursor++ = (TrackNumber >> 8) | 0x40; // set the second bit to 1 + *cursor++ = TrackNumber & 0xFF; + } + + assert(ParentCluster != NULL); + int16 ActualTimecode = ParentCluster->GetBlockLocalTimecode(Timecode); + big_int16 b16(ActualTimecode); + b16.Fill(cursor); + cursor += 2; + + *cursor++ = 0; // flags + + return GetSize(); +} +#endif // MATROSKA_VERSION + +/*! + \todo more optimisation is possible (render the Block head and don't copy the buffer in memory, care should be taken with the allocation of Data) + \todo the actual timecode to write should be retrieved from the Cluster from here +*/ +uint32 KaxInternalBlock::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) +{ + if (myBuffers.size() == 0) { + return 0; + } else { + assert(TrackNumber < 0x4000); + binary BlockHead[5], *cursor = BlockHead; + unsigned int i; + + if (myBuffers.size() == 1) { + SetSize_(4); + mLacing = LACING_NONE; + } else { + if (mLacing == LACING_NONE) + mLacing = LACING_EBML; // supposedly the best of all + SetSize_(4 + 1); // 1 for the lacing head (number of laced elements) + } + if (TrackNumber > 0x80) + SetSize_(GetSize() + 1); + + // write Block Head + if (TrackNumber < 0x80) { + *cursor++ = TrackNumber | 0x80; // set the first bit to 1 + } else { + *cursor++ = (TrackNumber >> 8) | 0x40; // set the second bit to 1 + *cursor++ = TrackNumber & 0xFF; + } + + assert(ParentCluster != NULL); + int16 ActualTimecode = ParentCluster->GetBlockLocalTimecode(Timecode); + big_int16 b16(ActualTimecode); + b16.Fill(cursor); + cursor += 2; + + *cursor = 0; // flags + + if (mLacing == LACING_AUTO) { + mLacing = GetBestLacingType(); + } + + // invisible flag + if (mInvisible) + *cursor = 0x08; + + if (bIsSimple) { + if (bIsKeyframe) + *cursor |= 0x80; + if (bIsDiscardable) + *cursor |= 0x01; + } + + // lacing flag + switch (mLacing) + { + case LACING_XIPH: + *cursor++ |= 0x02; + break; + case LACING_EBML: + *cursor++ |= 0x06; + break; + case LACING_FIXED: + *cursor++ |= 0x04; + break; + case LACING_NONE: + break; + default: + assert(0); + } + + output.writeFully(BlockHead, 4 + ((TrackNumber > 0x80) ? 1 : 0)); + + binary tmpValue; + switch (mLacing) + { + case LACING_XIPH: + // number of laces + tmpValue = myBuffers.size()-1; + output.writeFully(&tmpValue, 1); + + // set the size of each member in the lace + for (i=0; iSize(); + while (tmpSize >= 0xFF) { + output.writeFully(&tmpValue, 1); + SetSize_(GetSize() + 1); + tmpSize -= 0xFF; + } + tmpValue = binary(tmpSize); + output.writeFully(&tmpValue, 1); + SetSize_(GetSize() + 1); + } + break; + case LACING_EBML: + // number of laces + tmpValue = myBuffers.size()-1; + output.writeFully(&tmpValue, 1); + + { + int64 _Size; + int _CodedSize; + binary _FinalHead[8]; // 64 bits max coded size + + _Size = myBuffers[0]->Size(); + + _CodedSize = CodedSizeLength(_Size, 0, IsFiniteSize()); + + // first size in the lace is not a signed + CodedValueLength(_Size, _CodedSize, _FinalHead); + output.writeFully(_FinalHead, _CodedSize); + SetSize_(GetSize() + _CodedSize); + + // set the size of each member in the lace + for (i=1; iSize()) - int64(myBuffers[i-1]->Size()); + _CodedSize = CodedSizeLengthSigned(_Size, 0); + CodedValueLengthSigned(_Size, _CodedSize, _FinalHead); + output.writeFully(_FinalHead, _CodedSize); + SetSize_(GetSize() + _CodedSize); + } + } + break; + case LACING_FIXED: + // number of laces + tmpValue = myBuffers.size()-1; + output.writeFully(&tmpValue, 1); + break; + case LACING_NONE: + break; + default: + assert(0); + } + + // put the data of each frame + for (i=0; iBuffer(), myBuffers[i]->Size()); + SetSize_(GetSize() + myBuffers[i]->Size()); + } + } + + return GetSize(); +} + +uint64 KaxInternalBlock::ReadInternalHead(IOCallback & input) +{ + binary Buffer[5], *cursor = Buffer; + uint64 Result = input.read(cursor, 4); + if (Result != 4) + return Result; + + // update internal values + TrackNumber = *cursor++; + if ((TrackNumber & 0x80) == 0) { + // there is extra data + if ((TrackNumber & 0x40) == 0) { + // We don't support track numbers that large ! + return Result; + } + Result += input.read(&Buffer[4], 1); + TrackNumber = (TrackNumber & 0x3F) << 8; + TrackNumber += *cursor++; + } else { + TrackNumber &= 0x7F; + } + + + big_int16 b16; + b16.Eval(cursor); + assert(ParentCluster != NULL); + Timecode = ParentCluster->GetBlockGlobalTimecode(int16(b16)); + bLocalTimecodeUsed = false; + cursor += 2; + + return Result; +} + +/*! + \todo better zero copy handling +*/ +uint64 KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully) +{ + uint64 Result; + + FirstFrameLocation = input.getFilePointer(); // will be updated accordingly below + + if (ReadFully == SCOPE_ALL_DATA) + { + Result = EbmlBinary::ReadData(input, ReadFully); + binary *cursor = GetData(); + uint8 BlockHeadSize = 4; + + // update internal values + TrackNumber = *cursor++; + if ((TrackNumber & 0x80) == 0) { + // there is extra data + if ((TrackNumber & 0x40) == 0) { + // We don't support track numbers that large ! + return Result; + } + TrackNumber = (TrackNumber & 0x3F) << 8; + TrackNumber += *cursor++; + BlockHeadSize++; + } else { + TrackNumber &= 0x7F; + } + + big_int16 b16; + b16.Eval(cursor); + LocalTimecode = int16(b16); + bLocalTimecodeUsed = true; + cursor += 2; + + if (EbmlId(*this) == EBML_ID(KaxSimpleBlock)) { + bIsKeyframe = (*cursor & 0x80) != 0; + bIsDiscardable = (*cursor & 0x01) != 0; + } + mInvisible = (*cursor & 0x08) >> 3; + mLacing = LacingType((*cursor++ & 0x06) >> 1); + + // put all Frames in the list + if (mLacing == LACING_NONE) { + FirstFrameLocation += cursor - GetData(); + DataBuffer * soloFrame = new DataBuffer(cursor, GetSize() - BlockHeadSize); + myBuffers.push_back(soloFrame); + SizeList.resize(1); + SizeList[0] = GetSize() - BlockHeadSize; + } else { + // read the number of frames in the lace + uint32 LastBufferSize = GetSize() - BlockHeadSize - 1; // 1 for number of frame + uint8 FrameNum = *cursor++; // number of frames in the lace - 1 + // read the list of frame sizes + uint8 Index; + int32 FrameSize; + uint32 SizeRead; + uint64 SizeUnknown; + + SizeList.resize(FrameNum + 1); + + switch (mLacing) + { + case LACING_XIPH: + for (Index=0; Index> 3; + mLacing = LacingType((*cursor++ & 0x06) >> 1); + if (cursor == &_TempHead[4]) + { + _TempHead[0] = _TempHead[4]; + } else { + Result += input.read(_TempHead, 1); + } + + FirstFrameLocation += cursor - _TempHead; + + // put all Frames in the list + if (mLacing != LACING_NONE) { + // read the number of frames in the lace + uint32 LastBufferSize = GetSize() - BlockHeadSize - 1; // 1 for number of frame + uint8 FrameNum = _TempHead[0]; // number of frames in the lace - 1 + // read the list of frame sizes + uint8 Index; + int32 FrameSize; + uint32 SizeRead; + uint64 SizeUnknown; + + SizeList.resize(FrameNum + 1); + + switch (mLacing) + { + case LACING_XIPH: + for (Index=0; Index(*this); + assert(ParentCluster != NULL); + theBlock.SetParent(*ParentCluster); + ParentTrack = &track; + return theBlock.AddFrame(track, timecode, buffer, lacing); +} + +bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockGroup & PastBlock, LacingType lacing) +{ +// assert(past_timecode < 0); + + KaxBlock & theBlock = GetChild(*this); + assert(ParentCluster != NULL); + theBlock.SetParent(*ParentCluster); + ParentTrack = &track; + bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing); + + KaxReferenceBlock & thePastRef = GetChild(*this); + thePastRef.SetReferencedBlock(PastBlock); + thePastRef.SetParentBlock(*this); + + return bRes; +} + +bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing) +{ +// assert(past_timecode < 0); + +// assert(forw_timecode > 0); + + KaxBlock & theBlock = GetChild(*this); + assert(ParentCluster != NULL); + theBlock.SetParent(*ParentCluster); + ParentTrack = &track; + bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing); + + KaxReferenceBlock & thePastRef = GetChild(*this); + thePastRef.SetReferencedBlock(PastBlock); + thePastRef.SetParentBlock(*this); + + KaxReferenceBlock & theFutureRef = AddNewChild(*this); + theFutureRef.SetReferencedBlock(ForwBlock); + theFutureRef.SetParentBlock(*this); + + return bRes; +} + +bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockBlob * PastBlock, const KaxBlockBlob * ForwBlock, LacingType lacing) +{ + KaxBlock & theBlock = GetChild(*this); + assert(ParentCluster != NULL); + theBlock.SetParent(*ParentCluster); + ParentTrack = &track; + bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing); + + if (PastBlock != NULL) + { + KaxReferenceBlock & thePastRef = GetChild(*this); + thePastRef.SetReferencedBlock(PastBlock); + thePastRef.SetParentBlock(*this); + } + + if (ForwBlock != NULL) + { + KaxReferenceBlock & theFutureRef = AddNewChild(*this); + theFutureRef.SetReferencedBlock(ForwBlock); + theFutureRef.SetParentBlock(*this); + } + + return bRes; +} + +/*! + \todo we may cache the reference to the timecode block +*/ +uint64 KaxBlockGroup::GlobalTimecode() const +{ + assert(ParentCluster != NULL); // impossible otherwise + KaxInternalBlock & MyBlock = *static_cast(this->FindElt(EBML_INFO(KaxBlock))); + return MyBlock.GlobalTimecode(); + +} + +uint16 KaxBlockGroup::TrackNumber() const +{ + KaxInternalBlock & MyBlock = *static_cast(this->FindElt(EBML_INFO(KaxBlock))); + return MyBlock.TrackNum(); +} + +uint64 KaxBlockGroup::ClusterPosition() const +{ + assert(ParentCluster != NULL); // impossible otherwise + return ParentCluster->GetPosition(); +} + +uint64 KaxInternalBlock::ClusterPosition() const +{ + assert(ParentCluster != NULL); // impossible otherwise + return ParentCluster->GetPosition(); +} + +unsigned int KaxBlockGroup::ReferenceCount() const +{ + unsigned int Result = 0; + KaxReferenceBlock * MyBlockAdds = static_cast(FindFirstElt(EBML_INFO(KaxReferenceBlock))); + if (MyBlockAdds != NULL) { + Result++; + while ((MyBlockAdds = static_cast(FindNextElt(*MyBlockAdds))) != NULL) + { + Result++; + } + } + return Result; +} + +const KaxReferenceBlock & KaxBlockGroup::Reference(unsigned int Index) const +{ + KaxReferenceBlock * MyBlockAdds = static_cast(FindFirstElt(EBML_INFO(KaxReferenceBlock))); + assert(MyBlockAdds != NULL); // call of a non existing reference + + while (Index != 0) { + MyBlockAdds = static_cast(FindNextElt(*MyBlockAdds)); + assert(MyBlockAdds != NULL); + Index--; + } + return *MyBlockAdds; +} + +void KaxBlockGroup::ReleaseFrames() +{ + KaxInternalBlock & MyBlock = *static_cast(this->FindElt(EBML_INFO(KaxBlock))); + MyBlock.ReleaseFrames(); +} + +void KaxInternalBlock::ReleaseFrames() +{ + // free the allocated Frames + int i; + for (i=myBuffers.size()-1; i>=0; i--) { + if (myBuffers[i] != NULL) { + myBuffers[i]->FreeBuffer(*myBuffers[i]); + delete myBuffers[i]; + myBuffers[i] = NULL; + } + } +} + +void KaxBlockGroup::SetBlockDuration(uint64 TimeLength) +{ + assert(ParentTrack != NULL); + int64 scale = ParentTrack->GlobalTimecodeScale(); + KaxBlockDuration & myDuration = *static_cast(FindFirstElt(EBML_INFO(KaxBlockDuration), true)); + *(static_cast(&myDuration)) = TimeLength / uint64(scale); +} + +bool KaxBlockGroup::GetBlockDuration(uint64 &TheTimecode) const +{ + KaxBlockDuration * myDuration = static_cast(FindElt(EBML_INFO(KaxBlockDuration))); + if (myDuration == NULL) { + return false; + } + + assert(ParentTrack != NULL); + TheTimecode = uint64(*myDuration) * ParentTrack->GlobalTimecodeScale(); + return true; +} + +KaxBlockGroup::operator KaxInternalBlock &() { + KaxBlock & theBlock = GetChild(*this); + return theBlock; +} + +void KaxBlockGroup::SetParent(KaxCluster & aParentCluster) { + ParentCluster = &aParentCluster; + KaxBlock & theBlock = GetChild(*this); + theBlock.SetParent( aParentCluster ); +} + +void KaxInternalBlock::SetParent(KaxCluster & aParentCluster) +{ + ParentCluster = &aParentCluster; + if (bLocalTimecodeUsed) { + Timecode = aParentCluster.GetBlockGlobalTimecode(LocalTimecode); + bLocalTimecodeUsed = false; + } +} + +int64 KaxInternalBlock::GetDataPosition(size_t FrameNumber) +{ + int64 _Result = -1; + + if (ValueIsSet() && FrameNumber < SizeList.size()) + { + _Result = FirstFrameLocation; + + size_t _Idx = 0; + while(FrameNumber--) + { + _Result += SizeList[_Idx++]; + } + } + + return _Result; +} + +int64 KaxInternalBlock::GetFrameSize(size_t FrameNumber) +{ + int64 _Result = -1; + + if (/*bValueIsSet &&*/ FrameNumber < SizeList.size()) + { + _Result = SizeList[FrameNumber]; + } + + return _Result; +} + +KaxBlockBlob::operator KaxBlockGroup &() +{ + assert(!bUseSimpleBlock); + assert(Block.group); + return *Block.group; +} + +KaxBlockBlob::operator const KaxBlockGroup &() const +{ + assert(!bUseSimpleBlock); + assert(Block.group); + return *Block.group; +} + +KaxBlockBlob::operator KaxInternalBlock &() +{ + assert(Block.group); +#if MATROSKA_VERSION >= 2 + if (bUseSimpleBlock) + return *Block.simpleblock; + else +#endif + return *Block.group; +} + +KaxBlockBlob::operator const KaxInternalBlock &() const +{ + assert(Block.group); +#if MATROSKA_VERSION >= 2 + if (bUseSimpleBlock) + return *Block.simpleblock; + else +#endif + return *Block.group; +} + +#if MATROSKA_VERSION >= 2 +KaxBlockBlob::operator KaxSimpleBlock &() +{ + assert(bUseSimpleBlock); + assert(Block.simpleblock); + return *Block.simpleblock; +} +#endif + +bool KaxBlockBlob::AddFrameAuto(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing, const KaxBlockBlob * PastBlock, const KaxBlockBlob * ForwBlock) +{ + bool bResult = false; +#if MATROSKA_VERSION >= 2 + if ((SimpleBlockMode == BLOCK_BLOB_ALWAYS_SIMPLE) || (SimpleBlockMode == BLOCK_BLOB_SIMPLE_AUTO && PastBlock == NULL && ForwBlock == NULL)) { + assert(bUseSimpleBlock == true); + if (Block.simpleblock == NULL) { + Block.simpleblock = new KaxSimpleBlock(); + Block.simpleblock->SetParent(*ParentCluster); + } + + bResult = Block.simpleblock->AddFrame(track, timecode, buffer, lacing); + if (PastBlock == NULL && ForwBlock == NULL) { + Block.simpleblock->SetKeyframe(true); + Block.simpleblock->SetDiscardable(false); + } else { + Block.simpleblock->SetKeyframe(false); + if ((ForwBlock == NULL || ((const KaxInternalBlock &)*ForwBlock).GlobalTimecode() <= timecode) && + (PastBlock == NULL || ((const KaxInternalBlock &)*PastBlock).GlobalTimecode() <= timecode)) + Block.simpleblock->SetDiscardable(false); + else + Block.simpleblock->SetDiscardable(true); + } + } + else +#endif + { + if (ReplaceSimpleByGroup()) { + bResult = Block.group->AddFrame(track, timecode, buffer, PastBlock, ForwBlock, lacing); + } + } + + return bResult; +} + +void KaxBlockBlob::SetParent(KaxCluster & parent_clust) +{ + ParentCluster = &parent_clust; +} + +void KaxBlockBlob::SetBlockDuration(uint64 TimeLength) +{ + if (ReplaceSimpleByGroup()) + Block.group->SetBlockDuration(TimeLength); +} + +bool KaxBlockBlob::ReplaceSimpleByGroup() +{ + if (SimpleBlockMode== BLOCK_BLOB_ALWAYS_SIMPLE) + return false; + + if (!bUseSimpleBlock) { + if (Block.group == NULL) { + Block.group = new KaxBlockGroup(); + } + } +#if MATROSKA_VERSION >= 2 + else + { + + if (Block.simpleblock != NULL) { + KaxSimpleBlock *old_simpleblock = Block.simpleblock; + Block.group = new KaxBlockGroup(); + // _TODO_ : move all the data to the blockgroup + assert(false); + // -> while(frame) AddFrame(myBuffer) + delete old_simpleblock; + } else { + Block.group = new KaxBlockGroup(); + } + } +#endif + if (ParentCluster != NULL) + Block.group->SetParent(*ParentCluster); + + bUseSimpleBlock = false; + return true; +} + +void KaxBlockBlob::SetBlockGroup( KaxBlockGroup &BlockRef ) +{ + assert(!bUseSimpleBlock); + Block.group = &BlockRef; +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxBlockData.cpp b/src/KaxBlockData.cpp index a66b793..31533b8 100644 --- a/src/KaxBlockData.cpp +++ b/src/KaxBlockData.cpp @@ -1,138 +1,138 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxBlockData.cpp 1226 2005-10-13 21:16:43Z robux4 $ - \author Steve Lhomme -*/ -#include - -#include "matroska/KaxBlockData.h" -#include "matroska/KaxContexts.h" -#include "matroska/KaxBlock.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -const EbmlSemantic KaxSlices_ContextList[1] = -{ - EbmlSemantic(false, false, EBML_INFO(KaxTimeSlice)), -}; - -const EbmlSemantic KaxTimeSlice_ContextList[5] = -{ - EbmlSemantic(false, true, EBML_INFO(KaxSliceLaceNumber)), - EbmlSemantic(false, true, EBML_INFO(KaxSliceFrameNumber)), - EbmlSemantic(false, true, EBML_INFO(KaxSliceBlockAddID)), - EbmlSemantic(false, true, EBML_INFO(KaxSliceDelay)), - EbmlSemantic(false, true, EBML_INFO(KaxSliceDuration)), -}; - -EbmlId KaxReferencePriority_TheId(0xFA, 1); -EbmlId KaxReferenceBlock_TheId (0xFB, 1); -EbmlId KaxSlices_TheId (0x8E, 1); -EbmlId KaxTimeSlice_TheId (0xE8, 1); -EbmlId KaxSliceLaceNumber_TheId (0xCC, 1); -EbmlId KaxSliceFrameNumber_TheId (0xCD, 1); -EbmlId KaxSliceBlockAddID_TheId (0xCB, 1); -EbmlId KaxSliceDelay_TheId (0xCE, 1); -EbmlId KaxSliceDuration_TheId (0xCF, 1); -#if MATROSKA_VERSION >= 2 -EbmlId KaxReferenceVirtual_TheId (0xFD, 1); -#endif // MATROSKA_VERSION - -const EbmlSemanticContext KaxReferencePriority_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxReferencePriority)); -const EbmlSemanticContext KaxReferenceBlock_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxReferenceBlock)); -const EbmlSemanticContext KaxSlices_Context = EbmlSemanticContext(countof(KaxSlices_ContextList), KaxSlices_ContextList, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSlices)); -const EbmlSemanticContext KaxTimeSlice_Context = EbmlSemanticContext(countof(KaxTimeSlice_ContextList), KaxTimeSlice_ContextList, &KaxSlices_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTimeSlice)); -const EbmlSemanticContext KaxSliceLaceNumber_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSliceLaceNumber)); -const EbmlSemanticContext KaxSliceFrameNumber_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSliceFrameNumber)); -const EbmlSemanticContext KaxSliceBlockAddID_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSliceBlockAddID)); -const EbmlSemanticContext KaxSliceDelay_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSliceDelay)); -const EbmlSemanticContext KaxSliceDuration_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSliceDuration)); -#if MATROSKA_VERSION >= 2 -const EbmlSemanticContext KaxReferenceVirtual_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxReferenceVirtual)); -#endif // MATROSKA_VERSION - -const EbmlCallbacks KaxReferencePriority::ClassInfos(KaxReferencePriority::Create, KaxReferencePriority_TheId, "FlagReferenced", KaxReferencePriority_Context); -const EbmlCallbacks KaxReferenceBlock::ClassInfos(KaxReferenceBlock::Create, KaxReferenceBlock_TheId, "ReferenceBlock", KaxReferenceBlock_Context); -const EbmlCallbacks KaxSlices::ClassInfos(KaxSlices::Create, KaxSlices_TheId, "Slices", KaxSlices_Context); -const EbmlCallbacks KaxTimeSlice::ClassInfos(KaxTimeSlice::Create, KaxTimeSlice_TheId, "TimeSlice", KaxTimeSlice_Context); -const EbmlCallbacks KaxSliceLaceNumber::ClassInfos(KaxSliceLaceNumber::Create, KaxSliceLaceNumber_TheId, "SliceLaceNumber", KaxSliceLaceNumber_Context); -const EbmlCallbacks KaxSliceFrameNumber::ClassInfos(KaxSliceFrameNumber::Create, KaxSliceFrameNumber_TheId, "SliceFrameNumber", KaxSliceFrameNumber_Context); -const EbmlCallbacks KaxSliceBlockAddID::ClassInfos(KaxSliceBlockAddID::Create, KaxSliceBlockAddID_TheId, "SliceBlockAddID", KaxSliceBlockAddID_Context); -const EbmlCallbacks KaxSliceDelay::ClassInfos(KaxSliceDelay::Create, KaxSliceDelay_TheId, "SliceDelay", KaxSliceDelay_Context); -const EbmlCallbacks KaxSliceDuration::ClassInfos(KaxSliceDuration::Create, KaxSliceDuration_TheId, "SliceDuration", KaxSliceDuration_Context); -#if MATROSKA_VERSION >= 2 -const EbmlCallbacks KaxReferenceVirtual::ClassInfos(KaxReferenceVirtual::Create, KaxReferenceVirtual_TheId, "ReferenceVirtual", KaxReferenceVirtual_Context); -#endif // MATROSKA_VERSION - -KaxSlices::KaxSlices() - :EbmlMaster(KaxSlices_Context) -{} - -KaxTimeSlice::KaxTimeSlice() - :EbmlMaster(KaxTimeSlice_Context) -{} - -const KaxBlockBlob & KaxReferenceBlock::RefBlock() const -{ - assert(RefdBlock != NULL); - return *RefdBlock; -} - -uint64 KaxReferenceBlock::UpdateSize(bool bSaveDefault, bool bForceRender) -{ - if (!bTimecodeSet) { - assert(RefdBlock != NULL); - assert(ParentBlock != NULL); - - const KaxInternalBlock &block = *RefdBlock; - *static_cast(this) = (int64(block.GlobalTimecode()) - int64(ParentBlock->GlobalTimecode())) / int64(ParentBlock->GlobalTimecodeScale()); - } - return EbmlSInteger::UpdateSize(bSaveDefault, bForceRender); -} - -void KaxReferenceBlock::SetReferencedBlock(const KaxBlockBlob * aRefdBlock) -{ - assert(RefdBlock == NULL); - assert(aRefdBlock != NULL); - RefdBlock = aRefdBlock; - SetValueIsSet(); -} - -void KaxReferenceBlock::SetReferencedBlock(const KaxBlockGroup & aRefdBlock) -{ - KaxBlockBlob *block_blob = new KaxBlockBlob(BLOCK_BLOB_NO_SIMPLE); - block_blob->SetBlockGroup(*const_cast(&aRefdBlock)); - RefdBlock = block_blob; - SetValueIsSet(); -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxBlockData.cpp 1226 2005-10-13 21:16:43Z robux4 $ + \author Steve Lhomme +*/ +#include + +#include "matroska/KaxBlockData.h" +#include "matroska/KaxContexts.h" +#include "matroska/KaxBlock.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +const EbmlSemantic KaxSlices_ContextList[1] = +{ + EbmlSemantic(false, false, EBML_INFO(KaxTimeSlice)), +}; + +const EbmlSemantic KaxTimeSlice_ContextList[5] = +{ + EbmlSemantic(false, true, EBML_INFO(KaxSliceLaceNumber)), + EbmlSemantic(false, true, EBML_INFO(KaxSliceFrameNumber)), + EbmlSemantic(false, true, EBML_INFO(KaxSliceBlockAddID)), + EbmlSemantic(false, true, EBML_INFO(KaxSliceDelay)), + EbmlSemantic(false, true, EBML_INFO(KaxSliceDuration)), +}; + +EbmlId KaxReferencePriority_TheId(0xFA, 1); +EbmlId KaxReferenceBlock_TheId (0xFB, 1); +EbmlId KaxSlices_TheId (0x8E, 1); +EbmlId KaxTimeSlice_TheId (0xE8, 1); +EbmlId KaxSliceLaceNumber_TheId (0xCC, 1); +EbmlId KaxSliceFrameNumber_TheId (0xCD, 1); +EbmlId KaxSliceBlockAddID_TheId (0xCB, 1); +EbmlId KaxSliceDelay_TheId (0xCE, 1); +EbmlId KaxSliceDuration_TheId (0xCF, 1); +#if MATROSKA_VERSION >= 2 +EbmlId KaxReferenceVirtual_TheId (0xFD, 1); +#endif // MATROSKA_VERSION + +const EbmlSemanticContext KaxReferencePriority_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxReferencePriority)); +const EbmlSemanticContext KaxReferenceBlock_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxReferenceBlock)); +const EbmlSemanticContext KaxSlices_Context = EbmlSemanticContext(countof(KaxSlices_ContextList), KaxSlices_ContextList, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSlices)); +const EbmlSemanticContext KaxTimeSlice_Context = EbmlSemanticContext(countof(KaxTimeSlice_ContextList), KaxTimeSlice_ContextList, &KaxSlices_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTimeSlice)); +const EbmlSemanticContext KaxSliceLaceNumber_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSliceLaceNumber)); +const EbmlSemanticContext KaxSliceFrameNumber_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSliceFrameNumber)); +const EbmlSemanticContext KaxSliceBlockAddID_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSliceBlockAddID)); +const EbmlSemanticContext KaxSliceDelay_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSliceDelay)); +const EbmlSemanticContext KaxSliceDuration_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSliceDuration)); +#if MATROSKA_VERSION >= 2 +const EbmlSemanticContext KaxReferenceVirtual_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxReferenceVirtual)); +#endif // MATROSKA_VERSION + +const EbmlCallbacks KaxReferencePriority::ClassInfos(KaxReferencePriority::Create, KaxReferencePriority_TheId, "FlagReferenced", KaxReferencePriority_Context); +const EbmlCallbacks KaxReferenceBlock::ClassInfos(KaxReferenceBlock::Create, KaxReferenceBlock_TheId, "ReferenceBlock", KaxReferenceBlock_Context); +const EbmlCallbacks KaxSlices::ClassInfos(KaxSlices::Create, KaxSlices_TheId, "Slices", KaxSlices_Context); +const EbmlCallbacks KaxTimeSlice::ClassInfos(KaxTimeSlice::Create, KaxTimeSlice_TheId, "TimeSlice", KaxTimeSlice_Context); +const EbmlCallbacks KaxSliceLaceNumber::ClassInfos(KaxSliceLaceNumber::Create, KaxSliceLaceNumber_TheId, "SliceLaceNumber", KaxSliceLaceNumber_Context); +const EbmlCallbacks KaxSliceFrameNumber::ClassInfos(KaxSliceFrameNumber::Create, KaxSliceFrameNumber_TheId, "SliceFrameNumber", KaxSliceFrameNumber_Context); +const EbmlCallbacks KaxSliceBlockAddID::ClassInfos(KaxSliceBlockAddID::Create, KaxSliceBlockAddID_TheId, "SliceBlockAddID", KaxSliceBlockAddID_Context); +const EbmlCallbacks KaxSliceDelay::ClassInfos(KaxSliceDelay::Create, KaxSliceDelay_TheId, "SliceDelay", KaxSliceDelay_Context); +const EbmlCallbacks KaxSliceDuration::ClassInfos(KaxSliceDuration::Create, KaxSliceDuration_TheId, "SliceDuration", KaxSliceDuration_Context); +#if MATROSKA_VERSION >= 2 +const EbmlCallbacks KaxReferenceVirtual::ClassInfos(KaxReferenceVirtual::Create, KaxReferenceVirtual_TheId, "ReferenceVirtual", KaxReferenceVirtual_Context); +#endif // MATROSKA_VERSION + +KaxSlices::KaxSlices() + :EbmlMaster(KaxSlices_Context) +{} + +KaxTimeSlice::KaxTimeSlice() + :EbmlMaster(KaxTimeSlice_Context) +{} + +const KaxBlockBlob & KaxReferenceBlock::RefBlock() const +{ + assert(RefdBlock != NULL); + return *RefdBlock; +} + +uint64 KaxReferenceBlock::UpdateSize(bool bSaveDefault, bool bForceRender) +{ + if (!bTimecodeSet) { + assert(RefdBlock != NULL); + assert(ParentBlock != NULL); + + const KaxInternalBlock &block = *RefdBlock; + *static_cast(this) = (int64(block.GlobalTimecode()) - int64(ParentBlock->GlobalTimecode())) / int64(ParentBlock->GlobalTimecodeScale()); + } + return EbmlSInteger::UpdateSize(bSaveDefault, bForceRender); +} + +void KaxReferenceBlock::SetReferencedBlock(const KaxBlockBlob * aRefdBlock) +{ + assert(RefdBlock == NULL); + assert(aRefdBlock != NULL); + RefdBlock = aRefdBlock; + SetValueIsSet(); +} + +void KaxReferenceBlock::SetReferencedBlock(const KaxBlockGroup & aRefdBlock) +{ + KaxBlockBlob *block_blob = new KaxBlockBlob(BLOCK_BLOB_NO_SIMPLE); + block_blob->SetBlockGroup(*const_cast(&aRefdBlock)); + RefdBlock = block_blob; + SetValueIsSet(); +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxChapters.cpp b/src/KaxChapters.cpp index 7281b2a..e9933ab 100644 --- a/src/KaxChapters.cpp +++ b/src/KaxChapters.cpp @@ -1,208 +1,208 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxChapters.cpp 1201 2005-08-30 14:28:27Z robux4 $ - \author Steve Lhomme -*/ -#include "matroska/KaxChapters.h" -#include "matroska/KaxContexts.h" - -// sub elements -START_LIBMATROSKA_NAMESPACE - -EbmlSemantic KaxChapters_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxEditionEntry)), -}; - -EbmlSemantic KaxEditionEntry_ContextList[5] = -{ - EbmlSemantic(false, true , EBML_INFO(KaxEditionUID)), - EbmlSemantic(true , true , EBML_INFO(KaxEditionFlagHidden)), - EbmlSemantic(true , true , EBML_INFO(KaxEditionFlagDefault)), - EbmlSemantic(false, true , EBML_INFO(KaxEditionFlagOrdered)), - EbmlSemantic(true , false, EBML_INFO(KaxChapterAtom)), -}; - -EbmlSemantic KaxChapterAtom_ContextList[12] = -{ - EbmlSemantic(false, false, EBML_INFO(KaxChapterAtom)), - EbmlSemantic(true, true, EBML_INFO(KaxChapterUID)), - EbmlSemantic(true, true, EBML_INFO(KaxChapterTimeStart)), - EbmlSemantic(false, true, EBML_INFO(KaxChapterTimeEnd)), - EbmlSemantic(true , true, EBML_INFO(KaxChapterFlagHidden)), - EbmlSemantic(true , true, EBML_INFO(KaxChapterFlagEnabled)), - EbmlSemantic(false, true, EBML_INFO(KaxChapterSegmentUID)), - EbmlSemantic(false, true, EBML_INFO(KaxChapterSegmentEditionUID)), - EbmlSemantic(false, true, EBML_INFO(KaxChapterPhysicalEquiv)), - EbmlSemantic(false, true, EBML_INFO(KaxChapterTrack)), - EbmlSemantic(false, false, EBML_INFO(KaxChapterDisplay)), - EbmlSemantic(false, false, EBML_INFO(KaxChapterProcess)), -}; - -EbmlSemantic KaxChapterTrack_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxChapterTrackNumber)), -}; - -EbmlSemantic KaxChapterDisplay_ContextList[3] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxChapterString)), - EbmlSemantic(true, false, EBML_INFO(KaxChapterLanguage)), - EbmlSemantic(false, false, EBML_INFO(KaxChapterCountry)), -}; - -EbmlSemantic KaxChapterProcess_ContextList[3] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxChapterProcessCodecID)), - EbmlSemantic(false, true, EBML_INFO(KaxChapterProcessPrivate)), - EbmlSemantic(false, false, EBML_INFO(KaxChapterProcessCommand)), -}; - -EbmlSemantic KaxChapterProcessCommand_ContextList[2] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxChapterProcessTime)), - EbmlSemantic(true, true, EBML_INFO(KaxChapterProcessData)), -}; - -const EbmlSemanticContext KaxChapters_Context = EbmlSemanticContext(countof(KaxChapters_ContextList), KaxChapters_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapters)); -const EbmlSemanticContext KaxEditionEntry_Context = EbmlSemanticContext(countof(KaxEditionEntry_ContextList), KaxEditionEntry_ContextList, &KaxChapters_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxEditionEntry)); -const EbmlSemanticContext KaxEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxEditionUID)); -const EbmlSemanticContext KaxEditionFlagHidden_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxEditionFlagHidden)); -const EbmlSemanticContext KaxEditionFlagDefault_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxEditionFlagDefault)); -const EbmlSemanticContext KaxEditionFlagOrdered_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxEditionFlagOrdered)); -const EbmlSemanticContext KaxChapterAtom_Context = EbmlSemanticContext(countof(KaxChapterAtom_ContextList), KaxChapterAtom_ContextList, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterAtom)); -const EbmlSemanticContext KaxChapterTrack_Context = EbmlSemanticContext(countof(KaxChapterTrack_ContextList), KaxChapterTrack_ContextList, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTrack)); -const EbmlSemanticContext KaxChapterDisplay_Context = EbmlSemanticContext(countof(KaxChapterDisplay_ContextList), KaxChapterDisplay_ContextList, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterDisplay)); -const EbmlSemanticContext KaxChapterUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterUID)); -const EbmlSemanticContext KaxChapterTimeStart_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTimeStart)); -const EbmlSemanticContext KaxChapterTimeEnd_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTimeEnd)); -const EbmlSemanticContext KaxChapterFlagHidden_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterFlagHidden)); -const EbmlSemanticContext KaxChapterFlagEnabled_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterFlagEnabled)); -const EbmlSemanticContext KaxChapterSegmentUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterSegmentUID)); -const EbmlSemanticContext KaxChapterSegmentEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterSegmentEditionUID)); -const EbmlSemanticContext KaxChapterPhysicalEquiv_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterPhysicalEquiv)); -const EbmlSemanticContext KaxChapterTrackNumber_Context = EbmlSemanticContext(0, NULL, &KaxChapterTrack_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTrackNumber)); -const EbmlSemanticContext KaxChapterString_Context = EbmlSemanticContext(0, NULL, &KaxChapterDisplay_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterString)); -const EbmlSemanticContext KaxChapterLanguage_Context = EbmlSemanticContext(0, NULL, &KaxChapterLanguage_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterLanguage)); -const EbmlSemanticContext KaxChapterCountry_Context = EbmlSemanticContext(0, NULL, &KaxChapterCountry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterCountry)); -const EbmlSemanticContext KaxChapterProcess_Context = EbmlSemanticContext(countof(KaxChapterProcess_ContextList), KaxChapterProcess_ContextList, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcess)); -const EbmlSemanticContext KaxChapterProcessCodecID_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcess_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcessCodecID)); -const EbmlSemanticContext KaxChapterProcessPrivate_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcess_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcessPrivate)); -const EbmlSemanticContext KaxChapterProcessCommand_Context = EbmlSemanticContext(countof(KaxChapterProcessCommand_ContextList), KaxChapterProcessCommand_ContextList, &KaxChapterProcess_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcessCommand)); -const EbmlSemanticContext KaxChapterProcessTime_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcessCommand_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcessTime)); -const EbmlSemanticContext KaxChapterProcessData_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcessCommand_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcessData)); - -EbmlId KaxChapters_TheId (0x1043A770, 4); -EbmlId KaxEditionEntry_TheId (0x45B9, 2); -EbmlId KaxEditionUID_TheId (0x45BC, 2); -EbmlId KaxEditionFlagHidden_TheId (0x45BD, 2); -EbmlId KaxEditionFlagDefault_TheId (0x45DB, 2); -EbmlId KaxEditionFlagOrdered_TheId (0x45DD, 2); -EbmlId KaxChapterAtom_TheId (0xB6, 1); -EbmlId KaxChapterUID_TheId (0x73C4, 2); -EbmlId KaxChapterTimeStart_TheId (0x91, 1); -EbmlId KaxChapterTimeEnd_TheId (0x92, 1); -EbmlId KaxChapterFlagHidden_TheId (0x98, 1); -EbmlId KaxChapterFlagEnabled_TheId (0x4598, 2); -EbmlId KaxChapterSegmentUID_TheId (0x6E67, 2); -EbmlId KaxChapterSegmentEditionUID_TheId(0x6EBC, 2); -EbmlId KaxChapterPhysicalEquiv_TheId (0x63C3, 2); -EbmlId KaxChapterTrack_TheId (0x8F, 1); -EbmlId KaxChapterTrackNumber_TheId (0x89, 1); -EbmlId KaxChapterDisplay_TheId (0x80, 1); -EbmlId KaxChapterString_TheId (0x85, 1); -EbmlId KaxChapterLanguage_TheId (0x437C, 2); -EbmlId KaxChapterCountry_TheId (0x437E, 2); -EbmlId KaxChapterProcess_TheId (0x6944, 2); -EbmlId KaxChapterProcessCodecID_TheId (0x6955, 2); -EbmlId KaxChapterProcessPrivate_TheId (0x450D, 2); -EbmlId KaxChapterProcessCommand_TheId (0x6911, 2); -EbmlId KaxChapterProcessTime_TheId (0x6922, 2); -EbmlId KaxChapterProcessData_TheId (0x6933, 2); - -const EbmlCallbacks KaxChapters::ClassInfos(KaxChapters::Create, KaxChapters_TheId, "Chapters", KaxChapters_Context); -const EbmlCallbacks KaxEditionEntry::ClassInfos(KaxEditionEntry::Create, KaxEditionEntry_TheId, "EditionEntry", KaxEditionEntry_Context); -const EbmlCallbacks KaxEditionUID::ClassInfos(KaxEditionUID::Create, KaxEditionUID_TheId, "EditionUID", KaxEditionUID_Context); -const EbmlCallbacks KaxEditionFlagHidden::ClassInfos(KaxEditionFlagHidden::Create, KaxEditionFlagHidden_TheId, "EditionFlagHidden", KaxEditionFlagHidden_Context); -const EbmlCallbacks KaxEditionFlagDefault::ClassInfos(KaxEditionFlagDefault::Create, KaxEditionFlagDefault_TheId, "EditionFlagDefault", KaxEditionFlagDefault_Context); -const EbmlCallbacks KaxEditionFlagOrdered::ClassInfos(KaxEditionFlagOrdered::Create, KaxEditionFlagOrdered_TheId, "EditionFlagOrdered", KaxEditionFlagOrdered_Context); -const EbmlCallbacks KaxChapterAtom::ClassInfos(KaxChapterAtom::Create, KaxChapterAtom_TheId, "ChapterAtom", KaxChapterAtom_Context); -const EbmlCallbacks KaxChapterUID::ClassInfos(KaxChapterUID::Create, KaxChapterUID_TheId, "ChapterUID", KaxChapterUID_Context); -const EbmlCallbacks KaxChapterTimeStart::ClassInfos(KaxChapterTimeStart::Create, KaxChapterTimeStart_TheId, "ChapterTimeStart", KaxChapterTimeStart_Context); -const EbmlCallbacks KaxChapterTimeEnd::ClassInfos(KaxChapterTimeEnd::Create, KaxChapterTimeEnd_TheId, "ChapterTimeEnd", KaxChapterTimeEnd_Context); -const EbmlCallbacks KaxChapterFlagHidden::ClassInfos(KaxChapterFlagHidden::Create, KaxChapterFlagHidden_TheId, "ChapterFlagHidden", KaxChapterFlagHidden_Context); -const EbmlCallbacks KaxChapterFlagEnabled::ClassInfos(KaxChapterFlagEnabled::Create, KaxChapterFlagEnabled_TheId, "ChapterFlagEnabled", KaxChapterFlagEnabled_Context); -const EbmlCallbacks KaxChapterSegmentUID::ClassInfos(KaxChapterSegmentUID::Create, KaxChapterSegmentUID_TheId, "ChapterSegmentUID", KaxChapterSegmentUID_Context); -const EbmlCallbacks KaxChapterSegmentEditionUID::ClassInfos(KaxChapterSegmentEditionUID::Create, KaxChapterSegmentEditionUID_TheId, "ChapterSegmentEditionUID", KaxChapterSegmentEditionUID_Context); -const EbmlCallbacks KaxChapterPhysicalEquiv::ClassInfos(KaxChapterPhysicalEquiv::Create, KaxChapterPhysicalEquiv_TheId, "ChapterPhysicalEquiv", KaxChapterPhysicalEquiv_Context); -const EbmlCallbacks KaxChapterTrack::ClassInfos(KaxChapterTrack::Create, KaxChapterTrack_TheId, "ChapterTrack", KaxChapterTrack_Context); -const EbmlCallbacks KaxChapterTrackNumber::ClassInfos(KaxChapterTrackNumber::Create, KaxChapterTrackNumber_TheId, "ChapterTrackNumber", KaxChapterTrackNumber_Context); -const EbmlCallbacks KaxChapterDisplay::ClassInfos(KaxChapterDisplay::Create, KaxChapterDisplay_TheId, "ChapterDisplay", KaxChapterDisplay_Context); -const EbmlCallbacks KaxChapterString::ClassInfos(KaxChapterString::Create, KaxChapterString_TheId, "ChapterString", KaxChapterString_Context); -const EbmlCallbacks KaxChapterLanguage::ClassInfos(KaxChapterLanguage::Create, KaxChapterLanguage_TheId, "ChapterLanguage", KaxChapterLanguage_Context); -const EbmlCallbacks KaxChapterCountry::ClassInfos(KaxChapterCountry::Create, KaxChapterCountry_TheId, "ChapterCountry", KaxChapterCountry_Context); -const EbmlCallbacks KaxChapterProcess::ClassInfos(KaxChapterProcess::Create, KaxChapterProcess_TheId, "ChapterProcess", KaxChapterProcess_Context); -const EbmlCallbacks KaxChapterProcessCodecID::ClassInfos(KaxChapterProcessCodecID::Create, KaxChapterProcessCodecID_TheId, "ChapterProcessCodecID", KaxChapterProcessCodecID_Context); -const EbmlCallbacks KaxChapterProcessPrivate::ClassInfos(KaxChapterProcessPrivate::Create, KaxChapterProcessPrivate_TheId, "ChapterProcessPrivate", KaxChapterProcessPrivate_Context); -const EbmlCallbacks KaxChapterProcessCommand::ClassInfos(KaxChapterProcessCommand::Create, KaxChapterProcessCommand_TheId, "ChapterProcessCommand", KaxChapterProcessCommand_Context); -const EbmlCallbacks KaxChapterProcessTime::ClassInfos(KaxChapterProcessTime::Create, KaxChapterProcessTime_TheId, "ChapterProcessTime", KaxChapterProcessTime_Context); -const EbmlCallbacks KaxChapterProcessData::ClassInfos(KaxChapterProcessData::Create, KaxChapterProcessData_TheId, "ChapterProcessData", KaxChapterProcessData_Context); - -KaxChapters::KaxChapters() - :EbmlMaster(KaxChapters_Context) -{} - -KaxEditionEntry::KaxEditionEntry() -:EbmlMaster(KaxEditionEntry_Context) -{} - -KaxChapterAtom::KaxChapterAtom() -:EbmlMaster(KaxChapterAtom_Context) -{} - -KaxChapterTrack::KaxChapterTrack() -:EbmlMaster(KaxChapterTrack_Context) -{} - -KaxChapterDisplay::KaxChapterDisplay() -:EbmlMaster(KaxChapterDisplay_Context) -{} - -KaxChapterProcess::KaxChapterProcess() -:EbmlMaster(KaxChapterProcess_Context) -{} - -KaxChapterProcessCommand::KaxChapterProcessCommand() -:EbmlMaster(KaxChapterProcessCommand_Context) -{} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxChapters.cpp 1201 2005-08-30 14:28:27Z robux4 $ + \author Steve Lhomme +*/ +#include "matroska/KaxChapters.h" +#include "matroska/KaxContexts.h" + +// sub elements +START_LIBMATROSKA_NAMESPACE + +EbmlSemantic KaxChapters_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxEditionEntry)), +}; + +EbmlSemantic KaxEditionEntry_ContextList[5] = +{ + EbmlSemantic(false, true , EBML_INFO(KaxEditionUID)), + EbmlSemantic(true , true , EBML_INFO(KaxEditionFlagHidden)), + EbmlSemantic(true , true , EBML_INFO(KaxEditionFlagDefault)), + EbmlSemantic(false, true , EBML_INFO(KaxEditionFlagOrdered)), + EbmlSemantic(true , false, EBML_INFO(KaxChapterAtom)), +}; + +EbmlSemantic KaxChapterAtom_ContextList[12] = +{ + EbmlSemantic(false, false, EBML_INFO(KaxChapterAtom)), + EbmlSemantic(true, true, EBML_INFO(KaxChapterUID)), + EbmlSemantic(true, true, EBML_INFO(KaxChapterTimeStart)), + EbmlSemantic(false, true, EBML_INFO(KaxChapterTimeEnd)), + EbmlSemantic(true , true, EBML_INFO(KaxChapterFlagHidden)), + EbmlSemantic(true , true, EBML_INFO(KaxChapterFlagEnabled)), + EbmlSemantic(false, true, EBML_INFO(KaxChapterSegmentUID)), + EbmlSemantic(false, true, EBML_INFO(KaxChapterSegmentEditionUID)), + EbmlSemantic(false, true, EBML_INFO(KaxChapterPhysicalEquiv)), + EbmlSemantic(false, true, EBML_INFO(KaxChapterTrack)), + EbmlSemantic(false, false, EBML_INFO(KaxChapterDisplay)), + EbmlSemantic(false, false, EBML_INFO(KaxChapterProcess)), +}; + +EbmlSemantic KaxChapterTrack_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxChapterTrackNumber)), +}; + +EbmlSemantic KaxChapterDisplay_ContextList[3] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxChapterString)), + EbmlSemantic(true, false, EBML_INFO(KaxChapterLanguage)), + EbmlSemantic(false, false, EBML_INFO(KaxChapterCountry)), +}; + +EbmlSemantic KaxChapterProcess_ContextList[3] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxChapterProcessCodecID)), + EbmlSemantic(false, true, EBML_INFO(KaxChapterProcessPrivate)), + EbmlSemantic(false, false, EBML_INFO(KaxChapterProcessCommand)), +}; + +EbmlSemantic KaxChapterProcessCommand_ContextList[2] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxChapterProcessTime)), + EbmlSemantic(true, true, EBML_INFO(KaxChapterProcessData)), +}; + +const EbmlSemanticContext KaxChapters_Context = EbmlSemanticContext(countof(KaxChapters_ContextList), KaxChapters_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapters)); +const EbmlSemanticContext KaxEditionEntry_Context = EbmlSemanticContext(countof(KaxEditionEntry_ContextList), KaxEditionEntry_ContextList, &KaxChapters_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxEditionEntry)); +const EbmlSemanticContext KaxEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxEditionUID)); +const EbmlSemanticContext KaxEditionFlagHidden_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxEditionFlagHidden)); +const EbmlSemanticContext KaxEditionFlagDefault_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxEditionFlagDefault)); +const EbmlSemanticContext KaxEditionFlagOrdered_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxEditionFlagOrdered)); +const EbmlSemanticContext KaxChapterAtom_Context = EbmlSemanticContext(countof(KaxChapterAtom_ContextList), KaxChapterAtom_ContextList, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterAtom)); +const EbmlSemanticContext KaxChapterTrack_Context = EbmlSemanticContext(countof(KaxChapterTrack_ContextList), KaxChapterTrack_ContextList, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTrack)); +const EbmlSemanticContext KaxChapterDisplay_Context = EbmlSemanticContext(countof(KaxChapterDisplay_ContextList), KaxChapterDisplay_ContextList, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterDisplay)); +const EbmlSemanticContext KaxChapterUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterUID)); +const EbmlSemanticContext KaxChapterTimeStart_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTimeStart)); +const EbmlSemanticContext KaxChapterTimeEnd_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTimeEnd)); +const EbmlSemanticContext KaxChapterFlagHidden_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterFlagHidden)); +const EbmlSemanticContext KaxChapterFlagEnabled_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterFlagEnabled)); +const EbmlSemanticContext KaxChapterSegmentUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterSegmentUID)); +const EbmlSemanticContext KaxChapterSegmentEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterSegmentEditionUID)); +const EbmlSemanticContext KaxChapterPhysicalEquiv_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterPhysicalEquiv)); +const EbmlSemanticContext KaxChapterTrackNumber_Context = EbmlSemanticContext(0, NULL, &KaxChapterTrack_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTrackNumber)); +const EbmlSemanticContext KaxChapterString_Context = EbmlSemanticContext(0, NULL, &KaxChapterDisplay_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterString)); +const EbmlSemanticContext KaxChapterLanguage_Context = EbmlSemanticContext(0, NULL, &KaxChapterLanguage_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterLanguage)); +const EbmlSemanticContext KaxChapterCountry_Context = EbmlSemanticContext(0, NULL, &KaxChapterCountry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterCountry)); +const EbmlSemanticContext KaxChapterProcess_Context = EbmlSemanticContext(countof(KaxChapterProcess_ContextList), KaxChapterProcess_ContextList, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcess)); +const EbmlSemanticContext KaxChapterProcessCodecID_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcess_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcessCodecID)); +const EbmlSemanticContext KaxChapterProcessPrivate_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcess_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcessPrivate)); +const EbmlSemanticContext KaxChapterProcessCommand_Context = EbmlSemanticContext(countof(KaxChapterProcessCommand_ContextList), KaxChapterProcessCommand_ContextList, &KaxChapterProcess_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcessCommand)); +const EbmlSemanticContext KaxChapterProcessTime_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcessCommand_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcessTime)); +const EbmlSemanticContext KaxChapterProcessData_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcessCommand_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterProcessData)); + +EbmlId KaxChapters_TheId (0x1043A770, 4); +EbmlId KaxEditionEntry_TheId (0x45B9, 2); +EbmlId KaxEditionUID_TheId (0x45BC, 2); +EbmlId KaxEditionFlagHidden_TheId (0x45BD, 2); +EbmlId KaxEditionFlagDefault_TheId (0x45DB, 2); +EbmlId KaxEditionFlagOrdered_TheId (0x45DD, 2); +EbmlId KaxChapterAtom_TheId (0xB6, 1); +EbmlId KaxChapterUID_TheId (0x73C4, 2); +EbmlId KaxChapterTimeStart_TheId (0x91, 1); +EbmlId KaxChapterTimeEnd_TheId (0x92, 1); +EbmlId KaxChapterFlagHidden_TheId (0x98, 1); +EbmlId KaxChapterFlagEnabled_TheId (0x4598, 2); +EbmlId KaxChapterSegmentUID_TheId (0x6E67, 2); +EbmlId KaxChapterSegmentEditionUID_TheId(0x6EBC, 2); +EbmlId KaxChapterPhysicalEquiv_TheId (0x63C3, 2); +EbmlId KaxChapterTrack_TheId (0x8F, 1); +EbmlId KaxChapterTrackNumber_TheId (0x89, 1); +EbmlId KaxChapterDisplay_TheId (0x80, 1); +EbmlId KaxChapterString_TheId (0x85, 1); +EbmlId KaxChapterLanguage_TheId (0x437C, 2); +EbmlId KaxChapterCountry_TheId (0x437E, 2); +EbmlId KaxChapterProcess_TheId (0x6944, 2); +EbmlId KaxChapterProcessCodecID_TheId (0x6955, 2); +EbmlId KaxChapterProcessPrivate_TheId (0x450D, 2); +EbmlId KaxChapterProcessCommand_TheId (0x6911, 2); +EbmlId KaxChapterProcessTime_TheId (0x6922, 2); +EbmlId KaxChapterProcessData_TheId (0x6933, 2); + +const EbmlCallbacks KaxChapters::ClassInfos(KaxChapters::Create, KaxChapters_TheId, "Chapters", KaxChapters_Context); +const EbmlCallbacks KaxEditionEntry::ClassInfos(KaxEditionEntry::Create, KaxEditionEntry_TheId, "EditionEntry", KaxEditionEntry_Context); +const EbmlCallbacks KaxEditionUID::ClassInfos(KaxEditionUID::Create, KaxEditionUID_TheId, "EditionUID", KaxEditionUID_Context); +const EbmlCallbacks KaxEditionFlagHidden::ClassInfos(KaxEditionFlagHidden::Create, KaxEditionFlagHidden_TheId, "EditionFlagHidden", KaxEditionFlagHidden_Context); +const EbmlCallbacks KaxEditionFlagDefault::ClassInfos(KaxEditionFlagDefault::Create, KaxEditionFlagDefault_TheId, "EditionFlagDefault", KaxEditionFlagDefault_Context); +const EbmlCallbacks KaxEditionFlagOrdered::ClassInfos(KaxEditionFlagOrdered::Create, KaxEditionFlagOrdered_TheId, "EditionFlagOrdered", KaxEditionFlagOrdered_Context); +const EbmlCallbacks KaxChapterAtom::ClassInfos(KaxChapterAtom::Create, KaxChapterAtom_TheId, "ChapterAtom", KaxChapterAtom_Context); +const EbmlCallbacks KaxChapterUID::ClassInfos(KaxChapterUID::Create, KaxChapterUID_TheId, "ChapterUID", KaxChapterUID_Context); +const EbmlCallbacks KaxChapterTimeStart::ClassInfos(KaxChapterTimeStart::Create, KaxChapterTimeStart_TheId, "ChapterTimeStart", KaxChapterTimeStart_Context); +const EbmlCallbacks KaxChapterTimeEnd::ClassInfos(KaxChapterTimeEnd::Create, KaxChapterTimeEnd_TheId, "ChapterTimeEnd", KaxChapterTimeEnd_Context); +const EbmlCallbacks KaxChapterFlagHidden::ClassInfos(KaxChapterFlagHidden::Create, KaxChapterFlagHidden_TheId, "ChapterFlagHidden", KaxChapterFlagHidden_Context); +const EbmlCallbacks KaxChapterFlagEnabled::ClassInfos(KaxChapterFlagEnabled::Create, KaxChapterFlagEnabled_TheId, "ChapterFlagEnabled", KaxChapterFlagEnabled_Context); +const EbmlCallbacks KaxChapterSegmentUID::ClassInfos(KaxChapterSegmentUID::Create, KaxChapterSegmentUID_TheId, "ChapterSegmentUID", KaxChapterSegmentUID_Context); +const EbmlCallbacks KaxChapterSegmentEditionUID::ClassInfos(KaxChapterSegmentEditionUID::Create, KaxChapterSegmentEditionUID_TheId, "ChapterSegmentEditionUID", KaxChapterSegmentEditionUID_Context); +const EbmlCallbacks KaxChapterPhysicalEquiv::ClassInfos(KaxChapterPhysicalEquiv::Create, KaxChapterPhysicalEquiv_TheId, "ChapterPhysicalEquiv", KaxChapterPhysicalEquiv_Context); +const EbmlCallbacks KaxChapterTrack::ClassInfos(KaxChapterTrack::Create, KaxChapterTrack_TheId, "ChapterTrack", KaxChapterTrack_Context); +const EbmlCallbacks KaxChapterTrackNumber::ClassInfos(KaxChapterTrackNumber::Create, KaxChapterTrackNumber_TheId, "ChapterTrackNumber", KaxChapterTrackNumber_Context); +const EbmlCallbacks KaxChapterDisplay::ClassInfos(KaxChapterDisplay::Create, KaxChapterDisplay_TheId, "ChapterDisplay", KaxChapterDisplay_Context); +const EbmlCallbacks KaxChapterString::ClassInfos(KaxChapterString::Create, KaxChapterString_TheId, "ChapterString", KaxChapterString_Context); +const EbmlCallbacks KaxChapterLanguage::ClassInfos(KaxChapterLanguage::Create, KaxChapterLanguage_TheId, "ChapterLanguage", KaxChapterLanguage_Context); +const EbmlCallbacks KaxChapterCountry::ClassInfos(KaxChapterCountry::Create, KaxChapterCountry_TheId, "ChapterCountry", KaxChapterCountry_Context); +const EbmlCallbacks KaxChapterProcess::ClassInfos(KaxChapterProcess::Create, KaxChapterProcess_TheId, "ChapterProcess", KaxChapterProcess_Context); +const EbmlCallbacks KaxChapterProcessCodecID::ClassInfos(KaxChapterProcessCodecID::Create, KaxChapterProcessCodecID_TheId, "ChapterProcessCodecID", KaxChapterProcessCodecID_Context); +const EbmlCallbacks KaxChapterProcessPrivate::ClassInfos(KaxChapterProcessPrivate::Create, KaxChapterProcessPrivate_TheId, "ChapterProcessPrivate", KaxChapterProcessPrivate_Context); +const EbmlCallbacks KaxChapterProcessCommand::ClassInfos(KaxChapterProcessCommand::Create, KaxChapterProcessCommand_TheId, "ChapterProcessCommand", KaxChapterProcessCommand_Context); +const EbmlCallbacks KaxChapterProcessTime::ClassInfos(KaxChapterProcessTime::Create, KaxChapterProcessTime_TheId, "ChapterProcessTime", KaxChapterProcessTime_Context); +const EbmlCallbacks KaxChapterProcessData::ClassInfos(KaxChapterProcessData::Create, KaxChapterProcessData_TheId, "ChapterProcessData", KaxChapterProcessData_Context); + +KaxChapters::KaxChapters() + :EbmlMaster(KaxChapters_Context) +{} + +KaxEditionEntry::KaxEditionEntry() +:EbmlMaster(KaxEditionEntry_Context) +{} + +KaxChapterAtom::KaxChapterAtom() +:EbmlMaster(KaxChapterAtom_Context) +{} + +KaxChapterTrack::KaxChapterTrack() +:EbmlMaster(KaxChapterTrack_Context) +{} + +KaxChapterDisplay::KaxChapterDisplay() +:EbmlMaster(KaxChapterDisplay_Context) +{} + +KaxChapterProcess::KaxChapterProcess() +:EbmlMaster(KaxChapterProcess_Context) +{} + +KaxChapterProcessCommand::KaxChapterProcessCommand() +:EbmlMaster(KaxChapterProcessCommand_Context) +{} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxCluster.cpp b/src/KaxCluster.cpp index df0ce91..394ff53 100644 --- a/src/KaxCluster.cpp +++ b/src/KaxCluster.cpp @@ -1,335 +1,335 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxCluster.cpp 1228 2005-10-14 19:36:51Z robux4 $ - \author Steve Lhomme -*/ -#include "matroska/KaxCluster.h" -#include "matroska/KaxClusterData.h" -#include "matroska/KaxBlock.h" -#include "matroska/KaxContexts.h" -#include "matroska/KaxSegment.h" - -// sub elements -START_LIBMATROSKA_NAMESPACE - -#if MATROSKA_VERSION == 1 -EbmlSemantic KaxCluster_ContextList[5] = -#else // MATROSKA_VERSION -EbmlSemantic KaxCluster_ContextList[6] = -#endif // MATROSKA_VERSION -{ - EbmlSemantic(true, true, EBML_INFO(KaxClusterTimecode)), - EbmlSemantic(false, true, EBML_INFO(KaxClusterSilentTracks)), - EbmlSemantic(false, true, EBML_INFO(KaxClusterPrevSize)), - EbmlSemantic(false, false, EBML_INFO(KaxBlockGroup)), -#if MATROSKA_VERSION == 2 - EbmlSemantic(false, false, EBML_INFO(KaxSimpleBlock)), -#endif - EbmlSemantic(false, true, EBML_INFO(KaxClusterPosition)), -}; - -const EbmlSemanticContext KaxCluster_Context = EbmlSemanticContext(countof(KaxCluster_ContextList), KaxCluster_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCluster)); - -EbmlId KaxCluster_TheId(0x1F43B675, 4); -const EbmlCallbacks KaxCluster::ClassInfos(KaxCluster::Create, KaxCluster_TheId, "Cluster", KaxCluster_Context); - -KaxCluster::KaxCluster() - :EbmlMaster(KaxCluster_Context) - ,currentNewBlock(NULL) - ,ParentSegment(NULL) - ,bFirstFrameInside(false) - ,bPreviousTimecodeIsSet(false) - ,bTimecodeScaleIsSet(false) - ,bSilentTracksUsed(false) -{} - -KaxCluster::KaxCluster(const KaxCluster & ElementToClone) - :EbmlMaster(ElementToClone) - ,bSilentTracksUsed(ElementToClone.bSilentTracksUsed) -{ - // update the parent of each children - std::vector::const_iterator Itr = begin(); - while (Itr != end()) - { - if (EbmlId(**Itr) == EBML_ID(KaxBlockGroup)) { - static_cast(*Itr)->SetParent(*this); - } else if (EbmlId(**Itr) == EBML_ID(KaxBlock)) { - static_cast(*Itr)->SetParent(*this); -#if MATROSKA_VERSION >= 2 - } else if (EbmlId(**Itr) == EBML_ID(KaxBlockVirtual)) { - static_cast(*Itr)->SetParent(*this); -#endif // MATROSKA_VERSION - } - } -} - -bool KaxCluster::AddBlockBlob(KaxBlockBlob * NewBlob) -{ - Blobs.push_back(NewBlob); - return true; -} - -bool KaxCluster::AddFrameInternal(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup * PastBlock, const KaxBlockGroup * ForwBlock, LacingType lacing) -{ - if (!bFirstFrameInside) { - bFirstFrameInside = true; - MinTimecode = MaxTimecode = timecode; - } else { - if (timecode < MinTimecode) - MinTimecode = timecode; - if (timecode > MaxTimecode) - MaxTimecode = timecode; - } - - MyNewBlock = NULL; - - if (lacing == LACING_NONE || !track.LacingEnabled()) { - currentNewBlock = NULL; - } - - // force creation of a new block - if (currentNewBlock == NULL || uint32(track.TrackNumber()) != uint32(currentNewBlock->TrackNumber()) || PastBlock != NULL || ForwBlock != NULL) { - KaxBlockGroup & aNewBlock = GetNewBlock(); - MyNewBlock = currentNewBlock = &aNewBlock; - currentNewBlock = &aNewBlock; - } - - if (PastBlock != NULL) { - if (ForwBlock != NULL) { - if (currentNewBlock->AddFrame(track, timecode, buffer, *PastBlock, *ForwBlock, lacing)) { - // more data are allowed in this Block - return true; - } else { - currentNewBlock = NULL; - return false; - } - } else { - if (currentNewBlock->AddFrame(track, timecode, buffer, *PastBlock, lacing)) { - // more data are allowed in this Block - return true; - } else { - currentNewBlock = NULL; - return false; - } - } - } else { - if (currentNewBlock->AddFrame(track, timecode, buffer, lacing)) { - // more data are allowed in this Block - return true; - } else { - currentNewBlock = NULL; - return false; - } - } -} - -bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, LacingType lacing) -{ - assert(Blobs.size() == 0); // mutually exclusive for the moment - return AddFrameInternal(track, timecode, buffer, MyNewBlock, NULL, NULL, lacing); -} - -bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, LacingType lacing) -{ - assert(Blobs.size() == 0); // mutually exclusive for the moment - return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, NULL, lacing); -} - -bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing) -{ - assert(Blobs.size() == 0); // mutually exclusive for the moment - return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, &ForwBlock, lacing); -} - -/*! - \todo only put the Blocks written in the cue entries -*/ -uint32 KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bSaveDefault) -{ - uint32 Result = 0; - size_t TrkIndex, Index; - - // update the Timecode of the Cluster before writing - KaxClusterTimecode * Timecode = static_cast(this->FindElt(EBML_INFO(KaxClusterTimecode))); - *static_cast(Timecode) = GlobalTimecode() / GlobalTimecodeScale(); - - if (Blobs.size() == 0) { - // old-school direct KaxBlockGroup - - // SilentTracks handling - // check the parent cluster for existing tracks and see if they are contained in this cluster or not - if (bSilentTracksUsed) - { - KaxTracks & MyTracks = *static_cast(ParentSegment->FindElt(EBML_INFO(KaxTracks))); - for (TrkIndex = 0; TrkIndex < MyTracks.ListSize(); TrkIndex++) { - if (EbmlId(*MyTracks[TrkIndex]) == EBML_ID(KaxTrackEntry)) - { - KaxTrackEntry & entry = *static_cast(MyTracks[TrkIndex]); - uint32 tracknum = entry.TrackNumber(); - for (Index = 0; Index < ListSize(); Index++) { - if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) { - KaxBlockGroup & group = *static_cast((*this)[Index]); - if (group.TrackNumber() == tracknum) - break; // this track is used - } - } - // the track wasn't found in this cluster - if (Index == ListSize()) - { - KaxClusterSilentTracks * SilentTracks = static_cast(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks))); - assert(SilentTracks != NULL); // the flag bSilentTracksUsed should be set when creating the Cluster - KaxClusterSilentTrackNumber * trackelt = static_cast(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber))); - *static_cast(trackelt) = tracknum; - } - } - } - } - - Result = EbmlMaster::Render(output, bSaveDefault); - // For all Blocks add their position on the CueEntry - - for (Index = 0; Index < ListSize(); Index++) { - if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) { - CueToUpdate.PositionSet(*static_cast((*this)[Index])); - } - } - } else { - // new school, using KaxBlockBlob - for (Index = 0; Index= 2 - if (Blobs[Index]->IsSimpleBlock()) - PushElement( (KaxSimpleBlock&) *Blobs[Index] ); - else -#endif - PushElement( (KaxBlockGroup&) *Blobs[Index] ); - } - - // SilentTracks handling - // check the parent cluster for existing tracks and see if they are contained in this cluster or not - if (bSilentTracksUsed) - { - KaxTracks & MyTracks = *static_cast(ParentSegment->FindElt(EBML_INFO(KaxTracks))); - for (TrkIndex = 0; TrkIndex < MyTracks.ListSize(); TrkIndex++) { - if (EbmlId(*MyTracks[TrkIndex]) == EBML_ID(KaxTrackEntry)) - { - KaxTrackEntry & entry = *static_cast(MyTracks[TrkIndex]); - uint32 tracknum = entry.TrackNumber(); - for (Index = 0; Index(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks))); - assert(SilentTracks != NULL); // the flag bSilentTracksUsed should be set when creating the Cluster - KaxClusterSilentTrackNumber * trackelt = static_cast(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber))); - *static_cast(trackelt) = tracknum; - } - } - } - } - - Result = EbmlMaster::Render(output, bSaveDefault); - - // For all Blocks add their position on the CueEntry - for (Index = 0; Index= int16(0x8000) && TimecodeDelay <= int16(0x7FFF)); - return int16(TimecodeDelay); -} - -uint64 KaxCluster::GetBlockGlobalTimecode(int16 GlobalSavedTimecode) -{ - if (!bFirstFrameInside) { - KaxClusterTimecode * Timecode = static_cast(this->FindElt(EBML_INFO(KaxClusterTimecode))); - assert (bFirstFrameInside); // use the InitTimecode() hack for now - MinTimecode = MaxTimecode = PreviousTimecode = *static_cast(Timecode); - bFirstFrameInside = true; - bPreviousTimecodeIsSet = true; - } - return int64(GlobalSavedTimecode * GlobalTimecodeScale()) + GlobalTimecode(); -} - -KaxBlockGroup & KaxCluster::GetNewBlock() -{ - KaxBlockGroup & MyBlock = AddNewChild(*this); - MyBlock.SetParent(*this); - return MyBlock; -} - -void KaxCluster::ReleaseFrames() -{ - size_t Index; - - for (Index = 0; Index < ListSize(); Index++) { - if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) { - static_cast((*this)[Index])->ReleaseFrames(); - } - } -} - -uint64 KaxCluster::GetPosition() const -{ - assert(ParentSegment != NULL); - return ParentSegment->GetRelativePosition(*this); -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxCluster.cpp 1228 2005-10-14 19:36:51Z robux4 $ + \author Steve Lhomme +*/ +#include "matroska/KaxCluster.h" +#include "matroska/KaxClusterData.h" +#include "matroska/KaxBlock.h" +#include "matroska/KaxContexts.h" +#include "matroska/KaxSegment.h" + +// sub elements +START_LIBMATROSKA_NAMESPACE + +#if MATROSKA_VERSION == 1 +EbmlSemantic KaxCluster_ContextList[5] = +#else // MATROSKA_VERSION +EbmlSemantic KaxCluster_ContextList[6] = +#endif // MATROSKA_VERSION +{ + EbmlSemantic(true, true, EBML_INFO(KaxClusterTimecode)), + EbmlSemantic(false, true, EBML_INFO(KaxClusterSilentTracks)), + EbmlSemantic(false, true, EBML_INFO(KaxClusterPrevSize)), + EbmlSemantic(false, false, EBML_INFO(KaxBlockGroup)), +#if MATROSKA_VERSION == 2 + EbmlSemantic(false, false, EBML_INFO(KaxSimpleBlock)), +#endif + EbmlSemantic(false, true, EBML_INFO(KaxClusterPosition)), +}; + +const EbmlSemanticContext KaxCluster_Context = EbmlSemanticContext(countof(KaxCluster_ContextList), KaxCluster_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCluster)); + +EbmlId KaxCluster_TheId(0x1F43B675, 4); +const EbmlCallbacks KaxCluster::ClassInfos(KaxCluster::Create, KaxCluster_TheId, "Cluster", KaxCluster_Context); + +KaxCluster::KaxCluster() + :EbmlMaster(KaxCluster_Context) + ,currentNewBlock(NULL) + ,ParentSegment(NULL) + ,bFirstFrameInside(false) + ,bPreviousTimecodeIsSet(false) + ,bTimecodeScaleIsSet(false) + ,bSilentTracksUsed(false) +{} + +KaxCluster::KaxCluster(const KaxCluster & ElementToClone) + :EbmlMaster(ElementToClone) + ,bSilentTracksUsed(ElementToClone.bSilentTracksUsed) +{ + // update the parent of each children + std::vector::const_iterator Itr = begin(); + while (Itr != end()) + { + if (EbmlId(**Itr) == EBML_ID(KaxBlockGroup)) { + static_cast(*Itr)->SetParent(*this); + } else if (EbmlId(**Itr) == EBML_ID(KaxBlock)) { + static_cast(*Itr)->SetParent(*this); +#if MATROSKA_VERSION >= 2 + } else if (EbmlId(**Itr) == EBML_ID(KaxBlockVirtual)) { + static_cast(*Itr)->SetParent(*this); +#endif // MATROSKA_VERSION + } + } +} + +bool KaxCluster::AddBlockBlob(KaxBlockBlob * NewBlob) +{ + Blobs.push_back(NewBlob); + return true; +} + +bool KaxCluster::AddFrameInternal(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup * PastBlock, const KaxBlockGroup * ForwBlock, LacingType lacing) +{ + if (!bFirstFrameInside) { + bFirstFrameInside = true; + MinTimecode = MaxTimecode = timecode; + } else { + if (timecode < MinTimecode) + MinTimecode = timecode; + if (timecode > MaxTimecode) + MaxTimecode = timecode; + } + + MyNewBlock = NULL; + + if (lacing == LACING_NONE || !track.LacingEnabled()) { + currentNewBlock = NULL; + } + + // force creation of a new block + if (currentNewBlock == NULL || uint32(track.TrackNumber()) != uint32(currentNewBlock->TrackNumber()) || PastBlock != NULL || ForwBlock != NULL) { + KaxBlockGroup & aNewBlock = GetNewBlock(); + MyNewBlock = currentNewBlock = &aNewBlock; + currentNewBlock = &aNewBlock; + } + + if (PastBlock != NULL) { + if (ForwBlock != NULL) { + if (currentNewBlock->AddFrame(track, timecode, buffer, *PastBlock, *ForwBlock, lacing)) { + // more data are allowed in this Block + return true; + } else { + currentNewBlock = NULL; + return false; + } + } else { + if (currentNewBlock->AddFrame(track, timecode, buffer, *PastBlock, lacing)) { + // more data are allowed in this Block + return true; + } else { + currentNewBlock = NULL; + return false; + } + } + } else { + if (currentNewBlock->AddFrame(track, timecode, buffer, lacing)) { + // more data are allowed in this Block + return true; + } else { + currentNewBlock = NULL; + return false; + } + } +} + +bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, LacingType lacing) +{ + assert(Blobs.size() == 0); // mutually exclusive for the moment + return AddFrameInternal(track, timecode, buffer, MyNewBlock, NULL, NULL, lacing); +} + +bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, LacingType lacing) +{ + assert(Blobs.size() == 0); // mutually exclusive for the moment + return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, NULL, lacing); +} + +bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing) +{ + assert(Blobs.size() == 0); // mutually exclusive for the moment + return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, &ForwBlock, lacing); +} + +/*! + \todo only put the Blocks written in the cue entries +*/ +uint32 KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bSaveDefault) +{ + uint32 Result = 0; + size_t TrkIndex, Index; + + // update the Timecode of the Cluster before writing + KaxClusterTimecode * Timecode = static_cast(this->FindElt(EBML_INFO(KaxClusterTimecode))); + *static_cast(Timecode) = GlobalTimecode() / GlobalTimecodeScale(); + + if (Blobs.size() == 0) { + // old-school direct KaxBlockGroup + + // SilentTracks handling + // check the parent cluster for existing tracks and see if they are contained in this cluster or not + if (bSilentTracksUsed) + { + KaxTracks & MyTracks = *static_cast(ParentSegment->FindElt(EBML_INFO(KaxTracks))); + for (TrkIndex = 0; TrkIndex < MyTracks.ListSize(); TrkIndex++) { + if (EbmlId(*MyTracks[TrkIndex]) == EBML_ID(KaxTrackEntry)) + { + KaxTrackEntry & entry = *static_cast(MyTracks[TrkIndex]); + uint32 tracknum = entry.TrackNumber(); + for (Index = 0; Index < ListSize(); Index++) { + if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) { + KaxBlockGroup & group = *static_cast((*this)[Index]); + if (group.TrackNumber() == tracknum) + break; // this track is used + } + } + // the track wasn't found in this cluster + if (Index == ListSize()) + { + KaxClusterSilentTracks * SilentTracks = static_cast(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks))); + assert(SilentTracks != NULL); // the flag bSilentTracksUsed should be set when creating the Cluster + KaxClusterSilentTrackNumber * trackelt = static_cast(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber))); + *static_cast(trackelt) = tracknum; + } + } + } + } + + Result = EbmlMaster::Render(output, bSaveDefault); + // For all Blocks add their position on the CueEntry + + for (Index = 0; Index < ListSize(); Index++) { + if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) { + CueToUpdate.PositionSet(*static_cast((*this)[Index])); + } + } + } else { + // new school, using KaxBlockBlob + for (Index = 0; Index= 2 + if (Blobs[Index]->IsSimpleBlock()) + PushElement( (KaxSimpleBlock&) *Blobs[Index] ); + else +#endif + PushElement( (KaxBlockGroup&) *Blobs[Index] ); + } + + // SilentTracks handling + // check the parent cluster for existing tracks and see if they are contained in this cluster or not + if (bSilentTracksUsed) + { + KaxTracks & MyTracks = *static_cast(ParentSegment->FindElt(EBML_INFO(KaxTracks))); + for (TrkIndex = 0; TrkIndex < MyTracks.ListSize(); TrkIndex++) { + if (EbmlId(*MyTracks[TrkIndex]) == EBML_ID(KaxTrackEntry)) + { + KaxTrackEntry & entry = *static_cast(MyTracks[TrkIndex]); + uint32 tracknum = entry.TrackNumber(); + for (Index = 0; Index(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks))); + assert(SilentTracks != NULL); // the flag bSilentTracksUsed should be set when creating the Cluster + KaxClusterSilentTrackNumber * trackelt = static_cast(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber))); + *static_cast(trackelt) = tracknum; + } + } + } + } + + Result = EbmlMaster::Render(output, bSaveDefault); + + // For all Blocks add their position on the CueEntry + for (Index = 0; Index= int16(0x8000) && TimecodeDelay <= int16(0x7FFF)); + return int16(TimecodeDelay); +} + +uint64 KaxCluster::GetBlockGlobalTimecode(int16 GlobalSavedTimecode) +{ + if (!bFirstFrameInside) { + KaxClusterTimecode * Timecode = static_cast(this->FindElt(EBML_INFO(KaxClusterTimecode))); + assert (bFirstFrameInside); // use the InitTimecode() hack for now + MinTimecode = MaxTimecode = PreviousTimecode = *static_cast(Timecode); + bFirstFrameInside = true; + bPreviousTimecodeIsSet = true; + } + return int64(GlobalSavedTimecode * GlobalTimecodeScale()) + GlobalTimecode(); +} + +KaxBlockGroup & KaxCluster::GetNewBlock() +{ + KaxBlockGroup & MyBlock = AddNewChild(*this); + MyBlock.SetParent(*this); + return MyBlock; +} + +void KaxCluster::ReleaseFrames() +{ + size_t Index; + + for (Index = 0; Index < ListSize(); Index++) { + if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) { + static_cast((*this)[Index])->ReleaseFrames(); + } + } +} + +uint64 KaxCluster::GetPosition() const +{ + assert(ParentSegment != NULL); + return ParentSegment->GetRelativePosition(*this); +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxClusterData.cpp b/src/KaxClusterData.cpp index 68b08f3..9bf6b99 100644 --- a/src/KaxClusterData.cpp +++ b/src/KaxClusterData.cpp @@ -1,67 +1,67 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxClusterData.cpp 955 2004-11-28 15:24:37Z robux4 $ - \author Steve Lhomme -*/ -#include "matroska/KaxClusterData.h" -#include "matroska/KaxContexts.h" - -START_LIBMATROSKA_NAMESPACE - -EbmlId KaxClusterTimecode_TheId (0xE7, 1); -EbmlId KaxClusterSilentTracks_TheId (0x5854, 2); -EbmlId KaxClusterSilentTrackNumber_TheId(0x58D7, 2); -EbmlId KaxClusterPrevSize_TheId (0xAB, 1); -EbmlId KaxClusterPosition_TheId (0xA7, 1); - -EbmlSemantic KaxClusterSilentTracks_ContextList[1] = -{ - EbmlSemantic(false, false, EBML_INFO(KaxClusterSilentTrackNumber)), -}; - -const EbmlSemanticContext KaxClusterTimecode_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxClusterTimecode)); -const EbmlSemanticContext KaxClusterSilentTracks_Context = EbmlSemanticContext(countof(KaxClusterSilentTracks_ContextList), KaxClusterSilentTracks_ContextList, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxClusterSilentTracks)); -const EbmlSemanticContext KaxClusterSilentTrackNumber_Context = EbmlSemanticContext(0, NULL, &KaxClusterSilentTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxClusterSilentTrackNumber)); -const EbmlSemanticContext KaxClusterPosition_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxClusterPosition)); -const EbmlSemanticContext KaxClusterPrevSize_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxClusterPrevSize)); - -const EbmlCallbacks KaxClusterTimecode::ClassInfos(KaxClusterTimecode::Create, KaxClusterTimecode_TheId, "ClusterTimecode", KaxClusterTimecode_Context); -const EbmlCallbacks KaxClusterSilentTracks::ClassInfos(KaxClusterSilentTracks::Create, KaxClusterSilentTracks_TheId, "ClusterSilentTracks", KaxClusterSilentTracks_Context); -const EbmlCallbacks KaxClusterSilentTrackNumber::ClassInfos(KaxClusterSilentTrackNumber::Create, KaxClusterSilentTrackNumber_TheId, "ClusterSilentTrackNumber", KaxClusterSilentTrackNumber_Context); -const EbmlCallbacks KaxClusterPrevSize::ClassInfos(KaxClusterPrevSize::Create, KaxClusterPrevSize_TheId, "ClusterPrevSize", KaxClusterPrevSize_Context); -const EbmlCallbacks KaxClusterPosition::ClassInfos(KaxClusterPosition::Create, KaxClusterPosition_TheId, "ClusterPosition", KaxClusterPosition_Context); - -KaxClusterSilentTracks::KaxClusterSilentTracks() -:EbmlMaster(KaxClusterSilentTracks_Context) -{} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxClusterData.cpp 955 2004-11-28 15:24:37Z robux4 $ + \author Steve Lhomme +*/ +#include "matroska/KaxClusterData.h" +#include "matroska/KaxContexts.h" + +START_LIBMATROSKA_NAMESPACE + +EbmlId KaxClusterTimecode_TheId (0xE7, 1); +EbmlId KaxClusterSilentTracks_TheId (0x5854, 2); +EbmlId KaxClusterSilentTrackNumber_TheId(0x58D7, 2); +EbmlId KaxClusterPrevSize_TheId (0xAB, 1); +EbmlId KaxClusterPosition_TheId (0xA7, 1); + +EbmlSemantic KaxClusterSilentTracks_ContextList[1] = +{ + EbmlSemantic(false, false, EBML_INFO(KaxClusterSilentTrackNumber)), +}; + +const EbmlSemanticContext KaxClusterTimecode_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxClusterTimecode)); +const EbmlSemanticContext KaxClusterSilentTracks_Context = EbmlSemanticContext(countof(KaxClusterSilentTracks_ContextList), KaxClusterSilentTracks_ContextList, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxClusterSilentTracks)); +const EbmlSemanticContext KaxClusterSilentTrackNumber_Context = EbmlSemanticContext(0, NULL, &KaxClusterSilentTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxClusterSilentTrackNumber)); +const EbmlSemanticContext KaxClusterPosition_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxClusterPosition)); +const EbmlSemanticContext KaxClusterPrevSize_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxClusterPrevSize)); + +const EbmlCallbacks KaxClusterTimecode::ClassInfos(KaxClusterTimecode::Create, KaxClusterTimecode_TheId, "ClusterTimecode", KaxClusterTimecode_Context); +const EbmlCallbacks KaxClusterSilentTracks::ClassInfos(KaxClusterSilentTracks::Create, KaxClusterSilentTracks_TheId, "ClusterSilentTracks", KaxClusterSilentTracks_Context); +const EbmlCallbacks KaxClusterSilentTrackNumber::ClassInfos(KaxClusterSilentTrackNumber::Create, KaxClusterSilentTrackNumber_TheId, "ClusterSilentTrackNumber", KaxClusterSilentTrackNumber_Context); +const EbmlCallbacks KaxClusterPrevSize::ClassInfos(KaxClusterPrevSize::Create, KaxClusterPrevSize_TheId, "ClusterPrevSize", KaxClusterPrevSize_Context); +const EbmlCallbacks KaxClusterPosition::ClassInfos(KaxClusterPosition::Create, KaxClusterPosition_TheId, "ClusterPosition", KaxClusterPosition_Context); + +KaxClusterSilentTracks::KaxClusterSilentTracks() +:EbmlMaster(KaxClusterSilentTracks_Context) +{} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxContentEncoding.cpp b/src/KaxContentEncoding.cpp index d6f698c..6d54da5 100644 --- a/src/KaxContentEncoding.cpp +++ b/src/KaxContentEncoding.cpp @@ -1,254 +1,254 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxContentEncoding.cpp 640 2004-07-09 21:05:36Z mosu $ - \author Moritz Bunkus -*/ -#include "matroska/KaxContentEncoding.h" -#include "matroska/KaxContexts.h" - -START_LIBMATROSKA_NAMESPACE - -const EbmlSemantic KaxContentEncodings_ContextList[1] = { - EbmlSemantic(true, true, EBML_INFO(KaxContentEncoding)), -}; - -const EbmlSemantic KaxContentEncoding_ContextList[5] = { - EbmlSemantic(true, true, EBML_INFO(KaxContentEncodingOrder)), - EbmlSemantic(true, true, EBML_INFO(KaxContentEncodingScope)), - EbmlSemantic(true, true, EBML_INFO(KaxContentEncodingType)), - EbmlSemantic(false, true, EBML_INFO(KaxContentCompression)), - EbmlSemantic(false, true, EBML_INFO(KaxContentEncryption)), -}; - -const EbmlSemantic KaxContentCompression_ContextList[2] = { - EbmlSemantic(true, true, EBML_INFO(KaxContentCompAlgo)), - EbmlSemantic(false, true, EBML_INFO(KaxContentCompSettings)), -}; - -const EbmlSemantic KaxContentEncryption_ContextList[6] = { - EbmlSemantic(false, true, EBML_INFO(KaxContentEncAlgo)), - EbmlSemantic(false, true, EBML_INFO(KaxContentEncKeyID)), - EbmlSemantic(false, true, EBML_INFO(KaxContentSignature)), - EbmlSemantic(false, true, EBML_INFO(KaxContentSigKeyID)), - EbmlSemantic(false, true, EBML_INFO(KaxContentSigAlgo)), - EbmlSemantic(false, true, EBML_INFO(KaxContentSigHashAlgo)), -}; - -EbmlId KaxContentEncodings_TheId (0x6d80, 2); -EbmlId KaxContentEncoding_TheId (0x6240, 2); -EbmlId KaxContentEncodingOrder_TheId (0x5031, 2); -EbmlId KaxContentEncodingScope_TheId (0x5032, 2); -EbmlId KaxContentEncodingType_TheId (0x5033, 2); -EbmlId KaxContentCompression_TheId (0x5034, 2); -EbmlId KaxContentCompAlgo_TheId (0x4254, 2); -EbmlId KaxContentCompSettings_TheId (0x4255, 2); -EbmlId KaxContentEncryption_TheId (0x5035, 2); -EbmlId KaxContentEncAlgo_TheId (0x47e1, 2); -EbmlId KaxContentEncKeyID_TheId (0x47e2, 2); -EbmlId KaxContentSignature_TheId (0x47e3, 2); -EbmlId KaxContentSigKeyID_TheId (0x47e4, 2); -EbmlId KaxContentSigAlgo_TheId (0x47e5, 2); -EbmlId KaxContentSigHashAlgo_TheId (0x47e6, 2); - -const EbmlSemanticContext KaxContentEncodings_Context = -EbmlSemanticContext(countof(KaxContentEncodings_ContextList), - KaxContentEncodings_ContextList, &KaxTrackEntry_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentEncodings)); - -const EbmlSemanticContext KaxContentEncoding_Context = -EbmlSemanticContext(countof(KaxContentEncoding_ContextList), - KaxContentEncoding_ContextList, - &KaxContentEncodings_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentEncoding)); - -const EbmlSemanticContext KaxContentEncodingOrder_Context = -EbmlSemanticContext(0, NULL, &KaxContentEncoding_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentEncodingOrder)); - -const EbmlSemanticContext KaxContentEncodingScope_Context = -EbmlSemanticContext(0, NULL, &KaxContentEncoding_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentEncodingScope)); - -const EbmlSemanticContext KaxContentEncodingType_Context = -EbmlSemanticContext(0, NULL, &KaxContentEncoding_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentEncodingType)); - -const EbmlSemanticContext KaxContentCompression_Context = -EbmlSemanticContext(countof(KaxContentCompression_ContextList), - KaxContentCompression_ContextList, - &KaxContentEncoding_Context, *GetKaxGlobal_Context, - &EBML_INFO(KaxContentCompression)); - -const EbmlSemanticContext KaxContentCompAlgo_Context = -EbmlSemanticContext(0, NULL, &KaxContentCompression_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentCompAlgo)); - -const EbmlSemanticContext KaxContentCompSettings_Context = -EbmlSemanticContext(0, NULL, &KaxContentCompression_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentCompSettings)); - -const EbmlSemanticContext KaxContentEncryption_Context = -EbmlSemanticContext(countof(KaxContentEncryption_ContextList), - KaxContentEncryption_ContextList, - &KaxContentEncoding_Context, *GetKaxGlobal_Context, - &EBML_INFO(KaxContentEncryption)); - -const EbmlSemanticContext KaxContentEncAlgo_Context = -EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentEncAlgo)); - -const EbmlSemanticContext KaxContentEncKeyID_Context = -EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentEncKeyID)); - -const EbmlSemanticContext KaxContentSignature_Context = -EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentSignature)); - -const EbmlSemanticContext KaxContentSigAlgo_Context = -EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentSigKeyID)); - -const EbmlSemanticContext KaxContentSigHashAlgo_Context = -EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentSigKeyID)); - -const EbmlSemanticContext KaxContentSigKeyID_Context = -EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, - *GetKaxGlobal_Context, - &EBML_INFO(KaxContentSigKeyID)); - -const EbmlCallbacks -KaxContentEncodings::ClassInfos(KaxContentEncodings::Create, - KaxContentEncodings_TheId, - "ContentEncodings", - KaxContentEncodings_Context); -const EbmlCallbacks -KaxContentEncoding::ClassInfos(KaxContentEncoding::Create, - KaxContentEncoding_TheId, - "ContentEncoding", - KaxContentEncoding_Context); -const EbmlCallbacks -KaxContentEncodingOrder::ClassInfos(KaxContentEncodingOrder::Create, - KaxContentEncodingOrder_TheId, - "ContentEncodingOrder", - KaxContentEncodingOrder_Context); -const EbmlCallbacks -KaxContentEncodingScope::ClassInfos(KaxContentEncodingScope::Create, - KaxContentEncodingScope_TheId, - "ContentEncodingScope", - KaxContentEncodingScope_Context); -const EbmlCallbacks -KaxContentEncodingType::ClassInfos(KaxContentEncodingType::Create, - KaxContentEncodingType_TheId, - "ContentEncodingType", - KaxContentEncodingType_Context); -const EbmlCallbacks -KaxContentCompression::ClassInfos(KaxContentCompression::Create, - KaxContentCompression_TheId, - "ContentCompression", - KaxContentCompression_Context); -const EbmlCallbacks -KaxContentCompAlgo::ClassInfos(KaxContentCompAlgo::Create, - KaxContentCompAlgo_TheId, - "ContentCompAlgo", - KaxContentCompAlgo_Context); -const EbmlCallbacks -KaxContentCompSettings::ClassInfos(KaxContentCompSettings::Create, - KaxContentCompSettings_TheId, - "ContentCompSettings", - KaxContentCompSettings_Context); -const EbmlCallbacks -KaxContentEncryption::ClassInfos(KaxContentEncryption::Create, - KaxContentEncryption_TheId, - "ContentEncryption", - KaxContentEncryption_Context); -const EbmlCallbacks -KaxContentEncAlgo::ClassInfos(KaxContentEncAlgo::Create, - KaxContentEncAlgo_TheId, - "ContentEncAlgo", - KaxContentEncAlgo_Context); -const EbmlCallbacks -KaxContentEncKeyID::ClassInfos(KaxContentEncKeyID::Create, - KaxContentEncKeyID_TheId, - "ContentEncKeyID", - KaxContentEncKeyID_Context); -const EbmlCallbacks -KaxContentSignature::ClassInfos(KaxContentSignature::Create, - KaxContentSignature_TheId, - "ContentSignature", - KaxContentSignature_Context); -const EbmlCallbacks -KaxContentSigAlgo::ClassInfos(KaxContentSigAlgo::Create, - KaxContentSigAlgo_TheId, - "ContentSigAlgo", - KaxContentSigAlgo_Context); -const EbmlCallbacks -KaxContentSigHashAlgo::ClassInfos(KaxContentSigHashAlgo::Create, - KaxContentSigHashAlgo_TheId, - "ContentSigHashAlgo", - KaxContentSigHashAlgo_Context); -const EbmlCallbacks -KaxContentSigKeyID::ClassInfos(KaxContentSigKeyID::Create, - KaxContentSigKeyID_TheId, - "ContentSigKeyID", - KaxContentSigKeyID_Context); - -KaxContentEncodings::KaxContentEncodings(): - EbmlMaster(KaxContentEncodings_Context) { -} - -KaxContentEncoding::KaxContentEncoding(): - EbmlMaster(KaxContentEncoding_Context) { -} - -KaxContentCompression::KaxContentCompression(): - EbmlMaster(KaxContentCompression_Context) { -} - -KaxContentEncryption::KaxContentEncryption(): - EbmlMaster(KaxContentEncryption_Context) { -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxContentEncoding.cpp 640 2004-07-09 21:05:36Z mosu $ + \author Moritz Bunkus +*/ +#include "matroska/KaxContentEncoding.h" +#include "matroska/KaxContexts.h" + +START_LIBMATROSKA_NAMESPACE + +const EbmlSemantic KaxContentEncodings_ContextList[1] = { + EbmlSemantic(true, true, EBML_INFO(KaxContentEncoding)), +}; + +const EbmlSemantic KaxContentEncoding_ContextList[5] = { + EbmlSemantic(true, true, EBML_INFO(KaxContentEncodingOrder)), + EbmlSemantic(true, true, EBML_INFO(KaxContentEncodingScope)), + EbmlSemantic(true, true, EBML_INFO(KaxContentEncodingType)), + EbmlSemantic(false, true, EBML_INFO(KaxContentCompression)), + EbmlSemantic(false, true, EBML_INFO(KaxContentEncryption)), +}; + +const EbmlSemantic KaxContentCompression_ContextList[2] = { + EbmlSemantic(true, true, EBML_INFO(KaxContentCompAlgo)), + EbmlSemantic(false, true, EBML_INFO(KaxContentCompSettings)), +}; + +const EbmlSemantic KaxContentEncryption_ContextList[6] = { + EbmlSemantic(false, true, EBML_INFO(KaxContentEncAlgo)), + EbmlSemantic(false, true, EBML_INFO(KaxContentEncKeyID)), + EbmlSemantic(false, true, EBML_INFO(KaxContentSignature)), + EbmlSemantic(false, true, EBML_INFO(KaxContentSigKeyID)), + EbmlSemantic(false, true, EBML_INFO(KaxContentSigAlgo)), + EbmlSemantic(false, true, EBML_INFO(KaxContentSigHashAlgo)), +}; + +EbmlId KaxContentEncodings_TheId (0x6d80, 2); +EbmlId KaxContentEncoding_TheId (0x6240, 2); +EbmlId KaxContentEncodingOrder_TheId (0x5031, 2); +EbmlId KaxContentEncodingScope_TheId (0x5032, 2); +EbmlId KaxContentEncodingType_TheId (0x5033, 2); +EbmlId KaxContentCompression_TheId (0x5034, 2); +EbmlId KaxContentCompAlgo_TheId (0x4254, 2); +EbmlId KaxContentCompSettings_TheId (0x4255, 2); +EbmlId KaxContentEncryption_TheId (0x5035, 2); +EbmlId KaxContentEncAlgo_TheId (0x47e1, 2); +EbmlId KaxContentEncKeyID_TheId (0x47e2, 2); +EbmlId KaxContentSignature_TheId (0x47e3, 2); +EbmlId KaxContentSigKeyID_TheId (0x47e4, 2); +EbmlId KaxContentSigAlgo_TheId (0x47e5, 2); +EbmlId KaxContentSigHashAlgo_TheId (0x47e6, 2); + +const EbmlSemanticContext KaxContentEncodings_Context = +EbmlSemanticContext(countof(KaxContentEncodings_ContextList), + KaxContentEncodings_ContextList, &KaxTrackEntry_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentEncodings)); + +const EbmlSemanticContext KaxContentEncoding_Context = +EbmlSemanticContext(countof(KaxContentEncoding_ContextList), + KaxContentEncoding_ContextList, + &KaxContentEncodings_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentEncoding)); + +const EbmlSemanticContext KaxContentEncodingOrder_Context = +EbmlSemanticContext(0, NULL, &KaxContentEncoding_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentEncodingOrder)); + +const EbmlSemanticContext KaxContentEncodingScope_Context = +EbmlSemanticContext(0, NULL, &KaxContentEncoding_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentEncodingScope)); + +const EbmlSemanticContext KaxContentEncodingType_Context = +EbmlSemanticContext(0, NULL, &KaxContentEncoding_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentEncodingType)); + +const EbmlSemanticContext KaxContentCompression_Context = +EbmlSemanticContext(countof(KaxContentCompression_ContextList), + KaxContentCompression_ContextList, + &KaxContentEncoding_Context, *GetKaxGlobal_Context, + &EBML_INFO(KaxContentCompression)); + +const EbmlSemanticContext KaxContentCompAlgo_Context = +EbmlSemanticContext(0, NULL, &KaxContentCompression_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentCompAlgo)); + +const EbmlSemanticContext KaxContentCompSettings_Context = +EbmlSemanticContext(0, NULL, &KaxContentCompression_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentCompSettings)); + +const EbmlSemanticContext KaxContentEncryption_Context = +EbmlSemanticContext(countof(KaxContentEncryption_ContextList), + KaxContentEncryption_ContextList, + &KaxContentEncoding_Context, *GetKaxGlobal_Context, + &EBML_INFO(KaxContentEncryption)); + +const EbmlSemanticContext KaxContentEncAlgo_Context = +EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentEncAlgo)); + +const EbmlSemanticContext KaxContentEncKeyID_Context = +EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentEncKeyID)); + +const EbmlSemanticContext KaxContentSignature_Context = +EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentSignature)); + +const EbmlSemanticContext KaxContentSigAlgo_Context = +EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentSigKeyID)); + +const EbmlSemanticContext KaxContentSigHashAlgo_Context = +EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentSigKeyID)); + +const EbmlSemanticContext KaxContentSigKeyID_Context = +EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context, + *GetKaxGlobal_Context, + &EBML_INFO(KaxContentSigKeyID)); + +const EbmlCallbacks +KaxContentEncodings::ClassInfos(KaxContentEncodings::Create, + KaxContentEncodings_TheId, + "ContentEncodings", + KaxContentEncodings_Context); +const EbmlCallbacks +KaxContentEncoding::ClassInfos(KaxContentEncoding::Create, + KaxContentEncoding_TheId, + "ContentEncoding", + KaxContentEncoding_Context); +const EbmlCallbacks +KaxContentEncodingOrder::ClassInfos(KaxContentEncodingOrder::Create, + KaxContentEncodingOrder_TheId, + "ContentEncodingOrder", + KaxContentEncodingOrder_Context); +const EbmlCallbacks +KaxContentEncodingScope::ClassInfos(KaxContentEncodingScope::Create, + KaxContentEncodingScope_TheId, + "ContentEncodingScope", + KaxContentEncodingScope_Context); +const EbmlCallbacks +KaxContentEncodingType::ClassInfos(KaxContentEncodingType::Create, + KaxContentEncodingType_TheId, + "ContentEncodingType", + KaxContentEncodingType_Context); +const EbmlCallbacks +KaxContentCompression::ClassInfos(KaxContentCompression::Create, + KaxContentCompression_TheId, + "ContentCompression", + KaxContentCompression_Context); +const EbmlCallbacks +KaxContentCompAlgo::ClassInfos(KaxContentCompAlgo::Create, + KaxContentCompAlgo_TheId, + "ContentCompAlgo", + KaxContentCompAlgo_Context); +const EbmlCallbacks +KaxContentCompSettings::ClassInfos(KaxContentCompSettings::Create, + KaxContentCompSettings_TheId, + "ContentCompSettings", + KaxContentCompSettings_Context); +const EbmlCallbacks +KaxContentEncryption::ClassInfos(KaxContentEncryption::Create, + KaxContentEncryption_TheId, + "ContentEncryption", + KaxContentEncryption_Context); +const EbmlCallbacks +KaxContentEncAlgo::ClassInfos(KaxContentEncAlgo::Create, + KaxContentEncAlgo_TheId, + "ContentEncAlgo", + KaxContentEncAlgo_Context); +const EbmlCallbacks +KaxContentEncKeyID::ClassInfos(KaxContentEncKeyID::Create, + KaxContentEncKeyID_TheId, + "ContentEncKeyID", + KaxContentEncKeyID_Context); +const EbmlCallbacks +KaxContentSignature::ClassInfos(KaxContentSignature::Create, + KaxContentSignature_TheId, + "ContentSignature", + KaxContentSignature_Context); +const EbmlCallbacks +KaxContentSigAlgo::ClassInfos(KaxContentSigAlgo::Create, + KaxContentSigAlgo_TheId, + "ContentSigAlgo", + KaxContentSigAlgo_Context); +const EbmlCallbacks +KaxContentSigHashAlgo::ClassInfos(KaxContentSigHashAlgo::Create, + KaxContentSigHashAlgo_TheId, + "ContentSigHashAlgo", + KaxContentSigHashAlgo_Context); +const EbmlCallbacks +KaxContentSigKeyID::ClassInfos(KaxContentSigKeyID::Create, + KaxContentSigKeyID_TheId, + "ContentSigKeyID", + KaxContentSigKeyID_Context); + +KaxContentEncodings::KaxContentEncodings(): + EbmlMaster(KaxContentEncodings_Context) { +} + +KaxContentEncoding::KaxContentEncoding(): + EbmlMaster(KaxContentEncoding_Context) { +} + +KaxContentCompression::KaxContentCompression(): + EbmlMaster(KaxContentCompression_Context) { +} + +KaxContentEncryption::KaxContentEncryption(): + EbmlMaster(KaxContentEncryption_Context) { +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxContexts.cpp b/src/KaxContexts.cpp index 2e128ce..af8651f 100644 --- a/src/KaxContexts.cpp +++ b/src/KaxContexts.cpp @@ -1,48 +1,48 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxContexts.cpp 640 2004-07-09 21:05:36Z mosu $ - \author Steve Lhomme -*/ -#include "ebml/EbmlContexts.h" -#include "matroska/KaxContexts.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -// for the moment -const EbmlSemanticContext & GetKaxGlobal_Context() -{ - return GetEbmlGlobal_Context(); -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxContexts.cpp 640 2004-07-09 21:05:36Z mosu $ + \author Steve Lhomme +*/ +#include "ebml/EbmlContexts.h" +#include "matroska/KaxContexts.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +// for the moment +const EbmlSemanticContext & GetKaxGlobal_Context() +{ + return GetEbmlGlobal_Context(); +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxCues.cpp b/src/KaxCues.cpp index e3007d5..e998eb3 100644 --- a/src/KaxCues.cpp +++ b/src/KaxCues.cpp @@ -1,172 +1,172 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxCues.cpp 1265 2007-01-14 17:20:35Z mosu $ - \author Steve Lhomme -*/ -#include - -#include "matroska/KaxCues.h" -#include "matroska/KaxCuesData.h" -#include "matroska/KaxContexts.h" -#include "ebml/EbmlStream.h" - -// sub elements -START_LIBMATROSKA_NAMESPACE - -EbmlSemantic KaxCues_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxCuePoint)), -}; - -const EbmlSemanticContext KaxCues_Context = EbmlSemanticContext(countof(KaxCues_ContextList), KaxCues_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCues)); - -EbmlId KaxCues_TheId(0x1C53BB6B, 4); -const EbmlCallbacks KaxCues::ClassInfos(KaxCues::Create, KaxCues_TheId, "Cues", KaxCues_Context); - -KaxCues::KaxCues() - :EbmlMaster(KaxCues_Context) -{} - -KaxCues::~KaxCues() -{ - assert(myTempReferences.size() == 0); // otherwise that means you have added references and forgot to set the position -} - -bool KaxCues::AddBlockGroup(const KaxBlockGroup & BlockRef) -{ - // Do not add the element if it's already present. - std::vector::iterator ListIdx; - KaxBlockBlob &BlockReference = *(new KaxBlockBlob(BLOCK_BLOB_NO_SIMPLE)); - BlockReference.SetBlockGroup(*const_cast(&BlockRef)); - - for (ListIdx = myTempReferences.begin(); ListIdx != myTempReferences.end(); ListIdx++) - if (*ListIdx == &BlockReference) - return true; - - myTempReferences.push_back(&BlockReference); - return true; -} - -bool KaxCues::AddBlockBlob(const KaxBlockBlob & BlockReference) -{ - // Do not add the element if it's already present. - std::vector::iterator ListIdx; - - for (ListIdx = myTempReferences.begin(); ListIdx != myTempReferences.end(); ListIdx++) - if (*ListIdx == &BlockReference) - return true; - - myTempReferences.push_back(&BlockReference); - return true; -} - -void KaxCues::PositionSet(const KaxBlockBlob & BlockReference) -{ - // look for the element in the temporary references - std::vector::iterator ListIdx; - - for (ListIdx = myTempReferences.begin(); ListIdx != myTempReferences.end(); ListIdx++) { - if (*ListIdx == &BlockReference) { - // found, now add the element to the entry list - KaxCuePoint & NewPoint = AddNewChild(*this); - NewPoint.PositionSet(BlockReference, GlobalTimecodeScale()); - myTempReferences.erase(ListIdx); - break; - } - } -} - -void KaxCues::PositionSet(const KaxBlockGroup & BlockRef) -{ - // look for the element in the temporary references - std::vector::iterator ListIdx; - - for (ListIdx = myTempReferences.begin(); ListIdx != myTempReferences.end(); ListIdx++) { - const KaxInternalBlock &refTmp = **ListIdx; - if (refTmp.GlobalTimecode() == BlockRef.GlobalTimecode() && - refTmp.TrackNum() == BlockRef.TrackNumber()) { - // found, now add the element to the entry list - KaxCuePoint & NewPoint = AddNewChild(*this); - NewPoint.PositionSet(**ListIdx, GlobalTimecodeScale()); - myTempReferences.erase(ListIdx); - break; - } - } -} - -/*! - \warning Assume that the list has been sorted (Sort()) -*/ -const KaxCuePoint * KaxCues::GetTimecodePoint(uint64 aTimecode) const -{ - uint64 TimecodeToLocate = aTimecode / GlobalTimecodeScale(); - const KaxCuePoint * aPointPrev = NULL; - uint64 aPrevTime = 0; - const KaxCuePoint * aPointNext = NULL; - uint64 aNextTime = EBML_PRETTYLONGINT(0xFFFFFFFFFFFF); - - for (unsigned int i=0; i((*this)[i]); - // check the tile - const KaxCueTime *aTime = static_cast(tmp->FindFirstElt(EBML_INFO(KaxCueTime))); - if (aTime != NULL) - { - uint64 _Time = uint64(*aTime); - if (_Time > aPrevTime && _Time < TimecodeToLocate) { - aPrevTime = _Time; - aPointPrev = tmp; - } - if (_Time < aNextTime && _Time > TimecodeToLocate) { - aNextTime= _Time; - aPointNext = tmp; - } - } - } - } - - return aPointPrev; -} - -uint64 KaxCues::GetTimecodePosition(uint64 aTimecode) const -{ - const KaxCuePoint * aPoint = GetTimecodePoint(aTimecode); - if (aPoint == NULL) - return 0; - - const KaxCueTrackPositions * aTrack = aPoint->GetSeekPosition(); - if (aTrack == NULL) - return 0; - - return aTrack->ClusterPosition(); -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxCues.cpp 1265 2007-01-14 17:20:35Z mosu $ + \author Steve Lhomme +*/ +#include + +#include "matroska/KaxCues.h" +#include "matroska/KaxCuesData.h" +#include "matroska/KaxContexts.h" +#include "ebml/EbmlStream.h" + +// sub elements +START_LIBMATROSKA_NAMESPACE + +EbmlSemantic KaxCues_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxCuePoint)), +}; + +const EbmlSemanticContext KaxCues_Context = EbmlSemanticContext(countof(KaxCues_ContextList), KaxCues_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCues)); + +EbmlId KaxCues_TheId(0x1C53BB6B, 4); +const EbmlCallbacks KaxCues::ClassInfos(KaxCues::Create, KaxCues_TheId, "Cues", KaxCues_Context); + +KaxCues::KaxCues() + :EbmlMaster(KaxCues_Context) +{} + +KaxCues::~KaxCues() +{ + assert(myTempReferences.size() == 0); // otherwise that means you have added references and forgot to set the position +} + +bool KaxCues::AddBlockGroup(const KaxBlockGroup & BlockRef) +{ + // Do not add the element if it's already present. + std::vector::iterator ListIdx; + KaxBlockBlob &BlockReference = *(new KaxBlockBlob(BLOCK_BLOB_NO_SIMPLE)); + BlockReference.SetBlockGroup(*const_cast(&BlockRef)); + + for (ListIdx = myTempReferences.begin(); ListIdx != myTempReferences.end(); ListIdx++) + if (*ListIdx == &BlockReference) + return true; + + myTempReferences.push_back(&BlockReference); + return true; +} + +bool KaxCues::AddBlockBlob(const KaxBlockBlob & BlockReference) +{ + // Do not add the element if it's already present. + std::vector::iterator ListIdx; + + for (ListIdx = myTempReferences.begin(); ListIdx != myTempReferences.end(); ListIdx++) + if (*ListIdx == &BlockReference) + return true; + + myTempReferences.push_back(&BlockReference); + return true; +} + +void KaxCues::PositionSet(const KaxBlockBlob & BlockReference) +{ + // look for the element in the temporary references + std::vector::iterator ListIdx; + + for (ListIdx = myTempReferences.begin(); ListIdx != myTempReferences.end(); ListIdx++) { + if (*ListIdx == &BlockReference) { + // found, now add the element to the entry list + KaxCuePoint & NewPoint = AddNewChild(*this); + NewPoint.PositionSet(BlockReference, GlobalTimecodeScale()); + myTempReferences.erase(ListIdx); + break; + } + } +} + +void KaxCues::PositionSet(const KaxBlockGroup & BlockRef) +{ + // look for the element in the temporary references + std::vector::iterator ListIdx; + + for (ListIdx = myTempReferences.begin(); ListIdx != myTempReferences.end(); ListIdx++) { + const KaxInternalBlock &refTmp = **ListIdx; + if (refTmp.GlobalTimecode() == BlockRef.GlobalTimecode() && + refTmp.TrackNum() == BlockRef.TrackNumber()) { + // found, now add the element to the entry list + KaxCuePoint & NewPoint = AddNewChild(*this); + NewPoint.PositionSet(**ListIdx, GlobalTimecodeScale()); + myTempReferences.erase(ListIdx); + break; + } + } +} + +/*! + \warning Assume that the list has been sorted (Sort()) +*/ +const KaxCuePoint * KaxCues::GetTimecodePoint(uint64 aTimecode) const +{ + uint64 TimecodeToLocate = aTimecode / GlobalTimecodeScale(); + const KaxCuePoint * aPointPrev = NULL; + uint64 aPrevTime = 0; + const KaxCuePoint * aPointNext = NULL; + uint64 aNextTime = EBML_PRETTYLONGINT(0xFFFFFFFFFFFF); + + for (unsigned int i=0; i((*this)[i]); + // check the tile + const KaxCueTime *aTime = static_cast(tmp->FindFirstElt(EBML_INFO(KaxCueTime))); + if (aTime != NULL) + { + uint64 _Time = uint64(*aTime); + if (_Time > aPrevTime && _Time < TimecodeToLocate) { + aPrevTime = _Time; + aPointPrev = tmp; + } + if (_Time < aNextTime && _Time > TimecodeToLocate) { + aNextTime= _Time; + aPointNext = tmp; + } + } + } + } + + return aPointPrev; +} + +uint64 KaxCues::GetTimecodePosition(uint64 aTimecode) const +{ + const KaxCuePoint * aPoint = GetTimecodePoint(aTimecode); + if (aPoint == NULL) + return 0; + + const KaxCueTrackPositions * aTrack = aPoint->GetSeekPosition(); + if (aTrack == NULL) + return 0; + + return aTrack->ClusterPosition(); +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxCuesData.cpp b/src/KaxCuesData.cpp index db68faa..a6148f1 100644 --- a/src/KaxCuesData.cpp +++ b/src/KaxCuesData.cpp @@ -1,329 +1,329 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxCuesData.cpp 1265 2007-01-14 17:20:35Z mosu $ - \author Steve Lhomme -*/ -#include - -#include "matroska/KaxCuesData.h" -#include "matroska/KaxContexts.h" -#include "matroska/KaxBlock.h" -#include "matroska/KaxBlockData.h" -#include "matroska/KaxCluster.h" -#include "matroska/KaxSegment.h" - -START_LIBMATROSKA_NAMESPACE - -EbmlSemantic KaxCuePoint_ContextList[2] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxCueTime)), - EbmlSemantic(true, false, EBML_INFO(KaxCueTrackPositions)), -}; - -#if MATROSKA_VERSION == 1 -EbmlSemantic KaxCueTrackPositions_ContextList[3] = -#else // MATROSKA_VERSION -EbmlSemantic KaxCueTrackPositions_ContextList[5] = -#endif // MATROSKA_VERSION -{ - EbmlSemantic(true, true, EBML_INFO(KaxCueTrack)), - EbmlSemantic(true, true, EBML_INFO(KaxCueClusterPosition)), - EbmlSemantic(false, true, EBML_INFO(KaxCueBlockNumber)), -#if MATROSKA_VERSION >= 2 - EbmlSemantic(false, true, EBML_INFO(KaxCueCodecState)), - EbmlSemantic(false, false, EBML_INFO(KaxCueReference)), -#endif // MATROSKA_VERSION -}; - -#if MATROSKA_VERSION >= 2 -EbmlSemantic KaxCueReference_ContextList[4] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxCueRefTime)), - EbmlSemantic(true, true, EBML_INFO(KaxCueRefCluster)), - EbmlSemantic(false, true, EBML_INFO(KaxCueRefNumber)), - EbmlSemantic(false, true, EBML_INFO(KaxCueRefCodecState)), -}; -#endif // MATROSKA_VERSION - -EbmlId KaxCuePoint_TheId (0xBB, 1); -EbmlId KaxCueTime_TheId (0xB3, 1); -EbmlId KaxCueTrackPositions_TheId (0xB7, 1); -EbmlId KaxCueTrack_TheId (0xF7, 1); -EbmlId KaxCueClusterPosition_TheId(0xF1, 1); -EbmlId KaxCueBlockNumber_TheId (0x5378, 2); -#if MATROSKA_VERSION >= 2 -EbmlId KaxCueCodecState_TheId (0xEA, 1); -EbmlId KaxCueReference_TheId (0xDB, 1); -EbmlId KaxCueRefTime_TheId (0x96, 1); -EbmlId KaxCueRefCluster_TheId (0x97, 1); -EbmlId KaxCueRefNumber_TheId (0x535F, 2); -EbmlId KaxCueRefCodecState_TheId (0xEB, 1); -#endif // MATROSKA_VERSION - -const EbmlSemanticContext KaxCuePoint_Context = EbmlSemanticContext(countof(KaxCuePoint_ContextList), KaxCuePoint_ContextList, &KaxCues_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCuePoint)); -const EbmlSemanticContext KaxCueTime_Context = EbmlSemanticContext(0, NULL, &KaxCuePoint_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueTime)); -const EbmlSemanticContext KaxCueTrackPositions_Context = EbmlSemanticContext(countof(KaxCueTrackPositions_ContextList), KaxCueTrackPositions_ContextList, &KaxCuePoint_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueTrackPositions)); -const EbmlSemanticContext KaxCueTrack_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueTrack)); -const EbmlSemanticContext KaxCueClusterPosition_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueClusterPosition)); -const EbmlSemanticContext KaxCueBlockNumber_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueBlockNumber)); -#if MATROSKA_VERSION >= 2 -const EbmlSemanticContext KaxCueCodecState_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueCodecState)); -const EbmlSemanticContext KaxCueReference_Context = EbmlSemanticContext(countof(KaxCueReference_ContextList), KaxCueReference_ContextList, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueReference)); -const EbmlSemanticContext KaxCueRefTime_Context = EbmlSemanticContext(0, NULL, &KaxCueReference_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueRefTime)); -const EbmlSemanticContext KaxCueRefCluster_Context = EbmlSemanticContext(0, NULL, &KaxCueRefTime_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueRefCluster)); -const EbmlSemanticContext KaxCueRefNumber_Context = EbmlSemanticContext(0, NULL, &KaxCueRefTime_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueRefNumber)); -const EbmlSemanticContext KaxCueRefCodecState_Context = EbmlSemanticContext(0, NULL, &KaxCueRefTime_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueRefCodecState)); -#endif // MATROSKA_VERSION - -const EbmlCallbacks KaxCuePoint::ClassInfos(KaxCuePoint::Create, KaxCuePoint_TheId, "CuePoint", KaxCuePoint_Context); -const EbmlCallbacks KaxCueTime::ClassInfos(KaxCueTime::Create, KaxCueTime_TheId, "CueTime", KaxCueTime_Context); -const EbmlCallbacks KaxCueTrackPositions::ClassInfos(KaxCueTrackPositions::Create, KaxCueTrackPositions_TheId, "CueTrackPositions", KaxCueTrackPositions_Context); -const EbmlCallbacks KaxCueTrack::ClassInfos(KaxCueTrack::Create, KaxCueTrack_TheId, "CueTrack", KaxCueTrack_Context); -const EbmlCallbacks KaxCueClusterPosition::ClassInfos(KaxCueClusterPosition::Create, KaxCueClusterPosition_TheId, "CueClusterPosition", KaxCueClusterPosition_Context); -const EbmlCallbacks KaxCueBlockNumber::ClassInfos(KaxCueBlockNumber::Create, KaxCueBlockNumber_TheId, "CueBlockNumber", KaxCueBlockNumber_Context); -#if MATROSKA_VERSION >= 2 -const EbmlCallbacks KaxCueCodecState::ClassInfos(KaxCueCodecState::Create, KaxCueCodecState_TheId, "CueCodecState", KaxCueCodecState_Context); -const EbmlCallbacks KaxCueReference::ClassInfos(KaxCueReference::Create, KaxCueReference_TheId, "CueReference", KaxCueReference_Context); -const EbmlCallbacks KaxCueRefTime::ClassInfos(KaxCueRefTime::Create, KaxCueRefTime_TheId, "CueRefTime", KaxCueRefTime_Context); -const EbmlCallbacks KaxCueRefCluster::ClassInfos(KaxCueRefCluster::Create, KaxCueRefCluster_TheId, "CueRefCluster", KaxCueRefCluster_Context); -const EbmlCallbacks KaxCueRefNumber::ClassInfos(KaxCueRefNumber::Create, KaxCueRefNumber_TheId, "CueRefNumber", KaxCueRefNumber_Context); -const EbmlCallbacks KaxCueRefCodecState::ClassInfos(KaxCueRefCodecState::Create, KaxCueRefCodecState_TheId, "CueRefCodecState", KaxCueRefCodecState_Context); -#endif // MATROSKA_VERSION - -KaxCuePoint::KaxCuePoint() - :EbmlMaster(KaxCuePoint_Context) -{} - -KaxCueTrackPositions::KaxCueTrackPositions() - :EbmlMaster(KaxCueTrackPositions_Context) -{} - -#if MATROSKA_VERSION >= 2 -KaxCueReference::KaxCueReference() - :EbmlMaster(KaxCueReference_Context) -{} -#endif // MATROSKA_VERSION - -/*! - \todo handle codec state checking - \todo remove duplicate references (reference to 2 frames that each reference the same frame) -*/ -void KaxCuePoint::PositionSet(const KaxBlockGroup & BlockReference, uint64 GlobalTimecodeScale) -{ - // fill me - KaxCueTime & NewTime = GetChild(*this); - *static_cast(&NewTime) = BlockReference.GlobalTimecode() / GlobalTimecodeScale; - - KaxCueTrackPositions & NewPositions = AddNewChild(*this); - KaxCueTrack & TheTrack = GetChild(NewPositions); - *static_cast(&TheTrack) = BlockReference.TrackNumber(); - - KaxCueClusterPosition & TheClustPos = GetChild(NewPositions); - *static_cast(&TheClustPos) = BlockReference.ClusterPosition(); - -#if MATROSKA_VERSION >= 2 - // handle reference use - if (BlockReference.ReferenceCount() != 0) - { - unsigned int i; - for (i=0; i(NewPositions); - NewRefs.AddReference(BlockReference.Reference(i).RefBlock(), GlobalTimecodeScale); - } - } - - KaxCodecState *CodecState = static_cast(BlockReference.FindFirstElt(EBML_INFO(KaxCodecState))); - if (CodecState != NULL) { - KaxCueCodecState &CueCodecState = AddNewChild(NewPositions); - *static_cast(&CueCodecState) = BlockReference.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition()); - } -#endif // MATROSKA_VERSION - - SetValueIsSet(); -} - -void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalTimecodeScale) -{ - const KaxInternalBlock &BlockReference = BlobReference; - - // fill me - KaxCueTime & NewTime = GetChild(*this); - *static_cast(&NewTime) = BlockReference.GlobalTimecode() / GlobalTimecodeScale; - - KaxCueTrackPositions & NewPositions = AddNewChild(*this); - KaxCueTrack & TheTrack = GetChild(NewPositions); - *static_cast(&TheTrack) = BlockReference.TrackNum(); - - KaxCueClusterPosition & TheClustPos = GetChild(NewPositions); - *static_cast(&TheClustPos) = BlockReference.ClusterPosition(); - -#if 0 // MATROSKA_VERSION >= 2 - // handle reference use - if (BlockReference.ReferenceCount() != 0) - { - unsigned int i; - for (i=0; i(NewPositions); - NewRefs.AddReference(BlockReference.Reference(i).RefBlock(), GlobalTimecodeScale); - } - } -#endif // MATROSKA_VERSION - -#if MATROSKA_VERSION >= 2 - if (!BlobReference.IsSimpleBlock()) { - const KaxBlockGroup &BlockGroup = BlobReference; - const KaxCodecState *CodecState = static_cast(BlockGroup.FindFirstElt(EBML_INFO(KaxCodecState))); - if (CodecState != NULL) { - KaxCueCodecState &CueCodecState = AddNewChild(NewPositions); - *static_cast(&CueCodecState) = BlockGroup.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition()); - } - } -#endif // MATROSKA_VERSION - - SetValueIsSet(); -} - -#if MATROSKA_VERSION >= 2 -/*! - \todo handle codec state checking -*/ -void KaxCueReference::AddReference(const KaxBlockBlob & BlockReference, uint64 GlobalTimecodeScale) -{ - const KaxInternalBlock & theBlock = BlockReference; - KaxCueRefTime & NewTime = GetChild(*this); - *static_cast(&NewTime) = theBlock.GlobalTimecode() / GlobalTimecodeScale; - - KaxCueRefCluster & TheClustPos = GetChild(*this); - *static_cast(&TheClustPos) = theBlock.ClusterPosition(); - -#ifdef OLD - // handle recursive reference use - if (BlockReference.ReferenceCount() != 0) - { - unsigned int i; - for (i=0; i(&EltB); - - // compare timecode - const KaxCueTime * TimeCodeA = static_cast(FindElt(EBML_INFO(KaxCueTime))); - if (TimeCodeA == NULL) - return false; - - const KaxCueTime * TimeCodeB = static_cast(theEltB.FindElt(EBML_INFO(KaxCueTime))); - if (TimeCodeB == NULL) - return false; - - if (*TimeCodeA < *TimeCodeB) - return true; - - if (*TimeCodeB < *TimeCodeA) - return false; - - // compare tracks (timecodes are equal) - const KaxCueTrack * TrackA = static_cast(FindElt(EBML_INFO(KaxCueTrack))); - if (TrackA == NULL) - return false; - - const KaxCueTrack * TrackB = static_cast(theEltB.FindElt(EBML_INFO(KaxCueTrack))); - if (TrackB == NULL) - return false; - - if (*TrackA < *TrackB) - return true; - - if (*TrackB < *TrackA) - return false; - - return false; -} - -bool KaxCuePoint::Timecode(uint64 & aTimecode, uint64 GlobalTimecodeScale) const -{ - const KaxCueTime *aTime = static_cast(FindFirstElt(EBML_INFO(KaxCueTime))); - if (aTime == NULL) - return false; - aTimecode = uint64(*aTime) * GlobalTimecodeScale; - return true; -} - -/*! - \brief return the position of the Cluster to load -*/ -const KaxCueTrackPositions * KaxCuePoint::GetSeekPosition() const -{ - const KaxCueTrackPositions * result = NULL; - uint64 aPosition = EBML_PRETTYLONGINT(0xFFFFFFFFFFFFFFF); - // find the position of the "earlier" Cluster - const KaxCueTrackPositions *aPoss = static_cast(FindFirstElt(EBML_INFO(KaxCueTrackPositions))); - while (aPoss != NULL) - { - const KaxCueClusterPosition *aPos = static_cast(aPoss->FindFirstElt(EBML_INFO(KaxCueClusterPosition))); - if (aPos != NULL && uint64(*aPos) < aPosition) { - aPosition = uint64(*aPos); - result = aPoss; - } - - aPoss = static_cast(FindNextElt(*aPoss)); - } - return result; -} - -uint64 KaxCueTrackPositions::ClusterPosition() const -{ - const KaxCueClusterPosition *aPos = static_cast(FindFirstElt(EBML_INFO(KaxCueClusterPosition))); - if (aPos == NULL) - return 0; - - return uint64(*aPos); -} - -uint16 KaxCueTrackPositions::TrackNumber() const -{ - const KaxCueTrack *aTrack = static_cast(FindFirstElt(EBML_INFO(KaxCueTrack))); - if (aTrack == NULL) - return 0; - - return uint16(*aTrack); -} - - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxCuesData.cpp 1265 2007-01-14 17:20:35Z mosu $ + \author Steve Lhomme +*/ +#include + +#include "matroska/KaxCuesData.h" +#include "matroska/KaxContexts.h" +#include "matroska/KaxBlock.h" +#include "matroska/KaxBlockData.h" +#include "matroska/KaxCluster.h" +#include "matroska/KaxSegment.h" + +START_LIBMATROSKA_NAMESPACE + +EbmlSemantic KaxCuePoint_ContextList[2] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxCueTime)), + EbmlSemantic(true, false, EBML_INFO(KaxCueTrackPositions)), +}; + +#if MATROSKA_VERSION == 1 +EbmlSemantic KaxCueTrackPositions_ContextList[3] = +#else // MATROSKA_VERSION +EbmlSemantic KaxCueTrackPositions_ContextList[5] = +#endif // MATROSKA_VERSION +{ + EbmlSemantic(true, true, EBML_INFO(KaxCueTrack)), + EbmlSemantic(true, true, EBML_INFO(KaxCueClusterPosition)), + EbmlSemantic(false, true, EBML_INFO(KaxCueBlockNumber)), +#if MATROSKA_VERSION >= 2 + EbmlSemantic(false, true, EBML_INFO(KaxCueCodecState)), + EbmlSemantic(false, false, EBML_INFO(KaxCueReference)), +#endif // MATROSKA_VERSION +}; + +#if MATROSKA_VERSION >= 2 +EbmlSemantic KaxCueReference_ContextList[4] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxCueRefTime)), + EbmlSemantic(true, true, EBML_INFO(KaxCueRefCluster)), + EbmlSemantic(false, true, EBML_INFO(KaxCueRefNumber)), + EbmlSemantic(false, true, EBML_INFO(KaxCueRefCodecState)), +}; +#endif // MATROSKA_VERSION + +EbmlId KaxCuePoint_TheId (0xBB, 1); +EbmlId KaxCueTime_TheId (0xB3, 1); +EbmlId KaxCueTrackPositions_TheId (0xB7, 1); +EbmlId KaxCueTrack_TheId (0xF7, 1); +EbmlId KaxCueClusterPosition_TheId(0xF1, 1); +EbmlId KaxCueBlockNumber_TheId (0x5378, 2); +#if MATROSKA_VERSION >= 2 +EbmlId KaxCueCodecState_TheId (0xEA, 1); +EbmlId KaxCueReference_TheId (0xDB, 1); +EbmlId KaxCueRefTime_TheId (0x96, 1); +EbmlId KaxCueRefCluster_TheId (0x97, 1); +EbmlId KaxCueRefNumber_TheId (0x535F, 2); +EbmlId KaxCueRefCodecState_TheId (0xEB, 1); +#endif // MATROSKA_VERSION + +const EbmlSemanticContext KaxCuePoint_Context = EbmlSemanticContext(countof(KaxCuePoint_ContextList), KaxCuePoint_ContextList, &KaxCues_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCuePoint)); +const EbmlSemanticContext KaxCueTime_Context = EbmlSemanticContext(0, NULL, &KaxCuePoint_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueTime)); +const EbmlSemanticContext KaxCueTrackPositions_Context = EbmlSemanticContext(countof(KaxCueTrackPositions_ContextList), KaxCueTrackPositions_ContextList, &KaxCuePoint_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueTrackPositions)); +const EbmlSemanticContext KaxCueTrack_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueTrack)); +const EbmlSemanticContext KaxCueClusterPosition_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueClusterPosition)); +const EbmlSemanticContext KaxCueBlockNumber_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueBlockNumber)); +#if MATROSKA_VERSION >= 2 +const EbmlSemanticContext KaxCueCodecState_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueCodecState)); +const EbmlSemanticContext KaxCueReference_Context = EbmlSemanticContext(countof(KaxCueReference_ContextList), KaxCueReference_ContextList, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueReference)); +const EbmlSemanticContext KaxCueRefTime_Context = EbmlSemanticContext(0, NULL, &KaxCueReference_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueRefTime)); +const EbmlSemanticContext KaxCueRefCluster_Context = EbmlSemanticContext(0, NULL, &KaxCueRefTime_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueRefCluster)); +const EbmlSemanticContext KaxCueRefNumber_Context = EbmlSemanticContext(0, NULL, &KaxCueRefTime_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueRefNumber)); +const EbmlSemanticContext KaxCueRefCodecState_Context = EbmlSemanticContext(0, NULL, &KaxCueRefTime_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCueRefCodecState)); +#endif // MATROSKA_VERSION + +const EbmlCallbacks KaxCuePoint::ClassInfos(KaxCuePoint::Create, KaxCuePoint_TheId, "CuePoint", KaxCuePoint_Context); +const EbmlCallbacks KaxCueTime::ClassInfos(KaxCueTime::Create, KaxCueTime_TheId, "CueTime", KaxCueTime_Context); +const EbmlCallbacks KaxCueTrackPositions::ClassInfos(KaxCueTrackPositions::Create, KaxCueTrackPositions_TheId, "CueTrackPositions", KaxCueTrackPositions_Context); +const EbmlCallbacks KaxCueTrack::ClassInfos(KaxCueTrack::Create, KaxCueTrack_TheId, "CueTrack", KaxCueTrack_Context); +const EbmlCallbacks KaxCueClusterPosition::ClassInfos(KaxCueClusterPosition::Create, KaxCueClusterPosition_TheId, "CueClusterPosition", KaxCueClusterPosition_Context); +const EbmlCallbacks KaxCueBlockNumber::ClassInfos(KaxCueBlockNumber::Create, KaxCueBlockNumber_TheId, "CueBlockNumber", KaxCueBlockNumber_Context); +#if MATROSKA_VERSION >= 2 +const EbmlCallbacks KaxCueCodecState::ClassInfos(KaxCueCodecState::Create, KaxCueCodecState_TheId, "CueCodecState", KaxCueCodecState_Context); +const EbmlCallbacks KaxCueReference::ClassInfos(KaxCueReference::Create, KaxCueReference_TheId, "CueReference", KaxCueReference_Context); +const EbmlCallbacks KaxCueRefTime::ClassInfos(KaxCueRefTime::Create, KaxCueRefTime_TheId, "CueRefTime", KaxCueRefTime_Context); +const EbmlCallbacks KaxCueRefCluster::ClassInfos(KaxCueRefCluster::Create, KaxCueRefCluster_TheId, "CueRefCluster", KaxCueRefCluster_Context); +const EbmlCallbacks KaxCueRefNumber::ClassInfos(KaxCueRefNumber::Create, KaxCueRefNumber_TheId, "CueRefNumber", KaxCueRefNumber_Context); +const EbmlCallbacks KaxCueRefCodecState::ClassInfos(KaxCueRefCodecState::Create, KaxCueRefCodecState_TheId, "CueRefCodecState", KaxCueRefCodecState_Context); +#endif // MATROSKA_VERSION + +KaxCuePoint::KaxCuePoint() + :EbmlMaster(KaxCuePoint_Context) +{} + +KaxCueTrackPositions::KaxCueTrackPositions() + :EbmlMaster(KaxCueTrackPositions_Context) +{} + +#if MATROSKA_VERSION >= 2 +KaxCueReference::KaxCueReference() + :EbmlMaster(KaxCueReference_Context) +{} +#endif // MATROSKA_VERSION + +/*! + \todo handle codec state checking + \todo remove duplicate references (reference to 2 frames that each reference the same frame) +*/ +void KaxCuePoint::PositionSet(const KaxBlockGroup & BlockReference, uint64 GlobalTimecodeScale) +{ + // fill me + KaxCueTime & NewTime = GetChild(*this); + *static_cast(&NewTime) = BlockReference.GlobalTimecode() / GlobalTimecodeScale; + + KaxCueTrackPositions & NewPositions = AddNewChild(*this); + KaxCueTrack & TheTrack = GetChild(NewPositions); + *static_cast(&TheTrack) = BlockReference.TrackNumber(); + + KaxCueClusterPosition & TheClustPos = GetChild(NewPositions); + *static_cast(&TheClustPos) = BlockReference.ClusterPosition(); + +#if MATROSKA_VERSION >= 2 + // handle reference use + if (BlockReference.ReferenceCount() != 0) + { + unsigned int i; + for (i=0; i(NewPositions); + NewRefs.AddReference(BlockReference.Reference(i).RefBlock(), GlobalTimecodeScale); + } + } + + KaxCodecState *CodecState = static_cast(BlockReference.FindFirstElt(EBML_INFO(KaxCodecState))); + if (CodecState != NULL) { + KaxCueCodecState &CueCodecState = AddNewChild(NewPositions); + *static_cast(&CueCodecState) = BlockReference.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition()); + } +#endif // MATROSKA_VERSION + + SetValueIsSet(); +} + +void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalTimecodeScale) +{ + const KaxInternalBlock &BlockReference = BlobReference; + + // fill me + KaxCueTime & NewTime = GetChild(*this); + *static_cast(&NewTime) = BlockReference.GlobalTimecode() / GlobalTimecodeScale; + + KaxCueTrackPositions & NewPositions = AddNewChild(*this); + KaxCueTrack & TheTrack = GetChild(NewPositions); + *static_cast(&TheTrack) = BlockReference.TrackNum(); + + KaxCueClusterPosition & TheClustPos = GetChild(NewPositions); + *static_cast(&TheClustPos) = BlockReference.ClusterPosition(); + +#if 0 // MATROSKA_VERSION >= 2 + // handle reference use + if (BlockReference.ReferenceCount() != 0) + { + unsigned int i; + for (i=0; i(NewPositions); + NewRefs.AddReference(BlockReference.Reference(i).RefBlock(), GlobalTimecodeScale); + } + } +#endif // MATROSKA_VERSION + +#if MATROSKA_VERSION >= 2 + if (!BlobReference.IsSimpleBlock()) { + const KaxBlockGroup &BlockGroup = BlobReference; + const KaxCodecState *CodecState = static_cast(BlockGroup.FindFirstElt(EBML_INFO(KaxCodecState))); + if (CodecState != NULL) { + KaxCueCodecState &CueCodecState = AddNewChild(NewPositions); + *static_cast(&CueCodecState) = BlockGroup.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition()); + } + } +#endif // MATROSKA_VERSION + + SetValueIsSet(); +} + +#if MATROSKA_VERSION >= 2 +/*! + \todo handle codec state checking +*/ +void KaxCueReference::AddReference(const KaxBlockBlob & BlockReference, uint64 GlobalTimecodeScale) +{ + const KaxInternalBlock & theBlock = BlockReference; + KaxCueRefTime & NewTime = GetChild(*this); + *static_cast(&NewTime) = theBlock.GlobalTimecode() / GlobalTimecodeScale; + + KaxCueRefCluster & TheClustPos = GetChild(*this); + *static_cast(&TheClustPos) = theBlock.ClusterPosition(); + +#ifdef OLD + // handle recursive reference use + if (BlockReference.ReferenceCount() != 0) + { + unsigned int i; + for (i=0; i(&EltB); + + // compare timecode + const KaxCueTime * TimeCodeA = static_cast(FindElt(EBML_INFO(KaxCueTime))); + if (TimeCodeA == NULL) + return false; + + const KaxCueTime * TimeCodeB = static_cast(theEltB.FindElt(EBML_INFO(KaxCueTime))); + if (TimeCodeB == NULL) + return false; + + if (*TimeCodeA < *TimeCodeB) + return true; + + if (*TimeCodeB < *TimeCodeA) + return false; + + // compare tracks (timecodes are equal) + const KaxCueTrack * TrackA = static_cast(FindElt(EBML_INFO(KaxCueTrack))); + if (TrackA == NULL) + return false; + + const KaxCueTrack * TrackB = static_cast(theEltB.FindElt(EBML_INFO(KaxCueTrack))); + if (TrackB == NULL) + return false; + + if (*TrackA < *TrackB) + return true; + + if (*TrackB < *TrackA) + return false; + + return false; +} + +bool KaxCuePoint::Timecode(uint64 & aTimecode, uint64 GlobalTimecodeScale) const +{ + const KaxCueTime *aTime = static_cast(FindFirstElt(EBML_INFO(KaxCueTime))); + if (aTime == NULL) + return false; + aTimecode = uint64(*aTime) * GlobalTimecodeScale; + return true; +} + +/*! + \brief return the position of the Cluster to load +*/ +const KaxCueTrackPositions * KaxCuePoint::GetSeekPosition() const +{ + const KaxCueTrackPositions * result = NULL; + uint64 aPosition = EBML_PRETTYLONGINT(0xFFFFFFFFFFFFFFF); + // find the position of the "earlier" Cluster + const KaxCueTrackPositions *aPoss = static_cast(FindFirstElt(EBML_INFO(KaxCueTrackPositions))); + while (aPoss != NULL) + { + const KaxCueClusterPosition *aPos = static_cast(aPoss->FindFirstElt(EBML_INFO(KaxCueClusterPosition))); + if (aPos != NULL && uint64(*aPos) < aPosition) { + aPosition = uint64(*aPos); + result = aPoss; + } + + aPoss = static_cast(FindNextElt(*aPoss)); + } + return result; +} + +uint64 KaxCueTrackPositions::ClusterPosition() const +{ + const KaxCueClusterPosition *aPos = static_cast(FindFirstElt(EBML_INFO(KaxCueClusterPosition))); + if (aPos == NULL) + return 0; + + return uint64(*aPos); +} + +uint16 KaxCueTrackPositions::TrackNumber() const +{ + const KaxCueTrack *aTrack = static_cast(FindFirstElt(EBML_INFO(KaxCueTrack))); + if (aTrack == NULL) + return 0; + + return uint16(*aTrack); +} + + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxInfo.cpp b/src/KaxInfo.cpp index b33bace..3e66c96 100644 --- a/src/KaxInfo.cpp +++ b/src/KaxInfo.cpp @@ -1,77 +1,77 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxInfo.cpp 1078 2005-03-03 13:13:04Z robux4 $ - \author Steve Lhomme -*/ -#include "matroska/KaxInfo.h" -#include "matroska/KaxInfoData.h" - -#include "matroska/KaxContexts.h" - -// sub elements -START_LIBMATROSKA_NAMESPACE - -const EbmlSemantic KaxInfo_ContextList[14] = -{ - EbmlSemantic(false, true, EBML_INFO(KaxSegmentUID)), - EbmlSemantic(false, true, EBML_INFO(KaxSegmentFilename)), - EbmlSemantic(false, true, EBML_INFO(KaxPrevUID)), - EbmlSemantic(false, true, EBML_INFO(KaxPrevFilename)), - EbmlSemantic(false, true, EBML_INFO(KaxNextUID)), - EbmlSemantic(false, true, EBML_INFO(KaxNextFilename)), - EbmlSemantic(false, false, EBML_INFO(KaxSegmentFamily)), - EbmlSemantic(false, false, EBML_INFO(KaxChapterTranslate)), - EbmlSemantic(true, true, EBML_INFO(KaxTimecodeScale)), - EbmlSemantic(false, true, EBML_INFO(KaxDuration)), - EbmlSemantic(false, true, EBML_INFO(KaxDateUTC)), - EbmlSemantic(false, true, EBML_INFO(KaxTitle)), - EbmlSemantic(true, true, EBML_INFO(KaxMuxingApp)), - EbmlSemantic(true, true, EBML_INFO(KaxWritingApp)), -}; - -const EbmlSemanticContext KaxInfo_Context = EbmlSemanticContext(countof(KaxInfo_ContextList), KaxInfo_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxInfo)); -const EbmlSemanticContext KaxMuxingApp_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxMuxingApp)); -const EbmlSemanticContext KaxWritingApp_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxWritingApp)); - -EbmlId KaxInfo_TheId (0x1549A966, 4); -EbmlId KaxMuxingApp_TheId (0x4D80, 2); -EbmlId KaxWritingApp_TheId(0x5741, 2); - -const EbmlCallbacks KaxInfo::ClassInfos(KaxInfo::Create, KaxInfo_TheId, "Info", KaxInfo_Context); -const EbmlCallbacks KaxMuxingApp::ClassInfos(KaxMuxingApp::Create, KaxMuxingApp_TheId, "MuxingApp", KaxMuxingApp_Context); -const EbmlCallbacks KaxWritingApp::ClassInfos(KaxWritingApp::Create, KaxWritingApp_TheId, "WritingApp", KaxWritingApp_Context); - -KaxInfo::KaxInfo() - :EbmlMaster(KaxInfo_Context) -{} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxInfo.cpp 1078 2005-03-03 13:13:04Z robux4 $ + \author Steve Lhomme +*/ +#include "matroska/KaxInfo.h" +#include "matroska/KaxInfoData.h" + +#include "matroska/KaxContexts.h" + +// sub elements +START_LIBMATROSKA_NAMESPACE + +const EbmlSemantic KaxInfo_ContextList[14] = +{ + EbmlSemantic(false, true, EBML_INFO(KaxSegmentUID)), + EbmlSemantic(false, true, EBML_INFO(KaxSegmentFilename)), + EbmlSemantic(false, true, EBML_INFO(KaxPrevUID)), + EbmlSemantic(false, true, EBML_INFO(KaxPrevFilename)), + EbmlSemantic(false, true, EBML_INFO(KaxNextUID)), + EbmlSemantic(false, true, EBML_INFO(KaxNextFilename)), + EbmlSemantic(false, false, EBML_INFO(KaxSegmentFamily)), + EbmlSemantic(false, false, EBML_INFO(KaxChapterTranslate)), + EbmlSemantic(true, true, EBML_INFO(KaxTimecodeScale)), + EbmlSemantic(false, true, EBML_INFO(KaxDuration)), + EbmlSemantic(false, true, EBML_INFO(KaxDateUTC)), + EbmlSemantic(false, true, EBML_INFO(KaxTitle)), + EbmlSemantic(true, true, EBML_INFO(KaxMuxingApp)), + EbmlSemantic(true, true, EBML_INFO(KaxWritingApp)), +}; + +const EbmlSemanticContext KaxInfo_Context = EbmlSemanticContext(countof(KaxInfo_ContextList), KaxInfo_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxInfo)); +const EbmlSemanticContext KaxMuxingApp_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxMuxingApp)); +const EbmlSemanticContext KaxWritingApp_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxWritingApp)); + +EbmlId KaxInfo_TheId (0x1549A966, 4); +EbmlId KaxMuxingApp_TheId (0x4D80, 2); +EbmlId KaxWritingApp_TheId(0x5741, 2); + +const EbmlCallbacks KaxInfo::ClassInfos(KaxInfo::Create, KaxInfo_TheId, "Info", KaxInfo_Context); +const EbmlCallbacks KaxMuxingApp::ClassInfos(KaxMuxingApp::Create, KaxMuxingApp_TheId, "MuxingApp", KaxMuxingApp_Context); +const EbmlCallbacks KaxWritingApp::ClassInfos(KaxWritingApp::Create, KaxWritingApp_TheId, "WritingApp", KaxWritingApp_Context); + +KaxInfo::KaxInfo() + :EbmlMaster(KaxInfo_Context) +{} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxInfoData.cpp b/src/KaxInfoData.cpp index ef6a7aa..aad60a4 100644 --- a/src/KaxInfoData.cpp +++ b/src/KaxInfoData.cpp @@ -1,101 +1,101 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxInfoData.cpp 1078 2005-03-03 13:13:04Z robux4 $ - \author Steve Lhomme - \author John Cannon -*/ -#include "matroska/KaxInfoData.h" -#include "matroska/KaxContexts.h" - -START_LIBMATROSKA_NAMESPACE - -const EbmlSemantic KaxChapterTranslate_ContextList[3] = -{ - EbmlSemantic(false, false, EBML_INFO(KaxChapterTranslateEditionUID)), - EbmlSemantic(true, true, EBML_INFO(KaxChapterTranslateCodec)), - EbmlSemantic(true, true, EBML_INFO(KaxChapterTranslateID)), -}; - -EbmlId KaxSegmentUID_TheId (0x73A4, 2); -EbmlId KaxSegmentFilename_TheId (0x7384, 2); -EbmlId KaxPrevUID_TheId (0x3CB923, 3); -EbmlId KaxPrevFilename_TheId (0x3C83AB, 3); -EbmlId KaxNextUID_TheId (0x3EB923, 3); -EbmlId KaxNextFilename_TheId (0x3E83BB, 3); -EbmlId KaxSegmentFamily_TheId (0x4444, 2); -EbmlId KaxChapterTranslate_TheId(0x6924, 2); -EbmlId KaxChapterTranslateEditionUID_TheId(0x69FC, 2); -EbmlId KaxChapterTranslateCodec_TheId(0x69BF, 2); -EbmlId KaxChapterTranslateID_TheId(0x69A5, 2); -EbmlId KaxTimecodeScale_TheId (0x2AD7B1, 3); -EbmlId KaxDuration_TheId (0x4489, 2); -EbmlId KaxDateUTC_TheId (0x4461, 2); -EbmlId KaxTitle_TheId (0x7BA9, 2); - -const EbmlSemanticContext KaxSegmentUID_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSegmentUID)); -const EbmlSemanticContext KaxSegmentFilename_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSegmentFilename)); -const EbmlSemanticContext KaxPrevUID_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxPrevUID)); -const EbmlSemanticContext KaxPrevFilename_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxPrevFilename)); -const EbmlSemanticContext KaxNextUID_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxNextUID)); -const EbmlSemanticContext KaxNextFilename_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxNextFilename)); -const EbmlSemanticContext KaxSegmentFamily_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSegmentFamily)); -const EbmlSemanticContext KaxChapterTranslate_Context = EbmlSemanticContext(countof(KaxChapterTranslate_ContextList), KaxChapterTranslate_ContextList, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTranslate)); -const EbmlSemanticContext KaxChapterTranslateEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTranslateEditionUID)); -const EbmlSemanticContext KaxChapterTranslateCodec_Context = EbmlSemanticContext(0, NULL, &KaxChapterTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTranslateCodec)); -const EbmlSemanticContext KaxChapterTranslateID_Context = EbmlSemanticContext(0, NULL, &KaxChapterTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTranslateID)); -const EbmlSemanticContext KaxTimecodeScale_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTimecodeScale)); -const EbmlSemanticContext KaxDuration_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxDuration)); -const EbmlSemanticContext KaxDateUTC_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxDateUTC)); -const EbmlSemanticContext KaxTitle_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTitle)); - - -const EbmlCallbacks KaxSegmentUID::ClassInfos(KaxSegmentUID::Create, KaxSegmentUID_TheId, "SegmentUID", KaxSegmentUID_Context); -const EbmlCallbacks KaxSegmentFilename::ClassInfos(KaxSegmentFilename::Create, KaxSegmentFilename_TheId, "SegmentFilename", KaxSegmentFilename_Context); -const EbmlCallbacks KaxPrevUID::ClassInfos(KaxPrevUID::Create, KaxPrevUID_TheId, "PrevUID", KaxPrevUID_Context); -const EbmlCallbacks KaxPrevFilename::ClassInfos(KaxPrevFilename::Create, KaxPrevFilename_TheId, "PrevFilename", KaxPrevFilename_Context); -const EbmlCallbacks KaxNextUID::ClassInfos(KaxNextUID::Create, KaxNextUID_TheId, "NextUID", KaxNextUID_Context); -const EbmlCallbacks KaxNextFilename::ClassInfos(KaxNextFilename::Create, KaxNextFilename_TheId, "NextFilename", KaxNextFilename_Context); -const EbmlCallbacks KaxSegmentFamily::ClassInfos(KaxSegmentFamily::Create, KaxSegmentFamily_TheId, "SegmentFamily", KaxSegmentFamily_Context); -const EbmlCallbacks KaxChapterTranslate::ClassInfos(KaxChapterTranslate::Create, KaxChapterTranslate_TheId, "ChapterTranslate", KaxChapterTranslate_Context); -const EbmlCallbacks KaxChapterTranslateEditionUID::ClassInfos(KaxChapterTranslateEditionUID::Create, KaxChapterTranslateEditionUID_TheId, "ChapterTranslateEditionUID", KaxChapterTranslateEditionUID_Context); -const EbmlCallbacks KaxChapterTranslateCodec::ClassInfos(KaxChapterTranslateCodec::Create, KaxChapterTranslateCodec_TheId, "ChapterTranslateCodec", KaxChapterTranslateCodec_Context); -const EbmlCallbacks KaxChapterTranslateID::ClassInfos(KaxChapterTranslateID::Create, KaxChapterTranslateID_TheId, "ChapterTranslateID", KaxChapterTranslateID_Context); -const EbmlCallbacks KaxTimecodeScale::ClassInfos(KaxTimecodeScale::Create, KaxTimecodeScale_TheId, "TimecodeScale", KaxTimecodeScale_Context); -const EbmlCallbacks KaxDuration::ClassInfos(KaxDuration::Create, KaxDuration_TheId, "Duration", KaxDuration_Context); -const EbmlCallbacks KaxDateUTC::ClassInfos(KaxDateUTC::Create, KaxDateUTC_TheId, "DateUTC", KaxDateUTC_Context); -const EbmlCallbacks KaxTitle::ClassInfos(KaxTitle::Create, KaxTitle_TheId, "Title", KaxTitle_Context); - -KaxChapterTranslate::KaxChapterTranslate() - :EbmlMaster(KaxChapterTranslate_Context) -{} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxInfoData.cpp 1078 2005-03-03 13:13:04Z robux4 $ + \author Steve Lhomme + \author John Cannon +*/ +#include "matroska/KaxInfoData.h" +#include "matroska/KaxContexts.h" + +START_LIBMATROSKA_NAMESPACE + +const EbmlSemantic KaxChapterTranslate_ContextList[3] = +{ + EbmlSemantic(false, false, EBML_INFO(KaxChapterTranslateEditionUID)), + EbmlSemantic(true, true, EBML_INFO(KaxChapterTranslateCodec)), + EbmlSemantic(true, true, EBML_INFO(KaxChapterTranslateID)), +}; + +EbmlId KaxSegmentUID_TheId (0x73A4, 2); +EbmlId KaxSegmentFilename_TheId (0x7384, 2); +EbmlId KaxPrevUID_TheId (0x3CB923, 3); +EbmlId KaxPrevFilename_TheId (0x3C83AB, 3); +EbmlId KaxNextUID_TheId (0x3EB923, 3); +EbmlId KaxNextFilename_TheId (0x3E83BB, 3); +EbmlId KaxSegmentFamily_TheId (0x4444, 2); +EbmlId KaxChapterTranslate_TheId(0x6924, 2); +EbmlId KaxChapterTranslateEditionUID_TheId(0x69FC, 2); +EbmlId KaxChapterTranslateCodec_TheId(0x69BF, 2); +EbmlId KaxChapterTranslateID_TheId(0x69A5, 2); +EbmlId KaxTimecodeScale_TheId (0x2AD7B1, 3); +EbmlId KaxDuration_TheId (0x4489, 2); +EbmlId KaxDateUTC_TheId (0x4461, 2); +EbmlId KaxTitle_TheId (0x7BA9, 2); + +const EbmlSemanticContext KaxSegmentUID_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSegmentUID)); +const EbmlSemanticContext KaxSegmentFilename_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSegmentFilename)); +const EbmlSemanticContext KaxPrevUID_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxPrevUID)); +const EbmlSemanticContext KaxPrevFilename_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxPrevFilename)); +const EbmlSemanticContext KaxNextUID_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxNextUID)); +const EbmlSemanticContext KaxNextFilename_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxNextFilename)); +const EbmlSemanticContext KaxSegmentFamily_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSegmentFamily)); +const EbmlSemanticContext KaxChapterTranslate_Context = EbmlSemanticContext(countof(KaxChapterTranslate_ContextList), KaxChapterTranslate_ContextList, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTranslate)); +const EbmlSemanticContext KaxChapterTranslateEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTranslateEditionUID)); +const EbmlSemanticContext KaxChapterTranslateCodec_Context = EbmlSemanticContext(0, NULL, &KaxChapterTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTranslateCodec)); +const EbmlSemanticContext KaxChapterTranslateID_Context = EbmlSemanticContext(0, NULL, &KaxChapterTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxChapterTranslateID)); +const EbmlSemanticContext KaxTimecodeScale_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTimecodeScale)); +const EbmlSemanticContext KaxDuration_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxDuration)); +const EbmlSemanticContext KaxDateUTC_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxDateUTC)); +const EbmlSemanticContext KaxTitle_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTitle)); + + +const EbmlCallbacks KaxSegmentUID::ClassInfos(KaxSegmentUID::Create, KaxSegmentUID_TheId, "SegmentUID", KaxSegmentUID_Context); +const EbmlCallbacks KaxSegmentFilename::ClassInfos(KaxSegmentFilename::Create, KaxSegmentFilename_TheId, "SegmentFilename", KaxSegmentFilename_Context); +const EbmlCallbacks KaxPrevUID::ClassInfos(KaxPrevUID::Create, KaxPrevUID_TheId, "PrevUID", KaxPrevUID_Context); +const EbmlCallbacks KaxPrevFilename::ClassInfos(KaxPrevFilename::Create, KaxPrevFilename_TheId, "PrevFilename", KaxPrevFilename_Context); +const EbmlCallbacks KaxNextUID::ClassInfos(KaxNextUID::Create, KaxNextUID_TheId, "NextUID", KaxNextUID_Context); +const EbmlCallbacks KaxNextFilename::ClassInfos(KaxNextFilename::Create, KaxNextFilename_TheId, "NextFilename", KaxNextFilename_Context); +const EbmlCallbacks KaxSegmentFamily::ClassInfos(KaxSegmentFamily::Create, KaxSegmentFamily_TheId, "SegmentFamily", KaxSegmentFamily_Context); +const EbmlCallbacks KaxChapterTranslate::ClassInfos(KaxChapterTranslate::Create, KaxChapterTranslate_TheId, "ChapterTranslate", KaxChapterTranslate_Context); +const EbmlCallbacks KaxChapterTranslateEditionUID::ClassInfos(KaxChapterTranslateEditionUID::Create, KaxChapterTranslateEditionUID_TheId, "ChapterTranslateEditionUID", KaxChapterTranslateEditionUID_Context); +const EbmlCallbacks KaxChapterTranslateCodec::ClassInfos(KaxChapterTranslateCodec::Create, KaxChapterTranslateCodec_TheId, "ChapterTranslateCodec", KaxChapterTranslateCodec_Context); +const EbmlCallbacks KaxChapterTranslateID::ClassInfos(KaxChapterTranslateID::Create, KaxChapterTranslateID_TheId, "ChapterTranslateID", KaxChapterTranslateID_Context); +const EbmlCallbacks KaxTimecodeScale::ClassInfos(KaxTimecodeScale::Create, KaxTimecodeScale_TheId, "TimecodeScale", KaxTimecodeScale_Context); +const EbmlCallbacks KaxDuration::ClassInfos(KaxDuration::Create, KaxDuration_TheId, "Duration", KaxDuration_Context); +const EbmlCallbacks KaxDateUTC::ClassInfos(KaxDateUTC::Create, KaxDateUTC_TheId, "DateUTC", KaxDateUTC_Context); +const EbmlCallbacks KaxTitle::ClassInfos(KaxTitle::Create, KaxTitle_TheId, "Title", KaxTitle_Context); + +KaxChapterTranslate::KaxChapterTranslate() + :EbmlMaster(KaxChapterTranslate_Context) +{} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxSeekHead.cpp b/src/KaxSeekHead.cpp index 3f9aac6..8cbfc6f 100644 --- a/src/KaxSeekHead.cpp +++ b/src/KaxSeekHead.cpp @@ -1,181 +1,181 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxSeekHead.cpp 640 2004-07-09 21:05:36Z mosu $ - \author Steve Lhomme -*/ -#include "matroska/KaxSeekHead.h" -#include "matroska/KaxContexts.h" -#include "matroska/KaxSegment.h" -#include "matroska/KaxCues.h" - -using namespace LIBEBML_NAMESPACE; - -// sub elements -START_LIBMATROSKA_NAMESPACE - -EbmlSemantic KaxSeekHead_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxSeek)), -}; - -EbmlSemantic KaxSeek_ContextList[2] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxSeekID)), - EbmlSemantic(true, true, EBML_INFO(KaxSeekPosition)), -}; - -const EbmlSemanticContext KaxSeekHead_Context = EbmlSemanticContext(countof(KaxSeekHead_ContextList), KaxSeekHead_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSeekHead)); -const EbmlSemanticContext KaxSeek_Context = EbmlSemanticContext(countof(KaxSeek_ContextList), KaxSeek_ContextList, &KaxSeekHead_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSeek)); -const EbmlSemanticContext KaxSeekID_Context = EbmlSemanticContext(0, NULL, &KaxSeek_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSeekID)); -const EbmlSemanticContext KaxSeekPosition_Context = EbmlSemanticContext(0, NULL, &KaxSeek_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSeekPosition)); - -EbmlId KaxSeekHead_TheId (0x114D9B74, 4); -EbmlId KaxSeek_TheId (0x4DBB, 2); -EbmlId KaxSeekID_TheId (0x53AB, 2); -EbmlId KaxSeekPosition_TheId(0x53AC, 2); - -const EbmlCallbacks KaxSeekHead::ClassInfos(KaxSeekHead::Create, KaxSeekHead_TheId, "SeekHeader", KaxSeekHead_Context); -const EbmlCallbacks KaxSeek::ClassInfos(KaxSeek::Create, KaxSeek_TheId, "SeekPoint", KaxSeek_Context); -const EbmlCallbacks KaxSeekID::ClassInfos(KaxSeekID::Create, KaxSeekID_TheId, "SeekID", KaxSeekID_Context); -const EbmlCallbacks KaxSeekPosition::ClassInfos(KaxSeekPosition::Create, KaxSeekPosition_TheId, "SeekPosition", KaxSeekPosition_Context); - -KaxSeekHead::KaxSeekHead() - :EbmlMaster(KaxSeekHead_Context) -{} - -KaxSeek::KaxSeek() - :EbmlMaster(KaxSeek_Context) -{} - -/*! - \todo verify that the element is not already in the list -*/ -void KaxSeekHead::IndexThis(const EbmlElement & aElt, const KaxSegment & ParentSegment) -{ - // create a new point - KaxSeek & aNewPoint = AddNewChild(*this); - - // add the informations to this element - KaxSeekPosition & aNewPos = GetChild(aNewPoint); - *static_cast(&aNewPos) = ParentSegment.GetRelativePosition(aElt); - - KaxSeekID & aNewID = GetChild(aNewPoint); - binary ID[4]; - for (int i=EBML_ID_LENGTH(EbmlId(aElt)); i>0; i--) { - ID[4-i] = (EBML_ID_VALUE(EbmlId(aElt)) >> 8*(i-1)) & 0xFF; - } - aNewID.CopyBuffer(ID, EBML_ID_LENGTH(EbmlId(aElt))); -} - -KaxSeek * KaxSeekHead::FindFirstOf(const EbmlCallbacks & Callbacks) const -{ - // parse all the Entries and find the first to match the type - KaxSeek * aElt = static_cast(FindFirstElt(EBML_INFO(KaxSeek))); - while (aElt != NULL) - { - KaxSeekID * aId = NULL; - for (unsigned int i = 0; iListSize(); i++) { - if (EbmlId(*(*aElt)[i]) == EBML_ID(KaxSeekID)) { - aId = static_cast((*aElt)[i]); - EbmlId aEbmlId(aId->GetBuffer(), aId->GetSize()); - if (aEbmlId == Callbacks.GlobalId) - { - return aElt; - } - break; - } - } - aElt = static_cast(FindNextElt(*aElt)); - } - - return NULL; -} - -KaxSeek * KaxSeekHead::FindNextOf(const KaxSeek &aPrev) const -{ - unsigned int iIndex; - KaxSeek *tmp; - - // look for the previous in the list - for (iIndex = 0; iIndex(&aPrev)) - break; - } - - if (iIndex IsEbmlId(aPrev)) - return tmp; - } - } - } - - return NULL; -} - -int64 KaxSeek::Location() const -{ - KaxSeekPosition *aPos = static_cast(FindFirstElt(EBML_INFO(KaxSeekPosition))); - if (aPos == NULL) - return 0; - return uint64(*aPos); -} - -bool KaxSeek::IsEbmlId(const EbmlId & aId) const -{ - KaxSeekID *_Id = static_cast(FindFirstElt(EBML_INFO(KaxSeekID))); - if (_Id == NULL) - return false; - EbmlId aEbmlId(_Id->GetBuffer(), _Id->GetSize()); - return (aId == aEbmlId); -} - -bool KaxSeek::IsEbmlId(const KaxSeek & aPoint) const -{ - KaxSeekID *_IdA = static_cast(FindFirstElt(EBML_INFO(KaxSeekID))); - if (_IdA == NULL) - return false; - KaxSeekID *_IdB = static_cast(aPoint.FindFirstElt(EBML_INFO(KaxSeekID))); - if (_IdB == NULL) - return false; - EbmlId aEbmlIdA(_IdA->GetBuffer(), _IdA->GetSize()); - EbmlId aEbmlIdB(_IdB->GetBuffer(), _IdB->GetSize()); - return (aEbmlIdA == aEbmlIdB); -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxSeekHead.cpp 640 2004-07-09 21:05:36Z mosu $ + \author Steve Lhomme +*/ +#include "matroska/KaxSeekHead.h" +#include "matroska/KaxContexts.h" +#include "matroska/KaxSegment.h" +#include "matroska/KaxCues.h" + +using namespace LIBEBML_NAMESPACE; + +// sub elements +START_LIBMATROSKA_NAMESPACE + +EbmlSemantic KaxSeekHead_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxSeek)), +}; + +EbmlSemantic KaxSeek_ContextList[2] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxSeekID)), + EbmlSemantic(true, true, EBML_INFO(KaxSeekPosition)), +}; + +const EbmlSemanticContext KaxSeekHead_Context = EbmlSemanticContext(countof(KaxSeekHead_ContextList), KaxSeekHead_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSeekHead)); +const EbmlSemanticContext KaxSeek_Context = EbmlSemanticContext(countof(KaxSeek_ContextList), KaxSeek_ContextList, &KaxSeekHead_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSeek)); +const EbmlSemanticContext KaxSeekID_Context = EbmlSemanticContext(0, NULL, &KaxSeek_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSeekID)); +const EbmlSemanticContext KaxSeekPosition_Context = EbmlSemanticContext(0, NULL, &KaxSeek_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxSeekPosition)); + +EbmlId KaxSeekHead_TheId (0x114D9B74, 4); +EbmlId KaxSeek_TheId (0x4DBB, 2); +EbmlId KaxSeekID_TheId (0x53AB, 2); +EbmlId KaxSeekPosition_TheId(0x53AC, 2); + +const EbmlCallbacks KaxSeekHead::ClassInfos(KaxSeekHead::Create, KaxSeekHead_TheId, "SeekHeader", KaxSeekHead_Context); +const EbmlCallbacks KaxSeek::ClassInfos(KaxSeek::Create, KaxSeek_TheId, "SeekPoint", KaxSeek_Context); +const EbmlCallbacks KaxSeekID::ClassInfos(KaxSeekID::Create, KaxSeekID_TheId, "SeekID", KaxSeekID_Context); +const EbmlCallbacks KaxSeekPosition::ClassInfos(KaxSeekPosition::Create, KaxSeekPosition_TheId, "SeekPosition", KaxSeekPosition_Context); + +KaxSeekHead::KaxSeekHead() + :EbmlMaster(KaxSeekHead_Context) +{} + +KaxSeek::KaxSeek() + :EbmlMaster(KaxSeek_Context) +{} + +/*! + \todo verify that the element is not already in the list +*/ +void KaxSeekHead::IndexThis(const EbmlElement & aElt, const KaxSegment & ParentSegment) +{ + // create a new point + KaxSeek & aNewPoint = AddNewChild(*this); + + // add the informations to this element + KaxSeekPosition & aNewPos = GetChild(aNewPoint); + *static_cast(&aNewPos) = ParentSegment.GetRelativePosition(aElt); + + KaxSeekID & aNewID = GetChild(aNewPoint); + binary ID[4]; + for (int i=EBML_ID_LENGTH(EbmlId(aElt)); i>0; i--) { + ID[4-i] = (EBML_ID_VALUE(EbmlId(aElt)) >> 8*(i-1)) & 0xFF; + } + aNewID.CopyBuffer(ID, EBML_ID_LENGTH(EbmlId(aElt))); +} + +KaxSeek * KaxSeekHead::FindFirstOf(const EbmlCallbacks & Callbacks) const +{ + // parse all the Entries and find the first to match the type + KaxSeek * aElt = static_cast(FindFirstElt(EBML_INFO(KaxSeek))); + while (aElt != NULL) + { + KaxSeekID * aId = NULL; + for (unsigned int i = 0; iListSize(); i++) { + if (EbmlId(*(*aElt)[i]) == EBML_ID(KaxSeekID)) { + aId = static_cast((*aElt)[i]); + EbmlId aEbmlId(aId->GetBuffer(), aId->GetSize()); + if (aEbmlId == Callbacks.GlobalId) + { + return aElt; + } + break; + } + } + aElt = static_cast(FindNextElt(*aElt)); + } + + return NULL; +} + +KaxSeek * KaxSeekHead::FindNextOf(const KaxSeek &aPrev) const +{ + unsigned int iIndex; + KaxSeek *tmp; + + // look for the previous in the list + for (iIndex = 0; iIndex(&aPrev)) + break; + } + + if (iIndex IsEbmlId(aPrev)) + return tmp; + } + } + } + + return NULL; +} + +int64 KaxSeek::Location() const +{ + KaxSeekPosition *aPos = static_cast(FindFirstElt(EBML_INFO(KaxSeekPosition))); + if (aPos == NULL) + return 0; + return uint64(*aPos); +} + +bool KaxSeek::IsEbmlId(const EbmlId & aId) const +{ + KaxSeekID *_Id = static_cast(FindFirstElt(EBML_INFO(KaxSeekID))); + if (_Id == NULL) + return false; + EbmlId aEbmlId(_Id->GetBuffer(), _Id->GetSize()); + return (aId == aEbmlId); +} + +bool KaxSeek::IsEbmlId(const KaxSeek & aPoint) const +{ + KaxSeekID *_IdA = static_cast(FindFirstElt(EBML_INFO(KaxSeekID))); + if (_IdA == NULL) + return false; + KaxSeekID *_IdB = static_cast(aPoint.FindFirstElt(EBML_INFO(KaxSeekID))); + if (_IdB == NULL) + return false; + EbmlId aEbmlIdA(_IdA->GetBuffer(), _IdA->GetSize()); + EbmlId aEbmlIdB(_IdB->GetBuffer(), _IdB->GetSize()); + return (aEbmlIdA == aEbmlIdB); +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxSegment.cpp b/src/KaxSegment.cpp index c947366..1262118 100644 --- a/src/KaxSegment.cpp +++ b/src/KaxSegment.cpp @@ -1,111 +1,111 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxSegment.cpp 1096 2005-03-17 09:14:52Z robux4 $ - \author Steve Lhomme -*/ -#include "matroska/KaxSegment.h" -#include "ebml/EbmlHead.h" - -// sub elements -#include "matroska/KaxCluster.h" -#include "matroska/KaxSeekHead.h" -#include "matroska/KaxCues.h" -#include "matroska/KaxTracks.h" -#include "matroska/KaxInfo.h" -#include "matroska/KaxChapters.h" -#include "matroska/KaxAttachments.h" -#include "matroska/KaxTags.h" -#include "matroska/KaxContexts.h" - -START_LIBMATROSKA_NAMESPACE - -EbmlSemantic KaxMatroska_ContextList[2] = -{ - EbmlSemantic(true, true, EBML_INFO(EbmlHead)), - EbmlSemantic(true, false, EBML_INFO(KaxSegment)), -}; - -EbmlSemantic KaxSegment_ContextList[8] = -{ - EbmlSemantic(false, false, EBML_INFO(KaxCluster)), - EbmlSemantic(false, false, EBML_INFO(KaxSeekHead)), - EbmlSemantic(false, true, EBML_INFO(KaxCues)), - EbmlSemantic(false, false, EBML_INFO(KaxTracks)), - EbmlSemantic(true, true, EBML_INFO(KaxInfo)), - EbmlSemantic(false, true, EBML_INFO(KaxChapters)), - EbmlSemantic(false, true, EBML_INFO(KaxAttachments)), - EbmlSemantic(false, true, EBML_INFO(KaxTags)), -}; - -const EbmlSemanticContext KaxMatroska_Context = EbmlSemanticContext(countof(KaxMatroska_ContextList), KaxMatroska_ContextList, NULL, *GetKaxGlobal_Context, NULL); -const EbmlSemanticContext KaxSegment_Context = EbmlSemanticContext(countof(KaxSegment_ContextList), KaxSegment_ContextList, NULL, *GetKaxGlobal_Context, &EBML_INFO(KaxSegment)); - -EbmlId KaxSegment_TheId(0x18538067, 4); -const EbmlCallbacks KaxSegment::ClassInfos(KaxSegment::Create, KaxSegment_TheId, "Segment\0rotomopogo", KaxSegment_Context); - -KaxSegment::KaxSegment() - :EbmlMaster(KaxSegment_Context) -{ - SetSizeLength(5); // mandatory min size support (for easier updating) (2^(7*5)-2 = 32Go) - SetSizeInfinite(); // by default a segment is big and the size is unknown in advance -} - -KaxSegment::KaxSegment(const KaxSegment & ElementToClone) - :EbmlMaster(ElementToClone) -{ - // update the parent of each children - std::vector::const_iterator Itr = begin(); - while (Itr != end()) - { - if (EbmlId(**Itr) == EBML_ID(KaxCluster)) { - static_cast(*Itr)->SetParent(*this); - } - } -} - - -uint64 KaxSegment::GetRelativePosition(uint64 aGlobalPosition) const -{ - return aGlobalPosition - GetElementPosition() - HeadSize(); -} - -uint64 KaxSegment::GetRelativePosition(const EbmlElement & Elt) const -{ - return GetRelativePosition(Elt.GetElementPosition()); -} - -uint64 KaxSegment::GetGlobalPosition(uint64 aRelativePosition) const -{ - return aRelativePosition + GetElementPosition() + HeadSize(); -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxSegment.cpp 1096 2005-03-17 09:14:52Z robux4 $ + \author Steve Lhomme +*/ +#include "matroska/KaxSegment.h" +#include "ebml/EbmlHead.h" + +// sub elements +#include "matroska/KaxCluster.h" +#include "matroska/KaxSeekHead.h" +#include "matroska/KaxCues.h" +#include "matroska/KaxTracks.h" +#include "matroska/KaxInfo.h" +#include "matroska/KaxChapters.h" +#include "matroska/KaxAttachments.h" +#include "matroska/KaxTags.h" +#include "matroska/KaxContexts.h" + +START_LIBMATROSKA_NAMESPACE + +EbmlSemantic KaxMatroska_ContextList[2] = +{ + EbmlSemantic(true, true, EBML_INFO(EbmlHead)), + EbmlSemantic(true, false, EBML_INFO(KaxSegment)), +}; + +EbmlSemantic KaxSegment_ContextList[8] = +{ + EbmlSemantic(false, false, EBML_INFO(KaxCluster)), + EbmlSemantic(false, false, EBML_INFO(KaxSeekHead)), + EbmlSemantic(false, true, EBML_INFO(KaxCues)), + EbmlSemantic(false, false, EBML_INFO(KaxTracks)), + EbmlSemantic(true, true, EBML_INFO(KaxInfo)), + EbmlSemantic(false, true, EBML_INFO(KaxChapters)), + EbmlSemantic(false, true, EBML_INFO(KaxAttachments)), + EbmlSemantic(false, true, EBML_INFO(KaxTags)), +}; + +const EbmlSemanticContext KaxMatroska_Context = EbmlSemanticContext(countof(KaxMatroska_ContextList), KaxMatroska_ContextList, NULL, *GetKaxGlobal_Context, NULL); +const EbmlSemanticContext KaxSegment_Context = EbmlSemanticContext(countof(KaxSegment_ContextList), KaxSegment_ContextList, NULL, *GetKaxGlobal_Context, &EBML_INFO(KaxSegment)); + +EbmlId KaxSegment_TheId(0x18538067, 4); +const EbmlCallbacks KaxSegment::ClassInfos(KaxSegment::Create, KaxSegment_TheId, "Segment\0rotomopogo", KaxSegment_Context); + +KaxSegment::KaxSegment() + :EbmlMaster(KaxSegment_Context) +{ + SetSizeLength(5); // mandatory min size support (for easier updating) (2^(7*5)-2 = 32Go) + SetSizeInfinite(); // by default a segment is big and the size is unknown in advance +} + +KaxSegment::KaxSegment(const KaxSegment & ElementToClone) + :EbmlMaster(ElementToClone) +{ + // update the parent of each children + std::vector::const_iterator Itr = begin(); + while (Itr != end()) + { + if (EbmlId(**Itr) == EBML_ID(KaxCluster)) { + static_cast(*Itr)->SetParent(*this); + } + } +} + + +uint64 KaxSegment::GetRelativePosition(uint64 aGlobalPosition) const +{ + return aGlobalPosition - GetElementPosition() - HeadSize(); +} + +uint64 KaxSegment::GetRelativePosition(const EbmlElement & Elt) const +{ + return GetRelativePosition(Elt.GetElementPosition()); +} + +uint64 KaxSegment::GetGlobalPosition(uint64 aRelativePosition) const +{ + return aRelativePosition + GetElementPosition() + HeadSize(); +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxTag.cpp b/src/KaxTag.cpp index 1720959..ff2bc68 100644 --- a/src/KaxTag.cpp +++ b/src/KaxTag.cpp @@ -1,347 +1,347 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTag.cpp 1325 2009-03-30 07:56:54Z robux4 $ - \author Jory Stone - \author Steve Lhomme -*/ -#include "matroska/KaxTag.h" -#include "matroska/KaxTagMulti.h" -#include "matroska/KaxContexts.h" - -using namespace LIBEBML_NAMESPACE; - -// sub elements -START_LIBMATROSKA_NAMESPACE - -EbmlSemantic KaxTag_ContextList[14] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxTagTargets)), - EbmlSemantic(false, true, EBML_INFO(KaxTagGeneral)), - EbmlSemantic(false, true, EBML_INFO(KaxTagGenres)), - EbmlSemantic(false, true, EBML_INFO(KaxTagAudioSpecific)), - EbmlSemantic(false, true, EBML_INFO(KaxTagImageSpecific)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiCommercial)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiDate)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiEntity)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiIdentifier)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiLegal)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitle)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiAttachment)), -// EbmlSemantic(false, false, EBML_INFO(KaxTagLength)), -// EbmlSemantic(false, false, EBML_INFO(KaxTagPlaylistDelay)), -// EbmlSemantic(false, false, EBML_INFO(KaxTagUnsynchronisedText)), -// EbmlSemantic(false, false, EBML_INFO(KaxTagUserDefinedURL)), - EbmlSemantic(false, false, EBML_INFO(KaxTagMultiComment)), - EbmlSemantic(true, false, EBML_INFO(KaxTagSimple)), -}; - -EbmlSemantic KaxTagTargets_ContextList[6] = -{ - EbmlSemantic(false, true, EBML_INFO(KaxTagTargetTypeValue)), - EbmlSemantic(false, true, EBML_INFO(KaxTagTargetType)), - EbmlSemantic(false, false, EBML_INFO(KaxTagTrackUID)), - EbmlSemantic(false, false, EBML_INFO(KaxTagEditionUID)), - EbmlSemantic(false, false, EBML_INFO(KaxTagChapterUID)), - EbmlSemantic(false, false, EBML_INFO(KaxTagAttachmentUID)), -}; - -EbmlSemantic KaxTagGeneral_ContextList[17] = -{ - EbmlSemantic(false, true, EBML_INFO(KaxTagArchivalLocation)), - EbmlSemantic(false, true, EBML_INFO(KaxTagFile)), - EbmlSemantic(false, false, EBML_INFO(KaxTagKeywords)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMood)), - EbmlSemantic(false, false, EBML_INFO(KaxTagRecordLocation)), - EbmlSemantic(false, true, EBML_INFO(KaxTagSource)), - EbmlSemantic(false, true, EBML_INFO(KaxTagSourceForm)), - EbmlSemantic(false, true, EBML_INFO(KaxTagProduct)), - EbmlSemantic(false, true, EBML_INFO(KaxTagOriginalMediaType)), - EbmlSemantic(false, true, EBML_INFO(KaxTagPlayCounter)), - EbmlSemantic(false, true, EBML_INFO(KaxTagPopularimeter)), - EbmlSemantic(false, true, EBML_INFO(KaxTagSubject)), - EbmlSemantic(false, true, EBML_INFO(KaxTagBibliography)), - EbmlSemantic(false, true, EBML_INFO(KaxTagLanguage)), - EbmlSemantic(false, true, EBML_INFO(KaxTagRating)), - EbmlSemantic(false, true, EBML_INFO(KaxTagEncoder)), - EbmlSemantic(false, true, EBML_INFO(KaxTagEncodeSettings)), -}; - -EbmlSemantic KaxTagGenres_ContextList[3] = -{ - EbmlSemantic(false, false, EBML_INFO(KaxTagAudioGenre)), - EbmlSemantic(false, false, EBML_INFO(KaxTagVideoGenre)), - EbmlSemantic(false, true, EBML_INFO(KaxTagSubGenre)), -}; - -EbmlSemantic KaxTagAudioSpecific_ContextList[10] = -{ - EbmlSemantic(false, true, EBML_INFO(KaxTagAudioPeak)), - EbmlSemantic(false, true, EBML_INFO(KaxTagAudioEncryption)), - EbmlSemantic(false, true, EBML_INFO(KaxTagAudioGain)), - EbmlSemantic(false, true, EBML_INFO(KaxTagBPM)), - EbmlSemantic(false, true, EBML_INFO(KaxTagDiscTrack)), - EbmlSemantic(false, true, EBML_INFO(KaxTagSetPart)), - EbmlSemantic(false, true, EBML_INFO(KaxTagEqualisation)), - EbmlSemantic(false, true, EBML_INFO(KaxTagInitialKey)), - EbmlSemantic(false, true, EBML_INFO(KaxTagOfficialAudioFileURL)), - EbmlSemantic(false, true, EBML_INFO(KaxTagOfficialAudioSourceURL)), -}; - -EbmlSemantic KaxTagImageSpecific_ContextList[6] = -{ - EbmlSemantic(false, true, EBML_INFO(KaxTagCaptureDPI)), - EbmlSemantic(false, true, EBML_INFO(KaxTagCaptureLightness)), - EbmlSemantic(false, true, EBML_INFO(KaxTagCapturePaletteSetting)), - EbmlSemantic(false, true, EBML_INFO(KaxTagCaptureSharpness)), - EbmlSemantic(false, true, EBML_INFO(KaxTagCropped)), - EbmlSemantic(false, true, EBML_INFO(KaxTagOriginalDimensions)), -}; - -EbmlSemantic KaxTagSimple_ContextList[6] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxTagName)), - EbmlSemantic(true, true, EBML_INFO(KaxTagLangue)), - EbmlSemantic(true, true, EBML_INFO(KaxTagDefault)), - EbmlSemantic(false, true, EBML_INFO(KaxTagString)), - EbmlSemantic(false, true, EBML_INFO(KaxTagBinary)), - EbmlSemantic(false, false, EBML_INFO(KaxTagSimple)), -}; - -const EbmlSemanticContext KaxTag_Context = EbmlSemanticContext(countof(KaxTag_ContextList), KaxTag_ContextList, &KaxTags_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTag)); -const EbmlSemanticContext KaxTagTargets_Context = EbmlSemanticContext(countof(KaxTagTargets_ContextList), KaxTagTargets_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagTargets)); -const EbmlSemanticContext KaxTagGeneral_Context = EbmlSemanticContext(countof(KaxTagGeneral_ContextList), KaxTagGeneral_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagGeneral)); -const EbmlSemanticContext KaxTagGenres_Context = EbmlSemanticContext(countof(KaxTagGenres_ContextList), KaxTagGenres_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagGenres)); -const EbmlSemanticContext KaxTagAudioSpecific_Context = EbmlSemanticContext(countof(KaxTagAudioSpecific_ContextList), KaxTagAudioSpecific_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagAudioSpecific)); -const EbmlSemanticContext KaxTagImageSpecific_Context = EbmlSemanticContext(countof(KaxTagImageSpecific_ContextList), KaxTagImageSpecific_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagImageSpecific)); -const EbmlSemanticContext KaxTagBibliography_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagBibliography)); -const EbmlSemanticContext KaxTagEncoder_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagEncoder)); -const EbmlSemanticContext KaxTagEncodeSettings_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagEncodeSettings)); -const EbmlSemanticContext KaxTagLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagLanguage)); -const EbmlSemanticContext KaxTagLength_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagLength)); -const EbmlSemanticContext KaxTagPlaylistDelay_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagPlaylistDelay)); -const EbmlSemanticContext KaxTagRating_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagRating)); -const EbmlSemanticContext KaxTagSubject_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSubject)); -const EbmlSemanticContext KaxTagUnsynchronisedText_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagUnsynchronisedText)); -const EbmlSemanticContext KaxTagUserDefinedURL_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagUserDefinedURL)); -const EbmlSemanticContext KaxTagTargetTypeValue_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagTargetTypeValue)); -const EbmlSemanticContext KaxTagTargetType_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagTargetType)); -const EbmlSemanticContext KaxTagTrackUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagTrackUID)); -const EbmlSemanticContext KaxTagEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagEditionUID)); -const EbmlSemanticContext KaxTagChapterUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagChapterUID)); -const EbmlSemanticContext KaxTagAttachmentUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAttachmentUID)); -const EbmlSemanticContext KaxTagArchivalLocation_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagArchivalLocation)); -const EbmlSemanticContext KaxTagFile_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagFile)); -const EbmlSemanticContext KaxTagKeywords_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagKeywords)); -const EbmlSemanticContext KaxTagMood_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMood)); -const EbmlSemanticContext KaxTagRecordLocation_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagRecordLocation)); -const EbmlSemanticContext KaxTagSource_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSource)); -const EbmlSemanticContext KaxTagSourceForm_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSourceForm)); -const EbmlSemanticContext KaxTagProduct_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagProduct)); -const EbmlSemanticContext KaxTagOriginalMediaType_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagOriginalMediaType)); -const EbmlSemanticContext KaxTagPlayCounter_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagPlayCounter)); -const EbmlSemanticContext KaxTagPopularimeter_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagPopularimeter)); -const EbmlSemanticContext KaxTagAudioGenre_Context = EbmlSemanticContext(0, NULL, &KaxTagGenres_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAudioGenre)); -const EbmlSemanticContext KaxTagVideoGenre_Context = EbmlSemanticContext(0, NULL, &KaxTagGenres_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagVideoGenre)); -const EbmlSemanticContext KaxTagSubGenre_Context = EbmlSemanticContext(0, NULL, &KaxTagGenres_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSubGenre)); -const EbmlSemanticContext KaxTagAudioEncryption_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAudioEncryption)); -const EbmlSemanticContext KaxTagAudioGain_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAudioGain)); -const EbmlSemanticContext KaxTagAudioPeak_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAudioPeak)); -const EbmlSemanticContext KaxTagBPM_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagBPM)); -const EbmlSemanticContext KaxTagDiscTrack_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagDiscTrack)); -const EbmlSemanticContext KaxTagSetPart_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSetPart)); -const EbmlSemanticContext KaxTagEqualisation_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagEqualisation)); -const EbmlSemanticContext KaxTagInitialKey_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagInitialKey)); -const EbmlSemanticContext KaxTagOfficialAudioFileURL_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagOfficialAudioFileURL)); -const EbmlSemanticContext KaxTagOfficialAudioSourceURL_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagOfficialAudioSourceURL)); -const EbmlSemanticContext KaxTagCaptureDPI_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagCaptureDPI)); -const EbmlSemanticContext KaxTagCaptureLightness_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagCaptureLightness)); -const EbmlSemanticContext KaxTagCapturePaletteSetting_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagCapturePaletteSetting)); -const EbmlSemanticContext KaxTagCaptureSharpness_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagCaptureSharpness)); -const EbmlSemanticContext KaxTagCropped_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagCropped)); -const EbmlSemanticContext KaxTagOriginalDimensions_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagOriginalDimensions)); - -const EbmlSemanticContext KaxTagSimple_Context = EbmlSemanticContext(countof(KaxTagSimple_ContextList), KaxTagSimple_ContextList, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSimple)); -const EbmlSemanticContext KaxTagName_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagName)); -const EbmlSemanticContext KaxTagLangue_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagLangue)); -const EbmlSemanticContext KaxTagDefault_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagDefault)); -const EbmlSemanticContext KaxTagString_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagString)); -const EbmlSemanticContext KaxTagBinary_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagBinary)); - -EbmlId KaxTag_TheId (0x7373, 2); -EbmlId KaxTagTargets_TheId (0x63C0, 2); -EbmlId KaxTagGeneral_TheId (0x67C9, 2); -EbmlId KaxTagGenres_TheId (0x6583, 2); -EbmlId KaxTagAudioSpecific_TheId (0x41C5, 2); -EbmlId KaxTagImageSpecific_TheId (0x4990, 2); -EbmlId KaxTagBibliography_TheId (0x4488, 2); -EbmlId KaxTagEncoder_TheId (0x4431, 2); -EbmlId KaxTagEncodeSettings_TheId (0x6526, 2); -EbmlId KaxTagLanguage_TheId (0x22B59F, 3); -EbmlId KaxTagLength_TheId (0x5243, 2); -EbmlId KaxTagPlaylistDelay_TheId (0x72CC, 2); -EbmlId KaxTagRating_TheId (0x52BC, 2); -EbmlId KaxTagSubject_TheId (0x49C1, 2); -EbmlId KaxTagUnsynchronisedText_TheId (0x874B, 2); -EbmlId KaxTagUserDefinedURL_TheId (0x434A, 2); -EbmlId KaxTagTargetTypeValue_TheId (0x68CA, 2); -EbmlId KaxTagTargetType_TheId (0x63CA, 2); -EbmlId KaxTagTrackUID_TheId (0x63C5, 2); -EbmlId KaxTagEditionUID_TheId (0x63C9, 2); -EbmlId KaxTagChapterUID_TheId (0x63C4, 2); -EbmlId KaxTagAttachmentUID_TheId (0x63C6, 2); -EbmlId KaxTagAudioGenre_TheId (0x65C2, 2); -EbmlId KaxTagVideoGenre_TheId (0x65A1, 2); -EbmlId KaxTagSubGenre_TheId (0x65AC, 2); -EbmlId KaxTagAudioEncryption_TheId (0x41B4, 2); -EbmlId KaxTagAudioGain_TheId (0x4199, 2); -EbmlId KaxTagAudioPeak_TheId (0x4189, 2); -EbmlId KaxTagBPM_TheId (0x41A1, 2); -EbmlId KaxTagDiscTrack_TheId (0x41B6, 2); -EbmlId KaxTagSetPart_TheId (0x416E, 2); -EbmlId KaxTagEqualisation_TheId (0x41B1, 2); -EbmlId KaxTagInitialKey_TheId (0x413A, 2); -EbmlId KaxTagOfficialAudioFileURL_TheId (0x4133, 2); -EbmlId KaxTagOfficialAudioSourceURL_TheId(0x413E, 2); -EbmlId KaxTagArchivalLocation_TheId (0x45A4, 2); -EbmlId KaxTagFile_TheId (0x454E, 2); -EbmlId KaxTagKeywords_TheId (0x458C, 2); -EbmlId KaxTagMood_TheId (0x45AE, 2); -EbmlId KaxTagRecordLocation_TheId (0x457E, 2); -EbmlId KaxTagSource_TheId (0x458A, 2); -EbmlId KaxTagSourceForm_TheId (0x45B5, 2); -EbmlId KaxTagProduct_TheId (0x45E3, 2); -EbmlId KaxTagOriginalMediaType_TheId (0x45A7, 2); -EbmlId KaxTagPlayCounter_TheId (0x4566, 2); -EbmlId KaxTagPopularimeter_TheId (0x4532, 2); -EbmlId KaxTagCaptureDPI_TheId (0x49C7, 2); -EbmlId KaxTagCaptureLightness_TheId (0x49E1, 2); -EbmlId KaxTagCapturePaletteSetting_TheId (0x4934, 2); -EbmlId KaxTagCaptureSharpness_TheId (0x4922, 2); -EbmlId KaxTagCropped_TheId (0x4987, 2); -EbmlId KaxTagOriginalDimensions_TheId (0x4933, 2); - -EbmlId KaxTagSimple_TheId (0x67C8, 2); -EbmlId KaxTagName_TheId (0x45A3, 2); -EbmlId KaxTagLangue_TheId (0x447A, 2); -EbmlId KaxTagDefault_TheId (0x4484, 2); -EbmlId KaxTagString_TheId (0x4487, 2); -EbmlId KaxTagBinary_TheId (0x4485, 2); - -const EbmlCallbacks KaxTag::ClassInfos(KaxTag::Create, KaxTag_TheId, "Tag", KaxTag_Context); -const EbmlCallbacks KaxTagTargets::ClassInfos(KaxTagTargets::Create, KaxTagTargets_TheId, "TagTargets", KaxTagTargets_Context); -const EbmlCallbacks KaxTagGeneral::ClassInfos(KaxTagGeneral::Create, KaxTagGeneral_TheId, "TagGeneral", KaxTagGeneral_Context); -const EbmlCallbacks KaxTagGenres::ClassInfos(KaxTagGenres::Create, KaxTagGenres_TheId, "TagGenres", KaxTagGenres_Context); -const EbmlCallbacks KaxTagAudioSpecific::ClassInfos(KaxTagAudioSpecific::Create, KaxTagAudioSpecific_TheId, "TagAudioSpecific", KaxTagAudioSpecific_Context); -const EbmlCallbacks KaxTagImageSpecific::ClassInfos(KaxTagImageSpecific::Create, KaxTagImageSpecific_TheId, "TagImageSpecific", KaxTagImageSpecific_Context); -const EbmlCallbacks KaxTagBibliography::ClassInfos(KaxTagBibliography::Create, KaxTagBibliography_TheId, "Bibliography", KaxTagBibliography_Context); -const EbmlCallbacks KaxTagCaptureDPI::ClassInfos(KaxTagCaptureDPI::Create, KaxTagCaptureDPI_TheId, "CaptureDPI", KaxTagCaptureDPI_Context); -const EbmlCallbacks KaxTagCaptureLightness::ClassInfos(KaxTagCaptureLightness::Create, KaxTagCaptureLightness_TheId, "CaptureLightness", KaxTagCaptureLightness_Context); -const EbmlCallbacks KaxTagCapturePaletteSetting::ClassInfos(KaxTagCapturePaletteSetting::Create, KaxTagCapturePaletteSetting_TheId, "CapturePaletteSetting", KaxTagCapturePaletteSetting_Context); -const EbmlCallbacks KaxTagCaptureSharpness::ClassInfos(KaxTagCaptureSharpness::Create, KaxTagCaptureSharpness_TheId, "CaptureSharpness", KaxTagCaptureSharpness_Context); -const EbmlCallbacks KaxTagCropped::ClassInfos(KaxTagCropped::Create, KaxTagCropped_TheId, "Cropped", KaxTagCropped_Context); -const EbmlCallbacks KaxTagEncoder::ClassInfos(KaxTagEncoder::Create, KaxTagEncoder_TheId, "Encoder", KaxTagEncoder_Context); -const EbmlCallbacks KaxTagEncodeSettings::ClassInfos(KaxTagEncodeSettings::Create, KaxTagEncodeSettings_TheId, "EncodeSettings", KaxTagEncodeSettings_Context); -const EbmlCallbacks KaxTagLanguage::ClassInfos(KaxTagLanguage::Create, KaxTagLanguage_TheId, "Language", KaxTagLanguage_Context); -const EbmlCallbacks KaxTagLength::ClassInfos(KaxTagLength::Create, KaxTagLength_TheId, "Length", KaxTagLength_Context); -const EbmlCallbacks KaxTagOriginalDimensions::ClassInfos(KaxTagOriginalDimensions::Create, KaxTagOriginalDimensions_TheId, "OriginalDimensions", KaxTagOriginalDimensions_Context); -const EbmlCallbacks KaxTagPlaylistDelay::ClassInfos(KaxTagPlaylistDelay::Create, KaxTagPlaylistDelay_TheId, "PlaylistDelay", KaxTagPlaylistDelay_Context); -const EbmlCallbacks KaxTagRating::ClassInfos(KaxTagRating::Create, KaxTagRating_TheId, "Rating", KaxTagRating_Context); -const EbmlCallbacks KaxTagSubject::ClassInfos(KaxTagSubject::Create, KaxTagSubject_TheId, "Subject", KaxTagSubject_Context); -const EbmlCallbacks KaxTagUnsynchronisedText::ClassInfos(KaxTagUnsynchronisedText::Create, KaxTagUnsynchronisedText_TheId, "UnsynchronisedText", KaxTagUnsynchronisedText_Context); -const EbmlCallbacks KaxTagUserDefinedURL::ClassInfos(KaxTagUserDefinedURL::Create, KaxTagUserDefinedURL_TheId, "UserDefinedURL", KaxTagUserDefinedURL_Context); -const EbmlCallbacks KaxTagTargetTypeValue::ClassInfos(KaxTagTargetTypeValue::Create, KaxTagTargetTypeValue_TheId, "TagTargetTypeValue", KaxTagTargetTypeValue_Context); -const EbmlCallbacks KaxTagTargetType::ClassInfos(KaxTagTargetType::Create, KaxTagTargetType_TheId, "TagTargetType", KaxTagTargetType_Context); -const EbmlCallbacks KaxTagTrackUID::ClassInfos(KaxTagTrackUID::Create, KaxTagTrackUID_TheId, "TagTrackUID", KaxTagTrackUID_Context); -const EbmlCallbacks KaxTagEditionUID::ClassInfos(KaxTagEditionUID::Create, KaxTagEditionUID_TheId, "TagEditionUID", KaxTagEditionUID_Context); -const EbmlCallbacks KaxTagChapterUID::ClassInfos(KaxTagChapterUID::Create, KaxTagChapterUID_TheId, "TagChapterUID", KaxTagChapterUID_Context); -const EbmlCallbacks KaxTagAttachmentUID::ClassInfos(KaxTagAttachmentUID::Create, KaxTagAttachmentUID_TheId, "TagAttachmentUID", KaxTagAttachmentUID_Context); -const EbmlCallbacks KaxTagAudioGenre::ClassInfos(KaxTagAudioGenre::Create, KaxTagAudioGenre_TheId, "AudioGenre", KaxTagAudioGenre_Context); -const EbmlCallbacks KaxTagVideoGenre::ClassInfos(KaxTagVideoGenre::Create, KaxTagVideoGenre_TheId, "VideoGenre", KaxTagVideoGenre_Context); -const EbmlCallbacks KaxTagSubGenre::ClassInfos(KaxTagSubGenre::Create, KaxTagSubGenre_TheId, "SubGenre", KaxTagSubGenre_Context); -const EbmlCallbacks KaxTagAudioEncryption::ClassInfos(KaxTagAudioEncryption::Create, KaxTagAudioEncryption_TheId, "AudioEncryption", KaxTagAudioEncryption_Context); -const EbmlCallbacks KaxTagAudioGain::ClassInfos(KaxTagAudioGain::Create, KaxTagAudioGain_TheId, "AudioGain", KaxTagAudioGain_Context); -const EbmlCallbacks KaxTagAudioPeak::ClassInfos(KaxTagAudioPeak::Create, KaxTagAudioPeak_TheId, "AudioPeak", KaxTagAudioPeak_Context); -const EbmlCallbacks KaxTagBPM::ClassInfos(KaxTagBPM::Create, KaxTagBPM_TheId, "BPM", KaxTagBPM_Context); -const EbmlCallbacks KaxTagDiscTrack::ClassInfos(KaxTagDiscTrack::Create, KaxTagDiscTrack_TheId, "DiscTrack", KaxTagDiscTrack_Context); -const EbmlCallbacks KaxTagSetPart::ClassInfos(KaxTagSetPart::Create, KaxTagSetPart_TheId, "SetPart", KaxTagSetPart_Context); -const EbmlCallbacks KaxTagEqualisation::ClassInfos(KaxTagEqualisation::Create, KaxTagEqualisation_TheId, "Equalisation", KaxTagEqualisation_Context); -const EbmlCallbacks KaxTagInitialKey::ClassInfos(KaxTagInitialKey::Create, KaxTagInitialKey_TheId, "InitialKey", KaxTagInitialKey_Context); -const EbmlCallbacks KaxTagOfficialAudioFileURL::ClassInfos(KaxTagOfficialAudioFileURL::Create, KaxTagOfficialAudioFileURL_TheId, "OfficialAudioFileURL", KaxTagOfficialAudioFileURL_Context); -const EbmlCallbacks KaxTagOfficialAudioSourceURL::ClassInfos(KaxTagOfficialAudioSourceURL::Create, KaxTagOfficialAudioSourceURL_TheId, "AudioSourceURL", KaxTagOfficialAudioSourceURL_Context); -const EbmlCallbacks KaxTagArchivalLocation::ClassInfos(KaxTagArchivalLocation::Create, KaxTagArchivalLocation_TheId, "ArchivalLocation", KaxTagArchivalLocation_Context); -const EbmlCallbacks KaxTagFile::ClassInfos(KaxTagFile::Create, KaxTagFile_TheId, "File", KaxTagFile_Context); -const EbmlCallbacks KaxTagKeywords::ClassInfos(KaxTagKeywords::Create, KaxTagKeywords_TheId, "Keywords", KaxTagKeywords_Context); -const EbmlCallbacks KaxTagMood::ClassInfos(KaxTagMood::Create, KaxTagMood_TheId, "Mood", KaxTagMood_Context); -const EbmlCallbacks KaxTagRecordLocation::ClassInfos(KaxTagRecordLocation::Create, KaxTagRecordLocation_TheId, "RecordLocation", KaxTagRecordLocation_Context); -const EbmlCallbacks KaxTagSource::ClassInfos(KaxTagSource::Create, KaxTagSource_TheId, "Source", KaxTagSource_Context); -const EbmlCallbacks KaxTagSourceForm::ClassInfos(KaxTagSourceForm::Create, KaxTagSourceForm_TheId, "SourceForm", KaxTagSourceForm_Context); -const EbmlCallbacks KaxTagProduct::ClassInfos(KaxTagProduct::Create, KaxTagProduct_TheId, "Product", KaxTagProduct_Context); -const EbmlCallbacks KaxTagOriginalMediaType::ClassInfos(KaxTagOriginalMediaType::Create, KaxTagOriginalMediaType_TheId, "OriginalMediaType", KaxTagOriginalMediaType_Context); -const EbmlCallbacks KaxTagPlayCounter::ClassInfos(KaxTagPlayCounter::Create, KaxTagPlayCounter_TheId, "PlayCounter", KaxTagPlayCounter_Context); -const EbmlCallbacks KaxTagPopularimeter::ClassInfos(KaxTagPopularimeter::Create, KaxTagPopularimeter_TheId, "Popularimeter", KaxTagPopularimeter_Context); - -const EbmlCallbacks KaxTagSimple::ClassInfos(KaxTagSimple::Create, KaxTagSimple_TheId, "TagSimple", KaxTagSimple_Context); -const EbmlCallbacks KaxTagName::ClassInfos(KaxTagName::Create, KaxTagName_TheId, "TagName", KaxTagName_Context); -const EbmlCallbacks KaxTagLangue::ClassInfos(KaxTagLangue::Create, KaxTagLangue_TheId, "TagLanguage", KaxTagLangue_Context); -const EbmlCallbacks KaxTagDefault::ClassInfos(KaxTagDefault::Create, KaxTagDefault_TheId, "TagDefault", KaxTagDefault_Context); -const EbmlCallbacks KaxTagString::ClassInfos(KaxTagString::Create, KaxTagString_TheId, "TagString", KaxTagString_Context); -const EbmlCallbacks KaxTagBinary::ClassInfos(KaxTagBinary::Create, KaxTagBinary_TheId, "TagBinary", KaxTagBinary_Context); - -KaxTag::KaxTag() - :EbmlMaster(KaxTag_Context) -{} - -KaxTagTargets::KaxTagTargets() - :EbmlMaster(KaxTagTargets_Context) -{} - -KaxTagGeneral::KaxTagGeneral() - :EbmlMaster(KaxTagGeneral_Context) -{} - -KaxTagGenres::KaxTagGenres() - :EbmlMaster(KaxTagGenres_Context) -{} - -KaxTagAudioSpecific::KaxTagAudioSpecific() - :EbmlMaster(KaxTagAudioSpecific_Context) -{} - -KaxTagImageSpecific::KaxTagImageSpecific() - :EbmlMaster(KaxTagImageSpecific_Context) -{} - -KaxTagSimple::KaxTagSimple() - :EbmlMaster(KaxTagSimple_Context) -{} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTag.cpp 1325 2009-03-30 07:56:54Z robux4 $ + \author Jory Stone + \author Steve Lhomme +*/ +#include "matroska/KaxTag.h" +#include "matroska/KaxTagMulti.h" +#include "matroska/KaxContexts.h" + +using namespace LIBEBML_NAMESPACE; + +// sub elements +START_LIBMATROSKA_NAMESPACE + +EbmlSemantic KaxTag_ContextList[14] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxTagTargets)), + EbmlSemantic(false, true, EBML_INFO(KaxTagGeneral)), + EbmlSemantic(false, true, EBML_INFO(KaxTagGenres)), + EbmlSemantic(false, true, EBML_INFO(KaxTagAudioSpecific)), + EbmlSemantic(false, true, EBML_INFO(KaxTagImageSpecific)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiCommercial)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiDate)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiEntity)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiIdentifier)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiLegal)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitle)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiAttachment)), +// EbmlSemantic(false, false, EBML_INFO(KaxTagLength)), +// EbmlSemantic(false, false, EBML_INFO(KaxTagPlaylistDelay)), +// EbmlSemantic(false, false, EBML_INFO(KaxTagUnsynchronisedText)), +// EbmlSemantic(false, false, EBML_INFO(KaxTagUserDefinedURL)), + EbmlSemantic(false, false, EBML_INFO(KaxTagMultiComment)), + EbmlSemantic(true, false, EBML_INFO(KaxTagSimple)), +}; + +EbmlSemantic KaxTagTargets_ContextList[6] = +{ + EbmlSemantic(false, true, EBML_INFO(KaxTagTargetTypeValue)), + EbmlSemantic(false, true, EBML_INFO(KaxTagTargetType)), + EbmlSemantic(false, false, EBML_INFO(KaxTagTrackUID)), + EbmlSemantic(false, false, EBML_INFO(KaxTagEditionUID)), + EbmlSemantic(false, false, EBML_INFO(KaxTagChapterUID)), + EbmlSemantic(false, false, EBML_INFO(KaxTagAttachmentUID)), +}; + +EbmlSemantic KaxTagGeneral_ContextList[17] = +{ + EbmlSemantic(false, true, EBML_INFO(KaxTagArchivalLocation)), + EbmlSemantic(false, true, EBML_INFO(KaxTagFile)), + EbmlSemantic(false, false, EBML_INFO(KaxTagKeywords)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMood)), + EbmlSemantic(false, false, EBML_INFO(KaxTagRecordLocation)), + EbmlSemantic(false, true, EBML_INFO(KaxTagSource)), + EbmlSemantic(false, true, EBML_INFO(KaxTagSourceForm)), + EbmlSemantic(false, true, EBML_INFO(KaxTagProduct)), + EbmlSemantic(false, true, EBML_INFO(KaxTagOriginalMediaType)), + EbmlSemantic(false, true, EBML_INFO(KaxTagPlayCounter)), + EbmlSemantic(false, true, EBML_INFO(KaxTagPopularimeter)), + EbmlSemantic(false, true, EBML_INFO(KaxTagSubject)), + EbmlSemantic(false, true, EBML_INFO(KaxTagBibliography)), + EbmlSemantic(false, true, EBML_INFO(KaxTagLanguage)), + EbmlSemantic(false, true, EBML_INFO(KaxTagRating)), + EbmlSemantic(false, true, EBML_INFO(KaxTagEncoder)), + EbmlSemantic(false, true, EBML_INFO(KaxTagEncodeSettings)), +}; + +EbmlSemantic KaxTagGenres_ContextList[3] = +{ + EbmlSemantic(false, false, EBML_INFO(KaxTagAudioGenre)), + EbmlSemantic(false, false, EBML_INFO(KaxTagVideoGenre)), + EbmlSemantic(false, true, EBML_INFO(KaxTagSubGenre)), +}; + +EbmlSemantic KaxTagAudioSpecific_ContextList[10] = +{ + EbmlSemantic(false, true, EBML_INFO(KaxTagAudioPeak)), + EbmlSemantic(false, true, EBML_INFO(KaxTagAudioEncryption)), + EbmlSemantic(false, true, EBML_INFO(KaxTagAudioGain)), + EbmlSemantic(false, true, EBML_INFO(KaxTagBPM)), + EbmlSemantic(false, true, EBML_INFO(KaxTagDiscTrack)), + EbmlSemantic(false, true, EBML_INFO(KaxTagSetPart)), + EbmlSemantic(false, true, EBML_INFO(KaxTagEqualisation)), + EbmlSemantic(false, true, EBML_INFO(KaxTagInitialKey)), + EbmlSemantic(false, true, EBML_INFO(KaxTagOfficialAudioFileURL)), + EbmlSemantic(false, true, EBML_INFO(KaxTagOfficialAudioSourceURL)), +}; + +EbmlSemantic KaxTagImageSpecific_ContextList[6] = +{ + EbmlSemantic(false, true, EBML_INFO(KaxTagCaptureDPI)), + EbmlSemantic(false, true, EBML_INFO(KaxTagCaptureLightness)), + EbmlSemantic(false, true, EBML_INFO(KaxTagCapturePaletteSetting)), + EbmlSemantic(false, true, EBML_INFO(KaxTagCaptureSharpness)), + EbmlSemantic(false, true, EBML_INFO(KaxTagCropped)), + EbmlSemantic(false, true, EBML_INFO(KaxTagOriginalDimensions)), +}; + +EbmlSemantic KaxTagSimple_ContextList[6] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxTagName)), + EbmlSemantic(true, true, EBML_INFO(KaxTagLangue)), + EbmlSemantic(true, true, EBML_INFO(KaxTagDefault)), + EbmlSemantic(false, true, EBML_INFO(KaxTagString)), + EbmlSemantic(false, true, EBML_INFO(KaxTagBinary)), + EbmlSemantic(false, false, EBML_INFO(KaxTagSimple)), +}; + +const EbmlSemanticContext KaxTag_Context = EbmlSemanticContext(countof(KaxTag_ContextList), KaxTag_ContextList, &KaxTags_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTag)); +const EbmlSemanticContext KaxTagTargets_Context = EbmlSemanticContext(countof(KaxTagTargets_ContextList), KaxTagTargets_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagTargets)); +const EbmlSemanticContext KaxTagGeneral_Context = EbmlSemanticContext(countof(KaxTagGeneral_ContextList), KaxTagGeneral_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagGeneral)); +const EbmlSemanticContext KaxTagGenres_Context = EbmlSemanticContext(countof(KaxTagGenres_ContextList), KaxTagGenres_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagGenres)); +const EbmlSemanticContext KaxTagAudioSpecific_Context = EbmlSemanticContext(countof(KaxTagAudioSpecific_ContextList), KaxTagAudioSpecific_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagAudioSpecific)); +const EbmlSemanticContext KaxTagImageSpecific_Context = EbmlSemanticContext(countof(KaxTagImageSpecific_ContextList), KaxTagImageSpecific_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagImageSpecific)); +const EbmlSemanticContext KaxTagBibliography_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagBibliography)); +const EbmlSemanticContext KaxTagEncoder_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagEncoder)); +const EbmlSemanticContext KaxTagEncodeSettings_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagEncodeSettings)); +const EbmlSemanticContext KaxTagLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagLanguage)); +const EbmlSemanticContext KaxTagLength_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagLength)); +const EbmlSemanticContext KaxTagPlaylistDelay_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagPlaylistDelay)); +const EbmlSemanticContext KaxTagRating_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagRating)); +const EbmlSemanticContext KaxTagSubject_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSubject)); +const EbmlSemanticContext KaxTagUnsynchronisedText_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagUnsynchronisedText)); +const EbmlSemanticContext KaxTagUserDefinedURL_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagUserDefinedURL)); +const EbmlSemanticContext KaxTagTargetTypeValue_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagTargetTypeValue)); +const EbmlSemanticContext KaxTagTargetType_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagTargetType)); +const EbmlSemanticContext KaxTagTrackUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagTrackUID)); +const EbmlSemanticContext KaxTagEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagEditionUID)); +const EbmlSemanticContext KaxTagChapterUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagChapterUID)); +const EbmlSemanticContext KaxTagAttachmentUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAttachmentUID)); +const EbmlSemanticContext KaxTagArchivalLocation_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagArchivalLocation)); +const EbmlSemanticContext KaxTagFile_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagFile)); +const EbmlSemanticContext KaxTagKeywords_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagKeywords)); +const EbmlSemanticContext KaxTagMood_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMood)); +const EbmlSemanticContext KaxTagRecordLocation_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagRecordLocation)); +const EbmlSemanticContext KaxTagSource_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSource)); +const EbmlSemanticContext KaxTagSourceForm_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSourceForm)); +const EbmlSemanticContext KaxTagProduct_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagProduct)); +const EbmlSemanticContext KaxTagOriginalMediaType_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagOriginalMediaType)); +const EbmlSemanticContext KaxTagPlayCounter_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagPlayCounter)); +const EbmlSemanticContext KaxTagPopularimeter_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagPopularimeter)); +const EbmlSemanticContext KaxTagAudioGenre_Context = EbmlSemanticContext(0, NULL, &KaxTagGenres_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAudioGenre)); +const EbmlSemanticContext KaxTagVideoGenre_Context = EbmlSemanticContext(0, NULL, &KaxTagGenres_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagVideoGenre)); +const EbmlSemanticContext KaxTagSubGenre_Context = EbmlSemanticContext(0, NULL, &KaxTagGenres_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSubGenre)); +const EbmlSemanticContext KaxTagAudioEncryption_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAudioEncryption)); +const EbmlSemanticContext KaxTagAudioGain_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAudioGain)); +const EbmlSemanticContext KaxTagAudioPeak_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAudioPeak)); +const EbmlSemanticContext KaxTagBPM_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagBPM)); +const EbmlSemanticContext KaxTagDiscTrack_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagDiscTrack)); +const EbmlSemanticContext KaxTagSetPart_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSetPart)); +const EbmlSemanticContext KaxTagEqualisation_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagEqualisation)); +const EbmlSemanticContext KaxTagInitialKey_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagInitialKey)); +const EbmlSemanticContext KaxTagOfficialAudioFileURL_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagOfficialAudioFileURL)); +const EbmlSemanticContext KaxTagOfficialAudioSourceURL_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagOfficialAudioSourceURL)); +const EbmlSemanticContext KaxTagCaptureDPI_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagCaptureDPI)); +const EbmlSemanticContext KaxTagCaptureLightness_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagCaptureLightness)); +const EbmlSemanticContext KaxTagCapturePaletteSetting_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagCapturePaletteSetting)); +const EbmlSemanticContext KaxTagCaptureSharpness_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagCaptureSharpness)); +const EbmlSemanticContext KaxTagCropped_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagCropped)); +const EbmlSemanticContext KaxTagOriginalDimensions_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagOriginalDimensions)); + +const EbmlSemanticContext KaxTagSimple_Context = EbmlSemanticContext(countof(KaxTagSimple_ContextList), KaxTagSimple_ContextList, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagSimple)); +const EbmlSemanticContext KaxTagName_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagName)); +const EbmlSemanticContext KaxTagLangue_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagLangue)); +const EbmlSemanticContext KaxTagDefault_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagDefault)); +const EbmlSemanticContext KaxTagString_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagString)); +const EbmlSemanticContext KaxTagBinary_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagBinary)); + +EbmlId KaxTag_TheId (0x7373, 2); +EbmlId KaxTagTargets_TheId (0x63C0, 2); +EbmlId KaxTagGeneral_TheId (0x67C9, 2); +EbmlId KaxTagGenres_TheId (0x6583, 2); +EbmlId KaxTagAudioSpecific_TheId (0x41C5, 2); +EbmlId KaxTagImageSpecific_TheId (0x4990, 2); +EbmlId KaxTagBibliography_TheId (0x4488, 2); +EbmlId KaxTagEncoder_TheId (0x4431, 2); +EbmlId KaxTagEncodeSettings_TheId (0x6526, 2); +EbmlId KaxTagLanguage_TheId (0x22B59F, 3); +EbmlId KaxTagLength_TheId (0x5243, 2); +EbmlId KaxTagPlaylistDelay_TheId (0x72CC, 2); +EbmlId KaxTagRating_TheId (0x52BC, 2); +EbmlId KaxTagSubject_TheId (0x49C1, 2); +EbmlId KaxTagUnsynchronisedText_TheId (0x874B, 2); +EbmlId KaxTagUserDefinedURL_TheId (0x434A, 2); +EbmlId KaxTagTargetTypeValue_TheId (0x68CA, 2); +EbmlId KaxTagTargetType_TheId (0x63CA, 2); +EbmlId KaxTagTrackUID_TheId (0x63C5, 2); +EbmlId KaxTagEditionUID_TheId (0x63C9, 2); +EbmlId KaxTagChapterUID_TheId (0x63C4, 2); +EbmlId KaxTagAttachmentUID_TheId (0x63C6, 2); +EbmlId KaxTagAudioGenre_TheId (0x65C2, 2); +EbmlId KaxTagVideoGenre_TheId (0x65A1, 2); +EbmlId KaxTagSubGenre_TheId (0x65AC, 2); +EbmlId KaxTagAudioEncryption_TheId (0x41B4, 2); +EbmlId KaxTagAudioGain_TheId (0x4199, 2); +EbmlId KaxTagAudioPeak_TheId (0x4189, 2); +EbmlId KaxTagBPM_TheId (0x41A1, 2); +EbmlId KaxTagDiscTrack_TheId (0x41B6, 2); +EbmlId KaxTagSetPart_TheId (0x416E, 2); +EbmlId KaxTagEqualisation_TheId (0x41B1, 2); +EbmlId KaxTagInitialKey_TheId (0x413A, 2); +EbmlId KaxTagOfficialAudioFileURL_TheId (0x4133, 2); +EbmlId KaxTagOfficialAudioSourceURL_TheId(0x413E, 2); +EbmlId KaxTagArchivalLocation_TheId (0x45A4, 2); +EbmlId KaxTagFile_TheId (0x454E, 2); +EbmlId KaxTagKeywords_TheId (0x458C, 2); +EbmlId KaxTagMood_TheId (0x45AE, 2); +EbmlId KaxTagRecordLocation_TheId (0x457E, 2); +EbmlId KaxTagSource_TheId (0x458A, 2); +EbmlId KaxTagSourceForm_TheId (0x45B5, 2); +EbmlId KaxTagProduct_TheId (0x45E3, 2); +EbmlId KaxTagOriginalMediaType_TheId (0x45A7, 2); +EbmlId KaxTagPlayCounter_TheId (0x4566, 2); +EbmlId KaxTagPopularimeter_TheId (0x4532, 2); +EbmlId KaxTagCaptureDPI_TheId (0x49C7, 2); +EbmlId KaxTagCaptureLightness_TheId (0x49E1, 2); +EbmlId KaxTagCapturePaletteSetting_TheId (0x4934, 2); +EbmlId KaxTagCaptureSharpness_TheId (0x4922, 2); +EbmlId KaxTagCropped_TheId (0x4987, 2); +EbmlId KaxTagOriginalDimensions_TheId (0x4933, 2); + +EbmlId KaxTagSimple_TheId (0x67C8, 2); +EbmlId KaxTagName_TheId (0x45A3, 2); +EbmlId KaxTagLangue_TheId (0x447A, 2); +EbmlId KaxTagDefault_TheId (0x4484, 2); +EbmlId KaxTagString_TheId (0x4487, 2); +EbmlId KaxTagBinary_TheId (0x4485, 2); + +const EbmlCallbacks KaxTag::ClassInfos(KaxTag::Create, KaxTag_TheId, "Tag", KaxTag_Context); +const EbmlCallbacks KaxTagTargets::ClassInfos(KaxTagTargets::Create, KaxTagTargets_TheId, "TagTargets", KaxTagTargets_Context); +const EbmlCallbacks KaxTagGeneral::ClassInfos(KaxTagGeneral::Create, KaxTagGeneral_TheId, "TagGeneral", KaxTagGeneral_Context); +const EbmlCallbacks KaxTagGenres::ClassInfos(KaxTagGenres::Create, KaxTagGenres_TheId, "TagGenres", KaxTagGenres_Context); +const EbmlCallbacks KaxTagAudioSpecific::ClassInfos(KaxTagAudioSpecific::Create, KaxTagAudioSpecific_TheId, "TagAudioSpecific", KaxTagAudioSpecific_Context); +const EbmlCallbacks KaxTagImageSpecific::ClassInfos(KaxTagImageSpecific::Create, KaxTagImageSpecific_TheId, "TagImageSpecific", KaxTagImageSpecific_Context); +const EbmlCallbacks KaxTagBibliography::ClassInfos(KaxTagBibliography::Create, KaxTagBibliography_TheId, "Bibliography", KaxTagBibliography_Context); +const EbmlCallbacks KaxTagCaptureDPI::ClassInfos(KaxTagCaptureDPI::Create, KaxTagCaptureDPI_TheId, "CaptureDPI", KaxTagCaptureDPI_Context); +const EbmlCallbacks KaxTagCaptureLightness::ClassInfos(KaxTagCaptureLightness::Create, KaxTagCaptureLightness_TheId, "CaptureLightness", KaxTagCaptureLightness_Context); +const EbmlCallbacks KaxTagCapturePaletteSetting::ClassInfos(KaxTagCapturePaletteSetting::Create, KaxTagCapturePaletteSetting_TheId, "CapturePaletteSetting", KaxTagCapturePaletteSetting_Context); +const EbmlCallbacks KaxTagCaptureSharpness::ClassInfos(KaxTagCaptureSharpness::Create, KaxTagCaptureSharpness_TheId, "CaptureSharpness", KaxTagCaptureSharpness_Context); +const EbmlCallbacks KaxTagCropped::ClassInfos(KaxTagCropped::Create, KaxTagCropped_TheId, "Cropped", KaxTagCropped_Context); +const EbmlCallbacks KaxTagEncoder::ClassInfos(KaxTagEncoder::Create, KaxTagEncoder_TheId, "Encoder", KaxTagEncoder_Context); +const EbmlCallbacks KaxTagEncodeSettings::ClassInfos(KaxTagEncodeSettings::Create, KaxTagEncodeSettings_TheId, "EncodeSettings", KaxTagEncodeSettings_Context); +const EbmlCallbacks KaxTagLanguage::ClassInfos(KaxTagLanguage::Create, KaxTagLanguage_TheId, "Language", KaxTagLanguage_Context); +const EbmlCallbacks KaxTagLength::ClassInfos(KaxTagLength::Create, KaxTagLength_TheId, "Length", KaxTagLength_Context); +const EbmlCallbacks KaxTagOriginalDimensions::ClassInfos(KaxTagOriginalDimensions::Create, KaxTagOriginalDimensions_TheId, "OriginalDimensions", KaxTagOriginalDimensions_Context); +const EbmlCallbacks KaxTagPlaylistDelay::ClassInfos(KaxTagPlaylistDelay::Create, KaxTagPlaylistDelay_TheId, "PlaylistDelay", KaxTagPlaylistDelay_Context); +const EbmlCallbacks KaxTagRating::ClassInfos(KaxTagRating::Create, KaxTagRating_TheId, "Rating", KaxTagRating_Context); +const EbmlCallbacks KaxTagSubject::ClassInfos(KaxTagSubject::Create, KaxTagSubject_TheId, "Subject", KaxTagSubject_Context); +const EbmlCallbacks KaxTagUnsynchronisedText::ClassInfos(KaxTagUnsynchronisedText::Create, KaxTagUnsynchronisedText_TheId, "UnsynchronisedText", KaxTagUnsynchronisedText_Context); +const EbmlCallbacks KaxTagUserDefinedURL::ClassInfos(KaxTagUserDefinedURL::Create, KaxTagUserDefinedURL_TheId, "UserDefinedURL", KaxTagUserDefinedURL_Context); +const EbmlCallbacks KaxTagTargetTypeValue::ClassInfos(KaxTagTargetTypeValue::Create, KaxTagTargetTypeValue_TheId, "TagTargetTypeValue", KaxTagTargetTypeValue_Context); +const EbmlCallbacks KaxTagTargetType::ClassInfos(KaxTagTargetType::Create, KaxTagTargetType_TheId, "TagTargetType", KaxTagTargetType_Context); +const EbmlCallbacks KaxTagTrackUID::ClassInfos(KaxTagTrackUID::Create, KaxTagTrackUID_TheId, "TagTrackUID", KaxTagTrackUID_Context); +const EbmlCallbacks KaxTagEditionUID::ClassInfos(KaxTagEditionUID::Create, KaxTagEditionUID_TheId, "TagEditionUID", KaxTagEditionUID_Context); +const EbmlCallbacks KaxTagChapterUID::ClassInfos(KaxTagChapterUID::Create, KaxTagChapterUID_TheId, "TagChapterUID", KaxTagChapterUID_Context); +const EbmlCallbacks KaxTagAttachmentUID::ClassInfos(KaxTagAttachmentUID::Create, KaxTagAttachmentUID_TheId, "TagAttachmentUID", KaxTagAttachmentUID_Context); +const EbmlCallbacks KaxTagAudioGenre::ClassInfos(KaxTagAudioGenre::Create, KaxTagAudioGenre_TheId, "AudioGenre", KaxTagAudioGenre_Context); +const EbmlCallbacks KaxTagVideoGenre::ClassInfos(KaxTagVideoGenre::Create, KaxTagVideoGenre_TheId, "VideoGenre", KaxTagVideoGenre_Context); +const EbmlCallbacks KaxTagSubGenre::ClassInfos(KaxTagSubGenre::Create, KaxTagSubGenre_TheId, "SubGenre", KaxTagSubGenre_Context); +const EbmlCallbacks KaxTagAudioEncryption::ClassInfos(KaxTagAudioEncryption::Create, KaxTagAudioEncryption_TheId, "AudioEncryption", KaxTagAudioEncryption_Context); +const EbmlCallbacks KaxTagAudioGain::ClassInfos(KaxTagAudioGain::Create, KaxTagAudioGain_TheId, "AudioGain", KaxTagAudioGain_Context); +const EbmlCallbacks KaxTagAudioPeak::ClassInfos(KaxTagAudioPeak::Create, KaxTagAudioPeak_TheId, "AudioPeak", KaxTagAudioPeak_Context); +const EbmlCallbacks KaxTagBPM::ClassInfos(KaxTagBPM::Create, KaxTagBPM_TheId, "BPM", KaxTagBPM_Context); +const EbmlCallbacks KaxTagDiscTrack::ClassInfos(KaxTagDiscTrack::Create, KaxTagDiscTrack_TheId, "DiscTrack", KaxTagDiscTrack_Context); +const EbmlCallbacks KaxTagSetPart::ClassInfos(KaxTagSetPart::Create, KaxTagSetPart_TheId, "SetPart", KaxTagSetPart_Context); +const EbmlCallbacks KaxTagEqualisation::ClassInfos(KaxTagEqualisation::Create, KaxTagEqualisation_TheId, "Equalisation", KaxTagEqualisation_Context); +const EbmlCallbacks KaxTagInitialKey::ClassInfos(KaxTagInitialKey::Create, KaxTagInitialKey_TheId, "InitialKey", KaxTagInitialKey_Context); +const EbmlCallbacks KaxTagOfficialAudioFileURL::ClassInfos(KaxTagOfficialAudioFileURL::Create, KaxTagOfficialAudioFileURL_TheId, "OfficialAudioFileURL", KaxTagOfficialAudioFileURL_Context); +const EbmlCallbacks KaxTagOfficialAudioSourceURL::ClassInfos(KaxTagOfficialAudioSourceURL::Create, KaxTagOfficialAudioSourceURL_TheId, "AudioSourceURL", KaxTagOfficialAudioSourceURL_Context); +const EbmlCallbacks KaxTagArchivalLocation::ClassInfos(KaxTagArchivalLocation::Create, KaxTagArchivalLocation_TheId, "ArchivalLocation", KaxTagArchivalLocation_Context); +const EbmlCallbacks KaxTagFile::ClassInfos(KaxTagFile::Create, KaxTagFile_TheId, "File", KaxTagFile_Context); +const EbmlCallbacks KaxTagKeywords::ClassInfos(KaxTagKeywords::Create, KaxTagKeywords_TheId, "Keywords", KaxTagKeywords_Context); +const EbmlCallbacks KaxTagMood::ClassInfos(KaxTagMood::Create, KaxTagMood_TheId, "Mood", KaxTagMood_Context); +const EbmlCallbacks KaxTagRecordLocation::ClassInfos(KaxTagRecordLocation::Create, KaxTagRecordLocation_TheId, "RecordLocation", KaxTagRecordLocation_Context); +const EbmlCallbacks KaxTagSource::ClassInfos(KaxTagSource::Create, KaxTagSource_TheId, "Source", KaxTagSource_Context); +const EbmlCallbacks KaxTagSourceForm::ClassInfos(KaxTagSourceForm::Create, KaxTagSourceForm_TheId, "SourceForm", KaxTagSourceForm_Context); +const EbmlCallbacks KaxTagProduct::ClassInfos(KaxTagProduct::Create, KaxTagProduct_TheId, "Product", KaxTagProduct_Context); +const EbmlCallbacks KaxTagOriginalMediaType::ClassInfos(KaxTagOriginalMediaType::Create, KaxTagOriginalMediaType_TheId, "OriginalMediaType", KaxTagOriginalMediaType_Context); +const EbmlCallbacks KaxTagPlayCounter::ClassInfos(KaxTagPlayCounter::Create, KaxTagPlayCounter_TheId, "PlayCounter", KaxTagPlayCounter_Context); +const EbmlCallbacks KaxTagPopularimeter::ClassInfos(KaxTagPopularimeter::Create, KaxTagPopularimeter_TheId, "Popularimeter", KaxTagPopularimeter_Context); + +const EbmlCallbacks KaxTagSimple::ClassInfos(KaxTagSimple::Create, KaxTagSimple_TheId, "TagSimple", KaxTagSimple_Context); +const EbmlCallbacks KaxTagName::ClassInfos(KaxTagName::Create, KaxTagName_TheId, "TagName", KaxTagName_Context); +const EbmlCallbacks KaxTagLangue::ClassInfos(KaxTagLangue::Create, KaxTagLangue_TheId, "TagLanguage", KaxTagLangue_Context); +const EbmlCallbacks KaxTagDefault::ClassInfos(KaxTagDefault::Create, KaxTagDefault_TheId, "TagDefault", KaxTagDefault_Context); +const EbmlCallbacks KaxTagString::ClassInfos(KaxTagString::Create, KaxTagString_TheId, "TagString", KaxTagString_Context); +const EbmlCallbacks KaxTagBinary::ClassInfos(KaxTagBinary::Create, KaxTagBinary_TheId, "TagBinary", KaxTagBinary_Context); + +KaxTag::KaxTag() + :EbmlMaster(KaxTag_Context) +{} + +KaxTagTargets::KaxTagTargets() + :EbmlMaster(KaxTagTargets_Context) +{} + +KaxTagGeneral::KaxTagGeneral() + :EbmlMaster(KaxTagGeneral_Context) +{} + +KaxTagGenres::KaxTagGenres() + :EbmlMaster(KaxTagGenres_Context) +{} + +KaxTagAudioSpecific::KaxTagAudioSpecific() + :EbmlMaster(KaxTagAudioSpecific_Context) +{} + +KaxTagImageSpecific::KaxTagImageSpecific() + :EbmlMaster(KaxTagImageSpecific_Context) +{} + +KaxTagSimple::KaxTagSimple() + :EbmlMaster(KaxTagSimple_Context) +{} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxTagMulti.cpp b/src/KaxTagMulti.cpp index 3eb1da6..148b911 100644 --- a/src/KaxTagMulti.cpp +++ b/src/KaxTagMulti.cpp @@ -1,404 +1,404 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTagMulti.cpp 640 2004-07-09 21:05:36Z mosu $ - \author Jory Stone - \author Steve Lhomme -*/ -#include "matroska/KaxTagMulti.h" -#include "matroska/KaxContexts.h" - -using namespace LIBEBML_NAMESPACE; - -START_LIBMATROSKA_NAMESPACE - -EbmlSemantic KaxTagMultiGlobal_ContextList[1] = -{ - EbmlSemantic(false, false, EBML_INFO(KaxTagMultiComment)), -}; - -EbmlSemantic KaxTagMultiComment_ContextList[3] = -{ - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiCommentName)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiCommentComments)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiCommentLanguage)), -}; - -EbmlSemantic KaxTagMultiCommercial_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxTagCommercial)), -}; - -EbmlSemantic KaxTagCommercial_ContextList[5] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxTagMultiCommercialType)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiCommercialAddress)), - EbmlSemantic(false, false, EBML_INFO(KaxTagMultiCommercialURL)), - EbmlSemantic(false, false, EBML_INFO(KaxTagMultiCommercialEmail)), - EbmlSemantic(false, false, EBML_INFO(KaxTagMultiPrice)), -}; - -EbmlSemantic KaxTagMultiPrice_ContextList[3] = -{ - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiPriceCurrency)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiPriceAmount)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiPricePriceDate)), -}; - -EbmlSemantic KaxTagMultiDate_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxTagDate)), -}; - -EbmlSemantic KaxTagDate_ContextList[3] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxTagMultiDateType)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiDateDateBegin)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiDateDateEnd)), -}; - -EbmlSemantic KaxTagMultiEntity_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxTagEntity)), -}; - -EbmlSemantic KaxTagEntity_ContextList[5] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxTagMultiEntityType)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiEntityName)), - EbmlSemantic(false, false, EBML_INFO(KaxTagMultiEntityURL)), - EbmlSemantic(false, false, EBML_INFO(KaxTagMultiEntityEmail)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiEntityAddress)), -}; - -EbmlSemantic KaxTagMultiIdentifier_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxTagIdentifier)), -}; - -EbmlSemantic KaxTagIdentifier_ContextList[3] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxTagMultiIdentifierType)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiIdentifierBinary)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiIdentifierString)), -}; - -EbmlSemantic KaxTagMultiLegal_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxTagLegal)), -}; - -EbmlSemantic KaxTagLegal_ContextList[4] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxTagMultiLegalType)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiLegalContent)), - EbmlSemantic(false, false, EBML_INFO(KaxTagMultiLegalURL)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiLegalAddress)), -}; - -EbmlSemantic KaxTagMultiTitle_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxTagTitle)), -}; - -EbmlSemantic KaxTagTitle_ContextList[8] = -{ - EbmlSemantic(true, true, EBML_INFO(KaxTagMultiTitleType)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitleName)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitleSubTitle)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitleEdition)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitleAddress)), - EbmlSemantic(false, false, EBML_INFO(KaxTagMultiTitleURL)), - EbmlSemantic(false, false, EBML_INFO(KaxTagMultiTitleEmail)), - EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitleLanguage)), -}; - -EbmlSemantic KaxTagMultiAttachment_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxTagAttachment)), -}; - -EbmlSemantic KaxTagAttachment_ContextList[1] = -{ - EbmlSemantic(false, true, EBML_INFO(KaxTagAttachmentID)), -}; - -const EbmlSemanticContext KaxTagMultiGlobal_Context = EbmlSemanticContext(countof(KaxTagMultiGlobal_ContextList), KaxTagMultiGlobal_ContextList, NULL, *GetKaxGlobal_Context, NULL); - -const EbmlSemanticContext KaxTagMultiComment_Context = EbmlSemanticContext(countof(KaxTagMultiComment_ContextList), KaxTagMultiComment_ContextList, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiComment)); -const EbmlSemanticContext KaxTagMultiCommentName_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiComment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommentName)); -const EbmlSemanticContext KaxTagMultiCommentComments_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiComment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommentComments)); -const EbmlSemanticContext KaxTagMultiCommentLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiComment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommentLanguage)); - -const EbmlSemanticContext KaxTagMultiCommercial_Context = EbmlSemanticContext(countof(KaxTagMultiCommercial_ContextList), KaxTagMultiCommercial_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiCommercial)); -const EbmlSemanticContext KaxTagCommercial_Context = EbmlSemanticContext(countof(KaxTagCommercial_ContextList), KaxTagCommercial_ContextList, &KaxTagMultiCommercial_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagCommercial)); -const EbmlSemanticContext KaxTagMultiCommercialType_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommercialType)); -const EbmlSemanticContext KaxTagMultiCommercialAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommercialAddress)); -const EbmlSemanticContext KaxTagMultiCommercialURL_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommercialURL)); -const EbmlSemanticContext KaxTagMultiCommercialEmail_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommercialEmail)); - -const EbmlSemanticContext KaxTagMultiPrice_Context = EbmlSemanticContext(countof(KaxTagMultiPrice_ContextList), KaxTagMultiPrice_ContextList, &KaxTagCommercial_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiPrice)); -const EbmlSemanticContext KaxTagMultiPriceCurrency_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiPrice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiPriceCurrency)); -const EbmlSemanticContext KaxTagMultiPriceAmount_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiPrice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiPriceAmount)); -const EbmlSemanticContext KaxTagMultiPricePriceDate_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiPrice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiPricePriceDate)); - -const EbmlSemanticContext KaxTagMultiDate_Context = EbmlSemanticContext(countof(KaxTagMultiDate_ContextList), KaxTagMultiDate_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiDate)); -const EbmlSemanticContext KaxTagDate_Context = EbmlSemanticContext(countof(KaxTagDate_ContextList), KaxTagDate_ContextList, &KaxTagMultiDate_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagDate)); -const EbmlSemanticContext KaxTagMultiDateType_Context = EbmlSemanticContext(0, NULL, &KaxTagDate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiDateType)); -const EbmlSemanticContext KaxTagMultiDateDateBegin_Context = EbmlSemanticContext(0, NULL, &KaxTagDate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiDateDateBegin)); -const EbmlSemanticContext KaxTagMultiDateDateEnd_Context = EbmlSemanticContext(0, NULL, &KaxTagDate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiDateDateEnd)); - -const EbmlSemanticContext KaxTagMultiEntity_Context = EbmlSemanticContext(countof(KaxTagMultiEntity_ContextList), KaxTagMultiEntity_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiEntity)); -const EbmlSemanticContext KaxTagEntity_Context = EbmlSemanticContext(countof(KaxTagEntity_ContextList), KaxTagEntity_ContextList, &KaxTagMultiEntity_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagEntity)); -const EbmlSemanticContext KaxTagMultiEntityType_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiEntityType)); -const EbmlSemanticContext KaxTagMultiEntityName_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiEntityName)); -const EbmlSemanticContext KaxTagMultiEntityURL_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiEntityURL)); -const EbmlSemanticContext KaxTagMultiEntityEmail_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiEntityEmail)); -const EbmlSemanticContext KaxTagMultiEntityAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiEntityAddress)); - -const EbmlSemanticContext KaxTagMultiIdentifier_Context = EbmlSemanticContext(countof(KaxTagMultiIdentifier_ContextList), KaxTagMultiIdentifier_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiIdentifier)); -const EbmlSemanticContext KaxTagIdentifier_Context = EbmlSemanticContext(countof(KaxTagIdentifier_ContextList), KaxTagIdentifier_ContextList, &KaxTagMultiIdentifier_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagIdentifier)); -const EbmlSemanticContext KaxTagMultiIdentifierType_Context = EbmlSemanticContext(0, NULL, &KaxTagIdentifier_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiIdentifierType)); -const EbmlSemanticContext KaxTagMultiIdentifierBinary_Context = EbmlSemanticContext(0, NULL, &KaxTagIdentifier_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiIdentifierBinary)); -const EbmlSemanticContext KaxTagMultiIdentifierString_Context = EbmlSemanticContext(0, NULL, &KaxTagIdentifier_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiIdentifierString)); - -const EbmlSemanticContext KaxTagMultiLegal_Context = EbmlSemanticContext(countof(KaxTagMultiLegal_ContextList), KaxTagMultiLegal_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiLegal)); -const EbmlSemanticContext KaxTagLegal_Context = EbmlSemanticContext(countof(KaxTagLegal_ContextList), KaxTagLegal_ContextList, &KaxTagMultiLegal_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagLegal)); -const EbmlSemanticContext KaxTagMultiLegalType_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiLegalType)); -const EbmlSemanticContext KaxTagMultiLegalContent_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiLegalContent)); -const EbmlSemanticContext KaxTagMultiLegalURL_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiLegalURL)); -const EbmlSemanticContext KaxTagMultiLegalAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiLegalAddress)); - -const EbmlSemanticContext KaxTagMultiTitle_Context = EbmlSemanticContext(countof(KaxTagMultiTitle_ContextList), KaxTagMultiTitle_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiTitle)); -const EbmlSemanticContext KaxTagTitle_Context = EbmlSemanticContext(countof(KaxTagTitle_ContextList), KaxTagTitle_ContextList, &KaxTagMultiTitle_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagTitle)); -const EbmlSemanticContext KaxTagMultiTitleType_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleType)); -const EbmlSemanticContext KaxTagMultiTitleName_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleName)); -const EbmlSemanticContext KaxTagMultiTitleSubTitle_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleSubTitle)); -const EbmlSemanticContext KaxTagMultiTitleEdition_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleEdition)); -const EbmlSemanticContext KaxTagMultiTitleAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleAddress)); -const EbmlSemanticContext KaxTagMultiTitleURL_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleURL)); -const EbmlSemanticContext KaxTagMultiTitleEmail_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleEmail)); -const EbmlSemanticContext KaxTagMultiTitleLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleLanguage)); - -const EbmlSemanticContext KaxTagMultiAttachment_Context = EbmlSemanticContext(countof(KaxTagMultiAttachment_ContextList), KaxTagMultiAttachment_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiAttachment)); -const EbmlSemanticContext KaxTagAttachment_Context = EbmlSemanticContext(countof(KaxTagAttachment_ContextList), KaxTagAttachment_ContextList, &KaxTagMultiAttachment_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagAttachment)); -const EbmlSemanticContext KaxTagAttachmentID_Context = EbmlSemanticContext(0, NULL, &KaxTagAttachment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAttachmentID)); - -//The Muti Elements -EbmlId KaxTagMultiComment_TheId (0x5B7B, 2); -EbmlId KaxTagMultiCommentName_TheId (0x5F7D, 2); -EbmlId KaxTagMultiCommentComments_TheId (0x5F7C, 2); -EbmlId KaxTagMultiCommentLanguage_TheId (0x22B59D, 3); - -EbmlId KaxTagMultiCommercial_TheId (0x4DC7, 2); -EbmlId KaxTagCommercial_TheId (0x4EC7, 2); -EbmlId KaxTagMultiCommercialType_TheId (0x5BD7, 2); -EbmlId KaxTagMultiCommercialAddress_TheId (0x5BBB, 2); -EbmlId KaxTagMultiCommercialURL_TheId (0x5BDA, 2); -EbmlId KaxTagMultiCommercialEmail_TheId (0x5BC0, 2); - -EbmlId KaxTagMultiPrice_TheId (0x5BC3, 2); -EbmlId KaxTagMultiPriceCurrency_TheId (0x5B6C, 2); -EbmlId KaxTagMultiPriceAmount_TheId (0x5B6E, 2); -EbmlId KaxTagMultiPricePriceDate_TheId (0x5B6F, 2); - -EbmlId KaxTagMultiDate_TheId (0x4DC8, 2); -EbmlId KaxTagDate_TheId (0x4EC8, 2); -EbmlId KaxTagMultiDateType_TheId (0x5BD8, 2); -EbmlId KaxTagMultiDateDateBegin_TheId (0x4460, 2); -EbmlId KaxTagMultiDateDateEnd_TheId (0x4462, 2); - -EbmlId KaxTagMultiEntity_TheId (0x4DC9, 2); -EbmlId KaxTagEntity_TheId (0x4EC9, 2); -EbmlId KaxTagMultiEntityType_TheId (0x5BD9, 2); -EbmlId KaxTagMultiEntityName_TheId (0x5BED, 2); -EbmlId KaxTagMultiEntityAddress_TheId (0x5BDC, 2); -EbmlId KaxTagMultiEntityURL_TheId (0x5BDB, 2); -EbmlId KaxTagMultiEntityEmail_TheId (0x5BC1, 2); - -EbmlId KaxTagMultiIdentifier_TheId (0x4DC6, 2); -EbmlId KaxTagIdentifier_TheId (0x4EC6, 2); -EbmlId KaxTagMultiIdentifierType_TheId (0x5BAD, 2); -EbmlId KaxTagMultiIdentifierBinary_TheId (0x6B67, 2); -EbmlId KaxTagMultiIdentifierString_TheId (0x6B68, 2); - -EbmlId KaxTagMultiLegal_TheId (0x4DC5, 2); -EbmlId KaxTagLegal_TheId (0x4EC5, 2); -EbmlId KaxTagMultiLegalType_TheId (0x5BBD, 2); -EbmlId KaxTagMultiLegalContent_TheId (0x5BB2, 2); -EbmlId KaxTagMultiLegalURL_TheId (0x5B34, 2); -EbmlId KaxTagMultiLegalAddress_TheId (0x5B9B, 2); - -EbmlId KaxTagMultiTitle_TheId (0x4DC4, 2); -EbmlId KaxTagTitle_TheId (0x4EC4, 2); -EbmlId KaxTagMultiTitleType_TheId (0x5B7D, 2); -EbmlId KaxTagMultiTitleName_TheId (0x5BB9, 2); -EbmlId KaxTagMultiTitleSubTitle_TheId (0x5B5B, 2); -EbmlId KaxTagMultiTitleEdition_TheId (0x5BAE, 2); -EbmlId KaxTagMultiTitleAddress_TheId (0x5B33, 2); -EbmlId KaxTagMultiTitleURL_TheId (0x5BA9, 2); -EbmlId KaxTagMultiTitleEmail_TheId (0x5BC9, 2); -EbmlId KaxTagMultiTitleLanguage_TheId (0x22B59E, 3); - -EbmlId KaxTagMultiAttachment_TheId (0x4DC3, 2); -EbmlId KaxTagAttachment_TheId (0x4EC3, 2); -EbmlId KaxTagAttachmentID_TheId (0x5BA0, 2); - -const EbmlCallbacks KaxTagMultiComment::ClassInfos(KaxTagMultiComment::Create, KaxTagMultiComment_TheId, "MultiComment", KaxTagMultiComment_Context); -const EbmlCallbacks KaxTagMultiCommentName::ClassInfos(KaxTagMultiCommentName::Create, KaxTagMultiCommentName_TheId, "MultiCommentName", KaxTagMultiCommentName_Context); -const EbmlCallbacks KaxTagMultiCommentComments::ClassInfos(KaxTagMultiCommentComments::Create, KaxTagMultiCommentComments_TheId, "MultiCommentComments", KaxTagMultiCommentComments_Context); -const EbmlCallbacks KaxTagMultiCommentLanguage::ClassInfos(KaxTagMultiCommentLanguage::Create, KaxTagMultiCommentLanguage_TheId, "MultiCommentLanguage", KaxTagMultiCommentLanguage_Context); - -const EbmlCallbacks KaxTagMultiCommercial::ClassInfos(KaxTagMultiCommercial::Create, KaxTagMultiCommercial_TheId, "MultiCommercial", KaxTagMultiCommercial_Context); -const EbmlCallbacks KaxTagCommercial::ClassInfos(KaxTagCommercial::Create, KaxTagCommercial_TheId, "Commercial", KaxTagCommercial_Context); -const EbmlCallbacks KaxTagMultiCommercialType::ClassInfos(KaxTagMultiCommercialType::Create, KaxTagMultiCommercialType_TheId, "MultiCommercialType", KaxTagMultiCommercialType_Context); -const EbmlCallbacks KaxTagMultiCommercialAddress::ClassInfos(KaxTagMultiCommercialAddress::Create, KaxTagMultiCommercialAddress_TheId, "MultiCommercialAddress", KaxTagMultiCommercialAddress_Context); -const EbmlCallbacks KaxTagMultiCommercialURL::ClassInfos(KaxTagMultiCommercialURL::Create, KaxTagMultiCommercialURL_TheId, "MultiCommercialURL", KaxTagMultiCommercialURL_Context); -const EbmlCallbacks KaxTagMultiCommercialEmail::ClassInfos(KaxTagMultiCommercialEmail::Create, KaxTagMultiCommercialEmail_TheId, "MultiCommercialEmail", KaxTagMultiCommercialEmail_Context); - -const EbmlCallbacks KaxTagMultiPrice::ClassInfos(KaxTagMultiPrice::Create, KaxTagMultiPrice_TheId, "MultiPrice", KaxTagMultiPrice_Context); -const EbmlCallbacks KaxTagMultiPriceCurrency::ClassInfos(KaxTagMultiPriceCurrency::Create, KaxTagMultiPriceCurrency_TheId, "MultiPriceCurrency", KaxTagMultiPriceCurrency_Context); -const EbmlCallbacks KaxTagMultiPriceAmount::ClassInfos(KaxTagMultiPriceAmount::Create, KaxTagMultiPriceAmount_TheId, "MultiPriceAmount", KaxTagMultiPriceAmount_Context); -const EbmlCallbacks KaxTagMultiPricePriceDate::ClassInfos(KaxTagMultiPricePriceDate::Create, KaxTagMultiPricePriceDate_TheId, "MultiPricePriceDate", KaxTagMultiPricePriceDate_Context); - -const EbmlCallbacks KaxTagMultiDate::ClassInfos(KaxTagMultiDate::Create, KaxTagMultiDate_TheId, "MultiDate", KaxTagMultiDate_Context); -const EbmlCallbacks KaxTagDate::ClassInfos(KaxTagDate::Create, KaxTagDate_TheId, "Date", KaxTagDate_Context); -const EbmlCallbacks KaxTagMultiDateType::ClassInfos(KaxTagMultiDateType::Create, KaxTagMultiDateType_TheId, "MultiDateType", KaxTagMultiDateType_Context); -const EbmlCallbacks KaxTagMultiDateDateBegin::ClassInfos(KaxTagMultiDateDateBegin::Create, KaxTagMultiDateDateBegin_TheId, "MultiDateDateBegin", KaxTagMultiDateDateBegin_Context); -const EbmlCallbacks KaxTagMultiDateDateEnd::ClassInfos(KaxTagMultiDateDateEnd::Create, KaxTagMultiDateDateEnd_TheId, "MultiDateDateEnd", KaxTagMultiDateDateEnd_Context); - -const EbmlCallbacks KaxTagMultiEntity::ClassInfos(KaxTagMultiEntity::Create, KaxTagMultiEntity_TheId, "MultiEntity", KaxTagMultiEntity_Context); -const EbmlCallbacks KaxTagEntity::ClassInfos(KaxTagEntity::Create, KaxTagEntity_TheId, "Entity", KaxTagEntity_Context); -const EbmlCallbacks KaxTagMultiEntityType::ClassInfos(KaxTagMultiEntityType::Create, KaxTagMultiEntityType_TheId, "MultiEntityType", KaxTagMultiEntityType_Context); -const EbmlCallbacks KaxTagMultiEntityName::ClassInfos(KaxTagMultiEntityName::Create, KaxTagMultiEntityName_TheId, "MultiEntityName", KaxTagMultiEntityName_Context); -const EbmlCallbacks KaxTagMultiEntityURL::ClassInfos(KaxTagMultiEntityURL::Create, KaxTagMultiEntityURL_TheId, "MultiEntityURL", KaxTagMultiEntityURL_Context); -const EbmlCallbacks KaxTagMultiEntityEmail::ClassInfos(KaxTagMultiEntityEmail::Create, KaxTagMultiEntityEmail_TheId, "MultiEntityEmail", KaxTagMultiEntityEmail_Context); -const EbmlCallbacks KaxTagMultiEntityAddress::ClassInfos(KaxTagMultiEntityAddress::Create, KaxTagMultiEntityAddress_TheId, "MultiEntityAddress", KaxTagMultiEntityAddress_Context); - -const EbmlCallbacks KaxTagMultiIdentifier::ClassInfos(KaxTagMultiIdentifier::Create, KaxTagMultiIdentifier_TheId, "MultiIdentifier", KaxTagMultiIdentifier_Context); -const EbmlCallbacks KaxTagIdentifier::ClassInfos(KaxTagIdentifier::Create, KaxTagIdentifier_TheId, "Identifier", KaxTagIdentifier_Context); -const EbmlCallbacks KaxTagMultiIdentifierType::ClassInfos(KaxTagMultiIdentifierType::Create, KaxTagMultiIdentifierType_TheId, "TagMultiIdentifierType", KaxTagMultiIdentifierType_Context); -const EbmlCallbacks KaxTagMultiIdentifierBinary::ClassInfos(KaxTagMultiIdentifierBinary::Create, KaxTagMultiIdentifierBinary_TheId, "MultiIdentifierBinary", KaxTagMultiIdentifierBinary_Context); -const EbmlCallbacks KaxTagMultiIdentifierString::ClassInfos(KaxTagMultiIdentifierString::Create, KaxTagMultiIdentifierString_TheId, "MultiIdentifierString", KaxTagMultiIdentifierString_Context); - -const EbmlCallbacks KaxTagMultiLegal::ClassInfos(KaxTagMultiLegal::Create, KaxTagMultiLegal_TheId, "MultiLegal", KaxTagMultiLegal_Context); -const EbmlCallbacks KaxTagLegal::ClassInfos(KaxTagLegal::Create, KaxTagLegal_TheId, "Legal", KaxTagLegal_Context); -const EbmlCallbacks KaxTagMultiLegalType::ClassInfos(KaxTagMultiLegalType::Create, KaxTagMultiLegalType_TheId, "KaxTagMultiLegalType", KaxTagMultiLegalType_Context); -const EbmlCallbacks KaxTagMultiLegalContent::ClassInfos(KaxTagMultiLegalContent::Create, KaxTagMultiLegalContent_TheId, "TagMultiLegalContent", KaxTagMultiLegalContent_Context); -const EbmlCallbacks KaxTagMultiLegalURL::ClassInfos(KaxTagMultiLegalURL::Create, KaxTagMultiLegalURL_TheId, "KaxTagMultiLegalURL", KaxTagMultiLegalURL_Context); -const EbmlCallbacks KaxTagMultiLegalAddress::ClassInfos(KaxTagMultiLegalAddress::Create, KaxTagMultiLegalAddress_TheId, "KaxTagMultiLegalAddress", KaxTagMultiLegalAddress_Context); - -const EbmlCallbacks KaxTagMultiTitle::ClassInfos(KaxTagMultiTitle::Create, KaxTagMultiTitle_TheId, "MultiEntity", KaxTagMultiTitle_Context); -const EbmlCallbacks KaxTagTitle::ClassInfos(KaxTagTitle::Create, KaxTagTitle_TheId, "Entity", KaxTagTitle_Context); -const EbmlCallbacks KaxTagMultiTitleType::ClassInfos(KaxTagMultiTitleType::Create, KaxTagMultiTitleType_TheId, "MultiTitleType", KaxTagMultiTitleType_Context); -const EbmlCallbacks KaxTagMultiTitleName::ClassInfos(KaxTagMultiTitleName::Create, KaxTagMultiTitleName_TheId, "MultiTitleName", KaxTagMultiTitleName_Context); -const EbmlCallbacks KaxTagMultiTitleSubTitle::ClassInfos(KaxTagMultiTitleSubTitle::Create, KaxTagMultiTitleSubTitle_TheId, "MultiTitleSubTitle", KaxTagMultiTitleSubTitle_Context); -const EbmlCallbacks KaxTagMultiTitleEdition::ClassInfos(KaxTagMultiTitleEdition::Create, KaxTagMultiTitleEdition_TheId, "MultiTitleEdition", KaxTagMultiTitleEdition_Context); -const EbmlCallbacks KaxTagMultiTitleAddress::ClassInfos(KaxTagMultiTitleAddress::Create, KaxTagMultiTitleAddress_TheId, "MultiTitleAddress", KaxTagMultiTitleAddress_Context); -const EbmlCallbacks KaxTagMultiTitleURL::ClassInfos(KaxTagMultiTitleURL::Create, KaxTagMultiTitleURL_TheId, "MultiTitleURL", KaxTagMultiTitleURL_Context); -const EbmlCallbacks KaxTagMultiTitleEmail::ClassInfos(KaxTagMultiTitleEmail::Create, KaxTagMultiTitleEmail_TheId, "MultiTitleEmail", KaxTagMultiTitleEmail_Context); -const EbmlCallbacks KaxTagMultiTitleLanguage::ClassInfos(KaxTagMultiTitleLanguage::Create, KaxTagMultiTitleLanguage_TheId, "MultiTitleLanguage", KaxTagMultiTitleLanguage_Context); - -const EbmlCallbacks KaxTagMultiAttachment::ClassInfos(KaxTagMultiAttachment::Create, KaxTagMultiAttachment_TheId, "TagMultiAttachment", KaxTagMultiAttachment_Context); -const EbmlCallbacks KaxTagAttachment::ClassInfos(KaxTagAttachment::Create, KaxTagAttachment_TheId, "TagAttachment", KaxTagAttachment_Context); -const EbmlCallbacks KaxTagAttachmentID::ClassInfos(KaxTagAttachmentID::Create, KaxTagAttachmentID_TheId, "TagAttachmentID", KaxTagAttachmentID_Context); - -KaxTagMultiComment::KaxTagMultiComment() - :EbmlMaster(KaxTagMultiComment_Context) -{} - - -KaxTagMultiCommercial::KaxTagMultiCommercial() - :EbmlMaster(KaxTagMultiCommercial_Context) -{} - -KaxTagCommercial::KaxTagCommercial() - :EbmlMaster(KaxTagCommercial_Context) -{} - -KaxTagMultiPrice::KaxTagMultiPrice() - :EbmlMaster(KaxTagMultiPrice_Context) -{} - -KaxTagMultiDate::KaxTagMultiDate() - :EbmlMaster(KaxTagMultiDate_Context) -{} - -KaxTagDate::KaxTagDate() - :EbmlMaster(KaxTagDate_Context) -{} - -KaxTagMultiEntity::KaxTagMultiEntity() - :EbmlMaster(KaxTagMultiEntity_Context) -{} - -KaxTagEntity::KaxTagEntity() - :EbmlMaster(KaxTagEntity_Context) -{} - -KaxTagMultiLegal::KaxTagMultiLegal() - :EbmlMaster(KaxTagMultiLegal_Context) -{} - -KaxTagLegal::KaxTagLegal() - :EbmlMaster(KaxTagLegal_Context) -{} - -KaxTagMultiIdentifier::KaxTagMultiIdentifier() - :EbmlMaster(KaxTagMultiIdentifier_Context) -{} - -KaxTagIdentifier::KaxTagIdentifier() - :EbmlMaster(KaxTagIdentifier_Context) -{} - -KaxTagMultiTitle::KaxTagMultiTitle() - :EbmlMaster(KaxTagMultiTitle_Context) -{} - -KaxTagTitle::KaxTagTitle() - :EbmlMaster(KaxTagTitle_Context) -{} - -KaxTagMultiAttachment::KaxTagMultiAttachment() - :EbmlMaster(KaxTagMultiAttachment_Context) -{} - -KaxTagAttachment::KaxTagAttachment() - :EbmlMaster(KaxTagAttachment_Context) -{} - -const EbmlSemanticContext & GetKaxTagsGlobal_Context() -{ - return KaxTagMultiGlobal_Context; -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTagMulti.cpp 640 2004-07-09 21:05:36Z mosu $ + \author Jory Stone + \author Steve Lhomme +*/ +#include "matroska/KaxTagMulti.h" +#include "matroska/KaxContexts.h" + +using namespace LIBEBML_NAMESPACE; + +START_LIBMATROSKA_NAMESPACE + +EbmlSemantic KaxTagMultiGlobal_ContextList[1] = +{ + EbmlSemantic(false, false, EBML_INFO(KaxTagMultiComment)), +}; + +EbmlSemantic KaxTagMultiComment_ContextList[3] = +{ + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiCommentName)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiCommentComments)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiCommentLanguage)), +}; + +EbmlSemantic KaxTagMultiCommercial_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxTagCommercial)), +}; + +EbmlSemantic KaxTagCommercial_ContextList[5] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxTagMultiCommercialType)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiCommercialAddress)), + EbmlSemantic(false, false, EBML_INFO(KaxTagMultiCommercialURL)), + EbmlSemantic(false, false, EBML_INFO(KaxTagMultiCommercialEmail)), + EbmlSemantic(false, false, EBML_INFO(KaxTagMultiPrice)), +}; + +EbmlSemantic KaxTagMultiPrice_ContextList[3] = +{ + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiPriceCurrency)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiPriceAmount)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiPricePriceDate)), +}; + +EbmlSemantic KaxTagMultiDate_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxTagDate)), +}; + +EbmlSemantic KaxTagDate_ContextList[3] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxTagMultiDateType)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiDateDateBegin)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiDateDateEnd)), +}; + +EbmlSemantic KaxTagMultiEntity_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxTagEntity)), +}; + +EbmlSemantic KaxTagEntity_ContextList[5] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxTagMultiEntityType)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiEntityName)), + EbmlSemantic(false, false, EBML_INFO(KaxTagMultiEntityURL)), + EbmlSemantic(false, false, EBML_INFO(KaxTagMultiEntityEmail)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiEntityAddress)), +}; + +EbmlSemantic KaxTagMultiIdentifier_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxTagIdentifier)), +}; + +EbmlSemantic KaxTagIdentifier_ContextList[3] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxTagMultiIdentifierType)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiIdentifierBinary)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiIdentifierString)), +}; + +EbmlSemantic KaxTagMultiLegal_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxTagLegal)), +}; + +EbmlSemantic KaxTagLegal_ContextList[4] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxTagMultiLegalType)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiLegalContent)), + EbmlSemantic(false, false, EBML_INFO(KaxTagMultiLegalURL)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiLegalAddress)), +}; + +EbmlSemantic KaxTagMultiTitle_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxTagTitle)), +}; + +EbmlSemantic KaxTagTitle_ContextList[8] = +{ + EbmlSemantic(true, true, EBML_INFO(KaxTagMultiTitleType)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitleName)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitleSubTitle)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitleEdition)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitleAddress)), + EbmlSemantic(false, false, EBML_INFO(KaxTagMultiTitleURL)), + EbmlSemantic(false, false, EBML_INFO(KaxTagMultiTitleEmail)), + EbmlSemantic(false, true, EBML_INFO(KaxTagMultiTitleLanguage)), +}; + +EbmlSemantic KaxTagMultiAttachment_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxTagAttachment)), +}; + +EbmlSemantic KaxTagAttachment_ContextList[1] = +{ + EbmlSemantic(false, true, EBML_INFO(KaxTagAttachmentID)), +}; + +const EbmlSemanticContext KaxTagMultiGlobal_Context = EbmlSemanticContext(countof(KaxTagMultiGlobal_ContextList), KaxTagMultiGlobal_ContextList, NULL, *GetKaxGlobal_Context, NULL); + +const EbmlSemanticContext KaxTagMultiComment_Context = EbmlSemanticContext(countof(KaxTagMultiComment_ContextList), KaxTagMultiComment_ContextList, &KaxTag_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiComment)); +const EbmlSemanticContext KaxTagMultiCommentName_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiComment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommentName)); +const EbmlSemanticContext KaxTagMultiCommentComments_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiComment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommentComments)); +const EbmlSemanticContext KaxTagMultiCommentLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiComment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommentLanguage)); + +const EbmlSemanticContext KaxTagMultiCommercial_Context = EbmlSemanticContext(countof(KaxTagMultiCommercial_ContextList), KaxTagMultiCommercial_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiCommercial)); +const EbmlSemanticContext KaxTagCommercial_Context = EbmlSemanticContext(countof(KaxTagCommercial_ContextList), KaxTagCommercial_ContextList, &KaxTagMultiCommercial_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagCommercial)); +const EbmlSemanticContext KaxTagMultiCommercialType_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommercialType)); +const EbmlSemanticContext KaxTagMultiCommercialAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommercialAddress)); +const EbmlSemanticContext KaxTagMultiCommercialURL_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommercialURL)); +const EbmlSemanticContext KaxTagMultiCommercialEmail_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiCommercialEmail)); + +const EbmlSemanticContext KaxTagMultiPrice_Context = EbmlSemanticContext(countof(KaxTagMultiPrice_ContextList), KaxTagMultiPrice_ContextList, &KaxTagCommercial_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiPrice)); +const EbmlSemanticContext KaxTagMultiPriceCurrency_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiPrice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiPriceCurrency)); +const EbmlSemanticContext KaxTagMultiPriceAmount_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiPrice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiPriceAmount)); +const EbmlSemanticContext KaxTagMultiPricePriceDate_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiPrice_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiPricePriceDate)); + +const EbmlSemanticContext KaxTagMultiDate_Context = EbmlSemanticContext(countof(KaxTagMultiDate_ContextList), KaxTagMultiDate_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiDate)); +const EbmlSemanticContext KaxTagDate_Context = EbmlSemanticContext(countof(KaxTagDate_ContextList), KaxTagDate_ContextList, &KaxTagMultiDate_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagDate)); +const EbmlSemanticContext KaxTagMultiDateType_Context = EbmlSemanticContext(0, NULL, &KaxTagDate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiDateType)); +const EbmlSemanticContext KaxTagMultiDateDateBegin_Context = EbmlSemanticContext(0, NULL, &KaxTagDate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiDateDateBegin)); +const EbmlSemanticContext KaxTagMultiDateDateEnd_Context = EbmlSemanticContext(0, NULL, &KaxTagDate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiDateDateEnd)); + +const EbmlSemanticContext KaxTagMultiEntity_Context = EbmlSemanticContext(countof(KaxTagMultiEntity_ContextList), KaxTagMultiEntity_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiEntity)); +const EbmlSemanticContext KaxTagEntity_Context = EbmlSemanticContext(countof(KaxTagEntity_ContextList), KaxTagEntity_ContextList, &KaxTagMultiEntity_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagEntity)); +const EbmlSemanticContext KaxTagMultiEntityType_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiEntityType)); +const EbmlSemanticContext KaxTagMultiEntityName_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiEntityName)); +const EbmlSemanticContext KaxTagMultiEntityURL_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiEntityURL)); +const EbmlSemanticContext KaxTagMultiEntityEmail_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiEntityEmail)); +const EbmlSemanticContext KaxTagMultiEntityAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiEntityAddress)); + +const EbmlSemanticContext KaxTagMultiIdentifier_Context = EbmlSemanticContext(countof(KaxTagMultiIdentifier_ContextList), KaxTagMultiIdentifier_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiIdentifier)); +const EbmlSemanticContext KaxTagIdentifier_Context = EbmlSemanticContext(countof(KaxTagIdentifier_ContextList), KaxTagIdentifier_ContextList, &KaxTagMultiIdentifier_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagIdentifier)); +const EbmlSemanticContext KaxTagMultiIdentifierType_Context = EbmlSemanticContext(0, NULL, &KaxTagIdentifier_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiIdentifierType)); +const EbmlSemanticContext KaxTagMultiIdentifierBinary_Context = EbmlSemanticContext(0, NULL, &KaxTagIdentifier_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiIdentifierBinary)); +const EbmlSemanticContext KaxTagMultiIdentifierString_Context = EbmlSemanticContext(0, NULL, &KaxTagIdentifier_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiIdentifierString)); + +const EbmlSemanticContext KaxTagMultiLegal_Context = EbmlSemanticContext(countof(KaxTagMultiLegal_ContextList), KaxTagMultiLegal_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiLegal)); +const EbmlSemanticContext KaxTagLegal_Context = EbmlSemanticContext(countof(KaxTagLegal_ContextList), KaxTagLegal_ContextList, &KaxTagMultiLegal_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagLegal)); +const EbmlSemanticContext KaxTagMultiLegalType_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiLegalType)); +const EbmlSemanticContext KaxTagMultiLegalContent_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiLegalContent)); +const EbmlSemanticContext KaxTagMultiLegalURL_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiLegalURL)); +const EbmlSemanticContext KaxTagMultiLegalAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiLegalAddress)); + +const EbmlSemanticContext KaxTagMultiTitle_Context = EbmlSemanticContext(countof(KaxTagMultiTitle_ContextList), KaxTagMultiTitle_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiTitle)); +const EbmlSemanticContext KaxTagTitle_Context = EbmlSemanticContext(countof(KaxTagTitle_ContextList), KaxTagTitle_ContextList, &KaxTagMultiTitle_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagTitle)); +const EbmlSemanticContext KaxTagMultiTitleType_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleType)); +const EbmlSemanticContext KaxTagMultiTitleName_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleName)); +const EbmlSemanticContext KaxTagMultiTitleSubTitle_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleSubTitle)); +const EbmlSemanticContext KaxTagMultiTitleEdition_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleEdition)); +const EbmlSemanticContext KaxTagMultiTitleAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleAddress)); +const EbmlSemanticContext KaxTagMultiTitleURL_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleURL)); +const EbmlSemanticContext KaxTagMultiTitleEmail_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleEmail)); +const EbmlSemanticContext KaxTagMultiTitleLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagMultiTitleLanguage)); + +const EbmlSemanticContext KaxTagMultiAttachment_Context = EbmlSemanticContext(countof(KaxTagMultiAttachment_ContextList), KaxTagMultiAttachment_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagMultiAttachment)); +const EbmlSemanticContext KaxTagAttachment_Context = EbmlSemanticContext(countof(KaxTagAttachment_ContextList), KaxTagAttachment_ContextList, &KaxTagMultiAttachment_Context, *GetKaxTagsGlobal_Context, &EBML_INFO(KaxTagAttachment)); +const EbmlSemanticContext KaxTagAttachmentID_Context = EbmlSemanticContext(0, NULL, &KaxTagAttachment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTagAttachmentID)); + +//The Muti Elements +EbmlId KaxTagMultiComment_TheId (0x5B7B, 2); +EbmlId KaxTagMultiCommentName_TheId (0x5F7D, 2); +EbmlId KaxTagMultiCommentComments_TheId (0x5F7C, 2); +EbmlId KaxTagMultiCommentLanguage_TheId (0x22B59D, 3); + +EbmlId KaxTagMultiCommercial_TheId (0x4DC7, 2); +EbmlId KaxTagCommercial_TheId (0x4EC7, 2); +EbmlId KaxTagMultiCommercialType_TheId (0x5BD7, 2); +EbmlId KaxTagMultiCommercialAddress_TheId (0x5BBB, 2); +EbmlId KaxTagMultiCommercialURL_TheId (0x5BDA, 2); +EbmlId KaxTagMultiCommercialEmail_TheId (0x5BC0, 2); + +EbmlId KaxTagMultiPrice_TheId (0x5BC3, 2); +EbmlId KaxTagMultiPriceCurrency_TheId (0x5B6C, 2); +EbmlId KaxTagMultiPriceAmount_TheId (0x5B6E, 2); +EbmlId KaxTagMultiPricePriceDate_TheId (0x5B6F, 2); + +EbmlId KaxTagMultiDate_TheId (0x4DC8, 2); +EbmlId KaxTagDate_TheId (0x4EC8, 2); +EbmlId KaxTagMultiDateType_TheId (0x5BD8, 2); +EbmlId KaxTagMultiDateDateBegin_TheId (0x4460, 2); +EbmlId KaxTagMultiDateDateEnd_TheId (0x4462, 2); + +EbmlId KaxTagMultiEntity_TheId (0x4DC9, 2); +EbmlId KaxTagEntity_TheId (0x4EC9, 2); +EbmlId KaxTagMultiEntityType_TheId (0x5BD9, 2); +EbmlId KaxTagMultiEntityName_TheId (0x5BED, 2); +EbmlId KaxTagMultiEntityAddress_TheId (0x5BDC, 2); +EbmlId KaxTagMultiEntityURL_TheId (0x5BDB, 2); +EbmlId KaxTagMultiEntityEmail_TheId (0x5BC1, 2); + +EbmlId KaxTagMultiIdentifier_TheId (0x4DC6, 2); +EbmlId KaxTagIdentifier_TheId (0x4EC6, 2); +EbmlId KaxTagMultiIdentifierType_TheId (0x5BAD, 2); +EbmlId KaxTagMultiIdentifierBinary_TheId (0x6B67, 2); +EbmlId KaxTagMultiIdentifierString_TheId (0x6B68, 2); + +EbmlId KaxTagMultiLegal_TheId (0x4DC5, 2); +EbmlId KaxTagLegal_TheId (0x4EC5, 2); +EbmlId KaxTagMultiLegalType_TheId (0x5BBD, 2); +EbmlId KaxTagMultiLegalContent_TheId (0x5BB2, 2); +EbmlId KaxTagMultiLegalURL_TheId (0x5B34, 2); +EbmlId KaxTagMultiLegalAddress_TheId (0x5B9B, 2); + +EbmlId KaxTagMultiTitle_TheId (0x4DC4, 2); +EbmlId KaxTagTitle_TheId (0x4EC4, 2); +EbmlId KaxTagMultiTitleType_TheId (0x5B7D, 2); +EbmlId KaxTagMultiTitleName_TheId (0x5BB9, 2); +EbmlId KaxTagMultiTitleSubTitle_TheId (0x5B5B, 2); +EbmlId KaxTagMultiTitleEdition_TheId (0x5BAE, 2); +EbmlId KaxTagMultiTitleAddress_TheId (0x5B33, 2); +EbmlId KaxTagMultiTitleURL_TheId (0x5BA9, 2); +EbmlId KaxTagMultiTitleEmail_TheId (0x5BC9, 2); +EbmlId KaxTagMultiTitleLanguage_TheId (0x22B59E, 3); + +EbmlId KaxTagMultiAttachment_TheId (0x4DC3, 2); +EbmlId KaxTagAttachment_TheId (0x4EC3, 2); +EbmlId KaxTagAttachmentID_TheId (0x5BA0, 2); + +const EbmlCallbacks KaxTagMultiComment::ClassInfos(KaxTagMultiComment::Create, KaxTagMultiComment_TheId, "MultiComment", KaxTagMultiComment_Context); +const EbmlCallbacks KaxTagMultiCommentName::ClassInfos(KaxTagMultiCommentName::Create, KaxTagMultiCommentName_TheId, "MultiCommentName", KaxTagMultiCommentName_Context); +const EbmlCallbacks KaxTagMultiCommentComments::ClassInfos(KaxTagMultiCommentComments::Create, KaxTagMultiCommentComments_TheId, "MultiCommentComments", KaxTagMultiCommentComments_Context); +const EbmlCallbacks KaxTagMultiCommentLanguage::ClassInfos(KaxTagMultiCommentLanguage::Create, KaxTagMultiCommentLanguage_TheId, "MultiCommentLanguage", KaxTagMultiCommentLanguage_Context); + +const EbmlCallbacks KaxTagMultiCommercial::ClassInfos(KaxTagMultiCommercial::Create, KaxTagMultiCommercial_TheId, "MultiCommercial", KaxTagMultiCommercial_Context); +const EbmlCallbacks KaxTagCommercial::ClassInfos(KaxTagCommercial::Create, KaxTagCommercial_TheId, "Commercial", KaxTagCommercial_Context); +const EbmlCallbacks KaxTagMultiCommercialType::ClassInfos(KaxTagMultiCommercialType::Create, KaxTagMultiCommercialType_TheId, "MultiCommercialType", KaxTagMultiCommercialType_Context); +const EbmlCallbacks KaxTagMultiCommercialAddress::ClassInfos(KaxTagMultiCommercialAddress::Create, KaxTagMultiCommercialAddress_TheId, "MultiCommercialAddress", KaxTagMultiCommercialAddress_Context); +const EbmlCallbacks KaxTagMultiCommercialURL::ClassInfos(KaxTagMultiCommercialURL::Create, KaxTagMultiCommercialURL_TheId, "MultiCommercialURL", KaxTagMultiCommercialURL_Context); +const EbmlCallbacks KaxTagMultiCommercialEmail::ClassInfos(KaxTagMultiCommercialEmail::Create, KaxTagMultiCommercialEmail_TheId, "MultiCommercialEmail", KaxTagMultiCommercialEmail_Context); + +const EbmlCallbacks KaxTagMultiPrice::ClassInfos(KaxTagMultiPrice::Create, KaxTagMultiPrice_TheId, "MultiPrice", KaxTagMultiPrice_Context); +const EbmlCallbacks KaxTagMultiPriceCurrency::ClassInfos(KaxTagMultiPriceCurrency::Create, KaxTagMultiPriceCurrency_TheId, "MultiPriceCurrency", KaxTagMultiPriceCurrency_Context); +const EbmlCallbacks KaxTagMultiPriceAmount::ClassInfos(KaxTagMultiPriceAmount::Create, KaxTagMultiPriceAmount_TheId, "MultiPriceAmount", KaxTagMultiPriceAmount_Context); +const EbmlCallbacks KaxTagMultiPricePriceDate::ClassInfos(KaxTagMultiPricePriceDate::Create, KaxTagMultiPricePriceDate_TheId, "MultiPricePriceDate", KaxTagMultiPricePriceDate_Context); + +const EbmlCallbacks KaxTagMultiDate::ClassInfos(KaxTagMultiDate::Create, KaxTagMultiDate_TheId, "MultiDate", KaxTagMultiDate_Context); +const EbmlCallbacks KaxTagDate::ClassInfos(KaxTagDate::Create, KaxTagDate_TheId, "Date", KaxTagDate_Context); +const EbmlCallbacks KaxTagMultiDateType::ClassInfos(KaxTagMultiDateType::Create, KaxTagMultiDateType_TheId, "MultiDateType", KaxTagMultiDateType_Context); +const EbmlCallbacks KaxTagMultiDateDateBegin::ClassInfos(KaxTagMultiDateDateBegin::Create, KaxTagMultiDateDateBegin_TheId, "MultiDateDateBegin", KaxTagMultiDateDateBegin_Context); +const EbmlCallbacks KaxTagMultiDateDateEnd::ClassInfos(KaxTagMultiDateDateEnd::Create, KaxTagMultiDateDateEnd_TheId, "MultiDateDateEnd", KaxTagMultiDateDateEnd_Context); + +const EbmlCallbacks KaxTagMultiEntity::ClassInfos(KaxTagMultiEntity::Create, KaxTagMultiEntity_TheId, "MultiEntity", KaxTagMultiEntity_Context); +const EbmlCallbacks KaxTagEntity::ClassInfos(KaxTagEntity::Create, KaxTagEntity_TheId, "Entity", KaxTagEntity_Context); +const EbmlCallbacks KaxTagMultiEntityType::ClassInfos(KaxTagMultiEntityType::Create, KaxTagMultiEntityType_TheId, "MultiEntityType", KaxTagMultiEntityType_Context); +const EbmlCallbacks KaxTagMultiEntityName::ClassInfos(KaxTagMultiEntityName::Create, KaxTagMultiEntityName_TheId, "MultiEntityName", KaxTagMultiEntityName_Context); +const EbmlCallbacks KaxTagMultiEntityURL::ClassInfos(KaxTagMultiEntityURL::Create, KaxTagMultiEntityURL_TheId, "MultiEntityURL", KaxTagMultiEntityURL_Context); +const EbmlCallbacks KaxTagMultiEntityEmail::ClassInfos(KaxTagMultiEntityEmail::Create, KaxTagMultiEntityEmail_TheId, "MultiEntityEmail", KaxTagMultiEntityEmail_Context); +const EbmlCallbacks KaxTagMultiEntityAddress::ClassInfos(KaxTagMultiEntityAddress::Create, KaxTagMultiEntityAddress_TheId, "MultiEntityAddress", KaxTagMultiEntityAddress_Context); + +const EbmlCallbacks KaxTagMultiIdentifier::ClassInfos(KaxTagMultiIdentifier::Create, KaxTagMultiIdentifier_TheId, "MultiIdentifier", KaxTagMultiIdentifier_Context); +const EbmlCallbacks KaxTagIdentifier::ClassInfos(KaxTagIdentifier::Create, KaxTagIdentifier_TheId, "Identifier", KaxTagIdentifier_Context); +const EbmlCallbacks KaxTagMultiIdentifierType::ClassInfos(KaxTagMultiIdentifierType::Create, KaxTagMultiIdentifierType_TheId, "TagMultiIdentifierType", KaxTagMultiIdentifierType_Context); +const EbmlCallbacks KaxTagMultiIdentifierBinary::ClassInfos(KaxTagMultiIdentifierBinary::Create, KaxTagMultiIdentifierBinary_TheId, "MultiIdentifierBinary", KaxTagMultiIdentifierBinary_Context); +const EbmlCallbacks KaxTagMultiIdentifierString::ClassInfos(KaxTagMultiIdentifierString::Create, KaxTagMultiIdentifierString_TheId, "MultiIdentifierString", KaxTagMultiIdentifierString_Context); + +const EbmlCallbacks KaxTagMultiLegal::ClassInfos(KaxTagMultiLegal::Create, KaxTagMultiLegal_TheId, "MultiLegal", KaxTagMultiLegal_Context); +const EbmlCallbacks KaxTagLegal::ClassInfos(KaxTagLegal::Create, KaxTagLegal_TheId, "Legal", KaxTagLegal_Context); +const EbmlCallbacks KaxTagMultiLegalType::ClassInfos(KaxTagMultiLegalType::Create, KaxTagMultiLegalType_TheId, "KaxTagMultiLegalType", KaxTagMultiLegalType_Context); +const EbmlCallbacks KaxTagMultiLegalContent::ClassInfos(KaxTagMultiLegalContent::Create, KaxTagMultiLegalContent_TheId, "TagMultiLegalContent", KaxTagMultiLegalContent_Context); +const EbmlCallbacks KaxTagMultiLegalURL::ClassInfos(KaxTagMultiLegalURL::Create, KaxTagMultiLegalURL_TheId, "KaxTagMultiLegalURL", KaxTagMultiLegalURL_Context); +const EbmlCallbacks KaxTagMultiLegalAddress::ClassInfos(KaxTagMultiLegalAddress::Create, KaxTagMultiLegalAddress_TheId, "KaxTagMultiLegalAddress", KaxTagMultiLegalAddress_Context); + +const EbmlCallbacks KaxTagMultiTitle::ClassInfos(KaxTagMultiTitle::Create, KaxTagMultiTitle_TheId, "MultiEntity", KaxTagMultiTitle_Context); +const EbmlCallbacks KaxTagTitle::ClassInfos(KaxTagTitle::Create, KaxTagTitle_TheId, "Entity", KaxTagTitle_Context); +const EbmlCallbacks KaxTagMultiTitleType::ClassInfos(KaxTagMultiTitleType::Create, KaxTagMultiTitleType_TheId, "MultiTitleType", KaxTagMultiTitleType_Context); +const EbmlCallbacks KaxTagMultiTitleName::ClassInfos(KaxTagMultiTitleName::Create, KaxTagMultiTitleName_TheId, "MultiTitleName", KaxTagMultiTitleName_Context); +const EbmlCallbacks KaxTagMultiTitleSubTitle::ClassInfos(KaxTagMultiTitleSubTitle::Create, KaxTagMultiTitleSubTitle_TheId, "MultiTitleSubTitle", KaxTagMultiTitleSubTitle_Context); +const EbmlCallbacks KaxTagMultiTitleEdition::ClassInfos(KaxTagMultiTitleEdition::Create, KaxTagMultiTitleEdition_TheId, "MultiTitleEdition", KaxTagMultiTitleEdition_Context); +const EbmlCallbacks KaxTagMultiTitleAddress::ClassInfos(KaxTagMultiTitleAddress::Create, KaxTagMultiTitleAddress_TheId, "MultiTitleAddress", KaxTagMultiTitleAddress_Context); +const EbmlCallbacks KaxTagMultiTitleURL::ClassInfos(KaxTagMultiTitleURL::Create, KaxTagMultiTitleURL_TheId, "MultiTitleURL", KaxTagMultiTitleURL_Context); +const EbmlCallbacks KaxTagMultiTitleEmail::ClassInfos(KaxTagMultiTitleEmail::Create, KaxTagMultiTitleEmail_TheId, "MultiTitleEmail", KaxTagMultiTitleEmail_Context); +const EbmlCallbacks KaxTagMultiTitleLanguage::ClassInfos(KaxTagMultiTitleLanguage::Create, KaxTagMultiTitleLanguage_TheId, "MultiTitleLanguage", KaxTagMultiTitleLanguage_Context); + +const EbmlCallbacks KaxTagMultiAttachment::ClassInfos(KaxTagMultiAttachment::Create, KaxTagMultiAttachment_TheId, "TagMultiAttachment", KaxTagMultiAttachment_Context); +const EbmlCallbacks KaxTagAttachment::ClassInfos(KaxTagAttachment::Create, KaxTagAttachment_TheId, "TagAttachment", KaxTagAttachment_Context); +const EbmlCallbacks KaxTagAttachmentID::ClassInfos(KaxTagAttachmentID::Create, KaxTagAttachmentID_TheId, "TagAttachmentID", KaxTagAttachmentID_Context); + +KaxTagMultiComment::KaxTagMultiComment() + :EbmlMaster(KaxTagMultiComment_Context) +{} + + +KaxTagMultiCommercial::KaxTagMultiCommercial() + :EbmlMaster(KaxTagMultiCommercial_Context) +{} + +KaxTagCommercial::KaxTagCommercial() + :EbmlMaster(KaxTagCommercial_Context) +{} + +KaxTagMultiPrice::KaxTagMultiPrice() + :EbmlMaster(KaxTagMultiPrice_Context) +{} + +KaxTagMultiDate::KaxTagMultiDate() + :EbmlMaster(KaxTagMultiDate_Context) +{} + +KaxTagDate::KaxTagDate() + :EbmlMaster(KaxTagDate_Context) +{} + +KaxTagMultiEntity::KaxTagMultiEntity() + :EbmlMaster(KaxTagMultiEntity_Context) +{} + +KaxTagEntity::KaxTagEntity() + :EbmlMaster(KaxTagEntity_Context) +{} + +KaxTagMultiLegal::KaxTagMultiLegal() + :EbmlMaster(KaxTagMultiLegal_Context) +{} + +KaxTagLegal::KaxTagLegal() + :EbmlMaster(KaxTagLegal_Context) +{} + +KaxTagMultiIdentifier::KaxTagMultiIdentifier() + :EbmlMaster(KaxTagMultiIdentifier_Context) +{} + +KaxTagIdentifier::KaxTagIdentifier() + :EbmlMaster(KaxTagIdentifier_Context) +{} + +KaxTagMultiTitle::KaxTagMultiTitle() + :EbmlMaster(KaxTagMultiTitle_Context) +{} + +KaxTagTitle::KaxTagTitle() + :EbmlMaster(KaxTagTitle_Context) +{} + +KaxTagMultiAttachment::KaxTagMultiAttachment() + :EbmlMaster(KaxTagMultiAttachment_Context) +{} + +KaxTagAttachment::KaxTagAttachment() + :EbmlMaster(KaxTagAttachment_Context) +{} + +const EbmlSemanticContext & GetKaxTagsGlobal_Context() +{ + return KaxTagMultiGlobal_Context; +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxTags.cpp b/src/KaxTags.cpp index 272f63d..4beb39b 100644 --- a/src/KaxTags.cpp +++ b/src/KaxTags.cpp @@ -1,60 +1,60 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTags.cpp 711 2004-08-10 12:58:47Z robux4 $ - \author Steve Lhomme - \author Jory Stone -*/ -#include "matroska/KaxTags.h" -#include "matroska/KaxTag.h" -#include "matroska/KaxContexts.h" - -using namespace LIBEBML_NAMESPACE; - -// sub elements -START_LIBMATROSKA_NAMESPACE - -EbmlSemantic KaxTags_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxTag)), -}; - -const EbmlSemanticContext KaxTags_Context = EbmlSemanticContext(countof(KaxTags_ContextList), KaxTags_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTags)); - -EbmlId KaxTags_TheId(0x1254C367, 4); - -const EbmlCallbacks KaxTags::ClassInfos(KaxTags::Create, KaxTags_TheId, "Tags", KaxTags_Context); - -KaxTags::KaxTags() - :EbmlMaster(KaxTags_Context) -{} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTags.cpp 711 2004-08-10 12:58:47Z robux4 $ + \author Steve Lhomme + \author Jory Stone +*/ +#include "matroska/KaxTags.h" +#include "matroska/KaxTag.h" +#include "matroska/KaxContexts.h" + +using namespace LIBEBML_NAMESPACE; + +// sub elements +START_LIBMATROSKA_NAMESPACE + +EbmlSemantic KaxTags_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxTag)), +}; + +const EbmlSemanticContext KaxTags_Context = EbmlSemanticContext(countof(KaxTags_ContextList), KaxTags_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTags)); + +EbmlId KaxTags_TheId(0x1254C367, 4); + +const EbmlCallbacks KaxTags::ClassInfos(KaxTags::Create, KaxTags_TheId, "Tags", KaxTags_Context); + +KaxTags::KaxTags() + :EbmlMaster(KaxTags_Context) +{} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxTrackAudio.cpp b/src/KaxTrackAudio.cpp index 5671c35..8cb7dd5 100644 --- a/src/KaxTrackAudio.cpp +++ b/src/KaxTrackAudio.cpp @@ -1,88 +1,88 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTrackAudio.cpp 640 2004-07-09 21:05:36Z mosu $ - \author Steve Lhomme -*/ -#include "matroska/KaxTrackAudio.h" - -// sub elements -#include "matroska/KaxContexts.h" - -START_LIBMATROSKA_NAMESPACE - -#if MATROSKA_VERSION == 1 -const EbmlSemantic KaxTrackAudio_ContextList[4] = -#else // MATROSKA_VERSION -const EbmlSemantic KaxTrackAudio_ContextList[5] = -#endif // MATROSKA_VERSION -{ - EbmlSemantic(true , true, EBML_INFO(KaxAudioSamplingFreq)), - EbmlSemantic(true , true, EBML_INFO(KaxAudioChannels)), - EbmlSemantic(false, true, EBML_INFO(KaxAudioBitDepth)), - EbmlSemantic(false, true, EBML_INFO(KaxAudioOutputSamplingFreq)), -#if MATROSKA_VERSION >= 2 - EbmlSemantic(false, true, EBML_INFO(KaxAudioPosition)), -#endif // MATROSKA_VERSION -}; - -const EbmlSemanticContext KaxTrackAudio_Context = EbmlSemanticContext(countof(KaxTrackAudio_ContextList), KaxTrackAudio_ContextList, &KaxTrackEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackAudio)); -const EbmlSemanticContext KaxAudioSamplingFreq_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAudioSamplingFreq)); -const EbmlSemanticContext KaxAudioOutputSamplingFreq_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAudioOutputSamplingFreq)); -const EbmlSemanticContext KaxAudioChannels_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAudioChannels)); -const EbmlSemanticContext KaxAudioBitDepth_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAudioBitDepth)); -#if MATROSKA_VERSION >= 2 -const EbmlSemanticContext KaxAudioPosition_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAudioPosition)); -#endif // MATROSKA_VERSION - -EbmlId KaxTrackAudio_TheId (0xE1, 1); -EbmlId KaxAudioSamplingFreq_TheId(0xB5, 1); -EbmlId KaxAudioOutputSamplingFreq_TheId(0x78B5, 2); -EbmlId KaxAudioChannels_TheId (0x9F, 1); -EbmlId KaxAudioBitDepth_TheId (0x6264, 2); -#if MATROSKA_VERSION >= 2 -EbmlId KaxAudioPosition_TheId (0x7D7B, 2); -#endif // MATROSKA_VERSION - -const EbmlCallbacks KaxTrackAudio::ClassInfos(KaxTrackAudio::Create, KaxTrackAudio_TheId, "TrackAudio", KaxTrackAudio_Context); -const EbmlCallbacks KaxAudioSamplingFreq::ClassInfos(KaxAudioSamplingFreq::Create, KaxAudioSamplingFreq_TheId, "AudioSamplingFreq", KaxAudioSamplingFreq_Context); -const EbmlCallbacks KaxAudioOutputSamplingFreq::ClassInfos(KaxAudioOutputSamplingFreq::Create, KaxAudioOutputSamplingFreq_TheId, "AudioOutputSamplingFreq", KaxAudioOutputSamplingFreq_Context); -const EbmlCallbacks KaxAudioChannels::ClassInfos(KaxAudioChannels::Create, KaxAudioChannels_TheId, "AudioChannels", KaxAudioChannels_Context); -const EbmlCallbacks KaxAudioBitDepth::ClassInfos(KaxAudioBitDepth::Create, KaxAudioBitDepth_TheId, "AudioBitDepth", KaxAudioBitDepth_Context); -#if MATROSKA_VERSION >= 2 -const EbmlCallbacks KaxAudioPosition::ClassInfos(KaxAudioPosition::Create, KaxAudioPosition_TheId, "AudioPosition", KaxAudioPosition_Context); -#endif // MATROSKA_VERSION - -KaxTrackAudio::KaxTrackAudio() - :EbmlMaster(KaxTrackAudio_Context) -{} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTrackAudio.cpp 640 2004-07-09 21:05:36Z mosu $ + \author Steve Lhomme +*/ +#include "matroska/KaxTrackAudio.h" + +// sub elements +#include "matroska/KaxContexts.h" + +START_LIBMATROSKA_NAMESPACE + +#if MATROSKA_VERSION == 1 +const EbmlSemantic KaxTrackAudio_ContextList[4] = +#else // MATROSKA_VERSION +const EbmlSemantic KaxTrackAudio_ContextList[5] = +#endif // MATROSKA_VERSION +{ + EbmlSemantic(true , true, EBML_INFO(KaxAudioSamplingFreq)), + EbmlSemantic(true , true, EBML_INFO(KaxAudioChannels)), + EbmlSemantic(false, true, EBML_INFO(KaxAudioBitDepth)), + EbmlSemantic(false, true, EBML_INFO(KaxAudioOutputSamplingFreq)), +#if MATROSKA_VERSION >= 2 + EbmlSemantic(false, true, EBML_INFO(KaxAudioPosition)), +#endif // MATROSKA_VERSION +}; + +const EbmlSemanticContext KaxTrackAudio_Context = EbmlSemanticContext(countof(KaxTrackAudio_ContextList), KaxTrackAudio_ContextList, &KaxTrackEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackAudio)); +const EbmlSemanticContext KaxAudioSamplingFreq_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAudioSamplingFreq)); +const EbmlSemanticContext KaxAudioOutputSamplingFreq_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAudioOutputSamplingFreq)); +const EbmlSemanticContext KaxAudioChannels_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAudioChannels)); +const EbmlSemanticContext KaxAudioBitDepth_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAudioBitDepth)); +#if MATROSKA_VERSION >= 2 +const EbmlSemanticContext KaxAudioPosition_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxAudioPosition)); +#endif // MATROSKA_VERSION + +EbmlId KaxTrackAudio_TheId (0xE1, 1); +EbmlId KaxAudioSamplingFreq_TheId(0xB5, 1); +EbmlId KaxAudioOutputSamplingFreq_TheId(0x78B5, 2); +EbmlId KaxAudioChannels_TheId (0x9F, 1); +EbmlId KaxAudioBitDepth_TheId (0x6264, 2); +#if MATROSKA_VERSION >= 2 +EbmlId KaxAudioPosition_TheId (0x7D7B, 2); +#endif // MATROSKA_VERSION + +const EbmlCallbacks KaxTrackAudio::ClassInfos(KaxTrackAudio::Create, KaxTrackAudio_TheId, "TrackAudio", KaxTrackAudio_Context); +const EbmlCallbacks KaxAudioSamplingFreq::ClassInfos(KaxAudioSamplingFreq::Create, KaxAudioSamplingFreq_TheId, "AudioSamplingFreq", KaxAudioSamplingFreq_Context); +const EbmlCallbacks KaxAudioOutputSamplingFreq::ClassInfos(KaxAudioOutputSamplingFreq::Create, KaxAudioOutputSamplingFreq_TheId, "AudioOutputSamplingFreq", KaxAudioOutputSamplingFreq_Context); +const EbmlCallbacks KaxAudioChannels::ClassInfos(KaxAudioChannels::Create, KaxAudioChannels_TheId, "AudioChannels", KaxAudioChannels_Context); +const EbmlCallbacks KaxAudioBitDepth::ClassInfos(KaxAudioBitDepth::Create, KaxAudioBitDepth_TheId, "AudioBitDepth", KaxAudioBitDepth_Context); +#if MATROSKA_VERSION >= 2 +const EbmlCallbacks KaxAudioPosition::ClassInfos(KaxAudioPosition::Create, KaxAudioPosition_TheId, "AudioPosition", KaxAudioPosition_Context); +#endif // MATROSKA_VERSION + +KaxTrackAudio::KaxTrackAudio() + :EbmlMaster(KaxTrackAudio_Context) +{} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxTrackEntryData.cpp b/src/KaxTrackEntryData.cpp index 7f8fce9..6bccf8b 100644 --- a/src/KaxTrackEntryData.cpp +++ b/src/KaxTrackEntryData.cpp @@ -1,142 +1,142 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTrackEntryData.cpp 1201 2005-08-30 14:28:27Z robux4 $ - \author Steve Lhomme - \author John Cannon -*/ -#include "matroska/KaxTrackEntryData.h" -#include "matroska/KaxContexts.h" - -START_LIBMATROSKA_NAMESPACE - -const EbmlSemantic KaxTrackTranslate_ContextList[3] = -{ - EbmlSemantic(false, false,EBML_INFO(KaxTrackTranslateEditionUID)), - EbmlSemantic(true , true, EBML_INFO(KaxTrackTranslateCodec)), - EbmlSemantic(true , true, EBML_INFO(KaxTrackTranslateTrackID)), -}; - -EbmlId KaxTrackNumber_TheId (0xD7, 1); -EbmlId KaxTrackUID_TheId (0x73C5, 2); -EbmlId KaxTrackType_TheId (0x83, 1); -EbmlId KaxTrackFlagDefault_TheId (0x88, 1); -EbmlId KaxTrackFlagForced_TheId (0x55AA, 2); -EbmlId KaxTrackFlagLacing_TheId (0x9C, 1); -EbmlId KaxTrackMinCache_TheId (0x6DE7, 2); -EbmlId KaxTrackMaxCache_TheId (0x6DF8, 2); -EbmlId KaxTrackDefaultDuration_TheId (0x23E383, 3); -EbmlId KaxTrackTimecodeScale_TheId (0x23314F, 3); -EbmlId KaxMaxBlockAdditionID_TheId (0x55EE, 2); -EbmlId KaxTrackName_TheId (0x536E, 2); -EbmlId KaxTrackLanguage_TheId (0x22B59C, 3); -EbmlId KaxCodecID_TheId (0x86, 1); -EbmlId KaxCodecPrivate_TheId (0x63A2, 2); -EbmlId KaxCodecName_TheId (0x258688, 3); -EbmlId KaxTrackAttachmentLink_TheId (0x7446, 2); -EbmlId KaxTrackOverlay_TheId (0x6FAB, 2); -EbmlId KaxTrackTranslate_TheId (0x6624, 2); -EbmlId KaxTrackTranslateEditionUID_TheId(0x66FC, 2); -EbmlId KaxTrackTranslateCodec_TheId (0x66BF, 2); -EbmlId KaxTrackTranslateTrackID_TheId (0x66A5, 2); -#if MATROSKA_VERSION >= 2 -EbmlId KaxTrackFlagEnabled_TheId (0xB9, 1); -EbmlId KaxCodecSettings_TheId (0x3A9697, 3); -EbmlId KaxCodecInfoURL_TheId (0x3B4040, 3); -EbmlId KaxCodecDownloadURL_TheId (0x26B240, 3); -EbmlId KaxCodecDecodeAll_TheId (0xAA, 1); -#endif // MATROSKA_VERSION - -const EbmlSemanticContext KaxTrackNumber_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackNumber)); -const EbmlSemanticContext KaxTrackUID_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackUID)); -const EbmlSemanticContext KaxTrackType_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackType)); -const EbmlSemanticContext KaxTrackFlagDefault_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackFlagDefault)); -const EbmlSemanticContext KaxTrackFlagForced_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackFlagForced)); -const EbmlSemanticContext KaxTrackFlagLacing_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackFlagLacing)); -const EbmlSemanticContext KaxTrackMinCache_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackMinCache)); -const EbmlSemanticContext KaxTrackMaxCache_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackMaxCache)); -const EbmlSemanticContext KaxTrackDefaultDuration_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackDefaultDuration)); -const EbmlSemanticContext KaxTrackTimecodeScale_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackTimecodeScale)); -const EbmlSemanticContext KaxMaxBlockAdditionID_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxMaxBlockAdditionID)); -const EbmlSemanticContext KaxTrackName_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackName)); -const EbmlSemanticContext KaxTrackLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackLanguage)); -const EbmlSemanticContext KaxCodecID_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecID)); -const EbmlSemanticContext KaxCodecPrivate_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecPrivate)); -const EbmlSemanticContext KaxCodecName_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecName)); -const EbmlSemanticContext KaxTrackAttachmentLink_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackAttachmentLink)); -const EbmlSemanticContext KaxTrackOverlay_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackOverlay)); -const EbmlSemanticContext KaxTrackTranslate_Context = EbmlSemanticContext(countof(KaxTrackTranslate_ContextList), KaxTrackTranslate_ContextList, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackTranslate)); -const EbmlSemanticContext KaxTrackTranslateEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxTrackTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackTranslateEditionUID)); -const EbmlSemanticContext KaxTrackTranslateCodec_Context = EbmlSemanticContext(0, NULL, &KaxTrackTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackTranslateCodec)); -const EbmlSemanticContext KaxTrackTranslateTrackID_Context = EbmlSemanticContext(0, NULL, &KaxTrackTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackTranslateTrackID)); -#if MATROSKA_VERSION >= 2 -const EbmlSemanticContext KaxTrackFlagEnabled_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackFlagEnabled)); -const EbmlSemanticContext KaxCodecSettings_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecSettings)); -const EbmlSemanticContext KaxCodecInfoURL_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecInfoURL)); -const EbmlSemanticContext KaxCodecDownloadURL_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecDownloadURL)); -const EbmlSemanticContext KaxCodecDecodeAll_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecDecodeAll)); -#endif // MATROSKA_VERSION - -const EbmlCallbacks KaxTrackNumber::ClassInfos(KaxTrackNumber::Create, KaxTrackNumber_TheId, "TrackNumber", KaxTrackNumber_Context); -const EbmlCallbacks KaxTrackUID::ClassInfos(KaxTrackUID::Create, KaxTrackUID_TheId, "TrackUID", KaxTrackUID_Context); -const EbmlCallbacks KaxTrackType::ClassInfos(KaxTrackType::Create, KaxTrackType_TheId, "TrackType", KaxTrackType_Context); -const EbmlCallbacks KaxTrackFlagDefault::ClassInfos(KaxTrackFlagDefault::Create, KaxTrackFlagDefault_TheId, "TrackFlagDefault", KaxTrackFlagDefault_Context); -const EbmlCallbacks KaxTrackFlagForced::ClassInfos(KaxTrackFlagForced::Create, KaxTrackFlagForced_TheId, "TrackFlagForced", KaxTrackFlagForced_Context); -const EbmlCallbacks KaxTrackFlagLacing::ClassInfos(KaxTrackFlagLacing::Create, KaxTrackFlagLacing_TheId, "TrackFlagLacing", KaxTrackFlagLacing_Context); -const EbmlCallbacks KaxTrackMinCache::ClassInfos(KaxTrackMinCache::Create, KaxTrackMinCache_TheId, "TrackMinCache", KaxTrackMinCache_Context); -const EbmlCallbacks KaxTrackMaxCache::ClassInfos(KaxTrackMaxCache::Create, KaxTrackMaxCache_TheId, "TrackMaxCache\0rotomodobopo", KaxTrackMaxCache_Context); -const EbmlCallbacks KaxTrackDefaultDuration::ClassInfos(KaxTrackDefaultDuration::Create, KaxTrackDefaultDuration_TheId, "TrackDefaultDuration", KaxTrackDefaultDuration_Context); -const EbmlCallbacks KaxTrackTimecodeScale::ClassInfos(KaxTrackTimecodeScale::Create, KaxTrackTimecodeScale_TheId, "TrackTimecodeScale", KaxTrackTimecodeScale_Context); -const EbmlCallbacks KaxMaxBlockAdditionID::ClassInfos(KaxMaxBlockAdditionID::Create, KaxMaxBlockAdditionID_TheId, "MaxBlockAdditionID", KaxMaxBlockAdditionID_Context); -const EbmlCallbacks KaxTrackName::ClassInfos(KaxTrackName::Create, KaxTrackName_TheId, "TrackName", KaxTrackName_Context); -const EbmlCallbacks KaxTrackLanguage::ClassInfos(KaxTrackLanguage::Create, KaxTrackLanguage_TheId, "TrackLanguage", KaxTrackLanguage_Context); -const EbmlCallbacks KaxCodecID::ClassInfos(KaxCodecID::Create, KaxCodecID_TheId, "CodecID", KaxCodecID_Context); -const EbmlCallbacks KaxCodecPrivate::ClassInfos(KaxCodecPrivate::Create, KaxCodecPrivate_TheId, "CodecPrivate", KaxCodecPrivate_Context); -const EbmlCallbacks KaxCodecName::ClassInfos(KaxCodecName::Create, KaxCodecName_TheId, "CodecName", KaxCodecName_Context); -const EbmlCallbacks KaxTrackAttachmentLink::ClassInfos(KaxTrackAttachmentLink::Create, KaxTrackAttachmentLink_TheId, "TrackAttachmentLink", KaxTrackAttachmentLink_Context); -const EbmlCallbacks KaxTrackOverlay::ClassInfos(KaxTrackOverlay::Create, KaxTrackOverlay_TheId, "TrackOverlay", KaxTrackOverlay_Context); -const EbmlCallbacks KaxTrackTranslate::ClassInfos(KaxTrackTranslate::Create, KaxTrackTranslate_TheId, "TrackTranslate", KaxTrackTranslate_Context); -const EbmlCallbacks KaxTrackTranslateEditionUID::ClassInfos(KaxTrackTranslateEditionUID::Create, KaxTrackTranslateEditionUID_TheId, "TrackTranslateEditionUID", KaxTrackTranslateEditionUID_Context); -const EbmlCallbacks KaxTrackTranslateCodec::ClassInfos(KaxTrackTranslateCodec::Create, KaxTrackTranslateCodec_TheId, "TrackTranslateCodec", KaxTrackTranslateCodec_Context); -const EbmlCallbacks KaxTrackTranslateTrackID::ClassInfos(KaxTrackTranslateTrackID::Create, KaxTrackTranslateTrackID_TheId, "TrackTranslateTrackID", KaxTrackTranslateTrackID_Context); -#if MATROSKA_VERSION >= 2 -const EbmlCallbacks KaxTrackFlagEnabled::ClassInfos(KaxTrackFlagEnabled::Create, KaxTrackFlagEnabled_TheId, "TrackFlagEnabled", KaxTrackFlagEnabled_Context); -const EbmlCallbacks KaxCodecSettings::ClassInfos(KaxCodecSettings::Create, KaxCodecSettings_TheId, "CodecSettings", KaxCodecSettings_Context); -const EbmlCallbacks KaxCodecInfoURL::ClassInfos(KaxCodecInfoURL::Create, KaxCodecInfoURL_TheId, "CodecInfoURL", KaxCodecInfoURL_Context); -const EbmlCallbacks KaxCodecDownloadURL::ClassInfos(KaxCodecDownloadURL::Create, KaxCodecDownloadURL_TheId, "CodecDownloadURL", KaxCodecDownloadURL_Context); -const EbmlCallbacks KaxCodecDecodeAll::ClassInfos(KaxCodecDecodeAll::Create, KaxCodecDecodeAll_TheId, "CodecDecodeAll", KaxCodecDecodeAll_Context); -#endif // MATROSKA_VERSION - -KaxTrackTranslate::KaxTrackTranslate() - :EbmlMaster(KaxTrackTranslate_Context) -{} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTrackEntryData.cpp 1201 2005-08-30 14:28:27Z robux4 $ + \author Steve Lhomme + \author John Cannon +*/ +#include "matroska/KaxTrackEntryData.h" +#include "matroska/KaxContexts.h" + +START_LIBMATROSKA_NAMESPACE + +const EbmlSemantic KaxTrackTranslate_ContextList[3] = +{ + EbmlSemantic(false, false,EBML_INFO(KaxTrackTranslateEditionUID)), + EbmlSemantic(true , true, EBML_INFO(KaxTrackTranslateCodec)), + EbmlSemantic(true , true, EBML_INFO(KaxTrackTranslateTrackID)), +}; + +EbmlId KaxTrackNumber_TheId (0xD7, 1); +EbmlId KaxTrackUID_TheId (0x73C5, 2); +EbmlId KaxTrackType_TheId (0x83, 1); +EbmlId KaxTrackFlagDefault_TheId (0x88, 1); +EbmlId KaxTrackFlagForced_TheId (0x55AA, 2); +EbmlId KaxTrackFlagLacing_TheId (0x9C, 1); +EbmlId KaxTrackMinCache_TheId (0x6DE7, 2); +EbmlId KaxTrackMaxCache_TheId (0x6DF8, 2); +EbmlId KaxTrackDefaultDuration_TheId (0x23E383, 3); +EbmlId KaxTrackTimecodeScale_TheId (0x23314F, 3); +EbmlId KaxMaxBlockAdditionID_TheId (0x55EE, 2); +EbmlId KaxTrackName_TheId (0x536E, 2); +EbmlId KaxTrackLanguage_TheId (0x22B59C, 3); +EbmlId KaxCodecID_TheId (0x86, 1); +EbmlId KaxCodecPrivate_TheId (0x63A2, 2); +EbmlId KaxCodecName_TheId (0x258688, 3); +EbmlId KaxTrackAttachmentLink_TheId (0x7446, 2); +EbmlId KaxTrackOverlay_TheId (0x6FAB, 2); +EbmlId KaxTrackTranslate_TheId (0x6624, 2); +EbmlId KaxTrackTranslateEditionUID_TheId(0x66FC, 2); +EbmlId KaxTrackTranslateCodec_TheId (0x66BF, 2); +EbmlId KaxTrackTranslateTrackID_TheId (0x66A5, 2); +#if MATROSKA_VERSION >= 2 +EbmlId KaxTrackFlagEnabled_TheId (0xB9, 1); +EbmlId KaxCodecSettings_TheId (0x3A9697, 3); +EbmlId KaxCodecInfoURL_TheId (0x3B4040, 3); +EbmlId KaxCodecDownloadURL_TheId (0x26B240, 3); +EbmlId KaxCodecDecodeAll_TheId (0xAA, 1); +#endif // MATROSKA_VERSION + +const EbmlSemanticContext KaxTrackNumber_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackNumber)); +const EbmlSemanticContext KaxTrackUID_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackUID)); +const EbmlSemanticContext KaxTrackType_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackType)); +const EbmlSemanticContext KaxTrackFlagDefault_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackFlagDefault)); +const EbmlSemanticContext KaxTrackFlagForced_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackFlagForced)); +const EbmlSemanticContext KaxTrackFlagLacing_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackFlagLacing)); +const EbmlSemanticContext KaxTrackMinCache_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackMinCache)); +const EbmlSemanticContext KaxTrackMaxCache_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackMaxCache)); +const EbmlSemanticContext KaxTrackDefaultDuration_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackDefaultDuration)); +const EbmlSemanticContext KaxTrackTimecodeScale_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackTimecodeScale)); +const EbmlSemanticContext KaxMaxBlockAdditionID_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxMaxBlockAdditionID)); +const EbmlSemanticContext KaxTrackName_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackName)); +const EbmlSemanticContext KaxTrackLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackLanguage)); +const EbmlSemanticContext KaxCodecID_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecID)); +const EbmlSemanticContext KaxCodecPrivate_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecPrivate)); +const EbmlSemanticContext KaxCodecName_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecName)); +const EbmlSemanticContext KaxTrackAttachmentLink_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackAttachmentLink)); +const EbmlSemanticContext KaxTrackOverlay_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackOverlay)); +const EbmlSemanticContext KaxTrackTranslate_Context = EbmlSemanticContext(countof(KaxTrackTranslate_ContextList), KaxTrackTranslate_ContextList, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackTranslate)); +const EbmlSemanticContext KaxTrackTranslateEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxTrackTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackTranslateEditionUID)); +const EbmlSemanticContext KaxTrackTranslateCodec_Context = EbmlSemanticContext(0, NULL, &KaxTrackTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackTranslateCodec)); +const EbmlSemanticContext KaxTrackTranslateTrackID_Context = EbmlSemanticContext(0, NULL, &KaxTrackTranslate_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackTranslateTrackID)); +#if MATROSKA_VERSION >= 2 +const EbmlSemanticContext KaxTrackFlagEnabled_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackFlagEnabled)); +const EbmlSemanticContext KaxCodecSettings_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecSettings)); +const EbmlSemanticContext KaxCodecInfoURL_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecInfoURL)); +const EbmlSemanticContext KaxCodecDownloadURL_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecDownloadURL)); +const EbmlSemanticContext KaxCodecDecodeAll_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxCodecDecodeAll)); +#endif // MATROSKA_VERSION + +const EbmlCallbacks KaxTrackNumber::ClassInfos(KaxTrackNumber::Create, KaxTrackNumber_TheId, "TrackNumber", KaxTrackNumber_Context); +const EbmlCallbacks KaxTrackUID::ClassInfos(KaxTrackUID::Create, KaxTrackUID_TheId, "TrackUID", KaxTrackUID_Context); +const EbmlCallbacks KaxTrackType::ClassInfos(KaxTrackType::Create, KaxTrackType_TheId, "TrackType", KaxTrackType_Context); +const EbmlCallbacks KaxTrackFlagDefault::ClassInfos(KaxTrackFlagDefault::Create, KaxTrackFlagDefault_TheId, "TrackFlagDefault", KaxTrackFlagDefault_Context); +const EbmlCallbacks KaxTrackFlagForced::ClassInfos(KaxTrackFlagForced::Create, KaxTrackFlagForced_TheId, "TrackFlagForced", KaxTrackFlagForced_Context); +const EbmlCallbacks KaxTrackFlagLacing::ClassInfos(KaxTrackFlagLacing::Create, KaxTrackFlagLacing_TheId, "TrackFlagLacing", KaxTrackFlagLacing_Context); +const EbmlCallbacks KaxTrackMinCache::ClassInfos(KaxTrackMinCache::Create, KaxTrackMinCache_TheId, "TrackMinCache", KaxTrackMinCache_Context); +const EbmlCallbacks KaxTrackMaxCache::ClassInfos(KaxTrackMaxCache::Create, KaxTrackMaxCache_TheId, "TrackMaxCache\0rotomodobopo", KaxTrackMaxCache_Context); +const EbmlCallbacks KaxTrackDefaultDuration::ClassInfos(KaxTrackDefaultDuration::Create, KaxTrackDefaultDuration_TheId, "TrackDefaultDuration", KaxTrackDefaultDuration_Context); +const EbmlCallbacks KaxTrackTimecodeScale::ClassInfos(KaxTrackTimecodeScale::Create, KaxTrackTimecodeScale_TheId, "TrackTimecodeScale", KaxTrackTimecodeScale_Context); +const EbmlCallbacks KaxMaxBlockAdditionID::ClassInfos(KaxMaxBlockAdditionID::Create, KaxMaxBlockAdditionID_TheId, "MaxBlockAdditionID", KaxMaxBlockAdditionID_Context); +const EbmlCallbacks KaxTrackName::ClassInfos(KaxTrackName::Create, KaxTrackName_TheId, "TrackName", KaxTrackName_Context); +const EbmlCallbacks KaxTrackLanguage::ClassInfos(KaxTrackLanguage::Create, KaxTrackLanguage_TheId, "TrackLanguage", KaxTrackLanguage_Context); +const EbmlCallbacks KaxCodecID::ClassInfos(KaxCodecID::Create, KaxCodecID_TheId, "CodecID", KaxCodecID_Context); +const EbmlCallbacks KaxCodecPrivate::ClassInfos(KaxCodecPrivate::Create, KaxCodecPrivate_TheId, "CodecPrivate", KaxCodecPrivate_Context); +const EbmlCallbacks KaxCodecName::ClassInfos(KaxCodecName::Create, KaxCodecName_TheId, "CodecName", KaxCodecName_Context); +const EbmlCallbacks KaxTrackAttachmentLink::ClassInfos(KaxTrackAttachmentLink::Create, KaxTrackAttachmentLink_TheId, "TrackAttachmentLink", KaxTrackAttachmentLink_Context); +const EbmlCallbacks KaxTrackOverlay::ClassInfos(KaxTrackOverlay::Create, KaxTrackOverlay_TheId, "TrackOverlay", KaxTrackOverlay_Context); +const EbmlCallbacks KaxTrackTranslate::ClassInfos(KaxTrackTranslate::Create, KaxTrackTranslate_TheId, "TrackTranslate", KaxTrackTranslate_Context); +const EbmlCallbacks KaxTrackTranslateEditionUID::ClassInfos(KaxTrackTranslateEditionUID::Create, KaxTrackTranslateEditionUID_TheId, "TrackTranslateEditionUID", KaxTrackTranslateEditionUID_Context); +const EbmlCallbacks KaxTrackTranslateCodec::ClassInfos(KaxTrackTranslateCodec::Create, KaxTrackTranslateCodec_TheId, "TrackTranslateCodec", KaxTrackTranslateCodec_Context); +const EbmlCallbacks KaxTrackTranslateTrackID::ClassInfos(KaxTrackTranslateTrackID::Create, KaxTrackTranslateTrackID_TheId, "TrackTranslateTrackID", KaxTrackTranslateTrackID_Context); +#if MATROSKA_VERSION >= 2 +const EbmlCallbacks KaxTrackFlagEnabled::ClassInfos(KaxTrackFlagEnabled::Create, KaxTrackFlagEnabled_TheId, "TrackFlagEnabled", KaxTrackFlagEnabled_Context); +const EbmlCallbacks KaxCodecSettings::ClassInfos(KaxCodecSettings::Create, KaxCodecSettings_TheId, "CodecSettings", KaxCodecSettings_Context); +const EbmlCallbacks KaxCodecInfoURL::ClassInfos(KaxCodecInfoURL::Create, KaxCodecInfoURL_TheId, "CodecInfoURL", KaxCodecInfoURL_Context); +const EbmlCallbacks KaxCodecDownloadURL::ClassInfos(KaxCodecDownloadURL::Create, KaxCodecDownloadURL_TheId, "CodecDownloadURL", KaxCodecDownloadURL_Context); +const EbmlCallbacks KaxCodecDecodeAll::ClassInfos(KaxCodecDecodeAll::Create, KaxCodecDecodeAll_TheId, "CodecDecodeAll", KaxCodecDecodeAll_Context); +#endif // MATROSKA_VERSION + +KaxTrackTranslate::KaxTrackTranslate() + :EbmlMaster(KaxTrackTranslate_Context) +{} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxTrackVideo.cpp b/src/KaxTrackVideo.cpp index c1fdd8f..89dd977 100644 --- a/src/KaxTrackVideo.cpp +++ b/src/KaxTrackVideo.cpp @@ -1,134 +1,134 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTrackVideo.cpp 738 2004-08-30 09:21:46Z robux4 $ - \author Steve Lhomme -*/ -#include "matroska/KaxTrackVideo.h" - -// sub elements -#include "matroska/KaxContexts.h" - -START_LIBMATROSKA_NAMESPACE - -#if MATROSKA_VERSION == 1 -const EbmlSemantic KaxTrackVideo_ContextList[10] = -#else // MATROSKA_VERSION -const EbmlSemantic KaxTrackVideo_ContextList[15] = -#endif // MATROSKA_VERSION -{ - EbmlSemantic(true , true, EBML_INFO(KaxVideoPixelWidth)), - EbmlSemantic(true , true, EBML_INFO(KaxVideoPixelHeight)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoPixelCropBottom)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoPixelCropTop)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoPixelCropLeft)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoPixelCropRight)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoDisplayWidth)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoDisplayHeight)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoColourSpace)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoFrameRate)), -#if MATROSKA_VERSION >= 2 - EbmlSemantic(true , true, EBML_INFO(KaxVideoFlagInterlaced)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoStereoMode)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoDisplayUnit)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoAspectRatio)), - EbmlSemantic(false, true, EBML_INFO(KaxVideoGamma)), -#endif // MATROSKA_VERSION -}; - -const EbmlSemanticContext KaxTrackVideo_Context = EbmlSemanticContext(countof(KaxTrackVideo_ContextList), KaxTrackVideo_ContextList, &KaxTrackEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackVideo)); -const EbmlSemanticContext KaxVideoPixelWidth_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelWidth)); -const EbmlSemanticContext KaxVideoPixelHeight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelHeight)); -const EbmlSemanticContext KaxVideoPixelCropBottom_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelCropBottom)); -const EbmlSemanticContext KaxVideoPixelCropTop_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelCropTop)); -const EbmlSemanticContext KaxVideoPixelCropRight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelCropLeft)); -const EbmlSemanticContext KaxVideoPixelCropLeft_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelCropRight)); -const EbmlSemanticContext KaxVideoDisplayWidth_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoDisplayWidth)); -const EbmlSemanticContext KaxVideoDisplayHeight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoDisplayHeight)); -const EbmlSemanticContext KaxVideoColourSpace_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoColourSpace)); -const EbmlSemanticContext KaxVideoFrameRate_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoFrameRate)); -#if MATROSKA_VERSION >= 2 -const EbmlSemanticContext KaxVideoFlagInterlaced_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoFlagInterlaced)); -const EbmlSemanticContext KaxVideoStereoMode_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoStereoMode)); -const EbmlSemanticContext KaxVideoDisplayUnit_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoDisplayUnit)); -const EbmlSemanticContext KaxVideoAspectRatio_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoAspectRatio)); -const EbmlSemanticContext KaxVideoGamma_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoGamma)); -#endif // MATROSKA_VERSION - -EbmlId KaxTrackVideo_TheId (0xE0, 1); -EbmlId KaxVideoPixelWidth_TheId (0xB0, 1); -EbmlId KaxVideoPixelHeight_TheId (0xBA, 1); -EbmlId KaxVideoPixelCropBottom_TheId(0x54AA, 2); -EbmlId KaxVideoPixelCropTop_TheId (0x54BB, 2); -EbmlId KaxVideoPixelCropLeft_TheId (0x54CC, 2); -EbmlId KaxVideoPixelCropRight_TheId (0x54DD, 2); -EbmlId KaxVideoDisplayWidth_TheId (0x54B0, 2); -EbmlId KaxVideoDisplayHeight_TheId (0x54BA, 2); -EbmlId KaxVideoColourSpace_TheId (0x2EB524, 3); -EbmlId KaxVideoFrameRate_TheId (0x2383E3, 3); -#if MATROSKA_VERSION >= 2 -EbmlId KaxVideoFlagInterlaced_TheId (0x9A, 1); -EbmlId KaxVideoStereoMode_TheId (0x53B9, 2); -EbmlId KaxVideoDisplayUnit_TheId (0x54B2, 2); -EbmlId KaxVideoAspectRatio_TheId (0x54B3, 1); -EbmlId KaxVideoGamma_TheId (0x2FB523, 3); -#endif // MATROSKA_VERSION - -const EbmlCallbacks KaxTrackVideo::ClassInfos(KaxTrackVideo::Create, KaxTrackVideo_TheId, "TrackAudio", KaxTrackVideo_Context); -const EbmlCallbacks KaxVideoPixelWidth::ClassInfos(KaxVideoPixelWidth::Create, KaxVideoPixelWidth_TheId, "VideoPixelWidth", KaxVideoPixelWidth_Context); -const EbmlCallbacks KaxVideoPixelHeight::ClassInfos(KaxVideoPixelHeight::Create, KaxVideoPixelHeight_TheId, "VideoPixelHeight", KaxVideoPixelHeight_Context); -const EbmlCallbacks KaxVideoPixelCropBottom::ClassInfos(KaxVideoPixelCropBottom::Create, KaxVideoPixelCropBottom_TheId, "VideoPixelCropBottom", KaxVideoPixelCropBottom_Context); -const EbmlCallbacks KaxVideoPixelCropTop::ClassInfos(KaxVideoPixelCropTop::Create, KaxVideoPixelCropTop_TheId, "VideoPixelCropTop", KaxVideoPixelCropTop_Context); -const EbmlCallbacks KaxVideoPixelCropLeft::ClassInfos(KaxVideoPixelCropLeft::Create, KaxVideoPixelCropLeft_TheId, "VideoPixelCropLeft", KaxVideoPixelCropLeft_Context); -const EbmlCallbacks KaxVideoPixelCropRight::ClassInfos(KaxVideoPixelCropRight::Create, KaxVideoPixelCropRight_TheId, "VideoPixelCropRight", KaxVideoPixelCropRight_Context); -const EbmlCallbacks KaxVideoDisplayWidth::ClassInfos(KaxVideoDisplayWidth::Create, KaxVideoDisplayWidth_TheId, "VideoDisplayWidth", KaxVideoDisplayWidth_Context); -const EbmlCallbacks KaxVideoDisplayHeight::ClassInfos(KaxVideoDisplayHeight::Create, KaxVideoDisplayHeight_TheId, "VideoDisplayHeight", KaxVideoDisplayHeight_Context); -const EbmlCallbacks KaxVideoColourSpace::ClassInfos(KaxVideoColourSpace::Create, KaxVideoColourSpace_TheId, "VideoColourSpace", KaxVideoColourSpace_Context); -const EbmlCallbacks KaxVideoFrameRate::ClassInfos(KaxVideoFrameRate::Create, KaxVideoFrameRate_TheId, "VideoFrameRate", KaxVideoFrameRate_Context); -#if MATROSKA_VERSION >= 2 -const EbmlCallbacks KaxVideoFlagInterlaced::ClassInfos(KaxVideoFlagInterlaced::Create, KaxVideoFlagInterlaced_TheId, "VideoFlagInterlaced", KaxVideoFlagInterlaced_Context); -const EbmlCallbacks KaxVideoStereoMode::ClassInfos(KaxVideoStereoMode::Create, KaxVideoStereoMode_TheId, "VideoStereoMode", KaxVideoStereoMode_Context); -const EbmlCallbacks KaxVideoDisplayUnit::ClassInfos(KaxVideoDisplayUnit::Create, KaxVideoDisplayUnit_TheId, "VideoDisplayUnit", KaxVideoDisplayUnit_Context); -const EbmlCallbacks KaxVideoAspectRatio::ClassInfos(KaxVideoAspectRatio::Create, KaxVideoAspectRatio_TheId, "VideoAspectRatio", KaxVideoAspectRatio_Context); -const EbmlCallbacks KaxVideoGamma::ClassInfos(KaxVideoGamma::Create, KaxVideoGamma_TheId, "VideoGamma", KaxVideoGamma_Context); -#endif // MATROSKA_VERSION - -KaxTrackVideo::KaxTrackVideo() - :EbmlMaster(KaxTrackVideo_Context) -{} - -uint32 KaxVideoFrameRate::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) -{ - assert(false); // no you are not allowed to use this element ! - return 0; -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTrackVideo.cpp 738 2004-08-30 09:21:46Z robux4 $ + \author Steve Lhomme +*/ +#include "matroska/KaxTrackVideo.h" + +// sub elements +#include "matroska/KaxContexts.h" + +START_LIBMATROSKA_NAMESPACE + +#if MATROSKA_VERSION == 1 +const EbmlSemantic KaxTrackVideo_ContextList[10] = +#else // MATROSKA_VERSION +const EbmlSemantic KaxTrackVideo_ContextList[15] = +#endif // MATROSKA_VERSION +{ + EbmlSemantic(true , true, EBML_INFO(KaxVideoPixelWidth)), + EbmlSemantic(true , true, EBML_INFO(KaxVideoPixelHeight)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoPixelCropBottom)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoPixelCropTop)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoPixelCropLeft)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoPixelCropRight)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoDisplayWidth)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoDisplayHeight)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoColourSpace)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoFrameRate)), +#if MATROSKA_VERSION >= 2 + EbmlSemantic(true , true, EBML_INFO(KaxVideoFlagInterlaced)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoStereoMode)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoDisplayUnit)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoAspectRatio)), + EbmlSemantic(false, true, EBML_INFO(KaxVideoGamma)), +#endif // MATROSKA_VERSION +}; + +const EbmlSemanticContext KaxTrackVideo_Context = EbmlSemanticContext(countof(KaxTrackVideo_ContextList), KaxTrackVideo_ContextList, &KaxTrackEntry_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackVideo)); +const EbmlSemanticContext KaxVideoPixelWidth_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelWidth)); +const EbmlSemanticContext KaxVideoPixelHeight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelHeight)); +const EbmlSemanticContext KaxVideoPixelCropBottom_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelCropBottom)); +const EbmlSemanticContext KaxVideoPixelCropTop_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelCropTop)); +const EbmlSemanticContext KaxVideoPixelCropRight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelCropLeft)); +const EbmlSemanticContext KaxVideoPixelCropLeft_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoPixelCropRight)); +const EbmlSemanticContext KaxVideoDisplayWidth_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoDisplayWidth)); +const EbmlSemanticContext KaxVideoDisplayHeight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoDisplayHeight)); +const EbmlSemanticContext KaxVideoColourSpace_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoColourSpace)); +const EbmlSemanticContext KaxVideoFrameRate_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoFrameRate)); +#if MATROSKA_VERSION >= 2 +const EbmlSemanticContext KaxVideoFlagInterlaced_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoFlagInterlaced)); +const EbmlSemanticContext KaxVideoStereoMode_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoStereoMode)); +const EbmlSemanticContext KaxVideoDisplayUnit_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoDisplayUnit)); +const EbmlSemanticContext KaxVideoAspectRatio_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoAspectRatio)); +const EbmlSemanticContext KaxVideoGamma_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxVideoGamma)); +#endif // MATROSKA_VERSION + +EbmlId KaxTrackVideo_TheId (0xE0, 1); +EbmlId KaxVideoPixelWidth_TheId (0xB0, 1); +EbmlId KaxVideoPixelHeight_TheId (0xBA, 1); +EbmlId KaxVideoPixelCropBottom_TheId(0x54AA, 2); +EbmlId KaxVideoPixelCropTop_TheId (0x54BB, 2); +EbmlId KaxVideoPixelCropLeft_TheId (0x54CC, 2); +EbmlId KaxVideoPixelCropRight_TheId (0x54DD, 2); +EbmlId KaxVideoDisplayWidth_TheId (0x54B0, 2); +EbmlId KaxVideoDisplayHeight_TheId (0x54BA, 2); +EbmlId KaxVideoColourSpace_TheId (0x2EB524, 3); +EbmlId KaxVideoFrameRate_TheId (0x2383E3, 3); +#if MATROSKA_VERSION >= 2 +EbmlId KaxVideoFlagInterlaced_TheId (0x9A, 1); +EbmlId KaxVideoStereoMode_TheId (0x53B9, 2); +EbmlId KaxVideoDisplayUnit_TheId (0x54B2, 2); +EbmlId KaxVideoAspectRatio_TheId (0x54B3, 1); +EbmlId KaxVideoGamma_TheId (0x2FB523, 3); +#endif // MATROSKA_VERSION + +const EbmlCallbacks KaxTrackVideo::ClassInfos(KaxTrackVideo::Create, KaxTrackVideo_TheId, "TrackAudio", KaxTrackVideo_Context); +const EbmlCallbacks KaxVideoPixelWidth::ClassInfos(KaxVideoPixelWidth::Create, KaxVideoPixelWidth_TheId, "VideoPixelWidth", KaxVideoPixelWidth_Context); +const EbmlCallbacks KaxVideoPixelHeight::ClassInfos(KaxVideoPixelHeight::Create, KaxVideoPixelHeight_TheId, "VideoPixelHeight", KaxVideoPixelHeight_Context); +const EbmlCallbacks KaxVideoPixelCropBottom::ClassInfos(KaxVideoPixelCropBottom::Create, KaxVideoPixelCropBottom_TheId, "VideoPixelCropBottom", KaxVideoPixelCropBottom_Context); +const EbmlCallbacks KaxVideoPixelCropTop::ClassInfos(KaxVideoPixelCropTop::Create, KaxVideoPixelCropTop_TheId, "VideoPixelCropTop", KaxVideoPixelCropTop_Context); +const EbmlCallbacks KaxVideoPixelCropLeft::ClassInfos(KaxVideoPixelCropLeft::Create, KaxVideoPixelCropLeft_TheId, "VideoPixelCropLeft", KaxVideoPixelCropLeft_Context); +const EbmlCallbacks KaxVideoPixelCropRight::ClassInfos(KaxVideoPixelCropRight::Create, KaxVideoPixelCropRight_TheId, "VideoPixelCropRight", KaxVideoPixelCropRight_Context); +const EbmlCallbacks KaxVideoDisplayWidth::ClassInfos(KaxVideoDisplayWidth::Create, KaxVideoDisplayWidth_TheId, "VideoDisplayWidth", KaxVideoDisplayWidth_Context); +const EbmlCallbacks KaxVideoDisplayHeight::ClassInfos(KaxVideoDisplayHeight::Create, KaxVideoDisplayHeight_TheId, "VideoDisplayHeight", KaxVideoDisplayHeight_Context); +const EbmlCallbacks KaxVideoColourSpace::ClassInfos(KaxVideoColourSpace::Create, KaxVideoColourSpace_TheId, "VideoColourSpace", KaxVideoColourSpace_Context); +const EbmlCallbacks KaxVideoFrameRate::ClassInfos(KaxVideoFrameRate::Create, KaxVideoFrameRate_TheId, "VideoFrameRate", KaxVideoFrameRate_Context); +#if MATROSKA_VERSION >= 2 +const EbmlCallbacks KaxVideoFlagInterlaced::ClassInfos(KaxVideoFlagInterlaced::Create, KaxVideoFlagInterlaced_TheId, "VideoFlagInterlaced", KaxVideoFlagInterlaced_Context); +const EbmlCallbacks KaxVideoStereoMode::ClassInfos(KaxVideoStereoMode::Create, KaxVideoStereoMode_TheId, "VideoStereoMode", KaxVideoStereoMode_Context); +const EbmlCallbacks KaxVideoDisplayUnit::ClassInfos(KaxVideoDisplayUnit::Create, KaxVideoDisplayUnit_TheId, "VideoDisplayUnit", KaxVideoDisplayUnit_Context); +const EbmlCallbacks KaxVideoAspectRatio::ClassInfos(KaxVideoAspectRatio::Create, KaxVideoAspectRatio_TheId, "VideoAspectRatio", KaxVideoAspectRatio_Context); +const EbmlCallbacks KaxVideoGamma::ClassInfos(KaxVideoGamma::Create, KaxVideoGamma_TheId, "VideoGamma", KaxVideoGamma_Context); +#endif // MATROSKA_VERSION + +KaxTrackVideo::KaxTrackVideo() + :EbmlMaster(KaxTrackVideo_Context) +{} + +uint32 KaxVideoFrameRate::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) +{ + assert(false); // no you are not allowed to use this element ! + return 0; +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxTracks.cpp b/src/KaxTracks.cpp index 7813379..608ee6b 100644 --- a/src/KaxTracks.cpp +++ b/src/KaxTracks.cpp @@ -1,114 +1,114 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2005 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxTracks.cpp 1202 2005-08-30 14:39:01Z robux4 $ - \author Steve Lhomme -*/ -#include "matroska/KaxTracks.h" - -// sub elements -#include "matroska/KaxTrackEntryData.h" -#include "matroska/KaxTrackAudio.h" -#include "matroska/KaxTrackVideo.h" -#include "matroska/KaxContentEncoding.h" -#include "matroska/KaxContexts.h" - -START_LIBMATROSKA_NAMESPACE - -const EbmlSemantic KaxTracks_ContextList[1] = -{ - EbmlSemantic(true, false, EBML_INFO(KaxTrackEntry)), -}; - -#if MATROSKA_VERSION == 1 -const EbmlSemantic KaxTrackEntry_ContextList[22] = -#else // MATROSKA_VERSION -const EbmlSemantic KaxTrackEntry_ContextList[27] = -#endif // MATROSKA_VERSION -{ - EbmlSemantic(true , true, EBML_INFO(KaxTrackNumber)), - EbmlSemantic(true , true, EBML_INFO(KaxTrackUID)), - EbmlSemantic(true , true, EBML_INFO(KaxTrackType)), -#if MATROSKA_VERSION >= 2 - EbmlSemantic(true , true, EBML_INFO(KaxTrackFlagEnabled)), -#endif // MATROSKA_VERSION - EbmlSemantic(true , true, EBML_INFO(KaxTrackFlagDefault)), - EbmlSemantic(true , true, EBML_INFO(KaxTrackFlagForced)), - EbmlSemantic(true , true, EBML_INFO(KaxTrackFlagLacing)), - EbmlSemantic(true , true, EBML_INFO(KaxTrackMinCache)), - EbmlSemantic(false, true, EBML_INFO(KaxTrackMaxCache)), - EbmlSemantic(false, true, EBML_INFO(KaxTrackDefaultDuration)), - EbmlSemantic(true , true, EBML_INFO(KaxTrackTimecodeScale)), - EbmlSemantic(true , true, EBML_INFO(KaxMaxBlockAdditionID)), - EbmlSemantic(false, true, EBML_INFO(KaxTrackName)), - EbmlSemantic(false, true, EBML_INFO(KaxTrackLanguage)), - EbmlSemantic(true , true, EBML_INFO(KaxCodecID)), - EbmlSemantic(false, true, EBML_INFO(KaxCodecPrivate)), - EbmlSemantic(false, true, EBML_INFO(KaxCodecName)), - EbmlSemantic(false, true, EBML_INFO(KaxTrackAttachmentLink)), -#if MATROSKA_VERSION >= 2 - EbmlSemantic(false, true, EBML_INFO(KaxCodecSettings)), - EbmlSemantic(false, false,EBML_INFO(KaxCodecInfoURL)), - EbmlSemantic(false, false,EBML_INFO(KaxCodecDownloadURL)), - EbmlSemantic(true , true, EBML_INFO(KaxCodecDecodeAll)), -#endif // MATROSKA_VERSION - EbmlSemantic(false, false,EBML_INFO(KaxTrackOverlay)), - EbmlSemantic(false, false,EBML_INFO(KaxTrackTranslate)), - EbmlSemantic(false, true, EBML_INFO(KaxTrackAudio)), - EbmlSemantic(false, true, EBML_INFO(KaxTrackVideo)), - EbmlSemantic(false, true, EBML_INFO(KaxContentEncodings)), -}; - -const EbmlSemanticContext KaxTracks_Context = EbmlSemanticContext(countof(KaxTracks_ContextList), KaxTracks_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTracks)); -const EbmlSemanticContext KaxTrackEntry_Context = EbmlSemanticContext(countof(KaxTrackEntry_ContextList), KaxTrackEntry_ContextList, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackEntry)); - -EbmlId KaxTracks_TheId (0x1654AE6B, 4); -EbmlId KaxTrackEntry_TheId(0xAE, 1); - -const EbmlCallbacks KaxTracks::ClassInfos(KaxTracks::Create, KaxTracks_TheId, "Tracks", KaxTracks_Context); -const EbmlCallbacks KaxTrackEntry::ClassInfos(KaxTrackEntry::Create, KaxTrackEntry_TheId, "TrackEntry", KaxTrackEntry_Context); - -KaxTracks::KaxTracks() - :EbmlMaster(KaxTracks_Context) -{} - -KaxTrackEntry::KaxTrackEntry() - :EbmlMaster(KaxTrackEntry_Context) - ,bGlobalTimecodeScaleIsSet(false) -{} - -void KaxTrackEntry::EnableLacing(bool bEnable) -{ - KaxTrackFlagLacing & myLacing = GetChild(*this); - *(static_cast(&myLacing)) = bEnable ? 1 : 0; -} - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxTracks.cpp 1202 2005-08-30 14:39:01Z robux4 $ + \author Steve Lhomme +*/ +#include "matroska/KaxTracks.h" + +// sub elements +#include "matroska/KaxTrackEntryData.h" +#include "matroska/KaxTrackAudio.h" +#include "matroska/KaxTrackVideo.h" +#include "matroska/KaxContentEncoding.h" +#include "matroska/KaxContexts.h" + +START_LIBMATROSKA_NAMESPACE + +const EbmlSemantic KaxTracks_ContextList[1] = +{ + EbmlSemantic(true, false, EBML_INFO(KaxTrackEntry)), +}; + +#if MATROSKA_VERSION == 1 +const EbmlSemantic KaxTrackEntry_ContextList[22] = +#else // MATROSKA_VERSION +const EbmlSemantic KaxTrackEntry_ContextList[27] = +#endif // MATROSKA_VERSION +{ + EbmlSemantic(true , true, EBML_INFO(KaxTrackNumber)), + EbmlSemantic(true , true, EBML_INFO(KaxTrackUID)), + EbmlSemantic(true , true, EBML_INFO(KaxTrackType)), +#if MATROSKA_VERSION >= 2 + EbmlSemantic(true , true, EBML_INFO(KaxTrackFlagEnabled)), +#endif // MATROSKA_VERSION + EbmlSemantic(true , true, EBML_INFO(KaxTrackFlagDefault)), + EbmlSemantic(true , true, EBML_INFO(KaxTrackFlagForced)), + EbmlSemantic(true , true, EBML_INFO(KaxTrackFlagLacing)), + EbmlSemantic(true , true, EBML_INFO(KaxTrackMinCache)), + EbmlSemantic(false, true, EBML_INFO(KaxTrackMaxCache)), + EbmlSemantic(false, true, EBML_INFO(KaxTrackDefaultDuration)), + EbmlSemantic(true , true, EBML_INFO(KaxTrackTimecodeScale)), + EbmlSemantic(true , true, EBML_INFO(KaxMaxBlockAdditionID)), + EbmlSemantic(false, true, EBML_INFO(KaxTrackName)), + EbmlSemantic(false, true, EBML_INFO(KaxTrackLanguage)), + EbmlSemantic(true , true, EBML_INFO(KaxCodecID)), + EbmlSemantic(false, true, EBML_INFO(KaxCodecPrivate)), + EbmlSemantic(false, true, EBML_INFO(KaxCodecName)), + EbmlSemantic(false, true, EBML_INFO(KaxTrackAttachmentLink)), +#if MATROSKA_VERSION >= 2 + EbmlSemantic(false, true, EBML_INFO(KaxCodecSettings)), + EbmlSemantic(false, false,EBML_INFO(KaxCodecInfoURL)), + EbmlSemantic(false, false,EBML_INFO(KaxCodecDownloadURL)), + EbmlSemantic(true , true, EBML_INFO(KaxCodecDecodeAll)), +#endif // MATROSKA_VERSION + EbmlSemantic(false, false,EBML_INFO(KaxTrackOverlay)), + EbmlSemantic(false, false,EBML_INFO(KaxTrackTranslate)), + EbmlSemantic(false, true, EBML_INFO(KaxTrackAudio)), + EbmlSemantic(false, true, EBML_INFO(KaxTrackVideo)), + EbmlSemantic(false, true, EBML_INFO(KaxContentEncodings)), +}; + +const EbmlSemanticContext KaxTracks_Context = EbmlSemanticContext(countof(KaxTracks_ContextList), KaxTracks_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTracks)); +const EbmlSemanticContext KaxTrackEntry_Context = EbmlSemanticContext(countof(KaxTrackEntry_ContextList), KaxTrackEntry_ContextList, &KaxTracks_Context, *GetKaxGlobal_Context, &EBML_INFO(KaxTrackEntry)); + +EbmlId KaxTracks_TheId (0x1654AE6B, 4); +EbmlId KaxTrackEntry_TheId(0xAE, 1); + +const EbmlCallbacks KaxTracks::ClassInfos(KaxTracks::Create, KaxTracks_TheId, "Tracks", KaxTracks_Context); +const EbmlCallbacks KaxTrackEntry::ClassInfos(KaxTrackEntry::Create, KaxTrackEntry_TheId, "TrackEntry", KaxTrackEntry_Context); + +KaxTracks::KaxTracks() + :EbmlMaster(KaxTracks_Context) +{} + +KaxTrackEntry::KaxTrackEntry() + :EbmlMaster(KaxTrackEntry_Context) + ,bGlobalTimecodeScaleIsSet(false) +{} + +void KaxTrackEntry::EnableLacing(bool bEnable) +{ + KaxTrackFlagLacing & myLacing = GetChild(*this); + *(static_cast(&myLacing)) = bEnable ? 1 : 0; +} + +END_LIBMATROSKA_NAMESPACE diff --git a/src/KaxVersion.cpp b/src/KaxVersion.cpp index 6ed03d2..992c2db 100644 --- a/src/KaxVersion.cpp +++ b/src/KaxVersion.cpp @@ -1,40 +1,40 @@ -/**************************************************************************** -** libmatroska : parse Matroska files, see http://www.matroska.org/ -** -** -** -** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. -** -** This file is part of libmatroska. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** -** Contact license@matroska.org if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -/*! - \file - \version \$Id: KaxVersion.cpp 640 2004-07-09 21:05:36Z mosu $ - \author Steve Lhomme -*/ - -#include "matroska/KaxVersion.h" - -START_LIBMATROSKA_NAMESPACE - -END_LIBMATROSKA_NAMESPACE +/**************************************************************************** +** libmatroska : parse Matroska files, see http://www.matroska.org/ +** +** +** +** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. +** +** This file is part of libmatroska. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License along with this library; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +** +** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.** +** Contact license@matroska.org if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +/*! + \file + \version \$Id: KaxVersion.cpp 640 2004-07-09 21:05:36Z mosu $ + \author Steve Lhomme +*/ + +#include "matroska/KaxVersion.h" + +START_LIBMATROSKA_NAMESPACE + +END_LIBMATROSKA_NAMESPACE