pre-release commit
authorjhurst <jhurst@cinecert.com>
Tue, 20 Dec 2005 19:16:21 +0000 (19:16 +0000)
committerjhurst <>
Tue, 20 Dec 2005 19:16:21 +0000 (19:16 +0000)
18 files changed:
Identifier.h
Index.h
Mutex.h
README
src/AS_DCP.h
src/AS_DCP_MXF.cpp
src/Index.cpp
src/KLV.cpp
src/KLV.h
src/MDD.h
src/MXF.cpp
src/MXF.h
src/MXFTypes.cpp
src/MXFTypes.h
src/Metadata.h
src/asdcp-test.cpp
src/j2c-test.cpp
src/klvwalk.cpp

index be93639a1dc5bbfb5bd67dc43bd27ada7e151df7..ddfaa41636f64739beecbf98b22a1c4e7b6dd011 100755 (executable)
@@ -1,6 +1,33 @@
-//
-// Identifier.h
-//
+/*
+Copyright (c) 2005-2006, John Hurst
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*! \file    Identifier.h
+    \version $Id$
+    \brief   strings of bytes that identify things
+*/
 
 #ifndef _IDENTIFIER_H_
 #define _IDENTIFIER_H_
diff --git a/Index.h b/Index.h
index 8ac251182473433f1de01cafb03a3ed97342178f..298899b1a23d020d268095c67ed9a4009bd0e105 100755 (executable)
--- a/Index.h
+++ b/Index.h
@@ -1,6 +1,33 @@
-//
-//
-//
+/*
+Copyright (c) 2005-2006, John Hurst
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*! \file    Index.h
+    \version $Id$
+    \brief   MXF index segment objects
+*/
 
 #ifndef _INDEX_H_
 #define _INDEX_H_
diff --git a/Mutex.h b/Mutex.h
index f918f711878d80731d6e7dc62cae5c66691b68a2..fdd1e8180ef235863e93daf1ca548a1edd13c2c2 100755 (executable)
--- a/Mutex.h
+++ b/Mutex.h
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2005, John Hurst
+Copyright (c) 2005-2006, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff --git a/README b/README
index bae2f52b5c9cf4cc0a1047e40f005ea5e068274e..9646440b813d8cbac350537c488e8221c8a4cfab 100755 (executable)
--- a/README
+++ b/README
@@ -6,8 +6,9 @@ simplified access to files conforming to the sound and
 picture track file formats proposed by the SMPTE working
 group DC-28.20.
 
-This work was funded by Digital Cinema Initiatives, LLC
-and others.
+This work was originally funded by Digital Cinema
+Initiatives, LLC. Subsequent efforts have been funded by
+Deluxe Laboratories, Doremi Labs, and others.
 
 **The asdcplib project is housed on SourceForge. The project
 home page is at http://sourceforge.net/projects/asdcplib.
@@ -17,14 +18,11 @@ Feel free to email with questions or to request a tar file.
 
 The project used to depend upon the mxflib project. Because
 of the focus on covering the whole of the MXF spscifications,
-mxflib is considerably larger and more complex that what we
-require for this application. For this reason we have forked
-mxflib and have simplified its implementation to better suit
-our application. Thanks to Matt Beard and Oliver Morgan for
-their great work and support.
-
-OpenSSL is also required if you want to read and write
-encrypted AS-DCP files. See http://www.openssl.org
+mxflib is considerably larger and more complex that what I
+require for this application. For this reason I have created
+a dedicated MXF interface that is now part of this library.
+Special thanks to Matt Beard and Oliver Morgan for their great
+work and support.
 
 Thanks also to the members of the SMPTE DC-28.20 packaging
 ad-hoc group and the members of the MXF Interop Initiative
@@ -65,13 +63,17 @@ Build Instructions
 GNU make is required to build asdcplib. The makefile will
 work on win32 systems that have Cygwin. Other win32 gmake
 packages may or may not work depending upon the availability
-of standard POSIX shell commands.
+of standard POSIX shell commands. You will need gcc to rebuild
+the dep.make file.
+
+OpenSSL is required if you want to read and write encrypted
+AS-DCP files. See http://www.openssl.org
 
