From: jhurst Date: Mon, 20 Aug 2018 00:15:11 +0000 (+0000) Subject: o Fixes wrong MajorVersion in Preface X-Git-Tag: rel_2_10_32~43 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=30dba88305439d4df852bb5149e134739889dc93;p=asdcplib.git 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 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c20140..d75a4d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 b11ba5b..a66bdf2 100755 --- 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 diff --git a/src/AS_02_JP2K.cpp b/src/AS_02_JP2K.cpp index 0379a96..2d8bfa5 100644 --- a/src/AS_02_JP2K.cpp +++ b/src/AS_02_JP2K.cpp @@ -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); } } diff --git a/src/AS_02_internal.h b/src/AS_02_internal.h index e068f8d..c4aee7e 100644 --- a/src/AS_02_internal.h +++ b/src/AS_02_internal.h @@ -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); }; diff --git a/src/AS_DCP_internal.h b/src/AS_DCP_internal.h index 3c1a9b7..1049a98 100755 --- a/src/AS_DCP_internal.h +++ b/src/AS_DCP_internal.h @@ -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; } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 816d5b5..cf76725 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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") 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") 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") -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") +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") 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") set(UseRandomUUID OFF CACHE BOOL "") @@ -27,17 +27,17 @@ set(asdcp_src MPEG2_Parser.cpp MPEG.cpp JP2K_Codestream_Parser.cpp JP2K_Sequence ) # header for deployment (install target) -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) +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) # header 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 PCMParserList.h S12MTimecode.h AtmosSyncChannel_Generator.h AtmosSyncChannel_Mixer.h PCMDataProviders.h - SyncEncoder.h SyncCommon.h CRC16.h UUIDInformation.h + SyncEncoder.h SyncCommon.h CRC16.h UUIDInformation.h dirent_win.h ) # ----------as02---------- # source -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) +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) # header for deployment (install target) set(as02_deploy_header AS_02.h Metadata.h MXF.h MXFTypes.h KLV.h MDD.h) diff --git a/src/Wav.cpp b/src/Wav.cpp index aad4b89..2ffadd4 100755 --- a/src/Wav.cpp +++ b/src/Wav.cpp @@ -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; } diff --git a/src/as-02-wrap.cpp b/src/as-02-wrap.cpp index db3d659..e414e9e 100755 --- a/src/as-02-wrap.cpp +++ b/src/as-02-wrap.cpp @@ -151,8 +151,7 @@ Options:\n\ -j - Write key ID instead of creating a random value\n\ -k - Use key for ciphertext operations\n\ -l ,\n\ - - Integer values that set the VideoLineMap when creating\n\ - interlaced YCbCr files\n\ + - Integer values that set the VideoLineMap\n\ -m - Write MCA labels using . 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 ) { diff --git a/src/h__02_Writer.cpp b/src/h__02_Writer.cpp index 37393ca..41765de 100644 --- a/src/h__02_Writer.cpp +++ b/src/h__02_Writer.cpp @@ -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() {}