Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

PlayShot.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_VideoSet_PlayShot_h
00002 #define Impala_Core_VideoSet_PlayShot_h
00003 
00004 #include "Persistency/RepositoryInFileSystem.h"
00005 #include "Core/VideoSet/Segmentation.h"
00006 
00007 namespace Impala
00008 {
00009 namespace Core
00010 {
00011 namespace VideoSet
00012 {
00013 
00014 
00015 inline void
00016 PlayShot(Segmentation* shots, int shot)
00017 {
00018     ILOG_VAR(Impala.Core.VideoSet.PlayShot);
00019 #ifdef DX_USED
00020     int vidId = shots->GetVideoId(shot);
00021 #ifndef REPOSITORY_USED // Here comes the deprecated stuff
00022     String fileName = shots->GetVideoSet()->GetFilePathVideoData(vidId, false,
00023                                                                  false);
00024 #else // REPOSITORY_USED
00025     VideoSet* vidSet = shots->GetVideoSet();
00026     using namespace Persistency;
00027     // We really need a file otherwise DX cannot handle it.
00028     Locator loc("file:", vidSet->GetSetName());
00029     Persistency::File file = RepositoryInFileSystem::GetInstance().GetFile
00030         (loc, "VideoData", vidSet->GetAsPath(vidId), false, false);
00031     String fileName = file.GetPath();
00032 #endif // REPOSITORY_USED
00033     void* handle = HxDXOpenFullPlayer(fileName.c_str());
00034     if (! handle)
00035     {
00036         ILOG_ERROR("Unable to play " << fileName);
00037     }
00038     else
00039     {
00040         int startF = shots->GetStart(shot);
00041         int endF = shots->GetEnd(shot);
00042         HxDXShowSegmentPlayer(handle, startF, endF);
00043         HxDXClosePlayer(handle);
00044     }
00045 #else
00046     ILOG_ERROR("PlayShot not available.");
00047 #endif
00048 }
00049 
00050 } // namespace VideoSet
00051 } // namespace Core
00052 } // namespace Impala
00053 
00054 #endif

Generated on Thu Jan 13 09:04:47 2011 for ImpalaSrc by  doxygen 1.5.1