o Fixes wrong MajorVersion in Preface
authorjhurst <jhurst@cinecert.com>
Mon, 20 Aug 2018 00:15:11 +0000 (00:15 +0000)
committerjhurst <>
Mon, 20 Aug 2018 00:15:11 +0000 (00:15 +0000)
 o Adds VideoLineMap also to RGBA essence descriptor
 o Adds VideoLineMap to RGBA and CDCI descriptor only when option -l
   is present (disputable - but distinguished value {0, 0} is not
   allowed in closed and complete partitions)
 o Fixes issue with IndexRate not set in AS-02 J2K files
 o Additional fixes to minor version number in AS-02 partition packs
 o CMake brought up to date
 o Fixed erroneous WAV RF64 header interpretation

CMakeLists.txt
README
src/AS_02_JP2K.cpp
src/AS_02_internal.h
src/AS_DCP_internal.h
src/CMakeLists.txt
src/Wav.cpp
src/as-02-wrap.cpp
src/h__02_Writer.cpp

index 3c20140372e47622ec7cedfd469a7f83b6a5a403..d75a4d71a3ea06c18e66f3ece69001ebbb3c1ee0 100644 (file)
@@ -3,10 +3,13 @@ cmake_minimum_required(VERSION 2.8.12)
 project(asdcplib)
 
 # The version number.
