Write the given doc that corresponds to the given video to file.
Definition at line 18 of file Mpeg7DocWrite.h. References Impala::Core::VideoSet::Mpeg7Doc::ExportXml(), Impala::Core::VideoSet::Mpeg7Doc::GetAnnoFileName(), Impala::Core::VideoSet::Mpeg7Doc::GetAnnoIsConcept(), Impala::Core::VideoSet::Mpeg7Doc::GetConceptSet(), Impala::Core::VideoSet::Mpeg7Doc::GetFeature(), Impala::Util::Database::GetIOBuffer(), Impala::Core::VideoSet::Mpeg7Doc::HasAnnotations(), Impala::Core::VideoSet::Mpeg7Doc::HasFeatures(), ILOG_ERROR, and ILOG_VAR. Referenced by Impala::Visualization::SegmentationDocumentGuiAnno::CheckSaveMpeg7(), Impala::Application::Util::DoExportAnnoMpeg7(), Impala::Application::Util::DoExportShotMpeg7(), Impala::Application::Util::DoImportAnnotations(), Impala::Application::Util::DoImportAnnotationsActive(), Impala::Application::Util::DoImportAnnotationsOrk(), Impala::Core::VideoSet::ExportFeatures::HandleDoneFile(), Impala::Core::VideoSet::ExportConcepts::HandleDoneFile(), and Impala::Core::VideoSet::ShotSegmenter::WriteMp7ShotSeg(). 00019 { 00020 ILOG_VAR(Impala.Core.VideoSet.Mpeg7DocWrite); 00021 #ifndef REPOSITORY_USED // Here comes the deprecated stuff 00022 String fName; 00023 if (doc->GetAnnoIsConcept()) 00024 fName = vidSet->GetFilePathMpeg7Concept(videoId, doc->GetConceptSet(), 00025 doc->GetAnnoFileName() + ".xml", 00026 true, false); 00027 else if (doc->HasAnnotations()) 00028 fName = vidSet->GetFilePathMpeg7Anno(videoId, doc->GetConceptSet(), 00029 doc->GetAnnoFileName() + ".xml", 00030 true, false); 00031 else if (doc->HasFeatures()) 00032 fName = vidSet->GetFilePathMpeg7Feature(videoId, 00033 doc->GetFeature() + ".xml", 00034 true, false); 00035 else 00036 fName = vidSet->GetFilePathMpeg7Shot(videoId, true, false); 00037 if (fName.empty()) 00038 { 00039 ILOG_ERROR("Unable to write"); 00040 return false; 00041 } 00042 Util::Database* db = vidSet->GetDatabase(); 00043 Util::IOBuffer* ioBuf = db->GetIOBuffer(fName, false, false, "tmp"); 00044 doc->ExportXml(ioBuf); 00045 delete ioBuf; 00046 return true; 00047 #else // REPOSITORY_USED 00048 typedef Persistency::Mpeg7DocLocator Mpeg7DocLocator; 00049 String container = vidSet->GetAsPath(videoId); 00050 Mpeg7DocLocator loc; 00051 Persistency::Locator base = vidSet->GetLocator(); 00052 if (doc->GetAnnoIsConcept()) 00053 loc = Mpeg7DocLocator(base, Mpeg7DocLocator::MPEG7_CONCEPT, 00054 doc->GetConceptSet() + "/" + container, 00055 doc->GetAnnoFileName() + ".xml"); 00056 else if (doc->HasAnnotations()) 00057 loc = Mpeg7DocLocator(base, Mpeg7DocLocator::MPEG7_ANNOTATION, 00058 doc->GetConceptSet() + "/" + container, 00059 doc->GetAnnoFileName() + ".xml"); 00060 else if (doc->HasFeatures()) 00061 loc = Mpeg7DocLocator(base, Mpeg7DocLocator::MPEG7_FEATURE, 00062 container, doc->GetFeature() + ".xml"); 00063 else 00064 loc = Mpeg7DocLocator(base, Mpeg7DocLocator::MPEG7_SHOT, 00065 container, vidSet->GetFileBase(videoId) + ".xml"); 00066 Persistency::Mpeg7DocRepository().Add(loc, doc); 00067 return true; 00068 #endif // REPOSITORY_USED 00069 }
Here is the call graph for this function:
|