本文整理汇总了C++中VideoOutput::GetLastDecodedFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoOutput::GetLastDecodedFrame方法的具体用法?C++ VideoOutput::GetLastDecodedFrame怎么用?C++ VideoOutput::GetLastDecodedFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoOutput
的用法示例。
在下文中一共展示了VideoOutput::GetLastDecodedFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TranscodeFile
//.........这里部分代码省略.........
int dropvideo = 0;
long long lasttimecode = 0;
long long timecodeOffset = 0;
float rateTimeConv = arb->eff_audiorate / 1000.0f;
float vidFrameTime = 1000.0f / video_frame_rate;
int wait_recover = 0;
VideoOutput *videoOutput = player->getVideoOutput();
bool is_key = 0;
bool first_loop = true;
unsigned char *newFrame = new unsigned char[frame.size];
frame.buf = newFrame;
AVPicture imageIn, imageOut;
struct SwsContext *scontext = NULL;
if (fifow)
VERBOSE(VB_GENERAL, "Dumping Video and Audio data to fifos");
else if (copyaudio)
VERBOSE(VB_GENERAL, "Copying Audio while transcoding Video");
else
VERBOSE(VB_GENERAL, "Transcoding Video and Audio");
QTime flagTime;
flagTime.start();
while (player->TranscodeGetNextFrame(dm_iter, did_ff, is_key, honorCutList))
{
if (first_loop)
{
copyaudio = player->GetRawAudioState();
first_loop = false;
}
VideoFrame *lastDecode = videoOutput->GetLastDecodedFrame();
frame.timecode = lastDecode->timecode;
if (frame.timecode < lasttimecode)
frame.timecode = (long long)(lasttimecode + vidFrameTime);
if (fifow)
{
frame.buf = lastDecode->buf;
totalAudio += arb->audiobuffer_frames;
int audbufTime = (int)(totalAudio / rateTimeConv);
int auddelta = arb->last_audiotime - audbufTime;
int vidTime = (int)(curFrameNum * vidFrameTime + 0.5);
int viddelta = frame.timecode - vidTime;
int delta = viddelta - auddelta;
if (abs(delta) < 500 && abs(delta) >= vidFrameTime)
{
QString msg = QString("Audio is %1ms %2 video at # %3: "
"auddelta=%4, viddelta=%5")
.arg(abs(delta))
.arg(((delta > 0) ? "ahead of" : "behind"))
.arg((int)curFrameNum)
.arg(auddelta)
.arg(viddelta);
VERBOSE(VB_GENERAL, msg);
dropvideo = (delta > 0) ? 1 : -1;
wait_recover = 0;
}
else if (delta >= 500 && delta < 10000)
{
if (wait_recover == 0)
{