Definition at line 281 of file RgbDataSrcInfo.h. References BUFFER_SIZE, GetInfoIOBuffer(), Impala::Util::StringParser::GetInt(), ILOG_DEBUG, ILOG_ERROR, ILOG_WARN, Impala::MakeString(), MarkBadFrame(), Impala::Core::Stream::RgbDataSrc::mAspectRatioDen, Impala::Core::Stream::RgbDataSrc::mAspectRatioNum, mBadFrameNrs, Impala::Core::Stream::RgbDataSrc::mBitRate, Impala::Core::Stream::RgbDataSrc::mBlankFrames, Impala::Core::Stream::RgbDataSrc::mCodecName, Impala::Core::Stream::RgbDataSrc::mCodecTag, Impala::Core::Stream::RgbDataSrc::mDuration, Impala::Core::Stream::RgbDataSrc::mDurationHour, Impala::Core::Stream::RgbDataSrc::mDurationMin, Impala::Core::Stream::RgbDataSrc::mDurationSec, Impala::Core::Stream::RgbDataSrc::mFormatLName, Impala::Core::Stream::RgbDataSrc::mFormatName, mFormatStr, Impala::Core::Stream::RgbDataSrc::mFrameHeight, Impala::Core::Stream::RgbDataSrc::mFrameRateDen, Impala::Core::Stream::RgbDataSrc::mFrameRateNum, Impala::Core::Stream::RgbDataSrc::mFrameWidth, Impala::Core::Stream::RgbDataSrc::mGopSize, mIndex, Impala::Core::Stream::RgbDataSrc::mIndexExists, mInfoVersion, Impala::Core::Stream::RgbDataSrc::mLastFrame, Impala::Core::Stream::RgbDataSrc::mStreamCount, Impala::Core::Stream::RgbDataSrc::mTimeBaseDen, Impala::Core::Stream::RgbDataSrc::mTimeBaseNum, Impala::Core::Stream::RgbDataSrc::mVideoDuration, Impala::Util::Read(), Impala::Util::IOBuffer::Read(), Impala::Core::Stream::RgbDataSrc::SetLeadingBadFrames(), Impala::Core::Table::Table::Size(), Impala::Timer::SplitTime(), Impala::Util::StringParser::TheEnd(), and Impala::StringList::ToString(). Referenced by Impala::Core::Stream::RgbDataSrcLavc_old::Init(), Impala::Core::Stream::RgbDataSrcLavc::ReadIndex(), and RgbDataSrcInfo(). 00282 { 00283 ILOG_DEBUG("Reading info file"); 00284 Timer timer; 00285 Util::IOBuffer* infoBuf = GetInfoIOBuffer(false, silent); 00286 if (!infoBuf) 00287 { 00288 ILOG_WARN("Reading canceled"); 00289 return false; 00290 } 00291 00292 char buf[BUFFER_SIZE]; 00293 infoBuf->Read(buf, BUFFER_SIZE); 00294 char srcName[100]; 00295 char formatName[30]; 00296 char formatLName[100]; 00297 char codecName[30]; 00298 char codecTag[5]; 00299 char indexExists[5]; 00300 00301 int frameCount; 00302 char badFramesList[10000]; 00303 int numberOfLeadingBadFrames; 00304 int res = sscanf(buf, mFormatStr.c_str(), 00305 srcName, 00306 formatName, 00307 formatLName, 00308 &mBitRate, 00309 &mStreamCount, 00310 codecName, 00311 codecTag, 00312 &mTimeBaseNum, &mTimeBaseDen, 00313 &mVideoDuration, 00314 &mDuration, 00315 &mDurationHour, &mDurationMin, &mDurationSec, 00316 &mFrameWidth, 00317 &mFrameHeight, 00318 &mAspectRatioNum, &mAspectRatioDen, 00319 &frameCount, 00320 &mFrameRateNum, &mFrameRateDen, 00321 &mGopSize, 00322 &numberOfLeadingBadFrames, 00323 badFramesList, 00324 indexExists); 00325 if (res != 25) 00326 { 00327 ILOG_ERROR("RGB data source info format not compatible; " << 00328 "expected version is: " << mInfoVersion); 00329 return false; 00330 } 00331 00332 //if (frameCount != mLastFrame + 1) 00333 //{ 00334 // ILOG_ERROR("Number of frames according to info file (" << 00335 // frameCount << ") does not match currently " << 00336 // " established frame count (" << (mLastFrame + 1) << ")"); 00337 // return false; 00338 //} 00339 00340 //Copy the scanned data to member variables 00341 mLastFrame = frameCount - 1; 00342 mFormatName = formatName; 00343 mFormatLName = formatLName; 00344 mCodecName = codecName; 00345 mCodecTag = codecTag; 00346 00347 SetLeadingBadFrames(numberOfLeadingBadFrames); 00348 mBadFrameNrs.clear(); 00349 const String badFramesListString(badFramesList); 00350 if (badFramesListString != "none") 00351 { 00352 Util::StringParser parser(badFramesListString); 00353 while (!parser.TheEnd()) 00354 { 00355 const int frameNr = parser.GetInt(';', false, true); 00356 MarkBadFrame(frameNr); 00357 } 00358 } 00359 00360 if (String(indexExists) == "yes") 00361 mIndexExists = true; 00362 else 00363 mIndexExists = false; 00364 00365 // for debug log: 00366 { 00367 StringList badFramesString; 00368 for (int i = 0; i < mBadFrameNrs.size(); i++) 00369 badFramesString << MakeString(mBadFrameNrs[i]); 00370 00371 sprintf(buf, mFormatStr.c_str(), 00372 srcName, 00373 formatName, 00374 formatLName, 00375 mBitRate, 00376 mStreamCount, 00377 codecName, 00378 codecTag, 00379 mTimeBaseNum, mTimeBaseDen, 00380 mVideoDuration, 00381 mDuration, 00382 mDurationHour, mDurationMin, mDurationSec, 00383 mFrameWidth, 00384 mFrameHeight, 00385 mAspectRatioNum, mAspectRatioDen, 00386 mLastFrame + 1, 00387 mFrameRateNum, mFrameRateDen, 00388 mGopSize, 00389 mBlankFrames, 00390 badFramesString.ToString(';').c_str(), 00391 indexExists); 00392 ILOG_DEBUG("\n\n" << buf); 00393 } 00394 00395 if (mIndexExists) 00396 { 00397 ILOG_DEBUG("Reading the index attached to info file"); 00398 ILOG_DEBUG(" start read " << timer.SplitTime()); 00399 Read(mIndex, infoBuf); 00400 ILOG_DEBUG(" done actual read " << timer.SplitTime()); 00401 ILOG_DEBUG(mIndex->Size() << " index entries read"); 00402 } 00403 00404 delete infoBuf; 00405 return true; 00406 }
Here is the call graph for this function:
|