00001 #ifndef Impala_Core_VideoSet_Mpeg7DocWrite_h
00002 #define Impala_Core_VideoSet_Mpeg7DocWrite_h
00003
00004 #include "Persistency/Mpeg7DocRepository.h"
00005 #include "Core/VideoSet/VideoSet.h"
00006 #include "Core/VideoSet/Mpeg7Doc.h"
00007
00008 namespace Impala
00009 {
00010 namespace Core
00011 {
00012 namespace VideoSet
00013 {
00014
00015
00017 inline bool
00018 Mpeg7DocWrite(Mpeg7Doc* doc, VideoSet* vidSet, int videoId)
00019 {
00020 ILOG_VAR(Impala.Core.VideoSet.Mpeg7DocWrite);
00021 typedef Persistency::Mpeg7DocLocator Mpeg7DocLocator;
00022 String container = vidSet->GetAsPath(videoId);
00023 Mpeg7DocLocator loc;
00024 Persistency::Locator base = vidSet->GetLocator();
00025 if (doc->GetAnnoIsConcept())
00026 loc = Mpeg7DocLocator(base, Mpeg7DocLocator::MPEG7_CONCEPT,
00027 doc->GetConceptSet() + "/" + container,
00028 doc->GetAnnoFileName() + ".xml");
00029 else if (doc->HasAnnotations())
00030 loc = Mpeg7DocLocator(base, Mpeg7DocLocator::MPEG7_ANNOTATION,
00031 doc->GetConceptSet() + "/" + container,
00032 doc->GetAnnoFileName() + ".xml");
00033 else if (doc->HasFeatures())
00034 loc = Mpeg7DocLocator(base, Mpeg7DocLocator::MPEG7_FEATURE,
00035 container, doc->GetFeature() + ".xml");
00036 else
00037 loc = Mpeg7DocLocator(base, Mpeg7DocLocator::MPEG7_SHOT,
00038 container, vidSet->GetFileBase(videoId) + ".xml");
00039 Persistency::Mpeg7DocRepository().Add(loc, doc);
00040 return true;
00041 }
00042
00043 }
00044 }
00045 }
00046
00047 #endif