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

Segmentation* Impala::Samples::MonetTest::MakeSegmentationMapi ( VideoSet *  vidSet,
Connection *  conn 
)

Definition at line 78 of file mainMonetTest.cpp.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Add(), Impala::Core::Database::RawDataSet::GetSetNameBase(), ILOG_VAR, Impala::QuidId(), and Impala::Core::VideoSet::Segmentation::UpdateGroups().

Referenced by DoCheckSegmentation(), and MakeKeyframesMapi().

00079 {
00080     ILOG_VAR(Impala.Samples.MonetTest.MakeSegmentationMapi);
00081 
00082     String vidSetBase = vidSet->GetSetNameBase();
00083     String query =
00084         "select f.quid, fr.fragment_start, fr.fragment_length, fr.fragment_name \
00085          from   fragment fr, file f, video_set vs, video_sets vss \
00086          where  vss.set_name = '" + vidSetBase + "' and \
00087                 vs.video_sets_id = vss.video_sets_id and \
00088                 f.file_id = vs.file_id and \
00089                 fr.media_id = f.media_id and \
00090                 fr.fragment_length > 1 and \
00091                 fr.keyframe = false \
00092          order by f.quid, fr.fragment_start;";
00093 
00094     MapiHdl hdl = conn->QueryPartStart(query);
00095     if (hdl == 0)
00096         return 0;
00097 
00098     Quid* quid = 0;
00099     int quidSize = 0;
00100     if (!conn->QueryPartFetchULL(hdl, 0, quid, quidSize))
00101         return 0;
00102 
00103     int* start = 0;
00104     int startSize = 0;
00105     if (!conn->QueryPartFetchInt(hdl, 1, start, startSize))
00106         return 0;
00107 
00108     int* length = 0;
00109     int lengthSize = 0;
00110     if (!conn->QueryPartFetchInt(hdl, 2, length, lengthSize))
00111         return 0;
00112 
00113     std::vector<String> name;
00114     if (!conn->QueryPartFetchString(hdl, 3, name))
00115         return 0;
00116 
00117     conn->QueryPartEnd(hdl);
00118 
00119     Segmentation* seg = new Segmentation(vidSet, "");
00120     for (int i=0 ; i<quidSize ; i++)
00121     {
00122         int id = QuidId(quid[i]);
00123         int end = start[i] + length[i] - 1;
00124         seg->Add(id, start[i], end, name[i]);
00125     }
00126     seg->UpdateGroups();
00127 
00128     delete quid;
00129     delete start;
00130     delete length;
00131     return seg;
00132 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:38:10 2010 for ImpalaSrc by  doxygen 1.5.1