From: jhurst Date: Tue, 20 Dec 2005 19:16:21 +0000 (+0000) Subject: pre-release commit X-Git-Tag: rel_2_10_32~609 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=c6900386fb66832781456838804ed7e28c535d63;hp=d440dbd72e7b3395c589a72e391eb33b6d2109f4;p=asdcplib.git pre-release commit --- diff --git a/Identifier.h b/Identifier.h index be93639..ddfaa41 100755 --- a/Identifier.h +++ b/Identifier.h @@ -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 8ac2511..298899b 100755 --- 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 f918f71..fdd1e81 100755 --- 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 bae2f52..9646440 100755 --- 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. diff --git a/src/AS_DCP.h b/src/AS_DCP.h index 06ff8b9..d76c702 100755 --- a/src/AS_DCP.h +++ b/src/AS_DCP.h @@ -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 diff --git a/src/AS_DCP_MXF.cpp b/src/AS_DCP_MXF.cpp index a7cb1e3..03b9b54 100755 --- a/src/AS_DCP_MXF.cpp +++ b/src/AS_DCP_MXF.cpp @@ -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) diff --git a/src/Index.cpp b/src/Index.cpp index 9d1791a..96c81ed 100755 --- a/src/Index.cpp +++ b/src/Index.cpp @@ -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); } diff --git a/src/KLV.cpp b/src/KLV.cpp index b57e805..062fd74 100755 --- a/src/KLV.cpp +++ b/src/KLV.cpp @@ -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 diff --git a/src/KLV.h b/src/KLV.h index 587bbe8..d940ff3 100755 --- 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_ diff --git a/src/MDD.h b/src/MDD.h index 493e30d..bcf0a98 100755 --- 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_ diff --git a/src/MXF.cpp b/src/MXF.cpp index 45570bb..a04cfe2 100755 --- a/src/MXF.cpp +++ b/src/MXF.cpp @@ -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 @@ -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 FactoryList; -#define SETUP_IDX(t) const ui32_t FLT_##t = v; +typedef std::map::iterator FLi_t; + +class FactoryList : public std::map +{ + 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; diff --git a/src/MXF.h b/src/MXF.h index fc0d996..caaecae 100755 --- 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(); }; // diff --git a/src/MXFTypes.cpp b/src/MXFTypes.cpp index ca65bdf..2a8949e 100755 --- a/src/MXFTypes.cpp +++ b/src/MXFTypes.cpp @@ -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; } diff --git a/src/MXFTypes.h b/src/MXFTypes.h index 02efbb1..4667588 100755 --- a/src/MXFTypes.h +++ b/src/MXFTypes.h @@ -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 #include @@ -280,6 +303,8 @@ namespace ASDCP } // namespace ASDCP +#endif //_MXFTYPES_H_ + // // end MXFTypes.h // diff --git a/src/Metadata.h b/src/Metadata.h index 0a04790..deb1abd 100755 --- a/src/Metadata.h +++ b/src/Metadata.h @@ -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_ diff --git a/src/asdcp-test.cpp b/src/asdcp-test.cpp index c034626..12d8feb 100755 --- a/src/asdcp-test.cpp +++ b/src/asdcp-test.cpp @@ -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 @@ -1181,7 +1181,6 @@ show_file_info(CommandOptions& Options) fputs("File essence type is MPEG2 video.\n", stdout); FileInfoWrapper::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::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 \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 ) diff --git a/src/j2c-test.cpp b/src/j2c-test.cpp index 98c7cf4..cfced0c 100755 --- a/src/j2c-test.cpp +++ b/src/j2c-test.cpp @@ -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 #include diff --git a/src/klvwalk.cpp b/src/klvwalk.cpp index 3704f10..96d31e4 100755 --- a/src/klvwalk.cpp +++ b/src/klvwalk.cpp @@ -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 #include