the story so far
authorjhurst <jhurst@cinecert.com>
Fri, 13 May 2011 01:50:36 +0000 (01:50 +0000)
committerjhurst <>
Fri, 13 May 2011 01:50:36 +0000 (01:50 +0000)
12 files changed:
README
src/AS_DCP_JP2K.cpp
src/AS_DCP_MPEG2.cpp
src/AS_DCP_PCM.cpp
src/AS_DCP_TimedText.cpp
src/JP2K_Sequence_Parser.cpp
src/KLV.h
src/KM_util.cpp
src/MDD.cpp
src/MXFTypes.cpp
src/Makefile.am
src/PCM_Parser.cpp

diff --git a/README b/README
index 20f7d1b889640a9283f0b2bd169c13824a8da9d2..2806ad0fb642767fdc9c14377d406d6ceef1108a 100755 (executable)
--- a/README
+++ b/README
@@ -114,13 +114,30 @@ utilities all respond to -h.
 
 Change History
 
+new stuff:
+ o UL version byte now ignored when comparing UL values.
+ o JP2K Sequence Parser modified to skip directory entries that
+   are not files in the case where the parser is initialized with
+   a directory path.  When initialized with a list of file names
+   this check is not performed.  Based on a hint by Steve Q.
+ o Added missing FrameType() implementation to ASDCP::MPEG2::MXFReader.
+ o Added missing Close() implementations to MXF reader classes.
+ o Added missing Timestamp::Timestamp(const char* datestr)
+   implementation. (Thanks to Matt Sheby for this and the previous
+   item)
+
+
+
+
+
+
 2010.11.15 - bug fixes, enhancements v1.7.40
- o Fixed bug in long KLV packet support (Thanks to Jim R.).
+ o Fixed bug in long KLV packet support (Thanks to Jim Radford).
  o Fixed AvgBps in PCM files, *again*. Sorry for the crazy.
  o More fixes and changes in support of 25, 30, 50, 60 fps.
    (Thanks to Hans K. for the TC rate bug).
  o Updated KLVFill UL version element to 0x02.
- o Type change to support Xerces-C 3.x. (Thanks to Matt S.).
+ o Type change to support Xerces-C 3.x. (Thanks to Matt Sheby).
  o Some internal API changes to KLV types. Does not affect
    operation.
  o Added NetworkLocator type to MXF metadata types.
index 811ece6eb6a3984bc4cbb35477aae7387172c5d9..b8a156e3dbeede4adeab63b15c8b198497bcff87 100755 (executable)
@@ -498,6 +498,19 @@ ASDCP::JP2K::MXFReader::DumpIndex(FILE* stream) const
     m_Reader->m_FooterPart.Dump(stream);
 }
 
+//
+ASDCP::Result_t
+ASDCP::JP2K::MXFReader::Close() const
+{
+  if ( m_Reader && m_Reader->m_File.IsOpen() )
+    {
+      m_Reader->Close();
+      return RESULT_OK;
+    }
+
+  return RESULT_INIT;
+}
+
 
 //------------------------------------------------------------------------------------------
 
@@ -675,6 +688,20 @@ ASDCP::JP2K::MXFSReader::DumpIndex(FILE* stream) const
     m_Reader->m_FooterPart.Dump(stream);
 }
 
+//
+ASDCP::Result_t
+ASDCP::JP2K::MXFSReader::Close() const
+{
+  if ( m_Reader && m_Reader->m_File.IsOpen() )
+    {
+      m_Reader->Close();
+      return RESULT_OK;
+    }
+
+  return RESULT_INIT;
+}
+
+
 //------------------------------------------------------------------------------------------
 
 
index 5bd998c6f43261dfe50f237311074ac8fea4ce57..252c1fae0216962850b6106f818ce3a9f087c221 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2004-2010, John Hurst
+Copyright (c) 2004-2011, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -174,6 +174,7 @@ public:
   Result_t    ReadFrame(ui32_t, FrameBuffer&, AESDecContext*, HMACContext*);
   Result_t    ReadFrameGOPStart(ui32_t, FrameBuffer&, AESDecContext*, HMACContext*);
   Result_t    FindFrameGOPStart(ui32_t, ui32_t&);
+  Result_t    FrameType(ui32_t FrameNum, FrameType_t& type);
 };
 
 
