int main(int argc, char **argv) { plan_tests(136); TestHeader(); TestDate(); TestLocation(); TestExtensions(); TestFix(); TestFixTime(); TestDeclarationHeader(); TestDeclarationTurnpoint(); return exit_status(); }
ASDCP::Result_t ASDCP::EssenceType(const char* filename, EssenceType_t& type) { const Dictionary* m_Dict = &DefaultCompositeDict(); assert(m_Dict); ASDCP_TEST_NULL_STR(filename); Kumu::FileReader Reader; OPAtomHeader TestHeader(m_Dict); Result_t result = Reader.OpenRead(filename); if ( ASDCP_SUCCESS(result) ) result = TestHeader.InitFromFile(Reader); // test UL and OP if ( ASDCP_SUCCESS(result) ) { type = ESS_UNKNOWN; if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(RGBAEssenceDescriptor))) ) { if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(StereoscopicPictureSubDescriptor))) ) type = ESS_JPEG_2000_S; else type = ESS_JPEG_2000; } else if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(WaveAudioDescriptor))) ) 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(TimedTextDescriptor))) ) type = ESS_TIMED_TEXT; else if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(DCDataDescriptor))) ) { if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(DolbyAtmosSubDescriptor))) ) type = ESS_DCDATA_DOLBY_ATMOS; else type = ESS_DCDATA_UNKNOWN; } } return result; }
void TestBackTrace () { bool rc = true; TestHeader("backtrace test"); Tracker2 t; t.doTest(25); Progress(rc, "minimal functionality"); t.doTest(25); rc = (t._codepoints[10] != 0); Progress(rc, "many levels"); rc = (t.found() > 10); Progress(rc, "many levels retval"); t.doTest(8); rc = (t.found() == 8); Progress(rc, "few levels retval"); rc = (t._codepoints[8] == 0); Progress(rc, "few levels"); PrintSeparator(); }
ASDCP::Result_t ASDCP::EssenceType(const std::string& filename, EssenceType_t& type) { const Dictionary* m_Dict = &DefaultCompositeDict(); InterchangeObject* md_object = 0; assert(m_Dict); Kumu::FileReader Reader; OP1aHeader TestHeader(m_Dict); Result_t result = Reader.OpenRead(filename); if ( ASDCP_SUCCESS(result) ) result = TestHeader.InitFromFile(Reader); // test UL and OP if ( ASDCP_SUCCESS(result) ) { type = ESS_UNKNOWN; if ( TestHeader.OperationalPattern == UL(m_Dict->ul(MDD_OPAtom)) || TestHeader.OperationalPattern == UL(m_Dict->ul(MDD_MXFInterop_OPAtom)) ) { if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(JPEG2000PictureSubDescriptor))) ) { if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(StereoscopicPictureSubDescriptor))) ) { type = ESS_JPEG_2000_S; } else { type = ESS_JPEG_2000; } } else if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(WaveAudioDescriptor), &md_object)) ) { assert(md_object); if ( static_cast<ASDCP::MXF::WaveAudioDescriptor*>(md_object)->AudioSamplingRate == SampleRate_96k ) { type = ESS_PCM_24b_96k; } else { 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(TimedTextDescriptor))) ) { type = ESS_TIMED_TEXT; } else if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(DCDataDescriptor))) ) { if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(DolbyAtmosSubDescriptor))) ) { type = ESS_DCDATA_DOLBY_ATMOS; } else { type = ESS_DCDATA_UNKNOWN; } } } else if ( TestHeader.OperationalPattern == UL(m_Dict->ul(MDD_OP1a)) ) { if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(JPEG2000PictureSubDescriptor))) ) { type = ESS_AS02_JPEG_2000; } else if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(WaveAudioDescriptor), &md_object)) ) { assert(md_object); if ( static_cast<ASDCP::MXF::WaveAudioDescriptor*>(md_object)->AudioSamplingRate == SampleRate_96k ) { type = ESS_AS02_PCM_24b_96k; } else { type = ESS_AS02_PCM_24b_48k; } } else if ( ASDCP_SUCCESS(TestHeader.GetMDObjectByType(OBJ_TYPE_ARGS(TimedTextDescriptor))) ) { type = ESS_AS02_TIMED_TEXT; } } else { DefaultLogSink().Error("Unsupported MXF Operational Pattern.\n"); return RESULT_FORMAT; } } return result; }