-If you are building on win32 or a unix with no OpenSSL
-library support, you will have to also obtain and build
-OpenSSL (I'm using 0.9.7d).  Unpack it into the same
-parent directory as asdcplib/, and rename the directory
-as (or make a sym link named) 'openssl':
+If you are building on win32 or a unix with no OpenSSL library
+support, you will have to also obtain and build OpenSSL (I'm
+using 0.9.7d on win32).  Unpack it into the same parent directory
+as asdcplib/, and rename the directory as (or make a sym link
+named) 'openssl':
 
 myhost$ ls -l
 total 1761
@@ -116,6 +118,13 @@ examples. More detailed documentation will be written RSN.
 
 
 Change History
+2005.00.00 - A New Hope
+ o The temporary mxf-lite has been removed. MXF files are now 
+   managed via the objects in KLV.h, MXFTypes.h MXF.h and
+   Metadata.h. This release does not support writing MXF files.
+ o Fixed a header interpretation error in the Wav parser.
+
+
 2005.00.00 - The Reformation
  o Removed mxflib as a dependency by forking the necessary
    functions and placing them in the mxf-lite subdirectory.
index 06ff8b9931164c165acc93b2f3dbd20a77a2c80e..d76c70207ae9e8ef2d5323c14c2df70cdd087e02 100755 (executable)
@@ -143,7 +143,7 @@ namespace ASDCP {
   // 1.0.1. If changes were also required in AS_DCP.h, the new version would be 1.1.1.
   const ui32_t VERSION_MAJOR = 1;
   const ui32_t VERSION_APIMINOR = 0;
-  const ui32_t VERSION_IMPMINOR = 3;
+  const ui32_t VERSION_IMPMINOR = 4;
   const char* Version();
 
   // UUIDs are passed around as strings of UUIDlen bytes
index a7cb1e3a3be2addc238e195595e27e272add8409..03b9b5470365c8cabf3b68f94a6f8e3b6e4cc329 100755 (executable)
@@ -41,39 +41,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 // misc subroutines
 
 
-// helper class for XXX below
-//
-class PathSplitter
-{
-public:
-  char* Root;
-  char* SubPath;
-
-  PathSplitter(const std::string Str)
-  {
-    Root = strdup(Str.c_str());
-    assert(Root);
-
-    // sub-path exists?
-    SubPath = strchr(Root, OBJECT_PATH_SEPARATOR);
-
-    if ( SubPath )
-      {
-       while ( SubPath[1] == OBJECT_PATH_SEPARATOR )
-         SubPath++;
-
-       *SubPath++ = 0;
-
-       if ( *SubPath == 0 )
-         SubPath = 0;
-      }
-  }
-
-  ~PathSplitter() {
-    free(Root);
-  }
-};
-
 //
 void
 ASDCP::WriterInfoDump(const WriterInfo& Info, FILE* stream)
index 9d1791ad68944074b23baacc753a78b531ea5e6d..96c81ed4c7dbbd2da94758cdad61ff5f9dccf97f 100755 (executable)
@@ -1,6 +1,33 @@
-//
-// Index.cpp
-//
+/*
+Copyright (c) 2005-2006, John Hurst
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*! \file    Index.cpp
+    \version $Id$
+    \brief   MXF index segment objects
+*/
 
 #include "MDD.h"
 #include "MXF.h"
@@ -108,7 +135,16 @@ ASDCP::MXF::IndexTableSegment::Dump(FILE* stream)
   fprintf(stream, "  PosTableCount      = %hu\n", PosTableCount);
 
   fprintf(stream, "  DeltaEntryArray:\n");  DeltaEntryArray.Dump(stream);
-  fprintf(stream, "  IndexEntryArray:\n");  IndexEntryArray.Dump(stream);
+
+  if ( IndexEntryArray.size() < 100 )
+    {
+      fprintf(stream, "  IndexEntryArray:\n");
+      IndexEntryArray.Dump(stream);
+    }
+  else
+    {
+      fprintf(stream, "  IndexEntryArray: %lu entries\n", IndexEntryArray.size());
+    }
 
   fputs("==========================================================================\n", stream);
 }
index b57e805eab8ae8eb0c04d32058741ca88af48c82..062fd74450fa3f23ad5c0bd359651bae9d000995 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2005, John Hurst
+Copyright (c) 2005-2006, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -24,10 +24,10 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
-
-//
-// KLV.cpp
-//
+/*! \file    KLV.cpp
+  \version $Id$
+  \brief   KLV objects
+*/
 
 #include "KLV.h"
 #include <hex_utils.h>
index 587bbe8315a79b3c465ddd8964b82a5d985e6535..d940ff354013b486f6dc0bd274805c827c0bbddb 100755 (executable)
--- a/src/KLV.h
+++ b/src/KLV.h
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2005, John Hurst
+Copyright (c) 2005-2006, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,10 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
-
+/*! \file    KLV.h
+  \version $Id$
+  \brief   KLV objects
+*/
 
 #ifndef _KLV_H_
 #define _KLV_H_
index 493e30d983f4095b9632c01874638a497366d7db..bcf0a989a561d166823c24a460becbcce393294a 100755 (executable)
--- a/src/MDD.h
+++ b/src/MDD.h
@@ -1,6 +1,33 @@
-//
-// MDD.h
-//
+/*
+Copyright (c) 2005-2006, John Hurst
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*! \file    MDD.h
+    \version $Id$
+    \brief   MXF constants
+*/
 
 #ifndef _MDD_H_
 #define _MDD_H_
index 45570bb07bdb0efbc01e30b03a188acc15dd724e..a04cfe24335498d5a3558a0b733979efbfb8a4d8 100755 (executable)
@@ -31,7 +31,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #define ASDCP_DECLARE_MDD
 #include "MDD.h"
-
+#include "Mutex.h"
 #include "MXF.h"
 #include "Metadata.h"
 #include <hex_utils.h>
@@ -673,6 +673,7 @@ ASDCP::MXF::OPAtomHeader::GetMDObjectByType(const byte_t* ObjectID, InterchangeO
   return m_PacketList->GetMDObjectByType(ObjectID, Object);
 }
 
+//
 ASDCP::MXF::Identification*
 ASDCP::MXF::OPAtomHeader::GetIdentification()
 {
@@ -684,6 +685,18 @@ ASDCP::MXF::OPAtomHeader::GetIdentification()
   return 0;
 }
 
+//
+ASDCP::MXF::SourcePackage*
+ASDCP::MXF::OPAtomHeader::GetSourcePackage()
+{
+  InterchangeObject* Object;
+
+  if ( ASDCP_SUCCESS(GetMDObjectByType(OBJ_TYPE_ARGS(SourcePackage), &Object)) )
+    return (SourcePackage*)Object;
+
+  return 0;
+}
+
 //
 ASDCP::Result_t
 ASDCP::MXF::OPAtomHeader::WriteToFile(ASDCP::FileWriter& Writer, ui32_t HeaderSize)
@@ -974,10 +987,37 @@ enum FLT_t
   };
 
 //
