]> granicus.if.org Git - libmatroska/commitdiff
libmatroska: add KaxTrackDependency and related elements for combined stereo/3D tracks
authorSteve Lhomme <slhomme@matroska.org>
Sat, 7 Aug 2010 09:42:47 +0000 (09:42 +0000)
committerSteve Lhomme <slhomme@matroska.org>
Sat, 7 Aug 2010 09:42:47 +0000 (09:42 +0000)
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libmatroska@480 a6f86f6d-0131-4f8e-9e7b-e335508773d5

ChangeLog
matroska/KaxTracks.h
src/KaxTracks.cpp

index 0a0464830c53965902331d99ceb675cd2f6c0f7d..8f6652ccf6228c9c7b65d1e7fd3c14bb40da35f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
-2010-07-xx robux4
+2010-08-xx robux4
 New 1.1.0 version:
     - give access to the SetParent to KaxSimpleBlock as well
     - change the placement of a MATROSKA_DLL_API so that it actually works
     - remove all references to the old/outdated/previous tag system
     - add the possibility for a DataBuffer class to use its own internal memory
     - KaxCues::AddBlockGroup() was removed as it's broken beyond repair
+    - add KaxTrackDependency and related elements for combined stereo/3D tracks
 
 2010-06-04 robux4/mosu
 New 1.0.0 version:
