1 #ifndef HIDL_GENERATED_ANDROID_HARDWARE_MEDIA_C2_V1_2_TYPES_H
2 #define HIDL_GENERATED_ANDROID_HARDWARE_MEDIA_C2_V1_2_TYPES_H
3 
4 #include <hidl/HidlSupport.h>
5 #include <hidl/MQDescriptor.h>
6 #include <utils/NativeHandle.h>
7 #include <utils/misc.h>
8 
9 namespace android {
10 namespace hardware {
11 namespace media {
12 namespace c2 {
13 namespace V1_2 {
14 
15 // Forward declaration for forward reference support:
16 struct SurfaceSyncObj;
17 
18 /**
19  * Surface(BufferQueue/IGBP) synchronization object regarding # of dequeued
20  * output buffers. This keeps # of dequeued buffers from Surface less than
21  * configured max # of dequeued buffers all the time.
22  */
23 struct SurfaceSyncObj final {
24     /**
25      * ASharedMemory for synchronization data. Layout is below
26      *
27      * |lock(futex)                               4bytes|
28      * |conditional_variable(futex)               4bytes|
29      * |# of max dequeable buffer                 4bytes|
30      * |# of dequeued buffer                      4bytes|
31      * |Status of the surface                     4bytes|
32      *      INIT        = 0, Configuring surface is not finished.
33      *      ACTIVE      = 1, Surface is ready to allocate(dequeue).
34      *      SWITCHING   = 2, Switching to the new surface. It is blocked
35      *                       to allocate(dequeue) a buffer until switching
36      *                       completes.
37      */
38     ::android::hardware::hidl_handle syncMemory __attribute__ ((aligned(8)));
39     /**
40      * BufferQueue id.
41      */
42     uint64_t bqId __attribute__ ((aligned(8)));
43     /**
44      * Generation id.
45      */
46     uint32_t generationId __attribute__ ((aligned(4)));
47     /**
48      * Consumer usage flags. See +ndk
49      * libnativewindow#AHardwareBuffer_UsageFlags for possible values.
50      */
51     uint64_t consumerUsage __attribute__ ((aligned(8)));
52 };
53 
54 static_assert(offsetof(::android::hardware::media::c2::V1_2::SurfaceSyncObj, syncMemory) == 0, "wrong offset");
55 static_assert(offsetof(::android::hardware::media::c2::V1_2::SurfaceSyncObj, bqId) == 16, "wrong offset");
56 static_assert(offsetof(::android::hardware::media::c2::V1_2::SurfaceSyncObj, generationId) == 24, "wrong offset");
57 static_assert(offsetof(::android::hardware::media::c2::V1_2::SurfaceSyncObj, consumerUsage) == 32, "wrong offset");
58 static_assert(sizeof(::android::hardware::media::c2::V1_2::SurfaceSyncObj) == 40, "wrong size");
59 static_assert(__alignof(::android::hardware::media::c2::V1_2::SurfaceSyncObj) == 8, "wrong alignment");
60 
61 //
62 // type declarations for package
63 //
64 
65 static inline std::string toString(const ::android::hardware::media::c2::V1_2::SurfaceSyncObj& o);
66 static inline void PrintTo(const ::android::hardware::media::c2::V1_2::SurfaceSyncObj& o, ::std::ostream*);
67 // operator== and operator!= are not generated for SurfaceSyncObj
68 
69 //
70 // type header definitions for package
71 //
72 
toString(const::android::hardware::media::c2::V1_2::SurfaceSyncObj & o)73 static inline std::string toString(const ::android::hardware::media::c2::V1_2::SurfaceSyncObj& o) {
74     using ::android::hardware::toString;
75     std::string os;
76     os += "{";
77     os += ".syncMemory = ";
78     os += ::android::hardware::toString(o.syncMemory);
79     os += ", .bqId = ";
80     os += ::android::hardware::toString(o.bqId);
81     os += ", .generationId = ";
82     os += ::android::hardware::toString(o.generationId);
83     os += ", .consumerUsage = ";
84     os += ::android::hardware::toString(o.consumerUsage);
85     os += "}"; return os;
86 }
87 
PrintTo(const::android::hardware::media::c2::V1_2::SurfaceSyncObj & o,::std::ostream * os)88 static inline void PrintTo(const ::android::hardware::media::c2::V1_2::SurfaceSyncObj& o, ::std::ostream* os) {
89     *os << toString(o);
90 }
91 
92 // operator== and operator!= are not generated for SurfaceSyncObj
93 
94 
95 }  // namespace V1_2
96 }  // namespace c2
97 }  // namespace media
98 }  // namespace hardware
99 }  // namespace android
100 
101 //
102 // global type declarations for package
103 //
104 
105 
106 #endif  // HIDL_GENERATED_ANDROID_HARDWARE_MEDIA_C2_V1_2_TYPES_H
107