老翟的仓库zhaixishan.blog.chinaunix.net
zhaixishan
全部博文(125)
2014年(1)
2013年(1)
2012年(2)
2011年(29)
2010年(92)
along819
fuleru
bremen14
cn_unix
cynthia
浪花小雨
冇二哥
adwsxule
hkm080
分类: WINDOWS
2011-02-09 15:37:20
size_t AudioPlayer::fillBuffer(data, size) { ... mSource->read(&mInputBuffer, ...); mInputBuffer->meta_data()->findInt64(kKeyTime, &mPositionTimeMediaUs); mPositionTimeRealUs = ((mNumFramesPlayed + size_done / mFrameSize) * 1000000) / mSampleRate; ... }
void AwesomePlayer::onVideoEvent() { ... mVideoSource->read(&mVideoBuffer, ...); mVideoBuffer->meta_data()->findInt64(kKeyTime, &timeUs); mAudioPlayer->getMediaTimeMapping(&realTimeUs, &mediaTimeUs); mTimeSourceDeltaUs = realTimeUs - mediaTimeUs; nowUs = ts->getRealTimeUs() - mTimeSourceDeltaUs; latenessUs = nowUs - timeUs; ... }
void AwesomePlayer::onVideoEvent() { ... if (latenessUs > 40000) { mVideoBuffer->release(); mVideoBuffer = NULL; postVideoEvent_l(); return; } if (latenessUs < -10000) { postVideoEvent_l(10000); return; } mVideoRenderer->render(mVideoBuffer); ... }
上一篇:stagefright框架(五)-Video Rendering
下一篇:OpenCore代码阅读--PVPlayer的实现
chinaunix网友2011-07-07 11:31:42
好文章阿,只是有点疑问没在文章中找到:AudioPlayer::getRealTimeUsLocked()是什么用的阿
登录 注册