• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef ANDROID_DVR_VSYNC_H_
2 #define ANDROID_DVR_VSYNC_H_
3 
4 #include <stdint.h>
5 #include <sys/cdefs.h>
6 
7 __BEGIN_DECLS
8 
9 // Represents a vsync sample. The size of this struct is 32 bytes.
10 typedef struct __attribute__((packed, aligned(16))) DvrVsync {
11   // The timestamp for the last vsync in nanoseconds.
12   uint64_t vsync_timestamp_ns;
13 
14   // The index of the last vsync.
15   uint32_t vsync_count;
16 
17   // Scan out for the left eye = vsync_timestamp_ns + vsync_left_eye_offset_ns.
18   int32_t vsync_left_eye_offset_ns;
19 
20   // Scan out for the right eye = vsync_timestamp_ns + vsync_right_eye_offset_ns
21   int32_t vsync_right_eye_offset_ns;
22 
23   // The period of a vsync in nanoseconds.
24   uint32_t vsync_period_ns;
25 
26   // Padding to 32 bytes so the size is a multiple of 16.
27   uint8_t padding[8];
28 } DvrVsync;
29 
30 __END_DECLS
31 
32 #endif  // ANDROID_DVR_VSYNC_H_
33