|
void Impala::Core::Stream::RgbDataSrcInfo::WriteInfo |
( |
|
) |
[inline, protected] |
Definition at line 415 of file RgbDataSrcInfo.h.
References BUFFER_SIZE, Impala::FileNameTail(), GetInfoIOBuffer(), ILOG_DEBUG, ILOG_WARN, Impala::MakeString(), 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, Impala::Core::Stream::RgbDataSrc::mLastFrame, Impala::Core::Stream::RgbDataSrc::mSrcName, Impala::Core::Stream::RgbDataSrc::mStreamCount, Impala::Core::Stream::RgbDataSrc::mTimeBaseDen, Impala::Core::Stream::RgbDataSrc::mTimeBaseNum, Impala::Core::Stream::RgbDataSrc::mVideoDuration, ReplaceWhite(), Impala::Core::Table::Table::Size(), Impala::StringList::ToString(), Impala::Core::Table::Write(), and Impala::Util::IOBuffer::Write().
Referenced by Impala::Core::Stream::RgbDataSrcLavc_old::Init(), and Impala::Core::Stream::RgbDataSrcLavc::Init(). 00416 {
00417 ILOG_DEBUG("Writing info file");
00418
00419
00420 Util::IOBuffer* infoBuf = GetInfoIOBuffer(true);
00421
00422 if (!infoBuf)
00423 {
00424 ILOG_WARN("Writing canceled: if file already exists, "
00425 << "use the --override switch; "
00426 << "otherwise make sure the directory is writable.");
00427 return;
00428 }
00429
00430
00431 char buf[BUFFER_SIZE];
00432 memset(buf, 0, BUFFER_SIZE);
00433 StringList badFramesStringList;
00434 for (int i = 0; i < mBadFrameNrs.size(); i++)
00435 badFramesStringList << MakeString(mBadFrameNrs[i]);
00436 String badFramesString = badFramesStringList.ToString(';');
00437 if (badFramesString.empty())
00438 badFramesString = "none";
00439 sprintf(buf, mFormatStr.c_str(),
00440 ReplaceWhite(FileNameTail(mSrcName)).c_str(),
00441 ReplaceWhite(mFormatName).c_str(),
00442 ReplaceWhite(mFormatLName).c_str(),
00443 mBitRate,
00444 mStreamCount,
00445 ReplaceWhite(mCodecName).c_str(),
00446 ReplaceWhite(mCodecTag).c_str(),
00447 mTimeBaseNum, mTimeBaseDen,
00448 mVideoDuration,
00449 mDuration,
00450 mDurationHour, mDurationMin, mDurationSec,
00451 mFrameWidth,
00452 mFrameHeight,
00453 mAspectRatioNum, mAspectRatioDen,
00454 mLastFrame + 1,
00455 mFrameRateNum, mFrameRateDen,
00456 mGopSize,
00457 mBlankFrames,
00458 badFramesString.c_str(),
00459 (mIndexExists ? "yes" : "no") );
00460 infoBuf->Write(buf, BUFFER_SIZE);
00461
00462 if (mIndexExists)
00463 {
00464 ILOG_DEBUG("Index exists; writing table");
00465 Write(mIndex, infoBuf, true);
00466 ILOG_DEBUG(mIndex->Size() << " index entries written");
00467 }
00468
00469 delete infoBuf;
00470 }
Here is the call graph for this function:
|