-set(VERSION_MAJOR 2)
-set(VERSION_MINOR 5)
-set(VERSION_PATCH 14)
-set(VERSION_STRING ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
+file(STRINGS configure VERSION_STRING REGEX "PACKAGE_VERSION=.*")
+STRING(REGEX REPLACE "(.*)([\n*[.]]+).*" "\\2" ${VERSION_STRING} "${${VERSION_STRING}}")
+STRING(REGEX REPLACE "(PACKAGE_VERSION=')(.*)'" "\\2" VERSION_STRING ${VERSION_STRING})
+STRING(REGEX REPLACE "([0-9]+)[.].*" "\\1" VERSION_MAJOR ${VERSION_STRING})
+STRING(REGEX REPLACE ".*[.]([0-9]+)[.].*" "\\1" VERSION_MINOR ${VERSION_STRING})
+STRING(REGEX REPLACE ".*[.]+([0-9]+)" "\\1" VERSION_PATCH ${VERSION_STRING})
+message(STATUS "Version Number is ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "Default Targets")
 # use, i.e. don't skip the full RPATH for the build tree
diff --git a/README b/README
index b11ba5b169c5e75f16069c7865e623cee4460928..a66bdf2f9edb6e9a7a678e840523c8bb6c9de293 100755 (executable)
--- a/README
+++ b/README
@@ -151,6 +151,21 @@ command-line utilities all respond to -h.
 
 Change History
 
+
+2018-08-xx - 2.9.30
+ o Fixes wrong MajorVersion in Preface
+ o Adds VideoLineMap also to RGBA essence descriptor
+ o Adds VideoLineMap to RGBA and CDCI descriptor only when option -l
+   is present (disputable - but distinguished value {0, 0} is not
+   allowed in closed and complete partitions)
+ o Fixes issue with IndexRate not set in AS-02 J2K files
+ o Additional fixes to minor version number in AS-02 partition packs
+ o CMake brought up to date
+ o Fixed erroneous WAV RF64 header interpretation
+
+
+
+
 2018-08-08 - 2.8.29
  o Modified AS_02::ST2052_TextParser::OpenRead signature
  o Fixed partition version error in AS-02 interior body partitions
index 0379a96efb38bee83e333d3f6280aaf92591fa50..2d8bfa59e132c1712971cbae87ade85406dcbf40 100644 (file)
@@ -368,6 +368,7 @@ AS_02::JP2K::MXFWriter::h__Writer::SetSourceStream(const std::string& label, con
       if ( KM_SUCCESS(result) )
        {
          this->m_IndexWriter.SetPrimerLookup(&this->m_HeaderPart.m_Primer);
+         this->m_IndexWriter.SetEditRate(m_EssenceDescriptor->SampleRate);
        }
     }
 
index e068f8de2dd945e471a6933d5a2f0f86d70a7e5f..c4aee7e2b9b40ba031c7d7dd0b6dcd6533d809f0 100644 (file)
@@ -107,6 +107,7 @@ namespace AS_02
 
        ui32_t GetDuration() const;
        void PushIndexEntry(const ASDCP::MXF::IndexTableSegment::IndexEntry&);
+       void SetEditRate(const ASDCP::Rational& edit_rate);
       };
 
 
index 3c1a9b7f5e255bef36f9007afac1c529a7b664f8..1049a98b69bc777c6b8f225c54673c0e01880fcf 100755 (executable)
@@ -630,14 +630,14 @@ namespace ASDCP
          if ( mxf_ver == MXFVersion_2004 )
            {
              m_HeaderPart.MinorVersion = MXF_2004_MinorVersion;
-             m_HeaderPart.m_Preface->Version = ((MXF_ObjectModelVersion < 8) | MXF_2004_MinorVersion);
+             m_HeaderPart.m_Preface->Version = ((MXF_ObjectModelVersion << 8) | MXF_2004_MinorVersion);
              m_HeaderPart.m_Preface->ObjectModelVersion = MXF_ObjectModelVersion;
            }
          else
            {
              assert(mxf_ver == MXFVersion_2011);
              m_HeaderPart.MinorVersion = MXF_2011_MinorVersion;
-             m_HeaderPart.m_Preface->Version = ((MXF_ObjectModelVersion < 8) | MXF_2011_MinorVersion);
+             m_HeaderPart.m_Preface->Version = ((MXF_ObjectModelVersion << 8) | MXF_2011_MinorVersion);
              m_HeaderPart.m_Preface->ObjectModelVersion = MXF_ObjectModelVersion;
            }
 
index 816d5b56e33bd2b62a7ab86845646e48b2a253da..cf767254ce4dc04ddc382a726cb6bb533c27f97d 100644 (file)
@@ -1,7 +1,7 @@
 find_library(OpenSSLLib_PATH NAMES libeay32 crypto PATHS "${PROJECT_SOURCE_DIR}/../openssl" "${PROJECT_SOURCE_DIR}/../lib/openssl" "$ENV{CMAKE_HINT}/openssl" ENV CMAKE_HINT PATH_SUFFIXES "lib" "openssl" "lib/openssl")\r
 find_path(OpenSSLLib_include_DIR NAMES openssl/rand.h PATHS "${PROJECT_SOURCE_DIR}/../openssl" "${PROJECT_SOURCE_DIR}/../lib/openssl" "$ENV{CMAKE_HINT}/openssl" ENV CMAKE_HINT PATH_SUFFIXES "include" "inc32")\r
 find_library(XercescppLib_PATH NAMES xerces-c xerces-c_3 PATHS "${PROJECT_SOURCE_DIR}/../xercescpp" "${PROJECT_SOURCE_DIR}/../lib/xercescpp" "$ENV{CMAKE_HINT}/xercescpp" ENV CMAKE_HINT PATH_SUFFIXES "lib")\r
-find_library(XercescppLib_Debug_PATH NAMES xerces-c xerces-c_3D PATHS "${PROJECT_SOURCE_DIR}/../xercescpp" "${PROJECT_SOURCE_DIR}/../lib/xercescpp" "$ENV{CMAKE_HINT}/xercescpp" ENV CMAKE_HINT PATH_SUFFIXES "lib")\r
+find_library(XercescppLib_Debug_PATH NAMES xerces-cD xerces-c_3D xerces-c PATHS "${PROJECT_SOURCE_DIR}/../xercescpp" "${PROJECT_SOURCE_DIR}/../lib/xercescpp" "$ENV{CMAKE_HINT}/xercescpp" ENV CMAKE_HINT PATH_SUFFIXES "lib")\r
 find_path(XercescppLib_include_DIR NAMES xercesc/dom/DOM.hpp PATHS "${PROJECT_SOURCE_DIR}/../xercescpp" "${PROJECT_SOURCE_DIR}/../lib/xercescpp" "$ENV{CMAKE_HINT}/xercescpp" ENV CMAKE_HINT PATH_SUFFIXES "include")\r
 set(UseRandomUUID OFF CACHE BOOL "")\r
 \r
@@ -27,17 +27,17 @@ set(asdcp_src MPEG2_Parser.cpp MPEG.cpp JP2K_Codestream_Parser.cpp JP2K_Sequence
 )\r
 \r
 # header for deployment (install target)\r
-set(asdcp_deploy_header AS_DCP.h PCMParserList.h AS_DCP_internal.h KM_error.h KM_fileio.h KM_util.h KM_memio.h KM_tai.h KM_platform.h KM_log.h KM_mutex.h)\r
+set(asdcp_deploy_header AS_DCP.h PCMParserList.h AS_DCP_internal.h KM_error.h KM_fileio.h KM_util.h KM_memio.h KM_tai.h KM_platform.h KM_log.h KM_mutex.h dirent_win.h)\r
 \r
 # header\r
 set(asdcp_src ${asdcp_src} Wav.h WavFileWriter.h MXF.h Metadata.h JP2K.h AS_DCP.h AS_DCP_internal.h KLV.h MPEG.h MXFTypes.h MDD.h\r
        PCMParserList.h S12MTimecode.h AtmosSyncChannel_Generator.h AtmosSyncChannel_Mixer.h PCMDataProviders.h\r
-       SyncEncoder.h SyncCommon.h CRC16.h UUIDInformation.h\r
+       SyncEncoder.h SyncCommon.h CRC16.h UUIDInformation.h dirent_win.h\r
 )\r
 \r
 # ----------as02----------\r
 # source\r
-set(as02_src h__02_Reader.cpp h__02_Writer.cpp AS_02_JP2K.cpp AS_02_PCM.cpp ST2052_TextParser.cpp AS_02_TimedText.cpp)\r
+set(as02_src h__02_Reader.cpp h__02_Writer.cpp AS_02_ISXD.cpp AS_02_JP2K.cpp AS_02_PCM.cpp ST2052_TextParser.cpp AS_02_TimedText.cpp)\r
 \r
 # header for deployment (install target)\r
 set(as02_deploy_header AS_02.h Metadata.h MXF.h MXFTypes.h KLV.h MDD.h)\r
index aad4b89ab03d61bac648a7234e7d2df4ec371c1f..2ffadd404cecc360a8f5827db0e73d87b46ada14 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2005-2015, John Hurst
+Copyright (c) 2005-2018, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -548,14 +548,17 @@ ASDCP::RF64::SimpleRF64Header::ReadFromBuffer(const byte_t* buf, ui32_t buf_len,
 
         if ( test_fcc == Wav::FCC_data )
         {
-            if ( chunk_size > RIFF_len )
-            {
-                DefaultLogSink().Error("Chunk size %u larger than file: %u\n", chunk_size, RIFF_len);
-                return RESULT_RAW_FORMAT;
-            }
+            if ( chunk_size != MAX_RIFF_LEN )
+             {
+               if ( chunk_size > RIFF_len )
+                 {
+                   DefaultLogSink().Error("Chunk size %u larger than file: %u\n", chunk_size, RIFF_len);
+                   return RESULT_RAW_FORMAT;
+                 }
 
-            if (chunk_size != MAX_RIFF_LEN)
                 data_len = chunk_size;
+             }
             *data_start = p - buf;
             break;
         }
index db3d6598e0149a5ac38c33d9f81eb52e54649bb8..e414e9ec44d123dc2085d6c26363e963d9de722b 100755 (executable)
@@ -151,8 +151,7 @@ Options:\n\
   -j <key-id-str>   - Write key ID instead of creating a random value\n\
   -k <key-string>   - Use key for ciphertext operations\n\
   -l <first>,<second>\n\
-                    - Integer values that set the VideoLineMap when creating\n\
-                      interlaced YCbCr files\n\
+                    - Integer values that set the VideoLineMap\n\
   -m <expr>         - Write MCA labels using <expr>.  Example:\n\
                         51(L,R,C,LFE,Ls,Rs,),HI,VIN\n\
   -M                - Do not create HMAC values when writing\n\
@@ -293,6 +292,7 @@ public:
 
   //
   MXF::LineMapPair line_map;
+  bool line_map_flag;
   std::string out_file, profile_name; //
   std::string mca_audio_element_kind, mca_audio_content_kind;
   
@@ -445,7 +445,7 @@ public:
     horizontal_subsampling(2), vertical_subsampling(2), component_depth(10),
     frame_layout(0), aspect_ratio(ASDCP::Rational(4,3)), field_dominance(0),
     mxf_header_size(16384), cdci_WhiteRefLevel(940), cdci_BlackRefLevel(64), cdci_ColorRange(897),
-    md_min_luminance(0), md_max_luminance(0), line_map(0,0)
+    md_min_luminance(0), md_max_luminance(0), line_map(0,0), line_map_flag(false)
   {
     memset(key_value, 0, KeyLen);
     memset(key_id_value, 0, UUIDlen);
@@ -594,6 +594,8 @@ public:
                if ( ! set_video_line_map(argv[i]) )
                  {
                    return;
+                 } else {
+                               line_map_flag = true;
                  }
                break;
 
@@ -879,7 +881,7 @@ write_JP2K_file(CommandOptions& Options)
              tmp_dscr->WhiteReflevel = Options.cdci_WhiteRefLevel;
              tmp_dscr->BlackRefLevel = Options.cdci_BlackRefLevel;
              tmp_dscr->ColorRange = Options.cdci_ColorRange;
-             tmp_dscr->VideoLineMap = Options.line_map;
+             if (Options.line_map_flag)  tmp_dscr->VideoLineMap = Options.line_map;
 
              if ( Options.md_min_luminance || Options.md_max_luminance )
                {
@@ -914,6 +916,7 @@ write_JP2K_file(CommandOptions& Options)
              tmp_dscr->PictureEssenceCoding = Options.picture_coding;
              tmp_dscr->ComponentMaxRef = Options.rgba_MaxRef;
              tmp_dscr->ComponentMinRef = Options.rgba_MinRef;
+             if (Options.line_map_flag)  tmp_dscr->VideoLineMap = Options.line_map;
 
              if ( Options.md_min_luminance || Options.md_max_luminance )
                {
index 37393caf91903f18b5712c6ced5b7bca839dd941..41765de5609f88cfc175c98b1d7fff24f85f6011 100644 (file)
@@ -47,6 +47,7 @@ AS_02::MXF::AS02IndexWriterVBR::AS02IndexWriterVBR(const ASDCP::Dictionary*& d)
 {
   BodySID = 0;
   IndexSID = 129;
+  MinorVersion = 3;
 }
 
 AS_02::MXF::AS02IndexWriterVBR::~AS02IndexWriterVBR() {}
@@ -165,6 +166,11 @@ AS_02::MXF::AS02IndexWriterVBR::PushIndexEntry(const IndexTableSegment::IndexEnt
   m_CurrentSegment->IndexEntryArray.push_back(Entry);
 }
 
+void
+AS_02::MXF::AS02IndexWriterVBR::SetEditRate(const ASDCP::Rational& edit_rate)
+{
+  m_EditRate = edit_rate;
+}
 
 //------------------------------------------------------------------------------------------
 //
@@ -223,6 +229,7 @@ AS_02::MXF::AS02IndexWriterCBR::AS02IndexWriterCBR(const ASDCP::Dictionary*& d)
 {
   BodySID = 0;
   IndexSID = 129;
+  MinorVersion = 3;
 }
 
 AS_02::MXF::AS02IndexWriterCBR::~AS02IndexWriterCBR() {}