2017-08-16 140 views
0

我已閱讀DispSync等的源代碼,但它太複雜了。「FrameTimeNanos」在「Choreographer.FrameCallback」中的含義是什麼? HW_VSYNC時間或APP_VSYNC時間?

我所學到的是「FrameCallback」由APP_VSYNC事件觸發,它可能與HW_VSYNC有時間偏移。那麼,我怎麼知道HW_VSYNC的準確時間呢?

如果FrameCallback的時間參數告訴APP_VSYNC時間,我可以在哪裏獲得HW_VSYNC和APP_VSYNC之間的偏移值,以便計算硬件vsync時間?

回答

0

IIRC,編舞報道的時間戳是APP_VSYNC次。如在Grafika的ScheduledSwapActivity的評論中指出:

* We coordinate with the display refresh using Choreographer. The SurfaceFlinger DispSync 
* enhancements may cause the Choreographer-reported vsync time to be offset from the 
* actual-reported vsync time (which may itself be slightly offset from the actual-actual 
* vsync time). None of this is terribly important unless you care about A/V sync. 

如果A/V同步是你的目標,你或許應該使用的setPresentationTime()功能。有關其他說明,請參見comment above doFrame()