diff options
| author | jhurst <jhurst@cinecert.com> | 2015-01-22 21:05:58 +0000 |
|---|---|---|
| committer | jhurst <> | 2015-01-22 21:05:58 +0000 |
| commit | 665b2e2e5dcf2266e636d29bcf4ef281da65117f (patch) | |
| tree | 1c9ddb0c0433f369817dc196e6b8a3502b4a1122 /src | |
| parent | c37d749945eba6b8922ecf58ef886f32ee55b38e (diff) | |
phdr
Diffstat (limited to 'src')
| -rw-r--r-- | src/AS_02_PHDR.cpp | 2 | ||||
| -rw-r--r-- | src/AS_02_PHDR.h | 32 | ||||
| -rw-r--r-- | src/MDD.cpp | 6 | ||||
| -rwxr-xr-x | src/MDD.h | 3 | ||||
| -rw-r--r-- | src/Makefile.am | 34 | ||||
| -rwxr-xr-x | src/Metadata.cpp | 11 | ||||
| -rwxr-xr-x | src/Metadata.h | 3 | ||||
| -rwxr-xr-x | src/PHDR_Sequence_Parser.cpp | 2 |
8 files changed, 87 insertions, 6 deletions
diff --git a/src/AS_02_PHDR.cpp b/src/AS_02_PHDR.cpp index db9228a..dd413f9 100644 --- a/src/AS_02_PHDR.cpp +++ b/src/AS_02_PHDR.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2011-2014, John Hurst +Copyright (c) 2011-2015, John Hurst All rights reserved. diff --git a/src/AS_02_PHDR.h b/src/AS_02_PHDR.h index b3c94e7..1328de1 100644 --- a/src/AS_02_PHDR.h +++ b/src/AS_02_PHDR.h @@ -1,3 +1,35 @@ +/* +Copyright (c) 2011-2015, 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 AS_02_PHDR.h + \version $Id$ + \brief AS-02 library, JPEG 2000 P-HDR essence reader and writer implementation +*/ #ifndef _AS_02_PHDR_H_ diff --git a/src/MDD.cpp b/src/MDD.cpp index ce03603..cae083d 100644 --- a/src/MDD.cpp +++ b/src/MDD.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2006-2013, John Hurst +Copyright (c) 2006-2015, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -1183,6 +1183,10 @@ static const ASDCP::MDDEntry s_MDD_Table[] = { 0x0e, 0x09, 0x06, 0x07, 0x01, 0x01, 0x01, 0x06 }, {0}, false, "PHDRMetadataTrackSubDescriptor_SimplePayloadSID" }, + { { 0x06, 0x0e, 0x2b, 0x34, 0x01, 0x01, 0x01, 0x0e, // 380 + 0x04, 0x01, 0x06, 0x03, 0x0e, 0x00, 0x00, 0x00 }, + {0}, true, "JPEG2000PictureSubDescriptor_J2CLayout" }, + { {0}, {0}, false, 0 } }; @@ -1,5 +1,5 @@ /* -Copyright (c) 2006-2013, John Hurst +Copyright (c) 2006-2015, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -415,6 +415,7 @@ namespace ASDCP { MDD_PHDRMetadataTrackSubDescriptor_DataDefinition, // 377 MDD_PHDRMetadataTrackSubDescriptor_SourceTrackID, // 378 MDD_PHDRMetadataTrackSubDescriptor_SimplePayloadSID, // 379 + MDD_JPEG2000PictureSubDescriptor_J2CLayout, // 380 MDD_Max }; // enum MDD_t diff --git a/src/Makefile.am b/src/Makefile.am index a0dca91..a1f28f5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -80,6 +80,10 @@ if USE_AS_02 include_HEADERS += AS_02.h endif +if USE_PHDR +include_HEADERS += AS_02_PHDR.h +endif + # list of the libraries to build and install lib_LTLIBRARIES = libkumu.la libasdcp.la @@ -88,6 +92,10 @@ if USE_AS_02 lib_LTLIBRARIES += libas02.la endif +if USE_PHDR +lib_LTLIBRARIES += libphdr.la +endif + # sources for kumu library libkumu_la_SOURCES = KM_error.h KM_fileio.cpp KM_fileio.h KM_log.cpp KM_log.h \ KM_memio.h KM_mutex.h KM_platform.h KM_prng.cpp KM_prng.h KM_util.cpp \ @@ -141,6 +149,19 @@ libas02_la_LIBADD = libasdcp.la libkumu.la libas02_la_CPPFLAGS = -DASDCP_PLATFORM=\"@host@\" endif + +if USE_PHDR +# sources for PHDR library +libphdr_la_SOURCES = \ + AS_02_PHDR.h \ + PHDR_Sequence_Parser.cpp \ + AS_02_PHDR.cpp + +libphdr_la_LDFLAGS = -release @VERSION@ +libphdr_la_LIBADD = libasdcp.la libkumu.la +libphdr_la_CPPFLAGS = -DASDCP_PLATFORM=\"@host@\" +endif + # Python extension if PYTHON_USE lib_LTLIBRARIES += libpyasdcp.la @@ -196,6 +217,11 @@ bin_PROGRAMS += \ as-02-unwrap endif +if USE_PHDR +bin_PROGRAMS += \ + phdr-wrap \ + phdr-unwrap +endif # sources and linkage for CLI utilities asdcp_test_SOURCES = asdcp-test.cpp @@ -245,6 +271,14 @@ as_02_unwrap_SOURCES = as-02-unwrap.cpp as_02_unwrap_LDADD = libas02.la libasdcp.la libkumu.la endif +if USE_PHDR +phdr_wrap_SOURCES = phdr-wrap.cpp +phdr_wrap_LDADD = libphdr.la libas02.la libasdcp.la libkumu.la + +phdr_unwrap_SOURCES = phdr-unwrap.cpp +phdr_unwrap_LDADD = libphdr.la libas02.la libasdcp.la libkumu.la +endif + # list of programs that need to be compiled for use in test suite check_PROGRAMS = asdcp-mem-test path-test \ fips-186-rng-test asdcp-version diff --git a/src/Metadata.cpp b/src/Metadata.cpp index 0d163be..2ab2635 100755 --- a/src/Metadata.cpp +++ b/src/Metadata.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2005-2012, John Hurst +Copyright (c) 2005-2015, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -2048,6 +2048,10 @@ JPEG2000PictureSubDescriptor::InitFromTLVSet(TLVReader& TLVSet) result = TLVSet.ReadObject(OBJ_READ_ARGS_OPT(JPEG2000PictureSubDescriptor, QuantizationDefault)); QuantizationDefault.set_has_value( result == RESULT_OK ); } + if ( ASDCP_SUCCESS(result) ) { + result = TLVSet.ReadObject(OBJ_READ_ARGS_OPT(JPEG2000PictureSubDescriptor, J2CLayout)); + J2CLayout.set_has_value( result == RESULT_OK ); + } return result; } @@ -2070,6 +2074,7 @@ JPEG2000PictureSubDescriptor::WriteToTLVSet(TLVWriter& TLVSet) if ( ASDCP_SUCCESS(result) && ! PictureComponentSizing.empty() ) result = TLVSet.WriteObject(OBJ_WRITE_ARGS_OPT(JPEG2000PictureSubDescriptor, PictureComponentSizing)); if ( ASDCP_SUCCESS(result) && ! CodingStyleDefault.empty() ) result = TLVSet.WriteObject(OBJ_WRITE_ARGS_OPT(JPEG2000PictureSubDescriptor, CodingStyleDefault)); if ( ASDCP_SUCCESS(result) && ! QuantizationDefault.empty() ) result = TLVSet.WriteObject(OBJ_WRITE_ARGS_OPT(JPEG2000PictureSubDescriptor, QuantizationDefault)); + if ( ASDCP_SUCCESS(result) && ! J2CLayout.empty() ) result = TLVSet.WriteObject(OBJ_WRITE_ARGS_OPT(JPEG2000PictureSubDescriptor, J2CLayout)); return result; } @@ -2091,6 +2096,7 @@ JPEG2000PictureSubDescriptor::Copy(const JPEG2000PictureSubDescriptor& rhs) PictureComponentSizing = rhs.PictureComponentSizing; CodingStyleDefault = rhs.CodingStyleDefault; QuantizationDefault = rhs.QuantizationDefault; + J2CLayout = rhs.J2CLayout; } // @@ -2123,6 +2129,9 @@ JPEG2000PictureSubDescriptor::Dump(FILE* stream) if ( ! QuantizationDefault.empty() ) { fprintf(stream, " %22s = %s\n", "QuantizationDefault", QuantizationDefault.get().EncodeString(identbuf, IdentBufferLen)); } + if ( ! J2CLayout.empty() ) { + fprintf(stream, " %22s = %s\n", "J2CLayout", J2CLayout.get().EncodeString(identbuf, IdentBufferLen)); + } } // diff --git a/src/Metadata.h b/src/Metadata.h index dc8d921..b8d16dc 100755 --- a/src/Metadata.h +++ b/src/Metadata.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2005-2012, John Hurst +Copyright (c) 2005-2015, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -564,6 +564,7 @@ namespace ASDCP optional_property<Raw> PictureComponentSizing; optional_property<Raw> CodingStyleDefault; optional_property<Raw> QuantizationDefault; + optional_property<Raw> J2CLayout; JPEG2000PictureSubDescriptor(const Dictionary*& d); JPEG2000PictureSubDescriptor(const JPEG2000PictureSubDescriptor& rhs); diff --git a/src/PHDR_Sequence_Parser.cpp b/src/PHDR_Sequence_Parser.cpp index 47d7fde..d7d8616 100755 --- a/src/PHDR_Sequence_Parser.cpp +++ b/src/PHDR_Sequence_Parser.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2004-2014, John Hurst +Copyright (c) 2004-2015, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without |
