Definition at line 85 of file SegmentationRepositoryInMonet.h. References Impala::Persistency::RepositoryInMonetDB::GetConnection(), Impala::Core::VideoSet::Segmentation::GetEnd(), Impala::Core::VideoSet::Segmentation::GetFirstShotVideo(), Impala::Core::VideoSet::Segmentation::GetName(), Impala::Core::VideoSet::Segmentation::GetNrFramesVideo(), Impala::Core::VideoSet::Segmentation::GetNrShotsVideo(), Impala::Core::VideoSet::Segmentation::GetNrVideos(), Impala::Core::VideoSet::VideoSet::GetQuidVideo(), Impala::Core::VideoSet::Segmentation::GetStart(), Impala::Core::VideoSet::Segmentation::GetVideoSet(), ILOG_INFO, Impala::MakeString(), RepMonet(), and Impala::Timer::SplitTime(). 00086 { 00087 Connection* conn = RepMonet().GetConnection(loc); 00088 00089 VideoSet* vidSet = seg->GetVideoSet(); 00090 conn->Query("delete from i_bulk_fragment;", false, false); 00091 Timer timer; 00092 for (int v=0 ; v<seg->GetNrVideos() ; v++) 00093 { 00094 ILOG_INFO("v = " << v); 00095 Quid vidQuid = vidSet->GetQuidVideo(v, true); 00096 int first = seg->GetFirstShotVideo(v); 00097 int nr = seg->GetNrShotsVideo(v); 00098 String q = "copy " + MakeString(nr) + 00099 " records into i_bulk_fragment from stdin using delimiters ' ';\n"; 00100 for (int s=first ; s<first+nr ; s++) 00101 { 00102 int start = seg->GetStart(s); 00103 int len = seg->GetEnd(s) - start + 1; 00104 q += MakeString(vidQuid) + " " + MakeString(start) + " " 00105 + MakeString(len) + " " + seg->GetName(s) 00106 + " false false\n"; 00107 } 00108 conn->Query(q, false, false); 00109 00110 nr = seg->GetNrFramesVideo(v); 00111 q = "copy " + MakeString(nr) + 00112 " records into i_bulk_fragment from stdin using delimiters ' ';\n"; 00113 for (int f=0 ; f<nr ; f++) 00114 { 00115 q += MakeString(vidQuid) + " " + MakeString(f) + " 1 frame" 00116 + MakeString(f) + " false false\n"; 00117 } 00118 conn->Query(q, false, false); 00119 } 00120 ILOG_INFO("Did bulk in " << timer.SplitTime()); 00121 conn->Query("insert into fragment (media_id, fragment_start, \ 00122 fragment_length, fragment_name, \ 00123 keyframe, representative) \ 00124 select m.media_id, bf.fragment_start, bf.fragment_length, \ 00125 bf.fragment_name, bf.keyframe, bf.representative \ 00126 from i_bulk_fragment bf, media m \ 00127 where bf.quid = m.quid \ 00128 order by bf.quid, bf.fragment_start;", false, false); 00129 ILOG_INFO("Did insert select at " << timer.SplitTime()); 00130 conn->Query("delete from i_bulk_fragment;", false, false); 00131 }
Here is the call graph for this function:
|