1 #pragma once
2 
3 #include <aidl/android/hardware/graphics/allocator/AllocationResult.h>
4 #include <aidl/android/hardware/graphics/allocator/BnAllocator.h>
5 #include <aidlcommonsupport/NativeHandle.h>
6 
7 #include <cstdint>
8 #include <vector>
9 
10 namespace pixel {
11 namespace allocator {
12 
13 namespace AidlAllocator = aidl::android::hardware::graphics::allocator;
14 
15 class GrallocAllocator : public AidlAllocator::BnAllocator {
16 public:
17     GrallocAllocator();
18 
19     ~GrallocAllocator();
20 
21     virtual ndk::ScopedAStatus allocate(const std::vector<uint8_t>& descriptor, int32_t count,
22                                         AidlAllocator::AllocationResult* result) override;
23 
24     virtual binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
25 };
26 
27 } // namespace allocator
28 } // namespace pixel
29