diff options
| author | jhurst <jhurst@cinecert.com> | 2020-09-08 09:33:17 -0700 |
|---|---|---|
| committer | jhurst <jhurst@cinecert.com> | 2020-09-08 09:33:17 -0700 |
| commit | 2b52b1cc03707a4c876b38fdd8879a27a218d498 (patch) | |
| tree | 6510eb7fef08bf66d7a52f097f31109866ce4791 /src/asdcp-wrap.cpp | |
| parent | e1e8fdd9d0715c9df4ab12190cb27b02f3a1c5d8 (diff) | |
Added OpenSSL and Xerces build options to allow stand-alone compilation
Diffstat (limited to 'src/asdcp-wrap.cpp')
| -rwxr-xr-x | src/asdcp-wrap.cpp | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/src/asdcp-wrap.cpp b/src/asdcp-wrap.cpp index 66f291a..362ff3b 100755 --- a/src/asdcp-wrap.cpp +++ b/src/asdcp-wrap.cpp @@ -534,8 +534,6 @@ write_MPEG2_file(CommandOptions& Options) MPEG2::Parser Parser; MPEG2::MXFWriter Writer; MPEG2::VideoDescriptor VDesc; - byte_t IV_buf[CBC_BLOCK_SIZE]; - Kumu::FortunaRNG RNG; // set up essence parser Result_t result = Parser.OpenRead(Options.filenames.front()); @@ -568,9 +566,12 @@ write_MPEG2_file(CommandOptions& Options) fprintf(stderr, "ATTENTION! Writing SMPTE Universal Labels\n"); } +#ifdef HAVE_OPENSSL // configure encryption if( Options.key_flag ) { + byte_t IV_buf[CBC_BLOCK_SIZE]; + Kumu::FortunaRNG RNG; Kumu::GenRandomUUID(Info.ContextID); Info.EncryptedEssence = true; @@ -596,6 +597,7 @@ write_MPEG2_file(CommandOptions& Options) result = HMAC->InitKey(Options.key_value, Info.LabelSetType); } } +#endif // HAVE_OPENSSL if ( ASDCP_SUCCESS(result) ) result = Writer.OpenWrite(Options.out_file, Info, VDesc); @@ -690,7 +692,6 @@ write_JP2K_S_file(CommandOptions& Options) JP2K::PictureDescriptor PDesc; JP2K::SequenceParser ParserLeft, ParserRight; byte_t IV_buf[CBC_BLOCK_SIZE]; - Kumu::FortunaRNG RNG; if ( Options.filenames.size() != 2 ) { @@ -738,9 +739,11 @@ write_JP2K_S_file(CommandOptions& Options) fprintf(stderr, "ATTENTION! Writing SMPTE Universal Labels\n"); } +#ifdef HAVE_OPENSSL // configure encryption if( Options.key_flag ) { + Kumu::FortunaRNG RNG; Kumu::GenRandomUUID(Info.ContextID); Info.EncryptedEssence = true; @@ -766,6 +769,7 @@ write_JP2K_S_file(CommandOptions& Options) result = HMAC->InitKey(Options.key_value, Info.LabelSetType); } } +#endif // HAVE_OPENSSL if ( ASDCP_SUCCESS(result) ) result = Writer.OpenWrite(Options.out_file, Info, PDesc); @@ -840,7 +844,6 @@ write_JP2K_file(CommandOptions& Options) JP2K::PictureDescriptor PDesc; JP2K::SequenceParser Parser; byte_t IV_buf[CBC_BLOCK_SIZE]; - Kumu::FortunaRNG RNG; // set up essence parser Result_t result = Parser.OpenRead(Options.filenames.front(), Options.j2c_pedantic); @@ -877,9 +880,11 @@ write_JP2K_file(CommandOptions& Options) fprintf(stderr, "ATTENTION! Writing SMPTE Universal Labels\n"); } +#ifdef HAVE_OPENSSL // configure encryption if( Options.key_flag ) { + Kumu::FortunaRNG RNG; Kumu::GenRandomUUID(Info.ContextID); Info.EncryptedEssence = true; @@ -905,6 +910,7 @@ write_JP2K_file(CommandOptions& Options) result = HMAC->InitKey(Options.key_value, Info.LabelSetType); } } +#endif // HAVE_OPENSSL if ( ASDCP_SUCCESS(result) ) result = Writer.OpenWrite(Options.out_file, Info, PDesc); @@ -977,7 +983,6 @@ write_PCM_file(CommandOptions& Options) PCM::AudioDescriptor ADesc; Rational PictureRate = Options.PictureRate(); byte_t IV_buf[CBC_BLOCK_SIZE]; - Kumu::FortunaRNG RNG; // set up essence parser Result_t result = Parser.OpenRead(Options.filenames, PictureRate); @@ -1021,9 +1026,11 @@ write_PCM_file(CommandOptions& Options) fprintf(stderr, "ATTENTION! Writing SMPTE Universal Labels\n"); } +#ifdef HAVE_OPENSSL // configure encryption if( Options.key_flag ) { + Kumu::FortunaRNG RNG; Kumu::GenRandomUUID(Info.ContextID); Info.EncryptedEssence = true; @@ -1049,6 +1056,7 @@ write_PCM_file(CommandOptions& Options) result = HMAC->InitKey(Options.key_value, Info.LabelSetType); } } +#endif // HAVE_OPENSSL if ( ASDCP_SUCCESS(result) ) result = Writer.OpenWrite(Options.out_file, Info, ADesc); @@ -1171,7 +1179,6 @@ write_PCM_with_ATMOS_sync_file(CommandOptions& Options) PCM::AudioDescriptor ADesc; Rational PictureRate = Options.PictureRate(); byte_t IV_buf[CBC_BLOCK_SIZE]; - Kumu::FortunaRNG RNG; WriterInfo Info = s_MyInfo; // fill in your favorite identifiers here if ( Options.asset_id_flag ) @@ -1213,9 +1220,11 @@ write_PCM_with_ATMOS_sync_file(CommandOptions& Options) Info.LabelSetType = LS_MXF_SMPTE; fprintf(stderr, "ATTENTION! Writing SMPTE Universal Labels\n"); +#ifdef HAVE_OPENSSL // configure encryption if( Options.key_flag ) { + Kumu::FortunaRNG RNG; Kumu::GenRandomUUID(Info.ContextID); Info.EncryptedEssence = true; @@ -1241,6 +1250,7 @@ write_PCM_with_ATMOS_sync_file(CommandOptions& Options) result = HMAC->InitKey(Options.key_value, Info.LabelSetType); } } +#endif // HAVE_OPENSSL if ( ASDCP_SUCCESS(result) ) result = Writer.OpenWrite(Options.out_file, Info, ADesc); @@ -1297,6 +1307,8 @@ write_PCM_with_ATMOS_sync_file(CommandOptions& Options) } +#ifdef HAVE_XERCES_C + //------------------------------------------------------------------------------------------ // TimedText essence @@ -1314,7 +1326,6 @@ write_timed_text_file(CommandOptions& Options) TimedText::FrameBuffer FrameBuffer; TimedText::TimedTextDescriptor TDesc; byte_t IV_buf[CBC_BLOCK_SIZE]; - Kumu::FortunaRNG RNG; // set up essence parser Result_t result = Parser.OpenRead(Options.filenames.front()); @@ -1344,9 +1355,11 @@ write_timed_text_file(CommandOptions& Options) Info.LabelSetType = LS_MXF_SMPTE; fprintf(stderr, "ATTENTION! Writing SMPTE Universal Labels\n"); +#ifdef HAVE_OPENSSL // configure encryption if( Options.key_flag ) { + Kumu::FortunaRNG RNG; Kumu::GenRandomUUID(Info.ContextID); Info.EncryptedEssence = true; @@ -1372,6 +1385,7 @@ write_timed_text_file(CommandOptions& Options) result = HMAC->InitKey(Options.key_value, Info.LabelSetType); } } +#endif // HAVE_OPENSSL if ( ASDCP_SUCCESS(result) ) result = Writer.OpenWrite(Options.out_file, Info, TDesc); @@ -1420,6 +1434,8 @@ write_timed_text_file(CommandOptions& Options) return result; } +#endif //HAVE_XERCES_C + // Write one or more plaintext Dolby ATMOS bytestreams to a plaintext ASDCP file // Write one or more plaintext Dolby ATMOS bytestreams to a ciphertext ASDCP file // @@ -1433,7 +1449,6 @@ write_dolby_atmos_file(CommandOptions& Options) ATMOS::AtmosDescriptor ADesc; DCData::SequenceParser Parser; byte_t IV_buf[CBC_BLOCK_SIZE]; - Kumu::FortunaRNG RNG; // set up essence parser Result_t result = Parser.OpenRead(Options.filenames.front()); @@ -1468,9 +1483,11 @@ write_dolby_atmos_file(CommandOptions& Options) Info.LabelSetType = LS_MXF_SMPTE; +#ifdef HAVE_OPENSSL // configure encryption if( Options.key_flag ) { + Kumu::FortunaRNG RNG; Kumu::GenRandomUUID(Info.ContextID); Info.EncryptedEssence = true; @@ -1496,6 +1513,7 @@ write_dolby_atmos_file(CommandOptions& Options) result = HMAC->InitKey(Options.key_value, Info.LabelSetType); } } +#endif if ( ASDCP_SUCCESS(result) ) result = Writer.OpenWrite(Options.out_file, Info, ADesc); @@ -1555,7 +1573,6 @@ write_aux_data_file(CommandOptions& Options) DCData::DCDataDescriptor DDesc; DCData::SequenceParser Parser; byte_t IV_buf[CBC_BLOCK_SIZE]; - Kumu::FortunaRNG RNG; // set up essence parser Result_t result = Parser.OpenRead(Options.filenames.front()); @@ -1585,9 +1602,11 @@ write_aux_data_file(CommandOptions& Options) Info.LabelSetType = LS_MXF_SMPTE; +#ifdef HAVE_OPENSSL // configure encryption if( Options.key_flag ) { + Kumu::FortunaRNG RNG; Kumu::GenRandomUUID(Info.ContextID); Info.EncryptedEssence = true; @@ -1613,6 +1632,7 @@ write_aux_data_file(CommandOptions& Options) result = HMAC->InitKey(Options.key_value, Info.LabelSetType); } } +#endif // HAVE_OPENSSL if ( ASDCP_SUCCESS(result) ) result = Writer.OpenWrite(Options.out_file, Info, DDesc); @@ -1726,9 +1746,11 @@ main(int argc, const char** argv) } break; +#ifdef HAVE_XERCES_C case ESS_TIMED_TEXT: result = write_timed_text_file(Options); break; +#endif //HAVE_XERCES_C case ESS_DCDATA_DOLBY_ATMOS: result = write_dolby_atmos_file(Options); |