@@ -245,6 +246,26 @@ ASDCP::MPEG2::MXFReader::h__Reader::FindFrameGOPStart(ui32_t FrameNum, ui32_t& K
   return RESULT_OK;
 }
 
+//
+ASDCP::Result_t
+ASDCP::MPEG2::MXFReader::h__Reader::FrameType(ui32_t FrameNum, FrameType_t& type)
+{
+  if ( ! m_File.IsOpen() )
+    return RESULT_INIT;
+
+  // look up frame index node
+  IndexTableSegment::IndexEntry TmpEntry;
+
+  if ( ASDCP_FAILURE(m_FooterPart.Lookup(FrameNum, TmpEntry)) )
+    {
+      DefaultLogSink().Error("Frame value out of range: %u\n", FrameNum);
+      return RESULT_RANGE;
+    }
+
+  type = ( (TmpEntry.Flags & 0x0f) == 3 ) ? FRAME_B : ( (TmpEntry.Flags & 0x0f) == 2 ) ? FRAME_P : FRAME_I;
+  return RESULT_OK;
+}
+
 
 //
 //
@@ -403,6 +424,29 @@ ASDCP::MPEG2::MXFReader::DumpIndex(FILE* stream) const
     m_Reader->m_FooterPart.Dump(stream);
 }
 
+//
+ASDCP::Result_t
+ASDCP::MPEG2::MXFReader::Close() const
+{
+  if ( m_Reader && m_Reader->m_File.IsOpen() )
+    {
+      m_Reader->Close();
+      return RESULT_OK;
+    }
+
+  return RESULT_INIT;
+}
+
+//
+ASDCP::Result_t
+ASDCP::MPEG2::MXFReader::FrameType(ui32_t FrameNum, FrameType_t& type) const
+{
+  if ( ! m_Reader )
+    return RESULT_INIT;
+
+  return m_Reader->FrameType(FrameNum, type);
+}
+
 
 //------------------------------------------------------------------------------------------
 
index 635c176ad120aab618c32362b9b3ed34acbd495d..f93815bad1a6a89013173e6f566f0d9cb4c2e0ed 100755 (executable)
@@ -373,6 +373,19 @@ ASDCP::PCM::MXFReader::DumpIndex(FILE* stream) const
     m_Reader->m_FooterPart.Dump(stream);
 }
 
+//
+ASDCP::Result_t
+ASDCP::PCM::MXFReader::Close() const
+{
+  if ( m_Reader && m_Reader->m_File.IsOpen() )
+    {
+      m_Reader->Close();
+      return RESULT_OK;
+    }
+
+  return RESULT_INIT;
+}
+
 
 //------------------------------------------------------------------------------------------
 
index c13b4479d28c2fabc850806fcca6b9d0c800831b..f7d64bda3a004c2207a7200ea5983b737575874d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2008-2009, John Hurst
+Copyright (c) 2008-2011, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -431,6 +431,20 @@ ASDCP::TimedText::MXFReader::DumpIndex(FILE* stream) const
     m_Reader->m_FooterPart.Dump(stream);
 }
 
+//
+ASDCP::Result_t
+ASDCP::TimedText::MXFReader::Close() const
+{
+  if ( m_Reader && m_Reader->m_File.IsOpen() )
+    {
+      m_Reader->Close();
+      return RESULT_OK;
+    }
+
+  return RESULT_INIT;
+}
+
+
 //------------------------------------------------------------------------------------------
 
 
index 044ed468254f7ac72a7dbce836b8d195853448c8..c33321e285cbb53b04732e140647b0198494c434 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2004-2009, John Hurst
+Copyright (c) 2004-2011, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -78,7 +78,9 @@ public:
            std::string Str(m_DirName);
            Str += "/";
            Str += next_file;
-           push_back(Str);
+
+           if ( ! Kumu::PathIsDirectory(Str) )
+             push_back(Str);
          }
 
        sort();
index a79ea91fc6a474edb6ca8ebdf444b7366346c34b..1b378f0da13cd8215ed1dd31d32c1076146e878f 100755 (executable)
--- a/src/KLV.h
+++ b/src/KLV.h
@@ -106,6 +106,7 @@ inline const char* ui64sz(ui64_t i, char* buf)
       virtual ~UL() {}
 
       const char* EncodeString(char* str_buf, ui32_t buf_len) const;