index 600009940c0fa7b5db49ebbbff6ba877ad896528..a7a4b8f27f055dc0f2e18942dee04a3e0ccabca9 100644 (file)
@@ -1,81 +1,98 @@
-/****************************************************************************\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: KaxTracks.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $\r
-       \author Steve Lhomme     <robux4 @ users.sf.net>\r
-*/\r
-#ifndef LIBMATROSKA_TRACKS_H\r
-#define LIBMATROSKA_TRACKS_H\r
-\r
-#include "matroska/KaxTypes.h"\r
-#include "ebml/EbmlMaster.h"\r
-#include "ebml/EbmlUInteger.h"\r
-#include "matroska/KaxTrackEntryData.h"\r
-#include "matroska/KaxDefines.h"\r
-\r
-using namespace LIBEBML_NAMESPACE;\r
-\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-DECLARE_MKX_MASTER(KaxTracks)\r
-};\r
-\r
-DECLARE_MKX_MASTER(KaxTrackEntry)\r
-       public:\r
-               EbmlUInteger & TrackNumber() const { return *(static_cast<EbmlUInteger *>(FindElt(EBML_INFO(KaxTrackNumber)))); }\r
-\r
-               void EnableLacing(bool bEnable = true);\r
-\r
-               /*!\r
-                       \note lacing set by default\r
-               */\r
-               inline bool LacingEnabled() const {\r
-                       KaxTrackFlagLacing * myLacing = static_cast<KaxTrackFlagLacing *>(FindFirstElt(EBML_INFO(KaxTrackFlagLacing)));\r
-                       return((myLacing == NULL) || (uint8(*myLacing) != 0));\r
-               }\r
-\r
-               void SetGlobalTimecodeScale(uint64 aGlobalTimecodeScale) {\r
-                       mGlobalTimecodeScale = aGlobalTimecodeScale;\r
-                       bGlobalTimecodeScaleIsSet = true;\r
-               }\r
-               uint64 GlobalTimecodeScale() const {\r
-                       assert(bGlobalTimecodeScaleIsSet); \r
-                       return mGlobalTimecodeScale;\r
-               }\r
-\r
-       protected:\r
-               bool   bGlobalTimecodeScaleIsSet;\r
-               uint64 mGlobalTimecodeScale;\r
-};\r
-\r
-END_LIBMATROSKA_NAMESPACE\r
-\r
-#endif // LIBMATROSKA_TRACKS_H\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: KaxTracks.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $
+       \author Steve Lhomme     <robux4 @ users.sf.net>
+*/
+#ifndef LIBMATROSKA_TRACKS_H
+#define LIBMATROSKA_TRACKS_H
+
+#include "matroska/KaxTypes.h"
+#include "ebml/EbmlMaster.h"
+#include "ebml/EbmlUInteger.h"
+#include "matroska/KaxTrackEntryData.h"
+#include "matroska/KaxDefines.h"
+
+using namespace LIBEBML_NAMESPACE;
+
+START_LIBMATROSKA_NAMESPACE
+
+DECLARE_MKX_MASTER(KaxTracks)
+};
+
+DECLARE_MKX_MASTER(KaxTrackEntry)
+       public:
+               EbmlUInteger & TrackNumber() const { return *(static_cast<EbmlUInteger *>(FindElt(EBML_INFO(KaxTrackNumber)))); }
+
+               void EnableLacing(bool bEnable = true);
+
+               /*!
+                       \note lacing set by default
+               */
+               inline bool LacingEnabled() const {
+                       KaxTrackFlagLacing * myLacing = static_cast<KaxTrackFlagLacing *>(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;
+};
+
+#if MATROSKA_VERSION >= 2
+DECLARE_MKX_MASTER(KaxTrackDependency)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackDependencyType)
+};
+
+DECLARE_MKX_MASTER(KaxTrackDependencyItem)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackDependencyUID)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackDependencyStereoPos)
+};
+#endif
+
+END_LIBMATROSKA_NAMESPACE
+
+#endif // LIBMATROSKA_TRACKS_H
index dd549ad67131213a3d04a59217bb7bf881cabc3e..81b77d5b8107d844d72fda38fb98fb21c59b009a 100644 (file)
-/****************************************************************************\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: KaxTracks.cpp 1202 2005-08-30 14:39:01Z robux4 $\r
-       \author Steve Lhomme     <robux4 @ users.sf.net>\r
-*/\r
-#include "matroska/KaxTracks.h"\r
-\r
-// sub elements\r
-#include "matroska/KaxTrackEntryData.h"\r
-#include "matroska/KaxTrackAudio.h"\r
-#include "matroska/KaxTrackVideo.h"\r
-#include "matroska/KaxContentEncoding.h"\r
-#include "matroska/KaxContexts.h"\r
-#include "matroska/KaxDefines.h"\r
-\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-DEFINE_START_SEMANTIC(KaxTracks)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxTrackEntry)\r
-DEFINE_END_SEMANTIC(KaxTracks)\r
-\r
-DEFINE_START_SEMANTIC(KaxTrackEntry)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackNumber)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackUID)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackType)\r
-#if MATROSKA_VERSION >= 2\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagEnabled)\r
-#endif // MATROSKA_VERSION\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagDefault)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagForced)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagLacing)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackMinCache)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackMaxCache)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackDefaultDuration)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackTimecodeScale)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxMaxBlockAdditionID)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackName)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackLanguage)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxCodecID)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxCodecPrivate)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxCodecName)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackAttachmentLink)\r
-#if MATROSKA_VERSION >= 2\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxCodecSettings)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxCodecInfoURL)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxCodecDownloadURL)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxCodecDecodeAll)\r
-#endif // MATROSKA_VERSION\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTrackOverlay)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTrackTranslate)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackAudio)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackVideo)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncodings)\r
-DEFINE_END_SEMANTIC(KaxTrackEntry)\r
-\r
-DEFINE_MKX_MASTER     (KaxTracks, 0x1654AE6B, 4, KaxSegment, "Tracks");\r
-DEFINE_MKX_MASTER_CONS(KaxTrackEntry,   0xAE, 1, KaxTracks, "TrackEntry");\r
-\r
-KaxTrackEntry::KaxTrackEntry(EBML_EXTRA_DEF)\r
-       :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxTrackEntry) EBML_DEF_SEP EBML_EXTRA_CALL)\r
-       ,bGlobalTimecodeScaleIsSet(false)\r
-{}\r
-\r
-void KaxTrackEntry::EnableLacing(bool bEnable)\r
-{\r
-       KaxTrackFlagLacing & myLacing = GetChild<KaxTrackFlagLacing>(*this);\r
-       *(static_cast<EbmlUInteger *>(&myLacing)) = bEnable ? 1 : 0;\r
-}\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: KaxTracks.cpp 1202 2005-08-30 14:39:01Z robux4 $
+       \author Steve Lhomme     <robux4 @ users.sf.net>
+*/
+#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"
+#include "matroska/KaxDefines.h"
+
+START_LIBMATROSKA_NAMESPACE
+
+DEFINE_START_SEMANTIC(KaxTracks)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTrackEntry)
+#if MATROSKA_VERSION >= 2
+DEFINE_SEMANTIC_ITEM(false, false, KaxTrackDependency)
+#endif
+DEFINE_END_SEMANTIC(KaxTracks)
+
+DEFINE_START_SEMANTIC(KaxTrackEntry)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackNumber)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackUID)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackType)
+#if MATROSKA_VERSION >= 2
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagEnabled)
+#endif // MATROSKA_VERSION
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagDefault)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagForced)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagLacing)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackMinCache)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackMaxCache)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackDefaultDuration)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackTimecodeScale)
+DEFINE_SEMANTIC_ITEM(true, true, KaxMaxBlockAdditionID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackName)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackLanguage)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCodecID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxCodecPrivate)
+DEFINE_SEMANTIC_ITEM(false, true, KaxCodecName)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackAttachmentLink)
+#if MATROSKA_VERSION >= 2
+DEFINE_SEMANTIC_ITEM(false, true, KaxCodecSettings)
+DEFINE_SEMANTIC_ITEM(false, false, KaxCodecInfoURL)
+DEFINE_SEMANTIC_ITEM(false, false, KaxCodecDownloadURL)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCodecDecodeAll)
+#endif // MATROSKA_VERSION
+DEFINE_SEMANTIC_ITEM(false, false, KaxTrackOverlay)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTrackTranslate)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackAudio)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackVideo)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncodings)
+DEFINE_END_SEMANTIC(KaxTrackEntry)
+
+DEFINE_MKX_MASTER     (KaxTracks, 0x1654AE6B, 4, KaxSegment, "Tracks");
+DEFINE_MKX_MASTER_CONS(KaxTrackEntry,   0xAE, 1, KaxTracks, "TrackEntry");
+
+#if MATROSKA_VERSION >= 2
+DEFINE_START_SEMANTIC(KaxTrackDependency)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackDependencyType)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTrackDependencyItem)
+DEFINE_END_SEMANTIC(KaxTrackDependency)
+
+DEFINE_START_SEMANTIC(KaxTrackDependencyItem)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackDependencyUID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackDependencyStereoPos)
+DEFINE_END_SEMANTIC(KaxTrackDependencyItem)
+
+DEFINE_MKX_MASTER  (KaxTrackDependency,          0xE2, 1, KaxTracks, "TrackDependency");
+DEFINE_MKX_UINTEGER(KaxTrackDependencyType,      0xE3, 1, KaxTrackDependency, "TrackDependencyType");
+DEFINE_MKX_MASTER  (KaxTrackDependencyItem,      0xE4, 1, KaxTrackDependency, "TrackDependencyItem");
+DEFINE_MKX_UINTEGER(KaxTrackDependencyUID,       0xE5, 1, KaxTrackDependencyItem, "TrackDependencyUID");
+DEFINE_MKX_UINTEGER(KaxTrackDependencyStereoPos, 0xE9, 1, KaxTrackDependencyItem, "TrackDependencyStereoPos");
+#endif
+
+KaxTrackEntry::KaxTrackEntry(EBML_EXTRA_DEF)
+       :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxTrackEntry) EBML_DEF_SEP EBML_EXTRA_CALL)
+       ,bGlobalTimecodeScaleIsSet(false)
+{}
+
+void KaxTrackEntry::EnableLacing(bool bEnable)
+{
+       KaxTrackFlagLacing & myLacing = GetChild<KaxTrackFlagLacing>(*this);
+       *(static_cast<EbmlUInteger *>(&myLacing)) = bEnable ? 1 : 0;
+}
+
+END_LIBMATROSKA_NAMESPACE