+2010-06-04 robux4/mosu\r
+New 1.0.0 version:\r
+ - rename the library .so name as it's backward incompatible\r
+\r
2010-04-30 robux4/mosu\r
New 0.9.0 version:\r
- fix a memory freeing issue in KaxBlock\r
-Include "*/*.proj"\r
-\r
-LIB matroska\r
-{\r
- INCLUDE .\r
- EXPINCLUDE .\r
-\r
- IF HAVE_EBML2\r
- USE ebml2_legacy\r
- ELSE\r
- USE ebml\r
- USEINCLUDE corec // so that stdafx implied by ebml2_legacy can build\r
- ENDIF\r
-\r
-// OPTIMIZE_GLOBALLY .\r
- FAVOR_MAX_SPEED .\r
- REDUCE_SIZE .\r
- FASTER_FLOAT .\r
- \r
- SOURCE src/FileKax.cpp\r
- SOURCE src/KaxAttached.cpp\r
- SOURCE src/KaxAttachments.cpp\r
- SOURCE src/KaxBlock.cpp\r
- SOURCE src/KaxBlockData.cpp\r
- SOURCE src/KaxChapters.cpp\r
- SOURCE src/KaxCluster.cpp\r
- SOURCE src/KaxClusterData.cpp\r
- SOURCE src/KaxContentEncoding.cpp\r
- SOURCE src/KaxContexts.cpp\r
- SOURCE src/KaxCues.cpp\r
- SOURCE src/KaxCuesData.cpp\r
- SOURCE src/KaxInfo.cpp\r
- SOURCE src/KaxInfoData.cpp\r
- SOURCE src/KaxSeekHead.cpp\r
- SOURCE src/KaxSegment.cpp\r
- SOURCE src/KaxTag.cpp\r
- SOURCE src/KaxTagMulti.cpp\r
- SOURCE src/KaxTags.cpp\r
- SOURCE src/KaxTrackAudio.cpp\r
- SOURCE src/KaxTrackEntryData.cpp\r
- SOURCE src/KaxTrackVideo.cpp\r
- SOURCE src/KaxTracks.cpp\r
- SOURCE src/KaxVersion.cpp\r
-\r
- HEADER matroska/FileKax.h\r
- HEADER matroska/KaxAttached.h\r
- HEADER matroska/KaxAttachments.h\r
- HEADER matroska/KaxBlock.h\r
- HEADER matroska/KaxBlockData.h\r
- HEADER matroska/KaxChapters.h\r
- HEADER matroska/KaxCluster.h\r
- HEADER matroska/KaxClusterData.h\r
- HEADER matroska/KaxConfig.h\r
- HEADER matroska/KaxContentEncoding.h\r
- HEADER matroska/KaxContexts.h\r
- HEADER matroska/KaxCues.h\r
- HEADER matroska/KaxCuesData.h\r
- HEADER matroska/KaxDefines.h\r
- HEADER matroska/KaxInfo.h\r
- HEADER matroska/KaxInfoData.h\r
- HEADER matroska/KaxSeekHead.h\r
- HEADER matroska/KaxSegment.h\r
- HEADER matroska/KaxTag.h\r
- HEADER matroska/KaxTagMulti.h\r
- HEADER matroska/KaxTags.h\r
- HEADER matroska/KaxTrackAudio.h\r
- HEADER matroska/KaxTrackEntryData.h\r
- HEADER matroska/KaxTrackVideo.h\r
- HEADER matroska/KaxTracks.h\r
- HEADER matroska/KaxTypes.h\r
- HEADER matroska/KaxVersion.h\r
- HEADER matroska/c/libmatroska_t.h\r
- HEADER matroska/c/libmatroska.h\r
-}\r
+Include "*/*.proj"
+
+LIB matroska
+{
+ PROJECT_VERSION 1.0.0
+
+ INCLUDE .
+ EXPINCLUDE .
+
+ IF HAVE_EBML2
+ USE ebml2_legacy
+ ELSE
+ USE ebml
+ USEINCLUDE corec // so that stdafx implied by ebml2_legacy can build
+ ENDIF
+
+// OPTIMIZE_GLOBALLY .
+ FAVOR_MAX_SPEED .
+ REDUCE_SIZE .
+ FASTER_FLOAT .
+
+ SOURCE src/FileKax.cpp
+ SOURCE src/KaxAttached.cpp
+ SOURCE src/KaxAttachments.cpp
+ SOURCE src/KaxBlock.cpp
+ SOURCE src/KaxBlockData.cpp
+ SOURCE src/KaxChapters.cpp
+ SOURCE src/KaxCluster.cpp
+ SOURCE src/KaxClusterData.cpp
+ SOURCE src/KaxContentEncoding.cpp
+ SOURCE src/KaxContexts.cpp
+ SOURCE src/KaxCues.cpp
+ SOURCE src/KaxCuesData.cpp
+ SOURCE src/KaxInfo.cpp
+ SOURCE src/KaxInfoData.cpp
+ SOURCE src/KaxSeekHead.cpp
+ SOURCE src/KaxSegment.cpp
+ SOURCE src/KaxTag.cpp
+ SOURCE src/KaxTagMulti.cpp
+ SOURCE src/KaxTags.cpp
+ SOURCE src/KaxTrackAudio.cpp
+ SOURCE src/KaxTrackEntryData.cpp
+ SOURCE src/KaxTrackVideo.cpp
+ SOURCE src/KaxTracks.cpp
+ SOURCE src/KaxVersion.cpp
+
+ HEADER matroska/FileKax.h
+ HEADER matroska/KaxAttached.h
+ HEADER matroska/KaxAttachments.h
+ HEADER matroska/KaxBlock.h
+ HEADER matroska/KaxBlockData.h
+ HEADER matroska/KaxChapters.h
+ HEADER matroska/KaxCluster.h
+ HEADER matroska/KaxClusterData.h
+ HEADER matroska/KaxConfig.h
+ HEADER matroska/KaxContentEncoding.h
+ HEADER matroska/KaxContexts.h
+ HEADER matroska/KaxCues.h
+ HEADER matroska/KaxCuesData.h
+ HEADER matroska/KaxDefines.h
+ HEADER matroska/KaxInfo.h
+ HEADER matroska/KaxInfoData.h
+ HEADER matroska/KaxSeekHead.h
+ HEADER matroska/KaxSegment.h
+ HEADER matroska/KaxTag.h
+ HEADER matroska/KaxTagMulti.h
+ HEADER matroska/KaxTags.h
+ HEADER matroska/KaxTrackAudio.h
+ HEADER matroska/KaxTrackEntryData.h
+ HEADER matroska/KaxTrackVideo.h
+ HEADER matroska/KaxTracks.h
+ HEADER matroska/KaxTypes.h
+ HEADER matroska/KaxVersion.h
+ HEADER matroska/c/libmatroska_t.h
+ HEADER matroska/c/libmatroska.h
+}
-/****************************************************************************\r
-** libmatroska : parse Matroska files, see http://www.matroska.org/\r
-**\r
-** <file/class description>\r
-**\r
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
-**\r
-** This library is free software; you can redistribute it and/or\r
-** modify it under the terms of the GNU Lesser General Public\r
-** License as published by the Free Software Foundation; either\r
-** version 2.1 of the License, or (at your option) any later version.\r
-** \r
-** This library is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-** Lesser General Public License for more details.\r
-** \r
-** You should have received a copy of the GNU Lesser General Public\r
-** License along with this library; if not, write to the Free Software\r
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-**\r
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
-** Contact license@matroska.org if any conditions of this licensing are\r
-** not clear to you.\r
-**\r
-**********************************************************************/\r
-\r
-/*!\r
- \file\r
- \version \$Id: KaxDefines.h,v 1.8 2010/04/02 23:26:17 robux4 Exp $\r
- \author Steve Lhomme <robux4 @ users.sf.net>\r
-*/\r
-#ifndef LIBMATROSKA_DEFINES_H\r
-#define LIBMATROSKA_DEFINES_H\r
-\r
-#include "ebml/EbmlVersion.h"\r
-#include "ebml/EbmlElement.h"\r
-\r
-#if LIBEBML_VERSION >= 0x010000\r
-#define DEFINE_MKX_CONTEXT(a) DEFINE_xxx_CONTEXT(a,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_MASTER_CONS(a,b,c,d,e) DEFINE_xxx_MASTER_CONS(a,b,d,e,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,d,e,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_MASTER_ORPHAN(a,b,c,d) DEFINE_xxx_MASTER_ORPHAN(a,b,d,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_UINTEGER_DEF(a,b,c,d,e,v) DEFINE_xxx_UINTEGER_DEF(a,b,d,e,EBML_SemanticGlobal,v)\r
-#define DEFINE_MKX_UINTEGER(a,b,c,d,e) DEFINE_xxx_UINTEGER(a,b,d,e,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_SINTEGER(a,b,c,d,e) DEFINE_xxx_SINTEGER(a,b,d,e,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_SINTEGER_CONS(a,b,c,d,e) DEFINE_xxx_SINTEGER_CONS(a,b,d,e,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_STRING_DEF(a,b,c,d,e,v) DEFINE_xxx_STRING_DEF(a,b,d,e,EBML_SemanticGlobal,v)\r
-#define DEFINE_MKX_STRING(a,b,c,d,e) DEFINE_xxx_STRING(a,b,d,e,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_UNISTRING(a,b,c,d,e) DEFINE_xxx_UNISTRING(a,b,d,e,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_BINARY(a,b,c,d,e) DEFINE_xxx_BINARY(a,b,d,e,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_BINARY_CONS(a,b,c,d,e) DEFINE_xxx_BINARY_CONS(a,b,d,e,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_FLOAT_DEF(a,b,c,d,e,v) DEFINE_xxx_FLOAT_DEF(a,b,d,e,EBML_SemanticGlobal,v)\r
-#define DEFINE_MKX_FLOAT(a,b,c,d,e) DEFINE_xxx_FLOAT(a,b,d,e,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_FLOAT64(a,b,c,d,e) DEFINE_xxx_FLOAT64(a,b,d,e,EBML_SemanticGlobal)\r
-#define DEFINE_MKX_DATE(a,b,c,d,e) DEFINE_xxx_DATE(a,b,d,e,EBML_SemanticGlobal)\r
-\r
-#define DECLARE_MKX_CONTEXT(x)\r
-\r
-#define DECLARE_MKX_MASTER(x) DECLARE_MKX_CONTEXT(x) \\r
-class MATROSKA_DLL_API x : public EbmlMaster { \\r
- public: x(EBML_EXTRA_PARAM); \\r
- x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_MASTER_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
-class MATROSKA_DLL_API x : public EbmlMaster { \\r
- public: x(EBML_EXTRA_PARAM); \\r
- x(const x & ElementToClone); \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_BINARY(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlBinary { \\r
- public: x(EBML_EXTRA_PARAM); \\r
- x(const x & ElementToClone) :EbmlBinary(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_BINARY_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlBinary { \\r
- public: x(EBML_EXTRA_PARAM); \\r
- x(const x & ElementToClone); \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_UNISTRING(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlUnicodeString { \\r
- public: x(EBML_EXTRA_PARAM); \\r
- x(const x & ElementToClone) :EbmlUnicodeString(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_STRING(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlString { \\r
- public: x(EBML_EXTRA_PARAM); \\r
- x(const x & ElementToClone) :EbmlString(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_UINTEGER(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlUInteger { \\r
- public: x(EBML_EXTRA_PARAM); \\r
- x(const x & ElementToClone) :EbmlUInteger(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_SINTEGER_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlSInteger { \\r
- public: x(EBML_EXTRA_PARAM); \\r
- x(const x & ElementToClone); \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_SINTEGER(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlSInteger { \\r
- public: x(EBML_EXTRA_PARAM); \\r
- x(const x & ElementToClone) :EbmlSInteger(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_DATE(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlDate { \\r
- public: x(EBML_EXTRA_PARAM); \\r
- x(const x & ElementToClone) :EbmlDate(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_FLOAT(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlFloat { \\r
- public: x(EBML_EXTRA_PARAM); \\r
- x(const x & ElementToClone) :EbmlFloat(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-\r
-#else\r
-#define DEFINE_MKX_CONTEXT(a) DEFINE_xxx_CONTEXT(a,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_MASTER_CONS(a,b,c,d,e) DEFINE_xxx_MASTER_CONS(a,b,c,d,e,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,c,d,e,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_MASTER_ORPHAN(a,b,c,d) DEFINE_xxx_MASTER_ORPHAN(a,b,c,d,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_UINTEGER_DEF(a,b,c,d,e,v) DEFINE_xxx_UINTEGER_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)\r
-#define DEFINE_MKX_UINTEGER(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_SINTEGER(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_STRING_DEF(a,b,c,d,e,v) DEFINE_xxx_STRING_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)\r
-#define DEFINE_MKX_STRING(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_UNISTRING(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_BINARY(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_FLOAT_DEF(a,b,c,d,e,v) DEFINE_xxx_FLOAT_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)\r
-#define DEFINE_MKX_FLOAT(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_DATE(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_BINARY_CONS(a,b,c,d,e) DEFINE_xxx_CLASS_CONS(a,b,c,d,e,*GetKaxGlobal_Context)\r
-#define DEFINE_MKX_SINTEGER_CONS(a,b,c,d,e) DEFINE_xxx_CLASS_CONS(a,b,c,d,e,*GetKaxGlobal_Context)\r
-\r
-#define DECLARE_MKX_CONTEXT(x)\r
-\r
-#define DECLARE_MKX_MASTER(x) DECLARE_MKX_CONTEXT(x) \\r
-class MATROSKA_DLL_API x : public EbmlMaster { \\r
- public: x(); \\r
- x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_MASTER_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
-class MATROSKA_DLL_API x : public EbmlMaster { \\r
- public: x(); \\r
- x(const x & ElementToClone); \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_BINARY(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlBinary { \\r
- public: x(); \\r
- x(const x & ElementToClone) :EbmlBinary(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_BINARY_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlBinary { \\r
- public: x(); \\r
- x(const x & ElementToClone); \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_UNISTRING(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlUnicodeString { \\r
- public: x(); \\r
- x(const x & ElementToClone) :EbmlUnicodeString(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_STRING(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlString { \\r
- public: x(); \\r
- x(const x & ElementToClone) :EbmlString(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_UINTEGER(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlUInteger { \\r
- public: x(); \\r
- x(const x & ElementToClone) :EbmlUInteger(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_SINTEGER_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlSInteger { \\r
- public: x(); \\r
- x(const x & ElementToClone); \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_SINTEGER(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlSInteger { \\r
- public: x(); \\r
- x(const x & ElementToClone) :EbmlSInteger(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_DATE(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlDate { \\r
- public: x(); \\r
- x(const x & ElementToClone) :EbmlDate(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#define DECLARE_MKX_FLOAT(x) DECLARE_MKX_CONTEXT(x) \\r
- class MATROSKA_DLL_API x : public EbmlFloat { \\r
- public: x(); \\r
- x(const x & ElementToClone) :EbmlFloat(ElementToClone) {} \\r
- EBML_CONCRETE_CLASS(x)\r
-\r
-#endif\r
-\r
-#endif // LIBMATROSKA_DEFINES_H\r
+/****************************************************************************
+** libmatroska : parse Matroska files, see http://www.matroska.org/
+**
+** <file/class description>
+**
+** 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$
+ \author Steve Lhomme <robux4 @ users.sf.net>
+*/
+#ifndef LIBMATROSKA_DEFINES_H
+#define LIBMATROSKA_DEFINES_H
+
+#include "ebml/EbmlVersion.h"
+#include "ebml/EbmlElement.h"
+
+#if defined(HAVE_EBML2)
+#define DEFINE_MKX_CONTEXT(a) DEFINE_xxx_CONTEXT(a,EBML_SemanticGlobal)
+#define DEFINE_MKX_MASTER_CONS(a,b,c,d,e) DEFINE_xxx_MASTER_CONS(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_MASTER_ORPHAN(a,b,c,d) DEFINE_xxx_MASTER_ORPHAN(a,b,d,EBML_SemanticGlobal)
+#define DEFINE_MKX_UINTEGER_DEF(a,b,c,d,e,v) DEFINE_xxx_UINTEGER_DEF(a,b,d,e,EBML_SemanticGlobal,v)
+#define DEFINE_MKX_UINTEGER(a,b,c,d,e) DEFINE_xxx_UINTEGER(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_SINTEGER(a,b,c,d,e) DEFINE_xxx_SINTEGER(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_SINTEGER_CONS(a,b,c,d,e) DEFINE_xxx_SINTEGER_CONS(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_STRING_DEF(a,b,c,d,e,v) DEFINE_xxx_STRING_DEF(a,b,d,e,EBML_SemanticGlobal,v)
+#define DEFINE_MKX_STRING(a,b,c,d,e) DEFINE_xxx_STRING(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_UNISTRING(a,b,c,d,e) DEFINE_xxx_UNISTRING(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_BINARY(a,b,c,d,e) DEFINE_xxx_BINARY(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_BINARY_CONS(a,b,c,d,e) DEFINE_xxx_BINARY_CONS(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_FLOAT_DEF(a,b,c,d,e,v) DEFINE_xxx_FLOAT_DEF(a,b,d,e,EBML_SemanticGlobal,v)
+#define DEFINE_MKX_FLOAT(a,b,c,d,e) DEFINE_xxx_FLOAT(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_FLOAT64(a,b,c,d,e) DEFINE_xxx_FLOAT64(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_DATE(a,b,c,d,e) DEFINE_xxx_DATE(a,b,d,e,EBML_SemanticGlobal)
+
+#define DECLARE_MKX_CONTEXT(x)
+
+#define DECLARE_MKX_MASTER(x) DECLARE_MKX_CONTEXT(x) \
+class MATROSKA_DLL_API x : public EbmlMaster { \
+ public: x(EBML_EXTRA_PARAM); \
+ x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_MASTER_CONS(x) DECLARE_MKX_CONTEXT(x) \
+class MATROSKA_DLL_API x : public EbmlMaster { \
+ public: x(EBML_EXTRA_PARAM); \
+ x(const x & ElementToClone); \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_BINARY(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlBinary { \
+ public: x(EBML_EXTRA_PARAM); \
+ x(const x & ElementToClone) :EbmlBinary(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_BINARY_CONS(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlBinary { \
+ public: x(EBML_EXTRA_PARAM); \
+ x(const x & ElementToClone); \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_UNISTRING(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlUnicodeString { \
+ public: x(EBML_EXTRA_PARAM); \
+ x(const x & ElementToClone) :EbmlUnicodeString(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_STRING(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlString { \
+ public: x(EBML_EXTRA_PARAM); \
+ x(const x & ElementToClone) :EbmlString(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_UINTEGER(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlUInteger { \
+ public: x(EBML_EXTRA_PARAM); \
+ x(const x & ElementToClone) :EbmlUInteger(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_SINTEGER_CONS(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlSInteger { \
+ public: x(EBML_EXTRA_PARAM); \
+ x(const x & ElementToClone); \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_SINTEGER(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlSInteger { \
+ public: x(EBML_EXTRA_PARAM); \
+ x(const x & ElementToClone) :EbmlSInteger(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_DATE(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlDate { \
+ public: x(EBML_EXTRA_PARAM); \
+ x(const x & ElementToClone) :EbmlDate(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_FLOAT(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlFloat { \
+ public: x(EBML_EXTRA_PARAM); \
+ x(const x & ElementToClone) :EbmlFloat(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+
+#else
+#define DEFINE_MKX_CONTEXT(a) DEFINE_xxx_CONTEXT(a,*GetKaxGlobal_Context)
+#define DEFINE_MKX_MASTER_CONS(a,b,c,d,e) DEFINE_xxx_MASTER_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
+#define DEFINE_MKX_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,c,d,e,*GetKaxGlobal_Context)
+#define DEFINE_MKX_MASTER_ORPHAN(a,b,c,d) DEFINE_xxx_MASTER_ORPHAN(a,b,c,d,*GetKaxGlobal_Context)
+#define DEFINE_MKX_UINTEGER_DEF(a,b,c,d,e,v) DEFINE_xxx_UINTEGER_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
+#define DEFINE_MKX_UINTEGER(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
+#define DEFINE_MKX_SINTEGER(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
+#define DEFINE_MKX_STRING_DEF(a,b,c,d,e,v) DEFINE_xxx_STRING_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
+#define DEFINE_MKX_STRING(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
+#define DEFINE_MKX_UNISTRING(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
+#define DEFINE_MKX_BINARY(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
+#define DEFINE_MKX_FLOAT_DEF(a,b,c,d,e,v) DEFINE_xxx_FLOAT_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
+#define DEFINE_MKX_FLOAT(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
+#define DEFINE_MKX_DATE(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
+#define DEFINE_MKX_BINARY_CONS(a,b,c,d,e) DEFINE_xxx_CLASS_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
+#define DEFINE_MKX_SINTEGER_CONS(a,b,c,d,e) DEFINE_xxx_CLASS_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
+
+#define DECLARE_MKX_CONTEXT(x)
+
+#define DECLARE_MKX_MASTER(x) DECLARE_MKX_CONTEXT(x) \
+class MATROSKA_DLL_API x : public EbmlMaster { \
+ public: x(); \
+ x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_MASTER_CONS(x) DECLARE_MKX_CONTEXT(x) \
+class MATROSKA_DLL_API x : public EbmlMaster { \
+ public: x(); \
+ x(const x & ElementToClone); \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_BINARY(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlBinary { \
+ public: x(); \
+ x(const x & ElementToClone) :EbmlBinary(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_BINARY_CONS(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlBinary { \
+ public: x(); \
+ x(const x & ElementToClone); \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_UNISTRING(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlUnicodeString { \
+ public: x(); \
+ x(const x & ElementToClone) :EbmlUnicodeString(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_STRING(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlString { \
+ public: x(); \
+ x(const x & ElementToClone) :EbmlString(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_UINTEGER(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlUInteger { \
+ public: x(); \
+ x(const x & ElementToClone) :EbmlUInteger(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_SINTEGER_CONS(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlSInteger { \
+ public: x(); \
+ x(const x & ElementToClone); \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_SINTEGER(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlSInteger { \
+ public: x(); \
+ x(const x & ElementToClone) :EbmlSInteger(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_DATE(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlDate { \
+ public: x(); \
+ x(const x & ElementToClone) :EbmlDate(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#define DECLARE_MKX_FLOAT(x) DECLARE_MKX_CONTEXT(x) \
+ class MATROSKA_DLL_API x : public EbmlFloat { \
+ public: x(); \
+ x(const x & ElementToClone) :EbmlFloat(ElementToClone) {} \
+ EBML_CONCRETE_CLASS(x)
+
+#endif
+
+#endif // LIBMATROSKA_DEFINES_H
DECLARE_MKX_BINARY(KaxSegmentUID)
public:
-#if LIBEBML_VERSION >= 0x010000
+#if defined(HAVE_EBML2)
KaxSegmentUID(EBML_DEF_CONS EBML_DEF_SEP EBML_EXTRA_PARAM);
#endif
virtual bool ValidateSize() const { return IsFiniteSize() && (GetSize() == 16);}
-/****************************************************************************\r
-** libmatroska : parse Matroska files, see http://www.matroska.org/\r
-**\r
-** <file/class description>\r
-**\r
-** Copyright (C) 2002-2003 Steve Lhomme. All rights reserved.\r
-**\r
-** This file is part of libmatroska.\r
-**\r
-** This library is free software; you can redistribute it and/or\r
-** modify it under the terms of the GNU Lesser General Public\r
-** License as published by the Free Software Foundation; either\r
-** version 2.1 of the License, or (at your option) any later version.\r
-** \r
-** This library is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-** Lesser General Public License for more details.\r
-** \r
-** You should have received a copy of the GNU Lesser General Public\r
-** License along with this library; if not, write to the Free Software\r
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-**\r
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
-** Contact license@matroska.org if any conditions of this licensing are\r
-** not clear to you.\r
-**\r
-**********************************************************************/\r
-\r
-/*!\r
- \file\r
- \version \$Id: FileKax.cpp 640 2004-07-09 21:05:36Z mosu $\r
- \author Steve Lhomme <robux4 @ users.sf.net>\r
-*/\r
-//#include "StdInclude.h"\r
-#include "matroska/FileKax.h"\r
-#include "ebml/EbmlVersion.h"\r
-#include "ebml/EbmlContexts.h"\r
-//#include "Cluster.h"\r
-//#include "Track.h"\r
-//#include "Block.h"\r
-//#include "Frame.h"\r
-//#include "Version.h"\r
-\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-//typedef Track *TrackID;\r
-\r
-FileMatroska::FileMatroska(IOCallback & output)\r
- :myFile(output)\r
-#ifdef OLD\r
- ,myCurrReadBlock(NULL)\r
- ,myMinClusterSize(5*1024) // 5KB is the min size of a cluster\r
- ,myMaxClusterSize(2*1024*1024) // 2MB is the max size of a cluster\r
- ,myCurrReadBlockTrack(0)\r
- ,myCurrWriteCluster(2*1024*1024) // myMaxClusterSize\r
- ,myCurrReadCluster(NULL)\r
- ,myReadBlockNumber(0)\r
-#endif // OLD\r
-{\r
-#ifdef OLD\r
- myStreamInfo.MainHeaderSize = TypeHeader::default_size() +\r
- ActualHeader::default_size() + \r
- ExtendedInfo::default_size() + \r
- ContentInfo::default_size();\r
- myStreamInfo.TrackEntrySize = Track::default_size();\r
- myStreamInfo.BlockHeadSize = BLOCK_HEADER_SIZE;\r
- myStreamInfo.ClusterHeadSize = CLUSTER_HEADER_SIZE;\r
- myStreamInfo.ClusterFootSize = CLUSTER_TRAILER_SIZE;\r
-#endif // OLD\r
-}\r
-\r
-FileMatroska::~FileMatroska()\r
-{\r
-// if (myCurrCluster != NULL)\r
-// throw 0; // there are some data left to write\r
-// if (myCurrReadCluster != NULL || myCurrReadBlock != NULL)\r
-// throw 0; // there are some data left to write\r
-}\r
-\r
-#ifdef OLD\r
-void FileMatroska::SetMaxClusterSize(const uint32 value)\r
-{\r
- myMaxClusterSize = value;\r
- myCurrWriteCluster.setMaxSize(value);\r
-}\r
-\r
-void FileMatroska::Close(const uint32 aTimeLength)\r
-{\r
- Flush();\r
-\r
- // get the file size\r
- myFile.setFilePointer(0,seek_end);\r
- myMainHeader.type_SetSize(myFile.getFilePointer());\r
-\r
- // rewrite the header at the beginning\r
- myFile.setFilePointer(0,seek_beginning);\r
-\r
- // get the Track-entry size\r
- uint32 track_entries_size = 0;\r
- for (size_t i=0; i<myTracks.size(); i++)\r
- {\r
- track_entries_size += myTracks[i]->default_size();\r
- }\r
-\r
- myStreamInfo.TrackEntriesSize = track_entries_size;\r
- myStreamInfo.TimeLength = aTimeLength;\r
- myMainHeader.Render(myFile, myStreamInfo);\r
-\r
- for (i=0; i<myTracks.size(); i++)\r
- {\r
- delete myTracks[i];\r
- }\r
-}\r
-\r
-/*!\r
- \warning after rendering the head, some parameters are locked\r
-*/\r
-filepos_t FileMatroska::RenderHead(const std::string & aEncoderApp)\r
-{\r
- try {\r
- uint32 track_entries_size = 0;\r
- for (size_t i=0; i<myTracks.size(); i++)\r
- {\r
- track_entries_size += myTracks[i]->default_size();\r
- }\r
-\r
- std::string aStr = LIB_NAME;\r
- aStr += " ";\r
- aStr += VERSION;\r
- myStreamInfo.EncoderLib = aStr;\r
-\r
- myStreamInfo.EncoderApp = aEncoderApp;\r
-\r
- myStreamInfo.TrackEntryPosition = 0 + myStreamInfo.MainHeaderSize;\r
- myStreamInfo.TrackEntriesSize = myTracks.size() * myStreamInfo.TrackEntrySize;\r
-\r
- myStreamInfo.CodecEntryPosition = myStreamInfo.MainHeaderSize + myStreamInfo.TrackEntriesSize;\r
- myStreamInfo.CodecEntrySize = 4;\r
- for (i=0; i<myTracks.size(); i++)\r
- {\r
- myStreamInfo.CodecEntrySize += myTracks[i]->CodecSize();\r
- }\r
-\r
- // Main Header\r
- filepos_t result = myMainHeader.Render(myFile, myStreamInfo);\r
-\r
- // Track Entries\r
- for (i=0; i<myTracks.size(); i++)\r
- {\r
- myTracks[i]->RenderEntry(myFile, i+1);\r
- }\r
- myStreamInfo.ClusterPosition = myStreamInfo.CodecEntryPosition + myStreamInfo.CodecEntrySize;\r
-\r
- // Codec Header\r
- result = CodecHeader::Render(myFile, myTracks);\r
-\r
- return result;\r
- }\r
- catch (exception & Ex)\r
- {\r
- throw Ex;\r
- }\r
-}\r
-\r
-/*!\r
- \return 0 if the track was not created, or a valid track number\r
-*/\r
-Track * FileMatroska::CreateTrack(const track_type aType)\r
-{\r
- myTracks.push_back(new Track(aType));\r
- return myTracks.back();\r
-}\r
-\r
-/*Track *FileMatroska::findTrack(Track * aTrack) const\r
-{\r
- for (size_t i=0; i<myTracks.size(); i++)\r
- {\r
- if (myTracks[i] == aTrack)\r
- return myTracks[i];\r
- }\r
-\r
- return NULL;\r
-}*/\r
-\r
-void FileMatroska::track_SetName(Track * aTrack, const std::string & aName)\r
-{\r
- if (IsMyTrack(aTrack))\r
- {\r
- aTrack->SetName(aName);\r
- }\r
-}\r
-\r
-void FileMatroska::track_SetLaced(Track * aTrack, bool bLaced)\r
-{\r
- if (IsMyTrack(aTrack))\r
- {\r
- aTrack->SetLaced(bLaced);\r
- }\r
-}\r
-\r
-bool FileMatroska::AddFrame(Track * aTrack, const uint32 aTimecode, const binary *aFrame, const uint32 aFrameSize,\r
- bool aKeyFrame, bool aBFrame)\r
-{\r
- try {\r
- // make sure we know that track\r
- if (IsMyTrack(aTrack))\r
- {\r
- // pass the cluster to the track\r
- // handle the creation of a new cluster if needed\r
- if (aTrack->AddFrame(aTimecode, aFrame, aFrameSize, aKeyFrame, aBFrame))\r
- {\r
- while (!aTrack->SerialiseBlock(myCurrWriteCluster))\r
- {\r
- /// \todo handle errors\r
- uint32 aNbBlock;\r
- myStreamInfo.ClusterSize += myCurrWriteCluster.Render(myFile, aNbBlock);\r
- myStreamInfo.NumberBlock += aNbBlock;\r
- myCurrWriteCluster.Flush();\r
- }\r
- }\r
- return true;\r
- }\r
- return false;\r
- }\r
- catch (exception & Ex)\r
- {\r
- throw Ex;\r
- }\r
-}\r
-\r
-void FileMatroska::Flush()\r
-{\r
- uint32 aNbBlock;\r
- myStreamInfo.ClusterSize += myCurrWriteCluster.Render(myFile,aNbBlock);\r
- myStreamInfo.NumberBlock += aNbBlock;\r
-}\r
-\r
-uint32 FileMatroska::ReadHead()\r
-{\r
- try {\r
- uint32 result = myMainHeader.Read(myFile, myStreamInfo);\r
-\r
- return result;\r
- }\r
- catch (exception & Ex)\r
- {\r
- throw Ex;\r
- }\r
-}\r
-\r
-uint32 FileMatroska::ReadTracks()\r
-{\r
- try {\r
- uint32 result = 0;\r
-\r
- // seek to the start of the Track Entries\r
- myFile.setFilePointer(myStreamInfo.TrackEntryPosition);\r
- // get the number of Track Entries\r
- uint8 TrackNumber = myStreamInfo.TrackEntriesSize / myStreamInfo.TrackEntrySize;\r
- // read all the Track Entries\r
- myTracks.clear();\r
- for (uint8 TrackIdx = 0; TrackIdx<TrackNumber; TrackIdx ++) {\r
- Track * tmpTrack = Track::ReadEntry(myFile, TrackIdx+1, myStreamInfo);\r
- if (tmpTrack == NULL)\r
- throw 0;\r
- \r
- myTracks.push_back(tmpTrack);\r
- }\r
-\r
- return result;\r
- }\r
- catch (exception & Ex)\r
- {\r
- throw Ex;\r
- }\r
-}\r
-\r
-uint32 FileMatroska::ReadCodec()\r
-{\r
- try {\r
- // seek to the start of the Track Entries\r
- myFile.setFilePointer(myStreamInfo.CodecEntryPosition);\r
-\r
- uint32 result = CodecHeader::Read(myFile, myTracks);\r
-\r
- return result;\r
- }\r
- catch (exception & Ex)\r
- {\r
- throw Ex;\r
- }\r
-}\r
-\r
-inline bool FileMatroska::IsMyTrack(const Track * aTrack) const\r
-{\r
- if (aTrack == 0)\r
- throw 0;\r
-\r
- for (std::vector<Track*>::const_iterator i = myTracks.begin(); i != myTracks.end(); i ++)\r
- {\r
- if (*i == aTrack)\r
- break;\r
- }\r
-\r
- if (i != myTracks.end())\r
- return true;\r
- else\r
- return false;\r
-}\r
-\r
-void FileMatroska::SelectReadingTrack(Track * aTrack, bool select)\r
-{\r
- if (IsMyTrack(aTrack))\r
- {\r
- // here we have the right track\r
- // check if it's not already selected\r
- for (std::vector<uint8>::iterator j = mySelectedTracks.begin();\r
- j != mySelectedTracks.end(); j ++)\r
- {\r
- if (*j == aTrack->TrackNumber())\r
- break;\r
- }\r
-\r
- if (select && j == mySelectedTracks.end())\r
- mySelectedTracks.push_back(aTrack->TrackNumber());\r
- else if (!select && j != mySelectedTracks.end())\r
- mySelectedTracks.erase(j);\r
-\r
- std::sort(mySelectedTracks.begin(), mySelectedTracks.end());\r
- }\r
-}\r
-\r
-inline bool FileMatroska::IsReadingTrack(const uint8 aTrackNumber) const\r
-{\r
- for (std::vector<uint8>::const_iterator trackIdx = mySelectedTracks.begin();\r
- trackIdx != mySelectedTracks.end() && *trackIdx < aTrackNumber;\r
- trackIdx++)\r
- {}\r
-\r
- if (trackIdx == mySelectedTracks.end())\r
- return false;\r
- else\r
- return true;\r
-}\r
-\r
-//\r
-\r
-void FileMatroska::Track_GetInfo(const Track * aTrack, TrackInfo & aTrackInfo) const\r
-{\r
- if (IsMyTrack(aTrack))\r
- {\r
- aTrack->GetInfo(aTrackInfo);\r
- }\r
-}\r
-\r
-// Audio related getters/setters\r
-\r
-void FileMatroska::Track_GetInfo_Audio(const Track * aTrack, TrackInfoAudio & aTrackInfo) const\r
-{\r
- if (IsMyTrack(aTrack))\r
- {\r
- aTrack->GetInfoAudio(aTrackInfo);\r
- }\r
-}\r
-\r
-void FileMatroska::Track_SetInfo_Audio(Track * aTrack, const TrackInfoAudio & aTrackInfo)\r
-{\r
- if (IsMyTrack(aTrack))\r
- {\r
- aTrack->SetInfoAudio(aTrackInfo);\r
- }\r
-}\r
-\r
-// Video related getters/setters\r
-\r
-void FileMatroska::Track_GetInfo_Video(const Track * aTrack, TrackInfoVideo & aTrackInfo) const\r
-{\r
- if (IsMyTrack(aTrack))\r
- {\r
- aTrack->GetInfoVideo(aTrackInfo);\r
- }\r
-}\r
-\r
-void FileMatroska::Track_SetInfo_Video(Track * aTrack, const TrackInfoVideo & aTrackInfo)\r
-{\r
- if (IsMyTrack(aTrack))\r
- {\r
- aTrack->SetInfoVideo(aTrackInfo);\r
- }\r
-}\r
-\r
-/*!\r
- \todo exit when there is no Block left\r
-*/\r
-bool FileMatroska::ReadFrame(Track * & aTrack, uint32 & aTimecode, const binary * & aFrame, uint32 & aFrameSize,\r
- bool & aKeyFrame, bool & aBFrame)\r
-{\r
- if (myCurrReadBlockTrack == 0)\r
- {\r
- do {\r
- if (myReadBlockNumber >= myStreamInfo.NumberBlock)\r
- {\r
-// myReadBlockNumber = myStreamInfo.NumberBlock;\r
- return false;\r
- }\r
-\r
- // get the next frame in the file\r
- if (!myCurrReadCluster.BlockLeft())\r
- {\r
- myCurrReadCluster.Flush();\r
- try {\r
- myCurrReadCluster.FindHead(myFile);\r
- }\r
- catch (exception & Ex)\r
- {\r
- return false;\r
- }\r
- }\r
-\r
- myCurrReadCluster.GetBlock( myCurrReadBlock, myCurrReadBlockSize, myCurrReadBlockTrack );\r
- myReadBlockNumber++;\r
- } while (!IsReadingTrack(myCurrReadBlockTrack));\r
-\r
- // get the track associated (normally from myTracks)\r
- aTrack = myTracks[myCurrReadBlockTrack-1];\r
- // get the next frame from the current block\r
- aTrack->HandleBlock(myCurrReadBlock, myCurrReadBlockSize);\r
- }\r
- else\r
- {\r
- // get the track associated (normally from myTracks)\r
- aTrack = myTracks[myCurrReadBlockTrack-1];\r
- }\r
- \r
- Frame * myReadFrame;\r
- aTrack->GetNextFrame(aTimecode, myReadFrame, aKeyFrame, aBFrame);\r
- aFrame = myReadFrame->buf();\r
- aFrameSize = myReadFrame->length();\r
-\r
- if (aTrack->NoFrameLeft())\r
- {\r
- aTrack->FlushBlock();\r
- myCurrReadBlockTrack = 0;\r
- }\r
-\r
- return true;\r
-}\r
-#endif // OLD\r
-\r
-END_LIBMATROSKA_NAMESPACE\r
-\r
-void matroska_init()\r
-{\r
-#if LIBEBML_VERSION >= 0x010000\r
- ebml_init();\r
-#endif\r
-}\r
-\r
-void matroska_done()\r
-{\r
-#if LIBEBML_VERSION >= 0x010000\r
- ebml_done();\r
-#endif\r
-}\r
+/****************************************************************************
+** libmatroska : parse Matroska files, see http://www.matroska.org/
+**
+** <file/class description>
+**
+** Copyright (C) 2002-2003 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$
+ \author Steve Lhomme <robux4 @ users.sf.net>
+*/
+//#include "StdInclude.h"
+#include "matroska/FileKax.h"
+#include "ebml/EbmlVersion.h"
+#include "ebml/EbmlContexts.h"
+//#include "Cluster.h"
+//#include "Track.h"
+//#include "Block.h"
+//#include "Frame.h"
+//#include "Version.h"
+
+START_LIBMATROSKA_NAMESPACE
+
+//typedef Track *TrackID;
+
+FileMatroska::FileMatroska(IOCallback & output)
+ :myFile(output)
+#ifdef OLD
+ ,myCurrReadBlock(NULL)
+ ,myMinClusterSize(5*1024) // 5KB is the min size of a cluster
+ ,myMaxClusterSize(2*1024*1024) // 2MB is the max size of a cluster
+ ,myCurrReadBlockTrack(0)
+ ,myCurrWriteCluster(2*1024*1024) // myMaxClusterSize
+ ,myCurrReadCluster(NULL)
+ ,myReadBlockNumber(0)
+#endif // OLD
+{
+#ifdef OLD
+ myStreamInfo.MainHeaderSize = TypeHeader::default_size() +
+ ActualHeader::default_size() +
+ ExtendedInfo::default_size() +
+ ContentInfo::default_size();
+ myStreamInfo.TrackEntrySize = Track::default_size();
+ myStreamInfo.BlockHeadSize = BLOCK_HEADER_SIZE;
+ myStreamInfo.ClusterHeadSize = CLUSTER_HEADER_SIZE;
+ myStreamInfo.ClusterFootSize = CLUSTER_TRAILER_SIZE;
+#endif // OLD
+}
+
+FileMatroska::~FileMatroska()
+{
+// if (myCurrCluster != NULL)
+// throw 0; // there are some data left to write
+// if (myCurrReadCluster != NULL || myCurrReadBlock != NULL)
+// throw 0; // there are some data left to write
+}
+
+#ifdef OLD
+void FileMatroska::SetMaxClusterSize(const uint32 value)
+{
+ myMaxClusterSize = value;
+ myCurrWriteCluster.setMaxSize(value);
+}
+
+void FileMatroska::Close(const uint32 aTimeLength)
+{
+ Flush();
+
+ // get the file size
+ myFile.setFilePointer(0,seek_end);
+ myMainHeader.type_SetSize(myFile.getFilePointer());
+
+ // rewrite the header at the beginning
+ myFile.setFilePointer(0,seek_beginning);
+
+ // get the Track-entry size
+ uint32 track_entries_size = 0;
+ for (size_t i=0; i<myTracks.size(); i++)
+ {
+ track_entries_size += myTracks[i]->default_size();
+ }
+
+ myStreamInfo.TrackEntriesSize = track_entries_size;
+ myStreamInfo.TimeLength = aTimeLength;
+ myMainHeader.Render(myFile, myStreamInfo);
+
+ for (i=0; i<myTracks.size(); i++)
+ {
+ delete myTracks[i];
+ }
+}
+
+/*!
+ \warning after rendering the head, some parameters are locked
+*/
+filepos_t FileMatroska::RenderHead(const std::string & aEncoderApp)
+{
+ try {
+ uint32 track_entries_size = 0;
+ for (size_t i=0; i<myTracks.size(); i++)
+ {
+ track_entries_size += myTracks[i]->default_size();
+ }
+
+ std::string aStr = LIB_NAME;
+ aStr += " ";
+ aStr += VERSION;
+ myStreamInfo.EncoderLib = aStr;
+
+ myStreamInfo.EncoderApp = aEncoderApp;
+
+ myStreamInfo.TrackEntryPosition = 0 + myStreamInfo.MainHeaderSize;
+ myStreamInfo.TrackEntriesSize = myTracks.size() * myStreamInfo.TrackEntrySize;
+
+ myStreamInfo.CodecEntryPosition = myStreamInfo.MainHeaderSize + myStreamInfo.TrackEntriesSize;
+ myStreamInfo.CodecEntrySize = 4;
+ for (i=0; i<myTracks.size(); i++)
+ {
+ myStreamInfo.CodecEntrySize += myTracks[i]->CodecSize();
+ }
+
+ // Main Header
+ filepos_t result = myMainHeader.Render(myFile, myStreamInfo);
+
+ // Track Entries
+ for (i=0; i<myTracks.size(); i++)
+ {
+ myTracks[i]->RenderEntry(myFile, i+1);
+ }
+ myStreamInfo.ClusterPosition = myStreamInfo.CodecEntryPosition + myStreamInfo.CodecEntrySize;
+
+ // Codec Header
+ result = CodecHeader::Render(myFile, myTracks);
+
+ return result;
+ }
+ catch (exception & Ex)
+ {
+ throw Ex;
+ }
+}
+
+/*!
+ \return 0 if the track was not created, or a valid track number
+*/
+Track * FileMatroska::CreateTrack(const track_type aType)
+{
+ myTracks.push_back(new Track(aType));
+ return myTracks.back();
+}
+
+/*Track *FileMatroska::findTrack(Track * aTrack) const
+{
+ for (size_t i=0; i<myTracks.size(); i++)
+ {
+ if (myTracks[i] == aTrack)
+ return myTracks[i];
+ }
+
+ return NULL;
+}*/
+
+void FileMatroska::track_SetName(Track * aTrack, const std::string & aName)
+{
+ if (IsMyTrack(aTrack))
+ {
+ aTrack->SetName(aName);
+ }
+}
+
+void FileMatroska::track_SetLaced(Track * aTrack, bool bLaced)
+{
+ if (IsMyTrack(aTrack))
+ {
+ aTrack->SetLaced(bLaced);
+ }
+}
+
+bool FileMatroska::AddFrame(Track * aTrack, const uint32 aTimecode, const binary *aFrame, const uint32 aFrameSize,
+ bool aKeyFrame, bool aBFrame)
+{
+ try {
+ // make sure we know that track
+ if (IsMyTrack(aTrack))
+ {
+ // pass the cluster to the track
+ // handle the creation of a new cluster if needed
+ if (aTrack->AddFrame(aTimecode, aFrame, aFrameSize, aKeyFrame, aBFrame))
+ {
+ while (!aTrack->SerialiseBlock(myCurrWriteCluster))
+ {
+ /// \todo handle errors
+ uint32 aNbBlock;
+ myStreamInfo.ClusterSize += myCurrWriteCluster.Render(myFile, aNbBlock);
+ myStreamInfo.NumberBlock += aNbBlock;
+ myCurrWriteCluster.Flush();
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+ catch (exception & Ex)
+ {
+ throw Ex;
+ }
+}
+
+void FileMatroska::Flush()
+{
+ uint32 aNbBlock;
+ myStreamInfo.ClusterSize += myCurrWriteCluster.Render(myFile,aNbBlock);
+ myStreamInfo.NumberBlock += aNbBlock;
+}
+
+uint32 FileMatroska::ReadHead()
+{
+ try {
+ uint32 result = myMainHeader.Read(myFile, myStreamInfo);
+
+ return result;
+ }
+ catch (exception & Ex)
+ {
+ throw Ex;
+ }
+}
+
+uint32 FileMatroska::ReadTracks()
+{
+ try {
+ uint32 result = 0;
+
+ // seek to the start of the Track Entries
+ myFile.setFilePointer(myStreamInfo.TrackEntryPosition);
+ // get the number of Track Entries
+ uint8 TrackNumber = myStreamInfo.TrackEntriesSize / myStreamInfo.TrackEntrySize;
+ // read all the Track Entries
+ myTracks.clear();
+ for (uint8 TrackIdx = 0; TrackIdx<TrackNumber; TrackIdx ++) {
+ Track * tmpTrack = Track::ReadEntry(myFile, TrackIdx+1, myStreamInfo);
+ if (tmpTrack == NULL)
+ throw 0;
+
+ myTracks.push_back(tmpTrack);
+ }
+
+ return result;
+ }
+ catch (exception & Ex)
+ {
+ throw Ex;
+ }
+}
+
+uint32 FileMatroska::ReadCodec()
+{
+ try {
+ // seek to the start of the Track Entries
+ myFile.setFilePointer(myStreamInfo.CodecEntryPosition);
+
+ uint32 result = CodecHeader::Read(myFile, myTracks);
+
+ return result;
+ }
+ catch (exception & Ex)
+ {
+ throw Ex;
+ }
+}
+
+inline bool FileMatroska::IsMyTrack(const Track * aTrack) const
+{
+ if (aTrack == 0)
+ throw 0;
+
+ for (std::vector<Track*>::const_iterator i = myTracks.begin(); i != myTracks.end(); i ++)
+ {
+ if (*i == aTrack)
+ break;
+ }
+
+ if (i != myTracks.end())
+ return true;
+ else
+ return false;
+}
+
+void FileMatroska::SelectReadingTrack(Track * aTrack, bool select)
+{
+ if (IsMyTrack(aTrack))
+ {
+ // here we have the right track
+ // check if it's not already selected
+ for (std::vector<uint8>::iterator j = mySelectedTracks.begin();
+ j != mySelectedTracks.end(); j ++)
+ {
+ if (*j == aTrack->TrackNumber())
+ break;
+ }
+
+ if (select && j == mySelectedTracks.end())
+ mySelectedTracks.push_back(aTrack->TrackNumber());
+ else if (!select && j != mySelectedTracks.end())
+ mySelectedTracks.erase(j);
+
+ std::sort(mySelectedTracks.begin(), mySelectedTracks.end());
+ }
+}
+
+inline bool FileMatroska::IsReadingTrack(const uint8 aTrackNumber) const
+{
+ for (std::vector<uint8>::const_iterator trackIdx = mySelectedTracks.begin();
+ trackIdx != mySelectedTracks.end() && *trackIdx < aTrackNumber;
+ trackIdx++)
+ {}
+
+ if (trackIdx == mySelectedTracks.end())
+ return false;
+ else
+ return true;
+}
+
+//
+
+void FileMatroska::Track_GetInfo(const Track * aTrack, TrackInfo & aTrackInfo) const
+{
+ if (IsMyTrack(aTrack))
+ {
+ aTrack->GetInfo(aTrackInfo);
+ }
+}
+
+// Audio related getters/setters
+
+void FileMatroska::Track_GetInfo_Audio(const Track * aTrack, TrackInfoAudio & aTrackInfo) const
+{
+ if (IsMyTrack(aTrack))
+ {
+ aTrack->GetInfoAudio(aTrackInfo);
+ }
+}
+
+void FileMatroska::Track_SetInfo_Audio(Track * aTrack, const TrackInfoAudio & aTrackInfo)
+{
+ if (IsMyTrack(aTrack))
+ {
+ aTrack->SetInfoAudio(aTrackInfo);
+ }
+}
+
+// Video related getters/setters
+
+void FileMatroska::Track_GetInfo_Video(const Track * aTrack, TrackInfoVideo & aTrackInfo) const
+{
+ if (IsMyTrack(aTrack))
+ {
+ aTrack->GetInfoVideo(aTrackInfo);
+ }
+}
+
+void FileMatroska::Track_SetInfo_Video(Track * aTrack, const TrackInfoVideo & aTrackInfo)
+{
+ if (IsMyTrack(aTrack))
+ {
+ aTrack->SetInfoVideo(aTrackInfo);
+ }
+}
+
+/*!
+ \todo exit when there is no Block left
+*/
+bool FileMatroska::ReadFrame(Track * & aTrack, uint32 & aTimecode, const binary * & aFrame, uint32 & aFrameSize,
+ bool & aKeyFrame, bool & aBFrame)
+{
+ if (myCurrReadBlockTrack == 0)
+ {
+ do {
+ if (myReadBlockNumber >= myStreamInfo.NumberBlock)
+ {
+// myReadBlockNumber = myStreamInfo.NumberBlock;
+ return false;
+ }
+
+ // get the next frame in the file
+ if (!myCurrReadCluster.BlockLeft())
+ {
+ myCurrReadCluster.Flush();
+ try {
+ myCurrReadCluster.FindHead(myFile);
+ }
+ catch (exception & Ex)
+ {
+ return false;
+ }
+ }
+
+ myCurrReadCluster.GetBlock( myCurrReadBlock, myCurrReadBlockSize, myCurrReadBlockTrack );
+ myReadBlockNumber++;
+ } while (!IsReadingTrack(myCurrReadBlockTrack));
+
+ // get the track associated (normally from myTracks)
+ aTrack = myTracks[myCurrReadBlockTrack-1];
+ // get the next frame from the current block
+ aTrack->HandleBlock(myCurrReadBlock, myCurrReadBlockSize);
+ }
+ else
+ {
+ // get the track associated (normally from myTracks)
+ aTrack = myTracks[myCurrReadBlockTrack-1];
+ }
+
+ Frame * myReadFrame;
+ aTrack->GetNextFrame(aTimecode, myReadFrame, aKeyFrame, aBFrame);
+ aFrame = myReadFrame->buf();
+ aFrameSize = myReadFrame->length();
+
+ if (aTrack->NoFrameLeft())
+ {
+ aTrack->FlushBlock();
+ myCurrReadBlockTrack = 0;
+ }
+
+ return true;
+}
+#endif // OLD
+
+END_LIBMATROSKA_NAMESPACE
+
+void matroska_init()
+{
+#if defined(HAVE_EBML2)
+ ebml_init();
+#endif
+}
+
+void matroska_done()
+{
+#if defined(HAVE_EBML2)
+ ebml_done();
+#endif
+}
-/****************************************************************************\r
-** libmatroska : parse Matroska files, see http://www.matroska.org/\r
-**\r
-** <file/class description>\r
-**\r
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
-**\r
-** This file is part of libmatroska.\r
-**\r
-** This library is free software; you can redistribute it and/or\r
-** modify it under the terms of the GNU Lesser General Public\r
-** License as published by the Free Software Foundation; either\r
-** version 2.1 of the License, or (at your option) any later version.\r
-** \r
-** This library is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-** Lesser General Public License for more details.\r
-** \r
-** You should have received a copy of the GNU Lesser General Public\r
-** License along with this library; if not, write to the Free Software\r
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-**\r
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
-** Contact license@matroska.org if any conditions of this licensing are\r
-** not clear to you.\r
-**\r
-**********************************************************************/\r
-\r
-/*!\r
- \file\r
- \version \$Id: KaxInfoData.cpp 1078 2005-03-03 13:13:04Z robux4 $\r
- \author Steve Lhomme <robux4 @ users.sf.net>\r
- \author John Cannon <spyder2555 @ users.sf.net>\r
-*/\r
-#include "matroska/KaxInfoData.h"\r
-#include "matroska/KaxContexts.h"\r
-#include "matroska/KaxDefines.h"\r
-\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-DEFINE_START_SEMANTIC(KaxChapterTranslate)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxChapterTranslateEditionUID)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxChapterTranslateCodec)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxChapterTranslateID)\r
-DEFINE_END_SEMANTIC(KaxChapterTranslate)\r
-\r
-DEFINE_MKX_BINARY (KaxSegmentUID, 0x73A4, 2, KaxInfo, "SegmentUID");\r
-DEFINE_MKX_UNISTRING (KaxSegmentFilename, 0x7384, 2, KaxInfo, "SegmentFilename");\r
-DEFINE_MKX_BINARY_CONS (KaxPrevUID, 0x3CB923, 3, KaxInfo, "PrevUID");\r
-DEFINE_MKX_UNISTRING (KaxPrevFilename, 0x3C83AB, 3, KaxInfo, "PrevFilename");\r
-DEFINE_MKX_BINARY_CONS (KaxNextUID, 0x3EB923, 3, KaxInfo, "NextUID");\r
-DEFINE_MKX_UNISTRING (KaxNextFilename, 0x3E83BB, 3, KaxInfo, "NextFilename");\r
-DEFINE_MKX_BINARY (KaxSegmentFamily, 0x4444, 2, KaxInfo, "SegmentFamily");\r
-DEFINE_MKX_MASTER (KaxChapterTranslate, 0x6924, 2, KaxInfo, "ChapterTranslate");\r
-DEFINE_MKX_UINTEGER (KaxChapterTranslateEditionUID, 0x69FC, 2, KaxChapterTranslate, "ChapterTranslateEditionUID");\r
-DEFINE_MKX_UINTEGER (KaxChapterTranslateCodec, 0x69BF, 2, KaxChapterTranslate, "ChapterTranslateCodec");\r
-DEFINE_MKX_BINARY (KaxChapterTranslateID, 0x69A5, 2, KaxChapterTranslate, "ChapterTranslateID");\r
-DEFINE_MKX_UINTEGER_DEF(KaxTimecodeScale, 0x2AD7B1, 3, KaxInfo, "TimecodeScale", 1000000);\r
-DEFINE_MKX_FLOAT (KaxDuration, 0x4489, 2, KaxInfo, "Duration");\r
-DEFINE_MKX_DATE (KaxDateUTC, 0x4461, 2, KaxInfo, "DateUTC");\r
-DEFINE_MKX_UNISTRING (KaxTitle, 0x7BA9, 2, KaxInfo, "Title");\r
-\r
-KaxPrevUID::KaxPrevUID(EBML_EXTRA_DEF)\r
-:KaxSegmentUID(EBML_DEF_BINARY_CTX(KaxPrevUID) EBML_DEF_SEP EBML_EXTRA_CALL)\r
-{\r
-}\r
-\r
-KaxNextUID::KaxNextUID(EBML_EXTRA_DEF)\r
-:KaxSegmentUID(EBML_DEF_BINARY_CTX(KaxNextUID) EBML_DEF_SEP EBML_EXTRA_CALL)\r
-{\r
-}\r
-\r
-#if LIBEBML_VERSION >= 0x010000\r
-KaxSegmentUID::KaxSegmentUID(EBML_DEF_CONS EBML_DEF_SEP EBML_EXTRA_DEF)\r
-:EbmlBinary(EBML_DEF_PARAM EBML_DEF_SEP EBML_EXTRA_CALL)\r
-{\r
-}\r
-#endif\r
-\r
-END_LIBMATROSKA_NAMESPACE\r
+/****************************************************************************
+** libmatroska : parse Matroska files, see http://www.matroska.org/
+**
+** <file/class description>
+**
+** 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$
+ \author Steve Lhomme <robux4 @ users.sf.net>
+ \author John Cannon <spyder2555 @ users.sf.net>
+*/
+#include "matroska/KaxInfoData.h"
+#include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
+
+START_LIBMATROSKA_NAMESPACE
+
+DEFINE_START_SEMANTIC(KaxChapterTranslate)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterTranslateEditionUID)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterTranslateCodec)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterTranslateID)
+DEFINE_END_SEMANTIC(KaxChapterTranslate)
+
+DEFINE_MKX_BINARY (KaxSegmentUID, 0x73A4, 2, KaxInfo, "SegmentUID");
+DEFINE_MKX_UNISTRING (KaxSegmentFilename, 0x7384, 2, KaxInfo, "SegmentFilename");
+DEFINE_MKX_BINARY_CONS (KaxPrevUID, 0x3CB923, 3, KaxInfo, "PrevUID");
+DEFINE_MKX_UNISTRING (KaxPrevFilename, 0x3C83AB, 3, KaxInfo, "PrevFilename");
+DEFINE_MKX_BINARY_CONS (KaxNextUID, 0x3EB923, 3, KaxInfo, "NextUID");
+DEFINE_MKX_UNISTRING (KaxNextFilename, 0x3E83BB, 3, KaxInfo, "NextFilename");
+DEFINE_MKX_BINARY (KaxSegmentFamily, 0x4444, 2, KaxInfo, "SegmentFamily");
+DEFINE_MKX_MASTER (KaxChapterTranslate, 0x6924, 2, KaxInfo, "ChapterTranslate");
+DEFINE_MKX_UINTEGER (KaxChapterTranslateEditionUID, 0x69FC, 2, KaxChapterTranslate, "ChapterTranslateEditionUID");
+DEFINE_MKX_UINTEGER (KaxChapterTranslateCodec, 0x69BF, 2, KaxChapterTranslate, "ChapterTranslateCodec");
+DEFINE_MKX_BINARY (KaxChapterTranslateID, 0x69A5, 2, KaxChapterTranslate, "ChapterTranslateID");
+DEFINE_MKX_UINTEGER_DEF(KaxTimecodeScale, 0x2AD7B1, 3, KaxInfo, "TimecodeScale", 1000000);
+DEFINE_MKX_FLOAT (KaxDuration, 0x4489, 2, KaxInfo, "Duration");
+DEFINE_MKX_DATE (KaxDateUTC, 0x4461, 2, KaxInfo, "DateUTC");
+DEFINE_MKX_UNISTRING (KaxTitle, 0x7BA9, 2, KaxInfo, "Title");
+
+KaxPrevUID::KaxPrevUID(EBML_EXTRA_DEF)
+:KaxSegmentUID(EBML_DEF_BINARY_CTX(KaxPrevUID) EBML_DEF_SEP EBML_EXTRA_CALL)
+{
+}
+
+KaxNextUID::KaxNextUID(EBML_EXTRA_DEF)
+:KaxSegmentUID(EBML_DEF_BINARY_CTX(KaxNextUID) EBML_DEF_SEP EBML_EXTRA_CALL)
+{
+}
+
+#if defined(HAVE_EBML2)
+KaxSegmentUID::KaxSegmentUID(EBML_DEF_CONS EBML_DEF_SEP EBML_EXTRA_DEF)
+:EbmlBinary(EBML_DEF_PARAM EBML_DEF_SEP EBML_EXTRA_CALL)
+{
+}
+#endif
+
+END_LIBMATROSKA_NAMESPACE
-/****************************************************************************\r
-** libmatroska : parse Matroska files, see http://www.matroska.org/\r
-**\r
-** <file/class description>\r
-**\r
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
-**\r
-** This file is part of libmatroska.\r
-**\r
-** This library is free software; you can redistribute it and/or\r
-** modify it under the terms of the GNU Lesser General Public\r
-** License as published by the Free Software Foundation; either\r
-** version 2.1 of the License, or (at your option) any later version.\r
-** \r
-** This library is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-** Lesser General Public License for more details.\r
-** \r
-** You should have received a copy of the GNU Lesser General Public\r
-** License along with this library; if not, write to the Free Software\r
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-**\r
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
-** Contact license@matroska.org if any conditions of this licensing are\r
-** not clear to you.\r
-**\r
-**********************************************************************/\r
-\r
-/*!\r
- \file\r
- \version \$Id: KaxTagMulti.cpp 640 2004-07-09 21:05:36Z mosu $\r
- \author Jory Stone <jcsston @ toughguy.net>\r
- \author Steve Lhomme <robux4 @ users.sf.net>\r
-*/\r
-#include "matroska/KaxTagMulti.h"\r
-#include "matroska/KaxContexts.h"\r
-#include "matroska/KaxDefines.h"\r
-\r
-using namespace LIBEBML_NAMESPACE;\r
-\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-DEFINE_START_SEMANTIC(KaxTagMultiGlobal)\r
-// TODO: have the default EBML global semantic as well\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiComment)\r
-DEFINE_END_SEMANTIC(KaxTagMultiGlobal)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagMultiComment)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommentName)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommentComments)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommentLanguage)\r
-DEFINE_END_SEMANTIC(KaxTagMultiComment)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagMultiCommercial)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxTagCommercial)\r
-DEFINE_END_SEMANTIC(KaxTagMultiCommercial)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagCommercial)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiCommercialType)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommercialAddress)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiCommercialURL)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiCommercialEmail)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiPrice)\r
-DEFINE_END_SEMANTIC(KaxTagCommercial)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagMultiPrice)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiPriceCurrency)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiPriceAmount)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiPricePriceDate)\r
-DEFINE_END_SEMANTIC(KaxTagMultiPrice)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagMultiDate)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxTagDate)\r
-DEFINE_END_SEMANTIC(KaxTagMultiDate)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagDate)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiDateType)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiDateDateBegin)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiDateDateEnd)\r
-DEFINE_END_SEMANTIC(KaxTagDate)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagMultiEntity)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxTagEntity)\r
-DEFINE_END_SEMANTIC(KaxTagMultiEntity)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagEntity)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiEntityType)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiEntityName)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiEntityURL)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiEntityEmail)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiEntityAddress)\r
-DEFINE_END_SEMANTIC(KaxTagEntity)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagMultiIdentifier)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxTagIdentifier)\r
-DEFINE_END_SEMANTIC(KaxTagMultiIdentifier)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagIdentifier)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiIdentifierType)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiIdentifierBinary)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiIdentifierString)\r
-DEFINE_END_SEMANTIC(KaxTagIdentifier)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagMultiLegal)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxTagLegal)\r
-DEFINE_END_SEMANTIC(KaxTagMultiLegal)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagLegal)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiLegalType)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiLegalContent)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiLegalURL)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiLegalAddress)\r
-DEFINE_END_SEMANTIC(KaxTagLegal)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagMultiTitle)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxTagTitle)\r
-DEFINE_END_SEMANTIC(KaxTagMultiTitle)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagTitle)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiTitleType)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleName)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleSubTitle)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleEdition)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleAddress)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiTitleURL)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiTitleEmail)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleLanguage)\r
-DEFINE_END_SEMANTIC(KaxTagTitle)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagMultiAttachment)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxTagAttachment)\r
-DEFINE_END_SEMANTIC(KaxTagMultiAttachment)\r
-\r
-DEFINE_START_SEMANTIC(KaxTagAttachment)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTagAttachmentID)\r
-DEFINE_END_SEMANTIC(KaxTagAttachment)\r
-\r
-\r
-DEFINE_MKX_CONTEXT(KaxTagMultiGlobal);\r
-\r
-const EbmlSemanticContext & GetKaxTagsGlobal_Context()\r
-{\r
- return EBML_CLASS_SEMCONTEXT(KaxTagMultiGlobal);\r
-}\r
-\r
-#if LIBEBML_VERSION >= 0x010000\r
-#define DEFINE_TAG_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,d,e,EBML_SemanticKaxTagMultiGlobal)\r
-#else\r
-#define DEFINE_TAG_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,c,d,e,*GetKaxTagsGlobal_Context)\r
-#endif\r
-\r
-\r
-DEFINE_MKX_MASTER (KaxTagMultiComment, 0x5B7B, 2, KaxTag, "MultiComment");\r
-DEFINE_MKX_STRING (KaxTagMultiCommentName, 0x5F7D, 2, KaxTagMultiComment, "MultiCommentName");\r
-DEFINE_MKX_UNISTRING(KaxTagMultiCommentComments, 0x5F7C, 2, KaxTagMultiComment, "MultiCommentComments");\r
-DEFINE_MKX_STRING (KaxTagMultiCommentLanguage, 0x22B59D, 3, KaxTagMultiComment, "MultiCommentLanguage");\r
-\r
-DEFINE_TAG_MASTER (KaxTagMultiCommercial, 0x4DC7, 2, KaxTag, "MultiCommercial");\r
-DEFINE_TAG_MASTER (KaxTagCommercial, 0x4EC7, 2, KaxTagMultiCommercial, "Commercial");\r
-DEFINE_MKX_UINTEGER (KaxTagMultiCommercialType, 0x5BD7, 2, KaxTagCommercial, "MultiCommercialType");\r
-DEFINE_MKX_UNISTRING(KaxTagMultiCommercialAddress, 0x5BBB, 2, KaxTagCommercial, "MultiCommercialAddress");\r
-DEFINE_MKX_STRING (KaxTagMultiCommercialURL, 0x5BDA, 2, KaxTagCommercial, "MultiCommercialURL");\r
-DEFINE_MKX_STRING (KaxTagMultiCommercialEmail, 0x5BC0, 2, KaxTagCommercial, "MultiCommercialEmail");\r
-DEFINE_TAG_MASTER (KaxTagMultiPrice, 0x5BC3, 2, KaxTagCommercial, "MultiPrice");\r
-DEFINE_MKX_STRING (KaxTagMultiPriceCurrency, 0x5B6C, 2, KaxTagMultiPrice, "MultiPriceCurrency");\r
-DEFINE_MKX_FLOAT (KaxTagMultiPriceAmount, 0x5B6E, 2, KaxTagMultiPrice, "MultiPriceAmount");\r
-DEFINE_MKX_DATE (KaxTagMultiPricePriceDate, 0x5B6F, 2, KaxTagMultiPrice, "MultiPricePriceDate");\r
-\r
-DEFINE_TAG_MASTER (KaxTagMultiDate, 0x4DC8, 2, KaxTag, "MultiDate");\r
-DEFINE_TAG_MASTER (KaxTagDate, 0x4EC8, 2, KaxTagMultiDate, "Date");\r
-DEFINE_MKX_UINTEGER (KaxTagMultiDateType, 0x5BD8, 2, KaxTagDate, "MultiDateType");\r
-DEFINE_MKX_DATE (KaxTagMultiDateDateBegin, 0x4460, 2, KaxTagDate, "MultiDateDateBegin");\r
-DEFINE_MKX_DATE (KaxTagMultiDateDateEnd, 0x4462, 2, KaxTagDate, "MultiDateDateEnd");\r
-\r
-DEFINE_TAG_MASTER (KaxTagMultiEntity, 0x4DC9, 2, KaxTag, "MultiEntity");\r
-DEFINE_TAG_MASTER (KaxTagEntity, 0x4EC9, 2, KaxTagMultiEntity, "Entity");\r
-DEFINE_MKX_UINTEGER (KaxTagMultiEntityType, 0x5BD9, 2, KaxTagEntity, "MultiEntityType");\r
-DEFINE_MKX_UNISTRING(KaxTagMultiEntityName, 0x5BED, 2, KaxTagEntity, "MultiEntityName");\r
-DEFINE_MKX_STRING (KaxTagMultiEntityURL, 0x5BDB, 2, KaxTagEntity, "MultiEntityURL");\r
-DEFINE_MKX_STRING (KaxTagMultiEntityEmail, 0x5BC1, 2, KaxTagEntity, "MultiEntityEmail");\r
-DEFINE_MKX_UNISTRING(KaxTagMultiEntityAddress, 0x5BDC, 2, KaxTagEntity, "MultiEntityAddress");\r
-\r
-DEFINE_TAG_MASTER (KaxTagMultiIdentifier, 0x4DC6, 2, KaxTag, "MultiIdentifier");\r
-DEFINE_TAG_MASTER (KaxTagIdentifier, 0x4EC6, 2, KaxTagMultiIdentifier, "Identifier");\r
-DEFINE_MKX_UINTEGER (KaxTagMultiIdentifierType, 0x5BAD, 2, KaxTagIdentifier, "MultiIdentifierType");\r
-DEFINE_MKX_BINARY (KaxTagMultiIdentifierBinary, 0x6B67, 2, KaxTagIdentifier, "MultiIdentifierBinary");\r
-DEFINE_MKX_UNISTRING(KaxTagMultiIdentifierString, 0x6B68, 2, KaxTagIdentifier, "MultiIdentifierString");\r
-\r
-DEFINE_TAG_MASTER (KaxTagMultiLegal, 0x4DC5, 2, KaxTag, "MultiLegal");\r
-DEFINE_TAG_MASTER (KaxTagLegal, 0x4EC5, 2, KaxTagMultiLegal, "Legal");\r
-DEFINE_MKX_UINTEGER (KaxTagMultiLegalType, 0x5BBD, 2, KaxTagLegal, "MultiLegalType");\r
-DEFINE_MKX_UNISTRING(KaxTagMultiLegalContent, 0x5BB2, 2, KaxTagLegal, "MultiLegalContent");\r
-DEFINE_MKX_STRING (KaxTagMultiLegalURL, 0x5B34, 2, KaxTagLegal, "MultiLegalURL");\r
-DEFINE_MKX_UNISTRING(KaxTagMultiLegalAddress, 0x5B9B, 2, KaxTagLegal, "MultiLegalAddress");\r
-\r
-DEFINE_TAG_MASTER (KaxTagMultiTitle, 0x4DC4, 2, KaxTag, "MultiTitle");\r
-DEFINE_TAG_MASTER (KaxTagTitle, 0x4EC4, 2, KaxTagMultiTitle, "Title");\r
-DEFINE_MKX_UINTEGER (KaxTagMultiTitleType, 0x5B7D, 2, KaxTagTitle, "MultiTitleType");\r
-DEFINE_MKX_UNISTRING(KaxTagMultiTitleName, 0x5BB9, 2, KaxTagTitle, "MultiTitleName");\r
-DEFINE_MKX_UNISTRING(KaxTagMultiTitleSubTitle, 0x5B5B, 2, KaxTagTitle, "MultiTitleSubTitle");\r
-DEFINE_MKX_UNISTRING(KaxTagMultiTitleEdition, 0x5BAE, 2, KaxTagTitle, "MultiTitleEdition");\r
-DEFINE_MKX_UNISTRING(KaxTagMultiTitleAddress, 0x5B33, 2, KaxTagTitle, "MultiTitleAddress");\r
-DEFINE_MKX_STRING (KaxTagMultiTitleURL, 0x5BA9, 2, KaxTagTitle, "MultiTitleURL");\r
-DEFINE_MKX_STRING (KaxTagMultiTitleEmail, 0x5BC9, 2, KaxTagTitle, "MultiTitleEmail");\r
-DEFINE_MKX_STRING (KaxTagMultiTitleLanguage, 0x22B59E, 3, KaxTagTitle, "MultiTitleLanguage");\r
-\r
-DEFINE_TAG_MASTER (KaxTagMultiAttachment, 0x4DC3, 2, KaxTag, "MultiAttachment");\r
-DEFINE_TAG_MASTER (KaxTagAttachment, 0x4EC3, 2, KaxTagMultiAttachment, "Attachment");\r
-DEFINE_MKX_UINTEGER (KaxTagAttachmentID, 0x5BA0, 2, KaxTagAttachment, "AttachmentID");\r
-\r
-END_LIBMATROSKA_NAMESPACE\r
+/****************************************************************************
+** libmatroska : parse Matroska files, see http://www.matroska.org/
+**
+** <file/class description>
+**
+** 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$
+ \author Jory Stone <jcsston @ toughguy.net>
+ \author Steve Lhomme <robux4 @ users.sf.net>
+*/
+#include "matroska/KaxTagMulti.h"
+#include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
+
+using namespace LIBEBML_NAMESPACE;
+
+START_LIBMATROSKA_NAMESPACE
+
+DEFINE_START_SEMANTIC(KaxTagMultiGlobal)
+// TODO: have the default EBML global semantic as well
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiComment)
+DEFINE_END_SEMANTIC(KaxTagMultiGlobal)
+
+DEFINE_START_SEMANTIC(KaxTagMultiComment)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommentName)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommentComments)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommentLanguage)
+DEFINE_END_SEMANTIC(KaxTagMultiComment)
+
+DEFINE_START_SEMANTIC(KaxTagMultiCommercial)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagCommercial)
+DEFINE_END_SEMANTIC(KaxTagMultiCommercial)
+
+DEFINE_START_SEMANTIC(KaxTagCommercial)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiCommercialType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommercialAddress)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiCommercialURL)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiCommercialEmail)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiPrice)
+DEFINE_END_SEMANTIC(KaxTagCommercial)
+
+DEFINE_START_SEMANTIC(KaxTagMultiPrice)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiPriceCurrency)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiPriceAmount)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiPricePriceDate)
+DEFINE_END_SEMANTIC(KaxTagMultiPrice)
+
+DEFINE_START_SEMANTIC(KaxTagMultiDate)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagDate)
+DEFINE_END_SEMANTIC(KaxTagMultiDate)
+
+DEFINE_START_SEMANTIC(KaxTagDate)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiDateType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiDateDateBegin)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiDateDateEnd)
+DEFINE_END_SEMANTIC(KaxTagDate)
+
+DEFINE_START_SEMANTIC(KaxTagMultiEntity)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagEntity)
+DEFINE_END_SEMANTIC(KaxTagMultiEntity)
+
+DEFINE_START_SEMANTIC(KaxTagEntity)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiEntityType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiEntityName)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiEntityURL)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiEntityEmail)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiEntityAddress)
+DEFINE_END_SEMANTIC(KaxTagEntity)
+
+DEFINE_START_SEMANTIC(KaxTagMultiIdentifier)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagIdentifier)
+DEFINE_END_SEMANTIC(KaxTagMultiIdentifier)
+
+DEFINE_START_SEMANTIC(KaxTagIdentifier)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiIdentifierType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiIdentifierBinary)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiIdentifierString)
+DEFINE_END_SEMANTIC(KaxTagIdentifier)
+
+DEFINE_START_SEMANTIC(KaxTagMultiLegal)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagLegal)
+DEFINE_END_SEMANTIC(KaxTagMultiLegal)
+
+DEFINE_START_SEMANTIC(KaxTagLegal)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiLegalType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiLegalContent)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiLegalURL)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiLegalAddress)
+DEFINE_END_SEMANTIC(KaxTagLegal)
+
+DEFINE_START_SEMANTIC(KaxTagMultiTitle)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagTitle)
+DEFINE_END_SEMANTIC(KaxTagMultiTitle)
+
+DEFINE_START_SEMANTIC(KaxTagTitle)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiTitleType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleName)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleSubTitle)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleEdition)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleAddress)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiTitleURL)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiTitleEmail)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleLanguage)
+DEFINE_END_SEMANTIC(KaxTagTitle)
+
+DEFINE_START_SEMANTIC(KaxTagMultiAttachment)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagAttachment)
+DEFINE_END_SEMANTIC(KaxTagMultiAttachment)
+
+DEFINE_START_SEMANTIC(KaxTagAttachment)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagAttachmentID)
+DEFINE_END_SEMANTIC(KaxTagAttachment)
+
+
+DEFINE_MKX_CONTEXT(KaxTagMultiGlobal);
+
+const EbmlSemanticContext & GetKaxTagsGlobal_Context()
+{
+ return EBML_CLASS_SEMCONTEXT(KaxTagMultiGlobal);
+}
+
+#if defined(HAVE_EBML2)
+#define DEFINE_TAG_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,d,e,EBML_SemanticKaxTagMultiGlobal)
+#else
+#define DEFINE_TAG_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,c,d,e,*GetKaxTagsGlobal_Context)
+#endif
+
+
+DEFINE_MKX_MASTER (KaxTagMultiComment, 0x5B7B, 2, KaxTag, "MultiComment");
+DEFINE_MKX_STRING (KaxTagMultiCommentName, 0x5F7D, 2, KaxTagMultiComment, "MultiCommentName");
+DEFINE_MKX_UNISTRING(KaxTagMultiCommentComments, 0x5F7C, 2, KaxTagMultiComment, "MultiCommentComments");
+DEFINE_MKX_STRING (KaxTagMultiCommentLanguage, 0x22B59D, 3, KaxTagMultiComment, "MultiCommentLanguage");
+
+DEFINE_TAG_MASTER (KaxTagMultiCommercial, 0x4DC7, 2, KaxTag, "MultiCommercial");
+DEFINE_TAG_MASTER (KaxTagCommercial, 0x4EC7, 2, KaxTagMultiCommercial, "Commercial");
+DEFINE_MKX_UINTEGER (KaxTagMultiCommercialType, 0x5BD7, 2, KaxTagCommercial, "MultiCommercialType");
+DEFINE_MKX_UNISTRING(KaxTagMultiCommercialAddress, 0x5BBB, 2, KaxTagCommercial, "MultiCommercialAddress");
+DEFINE_MKX_STRING (KaxTagMultiCommercialURL, 0x5BDA, 2, KaxTagCommercial, "MultiCommercialURL");
+DEFINE_MKX_STRING (KaxTagMultiCommercialEmail, 0x5BC0, 2, KaxTagCommercial, "MultiCommercialEmail");
+DEFINE_TAG_MASTER (KaxTagMultiPrice, 0x5BC3, 2, KaxTagCommercial, "MultiPrice");
+DEFINE_MKX_STRING (KaxTagMultiPriceCurrency, 0x5B6C, 2, KaxTagMultiPrice, "MultiPriceCurrency");
+DEFINE_MKX_FLOAT (KaxTagMultiPriceAmount, 0x5B6E, 2, KaxTagMultiPrice, "MultiPriceAmount");
+DEFINE_MKX_DATE (KaxTagMultiPricePriceDate, 0x5B6F, 2, KaxTagMultiPrice, "MultiPricePriceDate");
+
+DEFINE_TAG_MASTER (KaxTagMultiDate, 0x4DC8, 2, KaxTag, "MultiDate");
+DEFINE_TAG_MASTER (KaxTagDate, 0x4EC8, 2, KaxTagMultiDate, "Date");
+DEFINE_MKX_UINTEGER (KaxTagMultiDateType, 0x5BD8, 2, KaxTagDate, "MultiDateType");
+DEFINE_MKX_DATE (KaxTagMultiDateDateBegin, 0x4460, 2, KaxTagDate, "MultiDateDateBegin");
+DEFINE_MKX_DATE (KaxTagMultiDateDateEnd, 0x4462, 2, KaxTagDate, "MultiDateDateEnd");
+
+DEFINE_TAG_MASTER (KaxTagMultiEntity, 0x4DC9, 2, KaxTag, "MultiEntity");
+DEFINE_TAG_MASTER (KaxTagEntity, 0x4EC9, 2, KaxTagMultiEntity, "Entity");
+DEFINE_MKX_UINTEGER (KaxTagMultiEntityType, 0x5BD9, 2, KaxTagEntity, "MultiEntityType");
+DEFINE_MKX_UNISTRING(KaxTagMultiEntityName, 0x5BED, 2, KaxTagEntity, "MultiEntityName");
+DEFINE_MKX_STRING (KaxTagMultiEntityURL, 0x5BDB, 2, KaxTagEntity, "MultiEntityURL");
+DEFINE_MKX_STRING (KaxTagMultiEntityEmail, 0x5BC1, 2, KaxTagEntity, "MultiEntityEmail");
+DEFINE_MKX_UNISTRING(KaxTagMultiEntityAddress, 0x5BDC, 2, KaxTagEntity, "MultiEntityAddress");
+
+DEFINE_TAG_MASTER (KaxTagMultiIdentifier, 0x4DC6, 2, KaxTag, "MultiIdentifier");
+DEFINE_TAG_MASTER (KaxTagIdentifier, 0x4EC6, 2, KaxTagMultiIdentifier, "Identifier");
+DEFINE_MKX_UINTEGER (KaxTagMultiIdentifierType, 0x5BAD, 2, KaxTagIdentifier, "MultiIdentifierType");
+DEFINE_MKX_BINARY (KaxTagMultiIdentifierBinary, 0x6B67, 2, KaxTagIdentifier, "MultiIdentifierBinary");
+DEFINE_MKX_UNISTRING(KaxTagMultiIdentifierString, 0x6B68, 2, KaxTagIdentifier, "MultiIdentifierString");
+
+DEFINE_TAG_MASTER (KaxTagMultiLegal, 0x4DC5, 2, KaxTag, "MultiLegal");
+DEFINE_TAG_MASTER (KaxTagLegal, 0x4EC5, 2, KaxTagMultiLegal, "Legal");
+DEFINE_MKX_UINTEGER (KaxTagMultiLegalType, 0x5BBD, 2, KaxTagLegal, "MultiLegalType");
+DEFINE_MKX_UNISTRING(KaxTagMultiLegalContent, 0x5BB2, 2, KaxTagLegal, "MultiLegalContent");
+DEFINE_MKX_STRING (KaxTagMultiLegalURL, 0x5B34, 2, KaxTagLegal, "MultiLegalURL");
+DEFINE_MKX_UNISTRING(KaxTagMultiLegalAddress, 0x5B9B, 2, KaxTagLegal, "MultiLegalAddress");
+
+DEFINE_TAG_MASTER (KaxTagMultiTitle, 0x4DC4, 2, KaxTag, "MultiTitle");
+DEFINE_TAG_MASTER (KaxTagTitle, 0x4EC4, 2, KaxTagMultiTitle, "Title");
+DEFINE_MKX_UINTEGER (KaxTagMultiTitleType, 0x5B7D, 2, KaxTagTitle, "MultiTitleType");
+DEFINE_MKX_UNISTRING(KaxTagMultiTitleName, 0x5BB9, 2, KaxTagTitle, "MultiTitleName");
+DEFINE_MKX_UNISTRING(KaxTagMultiTitleSubTitle, 0x5B5B, 2, KaxTagTitle, "MultiTitleSubTitle");
+DEFINE_MKX_UNISTRING(KaxTagMultiTitleEdition, 0x5BAE, 2, KaxTagTitle, "MultiTitleEdition");
+DEFINE_MKX_UNISTRING(KaxTagMultiTitleAddress, 0x5B33, 2, KaxTagTitle, "MultiTitleAddress");
+DEFINE_MKX_STRING (KaxTagMultiTitleURL, 0x5BA9, 2, KaxTagTitle, "MultiTitleURL");
+DEFINE_MKX_STRING (KaxTagMultiTitleEmail, 0x5BC9, 2, KaxTagTitle, "MultiTitleEmail");
+DEFINE_MKX_STRING (KaxTagMultiTitleLanguage, 0x22B59E, 3, KaxTagTitle, "MultiTitleLanguage");
+
+DEFINE_TAG_MASTER (KaxTagMultiAttachment, 0x4DC3, 2, KaxTag, "MultiAttachment");
+DEFINE_TAG_MASTER (KaxTagAttachment, 0x4EC3, 2, KaxTagMultiAttachment, "Attachment");
+DEFINE_MKX_UINTEGER (KaxTagAttachmentID, 0x5BA0, 2, KaxTagAttachment, "AttachmentID");
+
+END_LIBMATROSKA_NAMESPACE