-typedef std::map<ASDCP::UL, FLT_t> FactoryList;
-#define SETUP_IDX(t) const ui32_t FLT_##t = v;
+typedef std::map<ASDCP::UL, FLT_t>::iterator FLi_t;
+
+class FactoryList : public std::map<ASDCP::UL, FLT_t>
+{
+  ASDCP::Mutex m_Lock;
 
+public:
+  FactoryList() {}
+  ~FactoryList() {}
+
+  bool Empty() {
+    ASDCP::AutoMutex BlockLock(m_Lock);
+    return empty();
+  }
+
+  FLi_t Find(const byte_t* label) {
+    ASDCP::AutoMutex BlockLock(m_Lock);
+    return find(label);
+  }
+
+  FLi_t End() {
+    ASDCP::AutoMutex BlockLock(m_Lock);
+    return end();
+  }
+
+};
+
+//
 static FactoryList s_FactoryList;
+
+#define SETUP_IDX(t) const ui32_t FLT_##t = v;
 #define SETUP_FACTORY(t) s_FactoryList.insert(FactoryList::value_type(s_MDD_Table[MDDindex_##t].ul, FLT_##t));
 #define CASE_FACTORY(t)  case FLT_##t: return new t
 
@@ -1010,7 +1050,7 @@ ASDCP::MXF::CreateObject(const byte_t* label)
       SETUP_FACTORY(CryptographicContext);
     }
 
