diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-01-11 13:55:39 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-12-03 17:01:32 +0100 |
| commit | ab0c4cc3b599bf8e8bb21c81f0418b8aa4922be3 (patch) | |
| tree | bad76f376ae17ca6b956d3064b30348b0899468d /src | |
| parent | 04cf4482e9bcd5329f717f4ccffd94ff3e751e2a (diff) | |
Make the IMP stuff usable.
Diffstat (limited to 'src')
| -rw-r--r-- | src/AS_02_PHDR.h | 12 | ||||
| -rw-r--r-- | src/AS_02_internal.h | 2 | ||||
| -rwxr-xr-x | src/AS_DCP_internal.h | 2 | ||||
| -rwxr-xr-x | src/Dict.cpp | 6 | ||||
| -rwxr-xr-x | src/Index.cpp | 5 | ||||
| -rwxr-xr-x | src/KLV.cpp | 10 | ||||
| -rw-r--r-- | src/MDD.cpp | 4 | ||||
| -rwxr-xr-x | src/MXF.cpp | 34 | ||||
| -rwxr-xr-x | src/MXFTypes.cpp | 2 | ||||
| -rwxr-xr-x | src/Metadata.cpp | 112 | ||||
| -rw-r--r-- | src/asdcp/AS_02.h (renamed from src/AS_02.h) | 0 | ||||
| -rwxr-xr-x | src/asdcp/KLV.h (renamed from src/KLV.h) | 2 | ||||
| -rwxr-xr-x | src/asdcp/MDD.h (renamed from src/MDD.h) | 0 | ||||
| -rwxr-xr-x | src/asdcp/MXF.h (renamed from src/MXF.h) | 0 | ||||
| -rwxr-xr-x | src/asdcp/MXFTypes.h (renamed from src/MXFTypes.h) | 16 | ||||
| -rwxr-xr-x | src/asdcp/Metadata.h (renamed from src/Metadata.h) | 0 | ||||
| -rwxr-xr-x | src/h__Reader.cpp | 10 | ||||
| -rwxr-xr-x | src/h__Writer.cpp | 2 | ||||
| -rw-r--r-- | src/wscript | 6 |
19 files changed, 115 insertions, 110 deletions
diff --git a/src/AS_02_PHDR.h b/src/AS_02_PHDR.h index 1328de1..a23802d 100644 --- a/src/AS_02_PHDR.h +++ b/src/AS_02_PHDR.h @@ -24,7 +24,7 @@ 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 AS_02_PHDR.h \version $Id$ @@ -35,13 +35,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef _AS_02_PHDR_H_ #define _AS_02_PHDR_H_ -#include "AS_02.h" +#include "asdcp/AS_02.h" namespace AS_02 { namespace PHDR - { + { // class FrameBuffer : public ASDCP::JP2K::FrameBuffer { @@ -81,7 +81,7 @@ namespace AS_02 // Opens a file sequence for reading. The sequence is expected to contain one or // more pairs of filenames, each naming a file containing the codestream (.j2c) and the - // corresponding P-HDR metadata (.xml) for exactly one picture. The parser will + // corresponding P-HDR metadata (.xml) for exactly one picture. The parser will // automatically parse enough data from the first file to provide a complete set of // stream metadata for the MXFWriter below. If the "pedantic" parameter is given and // is true, the parser will check the metadata for each codestream and fail if a @@ -108,7 +108,7 @@ namespace AS_02 class h__Writer; ASDCP::mem_ptr<h__Writer> m_Writer; ASDCP_NO_COPY_CONSTRUCT(MXFWriter); - + public: MXFWriter(); virtual ~MXFWriter(); @@ -179,7 +179,7 @@ namespace AS_02 void DumpHeaderMetadata(FILE* = 0) const; void DumpIndex(FILE* = 0) const; }; - + } // end namespace PHDR } // end namespace AS_02 diff --git a/src/AS_02_internal.h b/src/AS_02_internal.h index fa8efde..33726ee 100644 --- a/src/AS_02_internal.h +++ b/src/AS_02_internal.h @@ -36,7 +36,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "KM_log.h" #include "AS_DCP_internal.h" -#include "AS_02.h" +#include "asdcp/AS_02.h" using Kumu::DefaultLogSink; diff --git a/src/AS_DCP_internal.h b/src/AS_DCP_internal.h index d759d1c..7a525b8 100755 --- a/src/AS_DCP_internal.h +++ b/src/AS_DCP_internal.h @@ -35,7 +35,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <asdcp/KM_platform.h> #include <asdcp/KM_util.h> #include <KM_log.h> -#include "Metadata.h" +#include <asdcp/Metadata.h> using Kumu::DefaultLogSink; using namespace ASDCP; diff --git a/src/Dict.cpp b/src/Dict.cpp index 639e40f..9747b9d 100755 --- a/src/Dict.cpp +++ b/src/Dict.cpp @@ -32,7 +32,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "KM_mutex.h" #include "KM_log.h" -#include "KLV.h" +#include <asdcp/KLV.h> #include "MDD.cpp" //------------------------------------------------------------------------------------------ @@ -257,7 +257,7 @@ ASDCP::Dictionary::FindUL(const byte_t* ul_buf) const { assert(m_MDD_Table[0].name[0]); std::map<UL, ui32_t>::const_iterator i = m_md_lookup.find(UL(ul_buf)); - + if ( i == m_md_lookup.end() ) { byte_t tmp_ul[SMPTE_UL_LENGTH]; @@ -284,7 +284,7 @@ ASDCP::Dictionary::FindSymbol(const std::string& str) const { assert(m_MDD_Table[0].name[0]); std::map<std::string, ui32_t>::const_iterator i = m_md_sym_lookup.find(str); - + if ( i == m_md_sym_lookup.end() ) { Kumu::DefaultLogSink().Warn("UL Dictionary: unknown symbol: %s\n", str.c_str()); diff --git a/src/Index.cpp b/src/Index.cpp index f996339..e651a1d 100755 --- a/src/Index.cpp +++ b/src/Index.cpp @@ -29,7 +29,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \brief MXF index segment objects */ -#include "MXF.h" +#include <asdcp/MXF.h> const ui32_t kl_length = ASDCP::SMPTE_UL_LENGTH + ASDCP::MXF_BER_LENGTH; @@ -185,7 +185,7 @@ ASDCP::MXF::IndexTableSegment::DeltaEntry::Archive(Kumu::MemIOWriter* Writer) co // Bit 7: Random Access // Bit 6: Sequence Header // Bit 5: forward prediction flag -// Bit 4: backward prediction flag +// Bit 4: backward prediction flag // e.g. // 00== I frame (no prediction) // 10== P frame(forward prediction from previous frame) @@ -240,4 +240,3 @@ ASDCP::MXF::IndexTableSegment::IndexEntry::Archive(Kumu::MemIOWriter* Writer) co // // end Index.cpp // - diff --git a/src/KLV.cpp b/src/KLV.cpp index 24a90a5..acf28bb 100755 --- a/src/KLV.cpp +++ b/src/KLV.cpp @@ -29,7 +29,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \brief KLV objects */ -#include "KLV.h" +#include <asdcp/KLV.h> #include <KM_log.h> using Kumu::DefaultLogSink; @@ -43,7 +43,7 @@ const ui32_t tmp_read_size = 32; //------------------------------------------------------------------------------------------ // -// +// ASDCP::Result_t ASDCP::KLVPacket::InitFromBuffer(const byte_t* buf, ui32_t buf_len, const UL& label) { @@ -146,7 +146,7 @@ ASDCP::KLVPacket::WriteKLToBuffer(ASDCP::FrameBuffer& Buffer, const UL& label, u DefaultLogSink().Error("Small write buffer\n"); return RESULT_FAIL; } - + memcpy(Buffer.Data() + Buffer.Size(), label.Value(), label.Size()); if ( ! Kumu::write_BER(Buffer.Data() + Buffer.Size() + SMPTE_UL_LENGTH, length, MXF_BER_LENGTH) ) @@ -187,7 +187,7 @@ ASDCP::KLVPacket::Dump(FILE* stream, const Dictionary& Dict, bool show_value) } } -// +// ASDCP::Result_t ASDCP::KLVFilePacket::InitFromFile(const Kumu::FileReader& Reader, const UL& label) { @@ -286,7 +286,7 @@ ASDCP::KLVFilePacket::InitFromFile(const Kumu::FileReader& Reader) if ( remainder > 0 ) { result = Reader.Read(m_Buffer.Data() + tmp_read_size, remainder, &read_count); - + if ( read_count != remainder ) { DefaultLogSink().Error("Short read of packet body, expecting %u, got %u\n", diff --git a/src/MDD.cpp b/src/MDD.cpp index 884059a..3b750e4 100644 --- a/src/MDD.cpp +++ b/src/MDD.cpp @@ -32,7 +32,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // MDD.cpp // -#include "KLV.h" +#include <asdcp/KLV.h> static const ASDCP::MDDEntry s_MDD_Table[] = { { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0 @@ -1146,7 +1146,7 @@ static const ASDCP::MDDEntry s_MDD_Table[] = { 0x04, 0x01, 0x01, 0x01, 0x00, 0x04, 0x02, 0x00 }, {0, 0}, false, "AlternativeCenterCuts_14x9" }, { { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, // 370 - 0x0d, 0x01, 0x03, 0x01, 0x02, 0x06, 0x02, 0x00 }, + 0x0d, 0x01, 0x03, 0x01, 0x02, 0x06, 0x02, 0x00 }, {0, 0}, false, "WAVWrappingClip" }, { { 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0d, // 371 0x0e, 0x16, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01 }, diff --git a/src/MXF.cpp b/src/MXF.cpp index bd3c12d..6e0abe3 100755 --- a/src/MXF.cpp +++ b/src/MXF.cpp @@ -29,8 +29,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \brief MXF objects */ -#include "MXF.h" -#include "Metadata.h" +#include <asdcp/MXF.h> +#include <asdcp/Metadata.h> #include <KM_log.h> using Kumu::DefaultLogSink; @@ -205,7 +205,7 @@ ASDCP::MXF::Partition::PacketList::GetMDObjectByID(const UUID& ObjectID, Interch ASDCP_TEST_NULL(Object); std::map<UUID, InterchangeObject*>::iterator mi = m_Map.find(ObjectID); - + if ( mi == m_Map.end() ) { *Object = 0; @@ -292,7 +292,7 @@ ASDCP::MXF::Partition::InitFromFile(const Kumu::FileReader& Reader) // could be one of several values if ( ASDCP_SUCCESS(result) ) result = ASDCP::MXF::Partition::InitFromBuffer(m_ValueStart, m_ValueLength); - + return result; } @@ -533,7 +533,7 @@ ASDCP::MXF::Primer::InsertTag(const MDDEntry& Entry, ASDCP::TagValue& Tag) { Tag = (*i).second; } - + return RESULT_OK; } @@ -571,7 +571,7 @@ ASDCP::MXF::Primer::Dump(FILE* stream) fprintf(stream, "Primer: %u %s\n", (ui32_t)LocalTagEntryBatch.size(), ( LocalTagEntryBatch.size() == 1 ? "entry" : "entries" )); - + Batch<LocalTagEntry>::iterator i = LocalTagEntryBatch.begin(); for ( ; i != LocalTagEntryBatch.end(); i++ ) { @@ -721,7 +721,7 @@ ASDCP::MXF::OP1aHeader::InitFromFile(const Kumu::FileReader& Reader) { DefaultLogSink().Warn("Improbably huge HeaderByteCount value: %qu\n", HeaderByteCount); } - + result = m_HeaderData.Capacity(Kumu::xmin(4*Kumu::Megabyte, static_cast<ui32_t>(HeaderByteCount))); if ( ASDCP_SUCCESS(result) ) @@ -879,7 +879,7 @@ ASDCP::MXF::OP1aHeader::WriteToFile(Kumu::FileWriter& Writer, ui32_t HeaderSize) if ( m_Preface == 0 ) return RESULT_STATE; - if ( HeaderSize < 4096 ) + if ( HeaderSize < 4096 ) { DefaultLogSink().Error("HeaderSize %u is too small. Must be >= 4096\n", HeaderSize); return RESULT_PARAM; @@ -888,7 +888,7 @@ ASDCP::MXF::OP1aHeader::WriteToFile(Kumu::FileWriter& Writer, ui32_t HeaderSize) ASDCP::FrameBuffer HeaderBuffer; HeaderByteCount = HeaderSize - ArchiveSize(); assert (HeaderByteCount <= 0xFFFFFFFFL); - Result_t result = HeaderBuffer.Capacity((ui32_t) HeaderByteCount); + Result_t result = HeaderBuffer.Capacity((ui32_t) HeaderByteCount); m_Preface->m_Lookup = &m_Primer; std::list<InterchangeObject*>::iterator pl_i = m_PacketList->m_List.begin(); @@ -1058,7 +1058,7 @@ ASDCP::MXF::OPAtomIndexFooter::InitFromBuffer(const byte_t* p, ui32_t l) { Result_t result = RESULT_OK; const byte_t* end_p = p + l; - + while ( ASDCP_SUCCESS(result) && p < end_p ) { // parse the packets and index them by uid, discard KLVFill items @@ -1095,7 +1095,7 @@ ASDCP::MXF::OPAtomIndexFooter::WriteToFile(Kumu::FileWriter& Writer, ui64_t dura assert(m_Dict); ASDCP::FrameBuffer FooterBuffer; ui32_t footer_size = m_PacketList->m_List.size() * MaxIndexSegmentSize; // segment-count * max-segment-size - Result_t result = FooterBuffer.Capacity(footer_size); + Result_t result = FooterBuffer.Capacity(footer_size); ui32_t iseg_count = 0; if ( m_CurrentSegment != 0 ) @@ -1262,7 +1262,7 @@ ASDCP::MXF::OPAtomIndexFooter::SetIndexParamsVBR(IPrimerLookup* lookup, const Ra void ASDCP::MXF::OPAtomIndexFooter::PushIndexEntry(const IndexTableSegment::IndexEntry& Entry) { - if ( m_BytesPerEditUnit != 0 ) // are we CBR? that's bad + if ( m_BytesPerEditUnit != 0 ) // are we CBR? that's bad { DefaultLogSink().Error("Call to PushIndexEntry() failed: index is CBR\n"); return; @@ -1347,7 +1347,7 @@ ASDCP::MXF::InterchangeObject::InitFromBuffer(const byte_t* p, ui32_t l) { result = KLVPacket::InitFromBuffer(p, l); } - + return result; } @@ -1500,13 +1500,13 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label } mca_label_map_t::const_iterator i = labels.find(symbol_buf); - + if ( i == labels.end() ) { DefaultLogSink().Error("Unknown symbol: '%s'\n", symbol_buf.c_str()); return false; } - + if ( i->second.ul.Value()[10] != 2 ) // magic depends on UL "Essence Facet" byte (see ST 428-12) { DefaultLogSink().Error("Not a soundfield group symbol: '%s'\n", symbol_buf.c_str()); @@ -1538,7 +1538,7 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label } mca_label_map_t::const_iterator i = labels.find(symbol_buf); - + if ( i == labels.end() ) { DefaultLogSink().Error("Unknown symbol: '%s'\n", symbol_buf.c_str()); @@ -1620,7 +1620,7 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label else if ( ! symbol_buf.empty() ) { mca_label_map_t::const_iterator i = labels.find(symbol_buf); - + if ( i == labels.end() ) { DefaultLogSink().Error("Unknown symbol: '%s'\n", symbol_buf.c_str()); diff --git a/src/MXFTypes.cpp b/src/MXFTypes.cpp index b7d4c4a..fd69789 100755 --- a/src/MXFTypes.cpp +++ b/src/MXFTypes.cpp @@ -31,7 +31,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <asdcp/KM_prng.h> #include <asdcp/KM_tai.h> -#include "MXFTypes.h" +#include <asdcp/MXFTypes.h> #include <KM_log.h> using Kumu::DefaultLogSink; diff --git a/src/Metadata.cpp b/src/Metadata.cpp index af32e5b..4c9a215 100755 --- a/src/Metadata.cpp +++ b/src/Metadata.cpp @@ -25,13 +25,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*! \file Metadata.cpp - \version $Id$ + \version $Id$ \brief AS-DCP library, MXF Metadata Sets implementation */ #include <KM_mutex.h> -#include "Metadata.h" +#include <asdcp/Metadata.h> using namespace ASDCP; using namespace ASDCP::MXF; @@ -346,7 +346,7 @@ EssenceContainerData::InitFromTLVSet(TLVReader& TLVSet) assert(m_Dict); Result_t result = InterchangeObject::InitFromTLVSet(TLVSet); if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadObject(OBJ_READ_ARGS(EssenceContainerData, LinkedPackageUID)); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(EssenceContainerData, IndexSID)); IndexSID.set_has_value( result == RESULT_OK ); } @@ -886,7 +886,7 @@ StructuralComponent::InitFromTLVSet(TLVReader& TLVSet) assert(m_Dict); Result_t result = InterchangeObject::InitFromTLVSet(TLVSet); if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadObject(OBJ_READ_ARGS(StructuralComponent, DataDefinition)); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi64(OBJ_READ_ARGS_OPT(StructuralComponent, Duration)); Duration.set_has_value( result == RESULT_OK ); } @@ -1259,12 +1259,12 @@ FileDescriptor::InitFromTLVSet(TLVReader& TLVSet) { assert(m_Dict); Result_t result = GenericDescriptor::InitFromTLVSet(TLVSet); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(FileDescriptor, LinkedTrackID)); LinkedTrackID.set_has_value( result == RESULT_OK ); } if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadObject(OBJ_READ_ARGS(FileDescriptor, SampleRate)); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi64(OBJ_READ_ARGS_OPT(FileDescriptor, ContainerDuration)); ContainerDuration.set_has_value( result == RESULT_OK ); } @@ -1367,17 +1367,17 @@ GenericSoundEssenceDescriptor::InitFromTLVSet(TLVReader& TLVSet) Result_t result = FileDescriptor::InitFromTLVSet(TLVSet); if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadObject(OBJ_READ_ARGS(GenericSoundEssenceDescriptor, AudioSamplingRate)); if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadUi8(OBJ_READ_ARGS(GenericSoundEssenceDescriptor, Locked)); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(GenericSoundEssenceDescriptor, AudioRefLevel)); AudioRefLevel.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(GenericSoundEssenceDescriptor, ElectroSpatialFormulation)); ElectroSpatialFormulation.set_has_value( result == RESULT_OK ); } if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadUi32(OBJ_READ_ARGS(GenericSoundEssenceDescriptor, ChannelCount)); if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadUi32(OBJ_READ_ARGS(GenericSoundEssenceDescriptor, QuantizationBits)); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(GenericSoundEssenceDescriptor, DialNorm)); DialNorm.set_has_value( result == RESULT_OK ); } @@ -1484,7 +1484,7 @@ WaveAudioDescriptor::InitFromTLVSet(TLVReader& TLVSet) assert(m_Dict); Result_t result = GenericSoundEssenceDescriptor::InitFromTLVSet(TLVSet); if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadUi16(OBJ_READ_ARGS(WaveAudioDescriptor, BlockAlign)); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(WaveAudioDescriptor, SequenceOffset)); SequenceOffset.set_has_value( result == RESULT_OK ); } @@ -1497,7 +1497,7 @@ WaveAudioDescriptor::InitFromTLVSet(TLVReader& TLVSet) result = TLVSet.ReadObject(OBJ_READ_ARGS_OPT(WaveAudioDescriptor, ReferenceImageEditRate)); ReferenceImageEditRate.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(WaveAudioDescriptor, ReferenceAudioAlignmentLevel)); ReferenceAudioAlignmentLevel.set_has_value( result == RESULT_OK ); } @@ -1598,59 +1598,59 @@ GenericPictureEssenceDescriptor::InitFromTLVSet(TLVReader& TLVSet) { assert(m_Dict); Result_t result = FileDescriptor::InitFromTLVSet(TLVSet); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, SignalStandard)); SignalStandard.set_has_value( result == RESULT_OK ); } if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadUi8(OBJ_READ_ARGS(GenericPictureEssenceDescriptor, FrameLayout)); if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadUi32(OBJ_READ_ARGS(GenericPictureEssenceDescriptor, StoredWidth)); if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadUi32(OBJ_READ_ARGS(GenericPictureEssenceDescriptor, StoredHeight)); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, StoredF2Offset)); StoredF2Offset.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, SampledWidth)); SampledWidth.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, SampledHeight)); SampledHeight.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, SampledXOffset)); SampledXOffset.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, SampledYOffset)); SampledYOffset.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, DisplayHeight)); DisplayHeight.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, DisplayWidth)); DisplayWidth.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, DisplayXOffset)); DisplayXOffset.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, DisplayYOffset)); DisplayYOffset.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, DisplayF2Offset)); DisplayF2Offset.set_has_value( result == RESULT_OK ); } if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadObject(OBJ_READ_ARGS(GenericPictureEssenceDescriptor, AspectRatio)); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, ActiveFormatDescriptor)); ActiveFormatDescriptor.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, AlphaTransparency)); AlphaTransparency.set_has_value( result == RESULT_OK ); } @@ -1658,19 +1658,19 @@ GenericPictureEssenceDescriptor::InitFromTLVSet(TLVReader& TLVSet) result = TLVSet.ReadObject(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, TransferCharacteristic)); TransferCharacteristic.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, ImageAlignmentOffset)); ImageAlignmentOffset.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, ImageStartOffset)); ImageStartOffset.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, ImageEndOffset)); ImageEndOffset.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, FieldDominance)); FieldDominance.set_has_value( result == RESULT_OK ); } @@ -1686,19 +1686,19 @@ GenericPictureEssenceDescriptor::InitFromTLVSet(TLVReader& TLVSet) if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadObject(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, AlternativeCenterCuts)); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, ActiveWidth)); ActiveWidth.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, ActiveHeight)); ActiveHeight.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, ActiveXOffset)); ActiveXOffset.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(GenericPictureEssenceDescriptor, ActiveYOffset)); ActiveYOffset.set_has_value( result == RESULT_OK ); } @@ -1914,23 +1914,23 @@ RGBAEssenceDescriptor::InitFromTLVSet(TLVReader& TLVSet) { assert(m_Dict); Result_t result = GenericPictureEssenceDescriptor::InitFromTLVSet(TLVSet); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(RGBAEssenceDescriptor, ComponentMaxRef)); ComponentMaxRef.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(RGBAEssenceDescriptor, ComponentMinRef)); ComponentMinRef.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(RGBAEssenceDescriptor, AlphaMinRef)); AlphaMinRef.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(RGBAEssenceDescriptor, AlphaMaxRef)); AlphaMaxRef.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(RGBAEssenceDescriptor, ScanningDirection)); ScanningDirection.set_has_value( result == RESULT_OK ); } @@ -2179,35 +2179,35 @@ CDCIEssenceDescriptor::InitFromTLVSet(TLVReader& TLVSet) Result_t result = GenericPictureEssenceDescriptor::InitFromTLVSet(TLVSet); if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadUi32(OBJ_READ_ARGS(CDCIEssenceDescriptor, ComponentDepth)); if ( ASDCP_SUCCESS(result) ) result = TLVSet.ReadUi32(OBJ_READ_ARGS(CDCIEssenceDescriptor, HorizontalSubsampling)); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(CDCIEssenceDescriptor, VerticalSubsampling)); VerticalSubsampling.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(CDCIEssenceDescriptor, ColorSiting)); ColorSiting.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(CDCIEssenceDescriptor, ReversedByteOrder)); ReversedByteOrder.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi16(OBJ_READ_ARGS_OPT(CDCIEssenceDescriptor, PaddingBits)); PaddingBits.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(CDCIEssenceDescriptor, AlphaSampleDepth)); AlphaSampleDepth.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(CDCIEssenceDescriptor, BlackRefLevel)); BlackRefLevel.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(CDCIEssenceDescriptor, WhiteReflevel)); WhiteReflevel.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(CDCIEssenceDescriptor, ColorRange)); ColorRange.set_has_value( result == RESULT_OK ); } @@ -2328,43 +2328,43 @@ MPEG2VideoDescriptor::InitFromTLVSet(TLVReader& TLVSet) { assert(m_Dict); Result_t result = CDCIEssenceDescriptor::InitFromTLVSet(TLVSet); - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(MPEG2VideoDescriptor, SingleSequence)); SingleSequence.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(MPEG2VideoDescriptor, ConstantBFrames)); ConstantBFrames.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(MPEG2VideoDescriptor, CodedContentType)); CodedContentType.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(MPEG2VideoDescriptor, LowDelay)); LowDelay.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(MPEG2VideoDescriptor, ClosedGOP)); ClosedGOP.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(MPEG2VideoDescriptor, IdenticalGOP)); IdenticalGOP.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(MPEG2VideoDescriptor, MaxGOP)); MaxGOP.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(MPEG2VideoDescriptor, BPictureCount)); BPictureCount.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(MPEG2VideoDescriptor, BitRate)); BitRate.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi8(OBJ_READ_ARGS_OPT(MPEG2VideoDescriptor, ProfileAndLevel)); ProfileAndLevel.set_has_value( result == RESULT_OK ); } @@ -3220,7 +3220,7 @@ MCALabelSubDescriptor::InitFromTLVSet(TLVReader& TLVSet) result = TLVSet.ReadObject(OBJ_READ_ARGS_OPT(MCALabelSubDescriptor, MCATagName)); MCATagName.set_has_value( result == RESULT_OK ); } - if ( ASDCP_SUCCESS(result) ) { + if ( ASDCP_SUCCESS(result) ) { result = TLVSet.ReadUi32(OBJ_READ_ARGS_OPT(MCALabelSubDescriptor, MCAChannelID)); MCAChannelID.set_has_value( result == RESULT_OK ); } diff --git a/src/AS_02.h b/src/asdcp/AS_02.h index 17561fd..17561fd 100644 --- a/src/AS_02.h +++ b/src/asdcp/AS_02.h diff --git a/src/KLV.h b/src/asdcp/KLV.h index 0f867d8..bad1f12 100755 --- a/src/KLV.h +++ b/src/asdcp/KLV.h @@ -35,7 +35,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <asdcp/KM_fileio.h> #include <asdcp/KM_memio.h> #include <asdcp/AS_DCP.h> -#include "MDD.h" +#include <asdcp/MDD.h> #include <map> diff --git a/src/MDD.h b/src/asdcp/MDD.h index f03e51f..f03e51f 100755 --- a/src/MDD.h +++ b/src/asdcp/MDD.h diff --git a/src/MXF.h b/src/asdcp/MXF.h index b90ebb7..b90ebb7 100755 --- a/src/MXF.h +++ b/src/asdcp/MXF.h diff --git a/src/MXFTypes.h b/src/asdcp/MXFTypes.h index b032b4b..a7180b1 100755 --- a/src/MXFTypes.h +++ b/src/asdcp/MXFTypes.h @@ -32,7 +32,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef _MXFTYPES_H_ #define _MXFTYPES_H_ -#include "KLV.h" +#include <asdcp/KLV.h> #include <list> #include <vector> #include <set> @@ -56,7 +56,7 @@ namespace ASDCP typedef std::pair<ui32_t, ui32_t> ItemInfo; typedef std::map<TagValue, ItemInfo> TagMap; - // + // class TLVReader : public Kumu::MemIOReader { @@ -76,7 +76,7 @@ namespace ASDCP Result_t ReadUi64(const MDDEntry&, ui64_t*); }; - // + // class TLVWriter : public Kumu::MemIOWriter { @@ -119,7 +119,7 @@ namespace ASDCP if ( ! Writer->WriteUi32BE(this->size()) ) return false; if ( ! Writer->WriteUi32BE(this->ItemSize()) ) return false; if ( this->empty() ) return true; - + typename ContainerType::const_iterator i; bool result = true; for ( i = this->begin(); i != this->end() && result; ++i ) @@ -163,7 +163,7 @@ namespace ASDCP { stream = stderr; } - + typename ContainerType::const_iterator i; for ( i = this->begin(); i != this->end(); ++i ) { @@ -234,7 +234,7 @@ namespace ASDCP for ( ; l_i != this->end(); l_i++ ) arch_size += l_i->ArchiveLength(); - + return arch_size; } @@ -415,7 +415,7 @@ namespace ASDCP Code (UInt8): Enumerated value specifying component (i.e., component identifier). "0" is the layout terminator. - Depth (UInt8): Integer specifying the number of bits occupied (see also G.2.26) + Depth (UInt8): Integer specifying the number of bits occupied (see also G.2.26) 1->32 indicates integer depth 253 = HALF (floating point 16-bit value) 254 = IEEE floating point 32-bit value @@ -488,7 +488,7 @@ namespace ASDCP RGBALayout(const RGBALayout& rhs) { Set(rhs.m_value); } const RGBALayout& operator=(const RGBALayout& rhs) { Set(rhs.m_value); return *this; } - + void Set(const byte_t* value) { memcpy(m_value, value, RGBAValueLength); } diff --git a/src/Metadata.h b/src/asdcp/Metadata.h index 55f06d4..55f06d4 100755 --- a/src/Metadata.h +++ b/src/asdcp/Metadata.h diff --git a/src/h__Reader.cpp b/src/h__Reader.cpp index 280e5d4..e142013 100755 --- a/src/h__Reader.cpp +++ b/src/h__Reader.cpp @@ -31,7 +31,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define DEFAULT_MD_DECL #include "AS_DCP_internal.h" -#include "KLV.h" +#include <asdcp/KLV.h> using namespace ASDCP; using namespace ASDCP::MXF; @@ -333,7 +333,7 @@ ASDCP::Read_EKLV_Packet(Kumu::FileReader& File, const ASDCP::Dictionary& Dict, ui32_t SourceLength = (ui32_t)KM_i64_BE(Kumu::cp2i<ui64_t>(ess_p)); ess_p += sizeof(ui64_t); assert(SourceLength); - + if ( FrameBuf.Capacity() < SourceLength ) { DefaultLogSink().Error("FrameBuf.Capacity: %u SourceLength: %u\n", FrameBuf.Capacity(), SourceLength); @@ -369,7 +369,7 @@ ASDCP::Read_EKLV_Packet(Kumu::FileReader& File, const ASDCP::Dictionary& Dict, result = DecryptFrameBuffer(TmpWrapper, FrameBuf, Ctx); FrameBuf.FrameNumber(FrameNum); - + // detect and test integrity pack if ( ASDCP_SUCCESS(result) && Info.UsesHMAC && HMAC ) { @@ -408,7 +408,7 @@ ASDCP::Read_EKLV_Packet(Kumu::FileReader& File, const ASDCP::Dictionary& Dict, ui32_t read_count; assert(PacketLength <= 0xFFFFFFFFL); result = File.Read(FrameBuf.Data(), (ui32_t) PacketLength, &read_count); - + if ( ASDCP_FAILURE(result) ) return result; @@ -419,7 +419,7 @@ ASDCP::Read_EKLV_Packet(Kumu::FileReader& File, const ASDCP::Dictionary& Dict, DefaultLogSink().Error("read_count: %s != FrameLength: %s\n", ui64sz(read_count, intbuf1), ui64sz(PacketLength, intbuf2) ); - + return RESULT_READFAIL; } diff --git a/src/h__Writer.cpp b/src/h__Writer.cpp index bb1a254..720482a 100755 --- a/src/h__Writer.cpp +++ b/src/h__Writer.cpp @@ -30,7 +30,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "AS_DCP_internal.h" -#include "KLV.h" +#include <asdcp/KLV.h> using namespace ASDCP; using namespace ASDCP::MXF; diff --git a/src/wscript b/src/wscript index 63ad311..f03d802 100644 --- a/src/wscript +++ b/src/wscript @@ -88,6 +88,12 @@ def build(bld): asdcp/KM_fileio.h asdcp/KM_prng.h asdcp/AS_DCP.h + asdcp/AS_02.h + asdcp/Metadata.h + asdcp/MXF.h + asdcp/MXFTypes.h + asdcp/KLV.h + asdcp/MDD.h """ bld.install_files('${PREFIX}/include/libasdcp-cth/asdcp', headers) |
