本文整理汇总了C++中VideoOutput::PrepareFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoOutput::PrepareFrame方法的具体用法?C++ VideoOutput::PrepareFrame怎么用?C++ VideoOutput::PrepareFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoOutput
的用法示例。
在下文中一共展示了VideoOutput::PrepareFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Test
void Test(void)
{
PIPMap dummy;
if (novideosync) // TODO
LOG(VB_GENERAL, LOG_INFO, "Will attempt to disable sync-to-vblank.");
RingBuffer *rb = RingBuffer::Create(file, false, true, 2000);
MythPlayer *mp = new MythPlayer(kAudioMuted);
mp->GetAudio()->SetAudioInfo("NULL", "NULL", 0, 0);
mp->GetAudio()->SetNoAudio();
ctx = new PlayerContext("VideoPerformanceTest");
ctx->SetRingBuffer(rb);
ctx->SetPlayer(mp);
ctx->SetPlayingInfo(new ProgramInfo(file));
mp->SetPlayerInfo(NULL, GetMythMainWindow(), true, ctx);
FrameScanType scan = deinterlace ? kScan_Interlaced : kScan_Progressive;
if (!mp->StartPlaying())
{
LOG(VB_GENERAL, LOG_ERR, "Failed to start playback.");
return;
}
VideoOutput *vo = mp->GetVideoOutput();
if (!vo)
{
LOG(VB_GENERAL, LOG_ERR, "No video output.");
return;
}
LOG(VB_GENERAL, LOG_INFO, "-----------------------------------");
LOG(VB_GENERAL, LOG_INFO, QString("Starting video performance test for '%1'.")
.arg(file));
LOG(VB_GENERAL, LOG_INFO, QString("Test will run for %1 seconds.")
.arg(secondstorun));
if (decodeonly)
LOG(VB_GENERAL, LOG_INFO, "Decoding frames only - skipping display.");
LOG(VB_GENERAL, LOG_INFO, QString("Deinterlacing %1")
.arg(deinterlace ? "enabled" : "disabled"));
Jitterometer *jitter = new Jitterometer("Performance: ", mp->GetFrameRate());
int ms = secondstorun * 1000;
QTime start = QTime::currentTime();
while (1)
{
int duration = start.msecsTo(QTime::currentTime());
if (duration < 0 || duration > ms)
{
LOG(VB_GENERAL, LOG_INFO, "Complete.");
break;
}
if (mp->IsErrored())
{
LOG(VB_GENERAL, LOG_ERR, "Playback error.");
break;
}
if (mp->GetEof())
{
LOG(VB_GENERAL, LOG_INFO, "End of file.");
break;
}
if (!mp->PrebufferEnoughFrames())
continue;
mp->SetBuffering(false);
vo->StartDisplayingFrame();
VideoFrame *frame = vo->GetLastShownFrame();
mp->CheckAspectRatio(frame);
if (!decodeonly)
{
vo->ProcessFrame(frame, NULL, NULL, dummy, scan);
vo->PrepareFrame(frame, scan, NULL);
vo->Show(scan);
}
vo->DoneDisplayingFrame(frame);
jitter->RecordCycleTime();
}
LOG(VB_GENERAL, LOG_INFO, "-----------------------------------");
}