-  FactoryList::iterator i = s_FactoryList.find(label);
+  FLi_t i = s_FactoryList.find(label);
 
   if ( i == s_FactoryList.end() )
     return new InterchangeObject;
index fc0d9962430efc517a9454be2252e7fee33efc5d..caaecaed236b307b3dd639b948197a8ff06e235b 100755 (executable)
--- a/src/MXF.h
+++ b/src/MXF.h
@@ -1,6 +1,33 @@
-//
-//
-//
+/*
+Copyright (c) 2005-2006, John Hurst
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*! \file    MXF.h
+    \version $Id$
+    \brief   MXF objects
+*/
 
 #ifndef _MXF_H_
 #define _MXF_H_
@@ -254,6 +281,7 @@ namespace ASDCP
       //
       class h__PacketList; // See MXF.cpp
       class Identification;
+      class SourcePackage;
 
       //
       class OPAtomHeader : public Partition
@@ -274,7 +302,8 @@ namespace ASDCP
          virtual Result_t WriteToFile(ASDCP::FileWriter& Writer, ui32_t HeaderLength = 16384);
          virtual void     Dump(FILE* = 0);
          virtual Result_t GetMDObjectByType(const byte_t*, InterchangeObject** = 0);
-         Identification* GetIdentification();
+         Identification*  GetIdentification();
+         SourcePackage*   GetSourcePackage();
        };
 
       //
index ca65bdf718398caefb58f02612d50593c36e579b..2a8949e44f1dda51ca4875f0c1ac99b3d32d2c9e 100755 (executable)
@@ -1,3 +1,33 @@
+/*
+Copyright (c) 2005-2006, John Hurst
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*! \file    MXFTypes.cpp
+    \version $Id$
+    \brief   MXF objects
+*/
 
 #include "MXFTypes.h"
 
@@ -96,8 +126,8 @@ ASDCP::MXF::TLVReader::FindTL(const MDDEntry& Entry)
     {
       if ( Entry.tag.a == 0 )
        {
-         DefaultLogSink().Error("No such UL in this TL list: %s (%02x %02x)\n",
-                                Entry.name, Entry.tag.a, Entry.tag.b);
+         DefaultLogSink().Info("No such UL in this TL list: %s (%02x %02x)\n",
+                               Entry.name, Entry.tag.a, Entry.tag.b);
          return false;
        }
 
@@ -113,7 +143,7 @@ ASDCP::MXF::TLVReader::FindTL(const MDDEntry& Entry)
       return true;
     }
 
-  //  DefaultLogSink().Warn("Not Found (%02x %02x): %s\n", TmpTag.a, TmpTag.b, Entry.name);
+  DefaultLogSink().Info("Not Found (%02x %02x): %s\n", TmpTag.a, TmpTag.b, Entry.name);
   return false;
 }
 
index 02efbb1e54e2dc7fb63088040c1dd9fe4f429402..46675885dfa05997d82f179c54fc90256daccd0e 100755 (executable)
@@ -1,14 +1,37 @@
-//
-// MXFTypes.h
-//
+/*
+Copyright (c) 2005-2006, John Hurst
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*! \file    MXFTypes.h
+    \version $Id$
+    \brief   MXF objects
+*/
 
 #ifndef _MXFTYPES_H_
 #define _MXFTYPES_H_
 
-
-
-#endif //_MXFTYPES_H_
-
 #include "KLV.h"
 #include <list>
 #include <vector>
@@ -280,6 +303,8 @@ namespace ASDCP
 } // namespace ASDCP
 
 
+#endif //_MXFTYPES_H_
+
 //
 // end MXFTypes.h
 //
index 0a04790bbeae129ed477df0ae975afffb5c148fd..deb1abd7804be042a35dbe3874d9a58a52fbc349 100755 (executable)
@@ -1,7 +1,33 @@
-//
-//
-// TODO: constructor initializers for all member variables
-//
+/*
+Copyright (c) 2005-2006, John Hurst
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*! \file    Metadata.h
+    \version $Id$
+    \brief   MXF metadata objects
+*/
 
 #ifndef _METADATA_H_
 #define _METADATA_H_
