(2) Stagefright中的video便依據從AudioPlayer得出來之兩個時間戳的差值,作為播放的依據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;...}AwesomePlayer從AudioPlayer取得realTimeUs(即mPositionTimeRealUs)和mediaTimeUs(即mPositionTimeMediaUs),並算出其差值mTimeSourceDeltaUs。
(3) 最後我們將該video資料做排程void AwesomePlayer::onVideoEvent(){...if (latenessUs > 40000){mVideoBuffer->release();mVideoBuffer = NULL;postVideoEvent_l();return;}if (latenessUs < -10000){postVideoEvent_l(10000);return;}mVideoRenderer->render(mVideoBuffer);...}
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-50199-7.html
佩服你的勇气~不过如果这样说~怕是看不到第二天的太阳了~
期待演员杨洋给我们展现他的潜力和作品
这种做错事不道歉的官僚作风不除