1

I've read the source code of DispSync and so on, but it's too complicate.

What I've learnt is that "FrameCallback" is triggered by APP_VSYNC event, which may have time offset from HW_VSYNC. So, how could I know the precise time of HW_VSYNC?

If the time parameter of FrameCallback tells the APP_VSYNC time, where can I get the offset value between HW_VSYNC and APP_VSYNC so I can caculate the hardware vsync time?

Ignacio Alorre
  • 7,307
  • 8
  • 57
  • 94
pippo
  • 53
  • 5

1 Answers1

0

IIRC, the timestamps reported by Choreographer are the APP_VSYNC times. As noted in the comments in Grafika's 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.

If A/V sync is your goal, you should probably be using the setPresentationTime() feature. See the comment above doFrame() for additional notes.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
fadden
  • 51,356
  • 5
  • 116
  • 166