index c034626894500053a2a512eec0b3c3b9e7195d97..12d8feb19be1224f7c794c9a4617f2eed4007899 100755 (executable)
@@ -1100,7 +1100,7 @@ class MyVideoDescriptor : public MPEG2::VideoDescriptor
     MPEG2::VideoDescriptorDump(*this, stream);
   }
 };
-#if 0
+
 class MyPictureDescriptor : public JP2K::PictureDescriptor
 {
  public:
@@ -1124,7 +1124,7 @@ class MyAudioDescriptor : public PCM::AudioDescriptor
     PCM::AudioDescriptorDump(*this, stream);
   }
 };
-#endif
+
 
 // MSVC didn't like the function template, so now it's a static class method
 template<class ReaderT, class DescriptorT>
@@ -1181,7 +1181,6 @@ show_file_info(CommandOptions& Options)
       fputs("File essence type is MPEG2 video.\n", stdout);
       FileInfoWrapper<ASDCP::MPEG2::MXFReader, MyVideoDescriptor>::file_info(Options);
     }
-#if 0
   else if ( EssenceType == ESS_PCM_24b_48k )
     {
       fputs("File essence type is PCM audio.\n", stdout);
@@ -1192,7 +1191,6 @@ show_file_info(CommandOptions& Options)
       fputs("File essence type is JPEG 2000 pictures.\n", stdout);
       FileInfoWrapper<ASDCP::JP2K::MXFReader, MyPictureDescriptor>::file_info(Options);
     }
-#endif
   else
     {
       fprintf(stderr, "File is not AS-DCP: %s\n", Options.filenames[0]);
@@ -1206,17 +1204,17 @@ show_file_info(CommandOptions& Options)
 
       if ( ASDCP_SUCCESS(result) )
        {
+         TestHeader.Partition::Dump();
+
          if ( MXF::Identification* ID = TestHeader.GetIdentification() )
-           {
-             TestHeader.Dump();
-             ID->Dump();
-             // show OP
-             // show 
-           }
+           ID->Dump();
          else
-           {
-             fputs("File contains no Identification object.\n", stdout);
-           }
+           fputs("File contains no Identification object.\n", stdout);
+
+         if ( MXF::SourcePackage* SP = TestHeader.GetSourcePackage() )
+           SP->Dump();
+         else
+           fputs("File contains no SourcePackage object.\n", stdout);
        }
       else
        {
@@ -1307,6 +1305,9 @@ main(int argc, const char** argv)
     }
   else if ( Options.create_flag )
     {
+      fprintf(stderr, "ATTENTION! This version of asdcplib does not support writing MXF files.\n");
+
+#if 0
       if ( Options.do_repeat && ! Options.duration_flag )
        {
          fputs("Option -R requires -d <duration>\n", stderr);
@@ -1318,7 +1319,6 @@ main(int argc, const char** argv)
 #ifdef SMPTE_LABELS
       fprintf(stderr, "ATTENTION! Writing SMPTE Universal Labels\n");
 #endif
-#if 0
       if ( ASDCP_SUCCESS(result) )
        {
          switch ( EssenceType )
index 98c7cf46cdf56055543660f4d9202510f0382c7a..cfced0c0237d1cc302bec783b232a68c5ac148ab 100755 (executable)
@@ -1,3 +1,33 @@
+/*
+Copyright (c) 2005-2006, John Hurst
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*! \file    jp2k-test.cpp
+    \version $Id$
+    \brief   JP2K parser test
+*/
 
 #include <AS_DCP.h>
 #include <FileIO.h>
index 3704f10f8e42b479fad033052af91d22125d8cbd..96d31e49bdcf6076dd34131699057714e8661238 100755 (executable)
@@ -1,6 +1,33 @@
-//
-// klvwalk.cpp
-//
+/*
+Copyright (c) 2005-2006, John Hurst
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*! \file    klvwalk.cpp
+    \version $Id$
+    \brief   KLV+MXF test
+*/
 
 #include <AS_DCP.h>
 #include <MXF.h>