+      bool operator==(const UL& rhs) const;
     };
 
   // UMID
index 8e4fa7c22691c06e65cfc06e3754e523a152c6b4..b84f7f520ab044ce07e5680d5dbce60ecf97d29c 100755 (executable)
@@ -970,6 +970,16 @@ Kumu::Timestamp::Timestamp(const Timestamp& rhs) : IArchive()
   Second = rhs.Second;
 }
 
+//
+Kumu::Timestamp::Timestamp(const char* datestr) : IArchive()
+{
+  if ( ! DecodeString(datestr) )
+    {
+      *this = Timestamp();
+    }
+}
+
+//
 Kumu::Timestamp::~Timestamp()
 {
 }
index aa53e35fb1d968c5e7c398b24b99f9121965ee11..e8e5b7df50f75add89410792cea04cb817be91e3 100644 (file)
@@ -803,7 +803,7 @@ static const ASDCP::MDDEntry s_MDD_Table[] = {
   { { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0a, // 255
       0x0d, 0x01, 0x03, 0x01, 0x02, 0x13, 0x01, 0x01 },
       {0}, false, "TimedTextWrapping" },
-  { { 0x06, 0x0e, 0x2b, 0x34, 0x01, 0x02, 0x01, 0x09, // 256
+  { { 0x06, 0x0e, 0x2b, 0x34, 0x01, 0x02, 0x01, 0x01, // 256
       0x0d, 0x01, 0x03, 0x01, 0x17, 0x01, 0x0b, 0x01 },
       {0}, false, "TimedTextEssence" },
   { { 0x06, 0x0e, 0x2b, 0x34, 0x02, 0x53, 0x01, 0x01, // 257
index b9b2bd9e405056c80af7bdec2a02e2f3724666b7..a76957fe5f3d5e0b7d23044e70e2eda2358d9d46 100755 (executable)
@@ -38,6 +38,32 @@ using Kumu::DefaultLogSink;
 //------------------------------------------------------------------------------------------
 //
 
+bool
+ASDCP::UL::operator==(const UL& rhs) const
+{
+  if ( m_Value[0] == rhs.m_Value[0] &&
+       m_Value[1] == rhs.m_Value[1] &&
+       m_Value[2] == rhs.m_Value[2] &&
+       m_Value[3] == rhs.m_Value[3] &&
+       m_Value[4] == rhs.m_Value[4] &&
+       m_Value[5] == rhs.m_Value[5] &&
+       m_Value[6] == rhs.m_Value[6] &&
+       //       m_Value[7] == rhs.m_Value[7] &&  version is ignored when performing lookups
+       m_Value[8] == rhs.m_Value[8] &&
+       m_Value[9] == rhs.m_Value[9] &&
+       m_Value[10] == rhs.m_Value[10] &&
+       m_Value[11] == rhs.m_Value[11] &&
+       m_Value[12] == rhs.m_Value[12] &&
+       m_Value[13] == rhs.m_Value[13] &&
+       m_Value[14] == rhs.m_Value[14] &&
+       m_Value[15] == rhs.m_Value[15]
+       )
+    return true;
+
+  return false;
+}
+
+
 const char*
 ASDCP::UL::EncodeString(char* str_buf, ui32_t buf_len) const
 {
index de85899fbc6ef82adb81495d30fd3906923bc9bb..c8f18e7992666d80b243f6652bc7b21dce0fb634 100644 (file)
@@ -40,7 +40,7 @@ endif
 
 # list of all the header files that should be installed
 include_HEADERS = KM_error.h KM_fileio.h KM_log.h KM_memio.h KM_mutex.h \
-               KM_platform.h KM_prng.h KM_util.h KM_xml.h AS_DCP.h
+               KM_platform.h KM_prng.h KM_util.h KM_tai.h KM_xml.h AS_DCP.h
 if DEV_HEADERS
 include_HEADERS += S12MTimecode.h MDD.h Metadata.h KLV.h MXFTypes.h MXF.h Wav.h \
                PCMParserList.h
index 2f96d2359047b6a6a9bd6173f47d85f1946b3aae..3fa6d7d44c5b2ed3b10c6815182f568d790a9ae3 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2004-2009, John Hurst
+Copyright (c) 2004-2011, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without