本文整理汇总了C++中VideoOutput::DoneDisplayingFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoOutput::DoneDisplayingFrame方法的具体用法?C++ VideoOutput::DoneDisplayingFrame怎么用?C++ VideoOutput::DoneDisplayingFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoOutput
的用法示例。
在下文中一共展示了VideoOutput::DoneDisplayingFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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, "-----------------------------------");
}
示例2: TranscodeFile
//.........这里部分代码省略.........
wait_recover--;
}
else
{
dropvideo = 0;
wait_recover = 0;
}
#if 0
int buflen = (int)(arb->audiobuffer_len / rateTimeConv);
VERBOSE(VB_GENERAL, QString("%1: video time: %2 audio time: %3 "
"buf: %4 exp: %5 delta: %6")
.arg(curFrameNum) .arg(frame.timecode)
.arg(arb->last_audiotime) .arg(buflen) .arg(audbufTime)
.arg(delta));
#endif
if (arb->audiobuffer_len)
fifow->FIFOWrite(1, arb->audiobuffer, arb->audiobuffer_len);
if (dropvideo < 0)
{
dropvideo++;
curFrameNum--;
}
else
{
fifow->FIFOWrite(0, frame.buf, vidSize);
if (dropvideo)
{
fifow->FIFOWrite(0, frame.buf, vidSize);
curFrameNum++;
dropvideo--;
}
}
videoOutput->DoneDisplayingFrame(lastDecode);
audioOutput->Reset();
player->GetCC608Reader()->FlushTxtBuffers();
lasttimecode = frame.timecode;
}
else if (copyaudio)
{
// Encoding from NuppelVideo to NuppelVideo with MP3 audio
// So let's not decode/reencode audio
if (!player->GetRawAudioState())
{
// The Raw state changed during decode. This is not good
VERBOSE(VB_IMPORTANT, "Transcoding aborted, MythPlayer "
"is not in raw audio mode.");
unlink(outputname.toLocal8Bit().constData());
delete [] newFrame;
if (player_ctx)
delete player_ctx;
return REENCODE_ERROR;
}
if (forceKeyFrames)
writekeyframe = true;
else
{
writekeyframe = is_key;
if (writekeyframe)
{
// Currently, we don't create new sync frames,
// (though we do create new 'I' frames), so we mark
// the key-frames before deciding whether we need a
// new 'I' frame.