#include <stdio.h>
#include <stdarg.h>
#include <math.h>
-#include <iostream>
+#include <iosfwd>
#include <string>
#include <list>
}
};
+ // Print WriterInfo to std::ostream
+ std::ostream& operator << (std::ostream& strm, const WriterInfo& winfo);
// Print WriterInfo to stream, stderr by default.
void WriterInfoDump(const WriterInfo&, FILE* = 0);
ui32_t ContainerDuration; //
};
+ // Print VideoDescriptor to std::ostream
+ std::ostream& operator << (std::ostream& strm, const VideoDescriptor& vdesc);
// Print VideoDescriptor to stream, stderr by default.
void VideoDescriptorDump(const VideoDescriptor&, FILE* = 0);
ui32_t ContainerDuration; // number of frames
};
+ // Print AudioDescriptor to std::ostream
+ std::ostream& operator << (std::ostream& strm, const AudioDescriptor& adesc);
// Print debugging information to stream (stderr default)
void AudioDescriptorDump(const AudioDescriptor&, FILE* = 0);
QuantizationDefault_t QuantizationDefault;
};
+ // Print debugging information to std::ostream
+ std::ostream& operator << (std::ostream& strm, const PictureDescriptor& pdesc);
// Print debugging information to stream (stderr default)
void PictureDescriptorDump(const PictureDescriptor&, FILE* = 0);
TimedTextDescriptor() : ContainerDuration(0), EncodingName("UTF-8") {} // D-Cinema format is always UTF-8
};
+ // Print debugging information to std::ostream
+ std::ostream& operator << (std::ostream& strm, const TimedTextDescriptor& tinfo);
// Print debugging information to stream (stderr default)
void DescriptorDump(const TimedTextDescriptor&, FILE* = 0);
*/
#include "AS_DCP_internal.h"
+#include <iostream>
+#include <iomanip>
using namespace ASDCP::JP2K;
using Kumu::GenRandomValue;
int s_exp_lookup[16] = { 0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024,2048, 4096, 8192, 16384, 32768 };
+//
+std::ostream&
+ASDCP::JP2K::operator << (std::ostream& strm, const PictureDescriptor& PDesc)
+{
+ strm << " AspectRatio: " << PDesc.AspectRatio.Numerator << "/" << PDesc.AspectRatio.Denominator << std::endl;
+ strm << " EditRate: " << PDesc.EditRate.Numerator << "/" << PDesc.EditRate.Denominator << std::endl;
+ strm << " StoredWidth: " << (unsigned) PDesc.StoredWidth << std::endl;
+ strm << " StoredHeight: " << (unsigned) PDesc.StoredHeight << std::endl;
+ strm << " Rsize: " << (unsigned) PDesc.Rsize << std::endl;
+ strm << " Xsize: " << (unsigned) PDesc.Xsize << std::endl;
+ strm << " Ysize: " << (unsigned) PDesc.Ysize << std::endl;
+ strm << " XOsize: " << (unsigned) PDesc.XOsize << std::endl;
+ strm << " YOsize: " << (unsigned) PDesc.YOsize << std::endl;
+ strm << " XTsize: " << (unsigned) PDesc.XTsize << std::endl;
+ strm << " YTsize: " << (unsigned) PDesc.YTsize << std::endl;
+ strm << " XTOsize: " << (unsigned) PDesc.XTOsize << std::endl;
+ strm << " YTOsize: " << (unsigned) PDesc.YTOsize << std::endl;
+ strm << " ContainerDuration: " << (unsigned) PDesc.ContainerDuration << std::endl;
+
+ strm << "-- JPEG 2000 Metadata --" << std::endl;
+ strm << " ImageComponents:" << std::endl;
+ strm << " bits h-sep v-sep" << std::endl;
+
+ ui32_t i;
+ for ( i = 0; i < PDesc.Csize; i++ )
+ {
+ strm << " " << std::setw(4) << PDesc.ImageComponents[i].Ssize + 1 /* See ISO 15444-1, Table A11, for the origin of '+1' */
+ << " " << std::setw(5) << PDesc.ImageComponents[i].XRsize
+ << " " << std::setw(5) << PDesc.ImageComponents[i].YRsize
+ << std::endl;
+ }
+
+ strm << " Scod: " << (short) PDesc.CodingStyleDefault.Scod << std::endl;
+ strm << " ProgressionOrder: " << (short) PDesc.CodingStyleDefault.SGcod.ProgressionOrder << std::endl;
+ strm << " NumberOfLayers: " << (short) KM_i16_BE(Kumu::cp2i<ui16_t>(PDesc.CodingStyleDefault.SGcod.NumberOfLayers)) << std::endl;
+ strm << " MultiCompTransform: " << (short) PDesc.CodingStyleDefault.SGcod.MultiCompTransform << std::endl;
+ strm << "DecompositionLevels: " << (short) PDesc.CodingStyleDefault.SPcod.DecompositionLevels << std::endl;
+ strm << " CodeblockWidth: " << (short) PDesc.CodingStyleDefault.SPcod.CodeblockWidth << std::endl;
+ strm << " CodeblockHeight: " << (short) PDesc.CodingStyleDefault.SPcod.CodeblockHeight << std::endl;
+ strm << " CodeblockStyle: " << (short) PDesc.CodingStyleDefault.SPcod.CodeblockStyle << std::endl;
+ strm << " Transformation: " << (short) PDesc.CodingStyleDefault.SPcod.Transformation << std::endl;
+
+
+ ui32_t precinct_set_size = 0;
+
+ for ( i = 0; PDesc.CodingStyleDefault.SPcod.PrecinctSize[i] != 0 && i < MaxPrecincts; i++ )
+ precinct_set_size++;
+
+ strm << " Precincts: " << (short) precinct_set_size << std::endl;
+ strm << "precinct dimensions:" << std::endl;
+
+ for ( i = 0; i < precinct_set_size; i++ )
+ strm << " " << i + 1 << ": " << s_exp_lookup[PDesc.CodingStyleDefault.SPcod.PrecinctSize[i]&0x0f] << " x "
+ << s_exp_lookup[(PDesc.CodingStyleDefault.SPcod.PrecinctSize[i]>>4)&0x0f] << std::endl;
+
+ strm << " Sqcd: " << (short) PDesc.QuantizationDefault.Sqcd << std::endl;
+
+ char tmp_buf[MaxDefaults*2];
+ strm << " SPqcd: " << Kumu::bin2hex(PDesc.QuantizationDefault.SPqcd, PDesc.QuantizationDefault.SPqcdLength, tmp_buf, MaxDefaults*2)
+ << std::endl;
+
+ return strm;
+}
+
//
void
ASDCP::JP2K::PictureDescriptorDump(const PictureDescriptor& PDesc, FILE* stream)
);
}
+
//------------------------------------------------------------------------------------------
//
// hidden, internal implementation of JPEG 2000 reader
*/
#include "AS_DCP_internal.h"
+#include <iostream>
+#include <iomanip>
//------------------------------------------------------------------------------------------
return RESULT_OK;
}
+//
+std::ostream&
+ASDCP::MPEG2::operator << (std::ostream& strm, const VideoDescriptor& VDesc)
+{
+ strm << " SampleRate: " << VDesc.SampleRate.Numerator << "/" << VDesc.SampleRate.Denominator << std::endl;
+ strm << " FrameLayout: " << (unsigned) VDesc.FrameLayout << std::endl;
+ strm << " StoredWidth: " << (unsigned) VDesc.StoredWidth << std::endl;
+ strm << " StoredHeight: " << (unsigned) VDesc.StoredHeight << std::endl;
+ strm << " AspectRatio: " << VDesc.AspectRatio.Numerator << "/" << VDesc.AspectRatio.Denominator << std::endl;
+ strm << " ComponentDepth: " << (unsigned) VDesc.ComponentDepth << std::endl;
+ strm << " HorizontalSubsmpl: " << (unsigned) VDesc.HorizontalSubsampling << std::endl;
+ strm << " VerticalSubsmpl: " << (unsigned) VDesc.VerticalSubsampling << std::endl;
+ strm << " ColorSiting: " << (unsigned) VDesc.ColorSiting << std::endl;
+ strm << " CodedContentType: " << (unsigned) VDesc.CodedContentType << std::endl;
+ strm << " LowDelay: " << (unsigned) VDesc.LowDelay << std::endl;
+ strm << " BitRate: " << (unsigned) VDesc.BitRate << std::endl;
+ strm << " ProfileAndLevel: " << (unsigned) VDesc.ProfileAndLevel << std::endl;
+ strm << " ContainerDuration: " << (unsigned) VDesc.ContainerDuration << std::endl;
+
+ return strm;
+}
//
void
#include "AS_DCP_internal.h"
#include <map>
+#include <iostream>
+#include <iomanip>
//------------------------------------------------------------------------------------------
return RESULT_OK;
}
+//
+std::ostream&
+ASDCP::PCM::operator << (std::ostream& strm, const AudioDescriptor& ADesc)
+{
+ strm << " SampleRate: " << ADesc.SampleRate.Numerator << "/" << ADesc.SampleRate.Denominator << std::endl;
+ strm << " AudioSamplingRate: " << ADesc.AudioSamplingRate.Numerator << "/" << ADesc.AudioSamplingRate.Denominator << std::endl;
+ strm << " Locked: " << (unsigned) ADesc.Locked << std::endl;
+ strm << " ChannelCount: " << (unsigned) ADesc.ChannelCount << std::endl;
+ strm << " QuantizationBits: " << (unsigned) ADesc.QuantizationBits << std::endl;
+ strm << " BlockAlign: " << (unsigned) ADesc.BlockAlign << std::endl;
+ strm << " AvgBps: " << (unsigned) ADesc.AvgBps << std::endl;
+ strm << " LinkedTrackID: " << (unsigned) ADesc.LinkedTrackID << std::endl;
+ strm << " ContainerDuration: " << (unsigned) ADesc.ContainerDuration << std::endl;
+
+ return strm;
+}
+
+//
void
ASDCP::PCM::AudioDescriptorDump(const AudioDescriptor& ADesc, FILE* stream)
{
#include "AS_DCP_internal.h"
#include "KM_xml.h"
+#include <iostream>
+#include <iomanip>
using Kumu::GenRandomValue;
return "application/octet-stream";
}
+//
+std::ostream&
+ASDCP::TimedText::operator << (std::ostream& strm, const TimedTextDescriptor& TDesc)
+{
+ UUID TmpID(TDesc.AssetID);
+ char buf[64];
+
+ strm << " EditRate: " << (unsigned) TDesc.EditRate.Numerator << "/" << (unsigned) TDesc.EditRate.Denominator << std::endl;
+ strm << "ContainerDuration: " << (unsigned) TDesc.ContainerDuration << std::endl;
+ strm << " AssetID: " << TmpID.EncodeHex(buf, 64) << std::endl;
+ strm << " NamespaceName: " << TDesc.NamespaceName << std::endl;
+ strm << " ResourceCount: " << (unsigned long) TDesc.ResourceList.size() << std::endl;
+
+ TimedText::ResourceList_t::const_iterator ri;
+ for ( ri = TDesc.ResourceList.begin() ; ri != TDesc.ResourceList.end(); ri++ )
+ {
+ TmpID.Set((*ri).ResourceID);
+ strm << " " << TmpID.EncodeHex(buf, 64) << ": " << MIME2str((*ri).Type) << std::endl;
+ }
+
+ return strm;
+}
+
//
void
ASDCP::TimedText::DescriptorDump(ASDCP::TimedText::TimedTextDescriptor const& TDesc, FILE* stream)