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

void Impala::Persistency::KeyframesRepositoryInMonet::Add ( const KeyframesLocator loc,
Keyframes keys 
) [inline]

Definition at line 83 of file KeyframesRepositoryInMonet.h.

References Impala::Persistency::RepositoryInMonetDB::GetConnection(), Impala::Core::VideoSet::Keyframes::GetFirstKeyframeVideo(), Impala::Core::VideoSet::Keyframes::GetFrameNr(), Impala::Core::VideoSet::Keyframes::GetName(), Impala::Core::VideoSet::Keyframes::GetNrKeyframesVideo(), Impala::Core::VideoSet::Keyframes::GetNrVideos(), Impala::Core::VideoSet::VideoSet::GetQuidVideo(), Impala::Core::VideoSet::Keyframes::GetVideoSet(), ILOG_INFO, Impala::Core::VideoSet::Keyframes::IsRKF(), Impala::MakeString(), RepMonet(), and Impala::Timer::SplitTime().

00084     {
00085         Connection* conn = RepMonet().GetConnection(loc);
00086 
00087         VideoSet* vidSet = keys->GetVideoSet();
00088         conn->Query("delete from i_bulk_fragment;", false, false);
00089         Timer timer;
00090         for (int v=0 ; v<keys->GetNrVideos() ; v++)
00091         {
00092             ILOG_INFO("v = " << v);
00093             Quid vidQuid = vidSet->GetQuidVideo(v, true);
00094             int first = keys->GetFirstKeyframeVideo(v);
00095             int nr = keys->GetNrKeyframesVideo(v);
00096             String q = "copy " + MakeString(nr) +
00097                 " records into i_bulk_fragment from stdin using delimiters ' ';\n";
00098             for (int k=first ; k<first+nr ; k++)
00099             {
00100                 //int shot = keys->GetShotId(k); // cannot store in schema
00101                 int frame = keys->GetFrameNr(k);
00102                 String rkf = (keys->IsRKF(k)) ? "true" : "false";
00103                 q += MakeString(vidQuid) + " " + MakeString(frame) + " 1 "
00104                     + keys->GetName(k) + " true " + rkf + "\n";
00105             }
00106             conn->Query(q, false, false);
00107         }
00108         ILOG_INFO("Did bulk in " << timer.SplitTime());
00109         conn->Query("insert into fragment (media_id, fragment_start, \
00110                                            fragment_length, fragment_name,  \
00111                                            keyframe, representative) \
00112                      select m.media_id, bf.fragment_start, bf.fragment_length, \
00113                             bf.fragment_name, bf.keyframe, bf.representative \
00114                      from i_bulk_fragment bf, media m \
00115                      where bf.quid = m.quid \
00116                      order by bf.quid, bf.fragment_start;", false, false);
00117         ILOG_INFO("Did insert select at " << timer.SplitTime());
00118         conn->Query("delete from i_bulk_fragment;", false, false);
00119     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:36:01 2010 for ImpalaSrc by  doxygen 1.5.1