本文整理汇总了C++中FramePtr::GetPts方法的典型用法代码示例。如果您正苦于以下问题:C++ FramePtr::GetPts方法的具体用法?C++ FramePtr::GetPts怎么用?C++ FramePtr::GetPts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FramePtr
的用法示例。
在下文中一共展示了FramePtr::GetPts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
bool update()
{
tick();
adjustTime();
FramePtr newFrame = fetchFrame();
if(newFrame != 0){
// Don't free currentFrame if it is currentFrame itself that's being converted
if(currentFrame == 0 || currentFrame->GetAvFrame() != newFrame->GetAvFrame()){
currentFrame = newFrame; // Save the current frame for snapshots etc.
}
lastFrameQueuePts = timeFromTs(newFrame->GetPts());
return true;
}
return false;
}
示例2: fetchFrame
FramePtr fetchFrame()
{
bool wasStepIntoQueue = stepIntoQueue;
if(frameQueue.empty() && IsEof() && !reportedEof)
{
reportedEof = true;
messageCallback(MEof, "eof");
}
if(stepIntoQueue && !frameQueue.empty())
{
stepIntoQueue = false;
timeHandler->SetTime(timeFromTs(frameQueue.top()->GetPts()) + .001);
audioHandler->discardQueueUntilTs(timeHandler->GetTime());
}
double time = timeHandler->GetTime();
FramePtr newFrame = 0;
// Throw away all old frames (timestamp older than now) except for the last
// and set the pFrame pointer to that.
int poppedFrames = 0;
while(!frameQueue.empty() && timeFromTs(frameQueue.top()->GetPts()) < time)
{
newFrame = frameQueue.top();
frameQueue.pop();
poppedFrames++;
}
if(poppedFrames > 1){
FlogD("skipped " << poppedFrames - 1 << " frames");
}
if(newFrame != 0 && (newFrame->GetPts() >= time || wasStepIntoQueue))
return newFrame;
return 0;
}