Definition at line 653 of file mainMonetTest.cpp. References Impala::CmdOptions::GetArg(), Impala::Core::VideoSet::Keyframes::GetFirstKeyframeVideo(), Impala::Core::VideoSet::Keyframes::GetFrameNr(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetInt(), Impala::Core::VideoSet::Keyframes::GetName(), Impala::CmdOptions::GetNrArg(), Impala::Core::VideoSet::Keyframes::GetNrKeyframes(), Impala::Core::VideoSet::Keyframes::GetNrKeyframesVideo(), Impala::Core::VideoSet::Keyframes::GetNrVideos(), Impala::Core::VideoSet::VideoSet::GetQuidVideo(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::Core::VideoSet::Keyframes::IsRKF(), Impala::MakeString(), Impala::Core::VideoSet::MakeVideoSet(), and Impala::Timer::SplitTime(). Referenced by mainMonetTest(). 00654 { 00655 ILOG_VAR(Impala.Samples.MonetTest.DoInsertKeyframes); 00656 CmdOptions& options = CmdOptions::GetInstance(); 00657 if (options.GetNrArg() < 5) 00658 { 00659 ILOG_ERROR("Need more parameters"); 00660 return; 00661 } 00662 00663 String vidSetName = options.GetArg(4); 00664 VideoSet* vidSet = Core::VideoSet::MakeVideoSet(vidSetName); 00665 00666 Keyframes keyframes(vidSet, "keyframes"); 00667 ILOG_INFO("nrVideos = " << keyframes.GetNrVideos()); 00668 ILOG_INFO("nrKeyframes = " << keyframes.GetNrKeyframes()); 00669 conn->Query("delete from i_bulk_fragment;", false, false); 00670 int startFile = options.GetInt("startFile"); 00671 Timer timer; 00672 for (int v=startFile ; v<keyframes.GetNrVideos() ; v++) 00673 { 00674 ILOG_INFO("v = " << v); 00675 Quid vidQuid = vidSet->GetQuidVideo(v, true); 00676 int first = keyframes.GetFirstKeyframeVideo(v); 00677 int nr = keyframes.GetNrKeyframesVideo(v); 00678 String q = "copy " + MakeString(nr) + 00679 " records into i_bulk_fragment from stdin using delimiters ' ';\n"; 00680 for (int k=first ; k<first+nr ; k++) 00681 { 00682 //int shot = keyframes.GetShotId(k); // cannot store in schema 00683 int frame = keyframes.GetFrameNr(k); 00684 String rkf = (keyframes.IsRKF(k)) ? "true" : "false"; 00685 q += MakeString(vidQuid) + " " + MakeString(frame) + " 1 " 00686 + keyframes.GetName(k) + " true " + rkf + "\n"; 00687 } 00688 conn->Query(q, false, false); 00689 } 00690 ILOG_INFO("Did bulk in " << timer.SplitTime()); 00691 conn->Query("insert into fragment (media_id, fragment_start, \ 00692 fragment_length, fragment_name, \ 00693 keyframe, representative) \ 00694 select m.media_id, bf.fragment_start, bf.fragment_length, \ 00695 bf.fragment_name, bf.keyframe, bf.representative \ 00696 from i_bulk_fragment bf, media m \ 00697 where bf.quid = m.quid \ 00698 order by bf.quid, bf.fragment_start;", false, false); 00699 ILOG_INFO("Did insert select at " << timer.SplitTime()); 00700 conn->Query("delete from i_bulk_fragment;", false, false); 00701 }
Here is the call graph for this function:
|