#include "JP2K.h"
#include "MPEG.h"
#include "Wav.h"
+#include <iostream>
+#include <iomanip>
//------------------------------------------------------------------------------------------
// misc subroutines
+//
+std::ostream&
+ASDCP::operator << (std::ostream& strm, const WriterInfo& Info)
+{
+ char str_buf[40];
+
+ strm << " ProductUUID: " << UUID(Info.ProductUUID).EncodeHex(str_buf, 40) << std::endl;
+ strm << " ProductVersion: " << Info.ProductVersion << std::endl;
+ strm << " CompanyName: " << Info.CompanyName << std::endl;
+ strm << " ProductName: " << Info.ProductName << std::endl;
+ strm << " EncryptedEssence: " << (Info.EncryptedEssence ? "Yes" : "No") << std::endl;
+
+ if ( Info.EncryptedEssence )
+ {
+ strm << " HMAC: " << (Info.UsesHMAC ? "Yes" : "No") << std::endl;
+ strm << " ContextID: " << UUID(Info.ContextID).EncodeHex(str_buf, 40) << std::endl;
+ strm << "CryptographicKeyID: " << UUID(Info.CryptographicKeyID).EncodeHex(str_buf, 40) << std::endl;
+ }
+
+ strm << " AssetUUID: " << UUID(Info.AssetUUID).EncodeHex(str_buf, 40) << std::endl;
+ strm << " Label Set Type: " << (Info.LabelSetType == LS_MXF_SMPTE ? "SMPTE" :
+ (Info.LabelSetType == LS_MXF_INTEROP ? "MXF Interop" :
+ "Unknown")) << std::endl;
+ return strm;
+}
+
//
void
ASDCP::WriterInfoDump(const WriterInfo& Info, FILE* stream)
type = ESS_PCM_24b_48k;
else if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(MPEG2VideoDescriptor))) )
type = ESS_MPEG2_VES;
- else if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(DCTimedTextDescriptor))) )
+ else if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(TimedTextDescriptor))) )
type = ESS_TIMED_TEXT;
}
while ( p[i] == 0 ) i++;
if ( i > 1 && p[i] == 1 && (p[i+1] == ASDCP::MPEG2::SEQ_START || p[i+1] == ASDCP::MPEG2::PIC_START) )
- type = ESS_MPEG2_VES;
-
- else if ( Kumu::StringIsXML((const char*)p, FB.Size()) )
- type = ESS_TIMED_TEXT;
-
+ {
+ type = ESS_MPEG2_VES;
+ }
else if ( ASDCP_SUCCESS(WavHeader.ReadFromBuffer(p, read_count, &data_offset)) )
- type = ESS_PCM_24b_48k;
-
+ {
+ switch ( WavHeader.samplespersec )
+ {
+ case 48000: type = ESS_PCM_24b_48k; break;
+ case 96000: type = ESS_PCM_24b_96k; break;
+ default:
+ return RESULT_FORMAT;
+ }
+ }
else if ( ASDCP_SUCCESS(AIFFHeader.ReadFromBuffer(p, read_count, &data_offset)) )
- type = ESS_PCM_24b_48k;
+ {
+ type = ESS_PCM_24b_48k;
+ }
+ else if ( Kumu::StringIsXML((const char*)p, FB.Size()) )
+ {
+ type = ESS_TIMED_TEXT;
+ }
}
}
else if ( Kumu::PathIsDirectory(filename) )