1 /*
2  * This file is auto-generated.  DO NOT MODIFY.
3  * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash d4c3897135ef9475dee2021ac39a41ae79c7690e -t --stability vintf --min_sdk_version 30 -pout/soong/.intermediates/hardware/interfaces/common/aidl/android.hardware.common_interface/2/preprocessed.aidl -pout/soong/.intermediates/hardware/interfaces/media/bufferpool/aidl/android.hardware.media.bufferpool2_interface/2/preprocessed.aidl --ninja -d out/soong/.intermediates/hardware/interfaces/media/c2/aidl/android.hardware.media.c2-V1-ndk-source/gen/staging/android/hardware/media/c2/IGraphicBufferAllocator.cpp.d -h out/soong/.intermediates/hardware/interfaces/media/c2/aidl/android.hardware.media.c2-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/hardware/interfaces/media/c2/aidl/android.hardware.media.c2-V1-ndk-source/gen/staging -Iframeworks/native/aidl/gui -Iframeworks/base/core/java -Nhardware/interfaces/media/c2/aidl/aidl_api/android.hardware.media.c2/1 hardware/interfaces/media/c2/aidl/aidl_api/android.hardware.media.c2/1/android/hardware/media/c2/IGraphicBufferAllocator.aidl
4  *
5  * DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
6  * ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
7  * AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
8  */
9 #pragma once
10 
11 #include <cstdint>
12 #include <memory>
13 #include <optional>
14 #include <string>
15 #include <vector>
16 #include <android/binder_interface_utils.h>
17 #include <android/binder_parcelable_utils.h>
18 #include <android/binder_to_string.h>
19 #include <android/hardware_buffer_aidl.h>
20 #include <aidl/android/hardware/media/c2/IGraphicBufferAllocator.h>
21 #ifdef BINDER_STABILITY_SUPPORT
22 #include <android/binder_stability.h>
23 #endif  // BINDER_STABILITY_SUPPORT
24 
25 namespace aidl {
26 namespace android {
27 namespace hardware {
28 namespace media {
29 namespace c2 {
30 class IGraphicBufferAllocatorDelegator;
31 
32 class IGraphicBufferAllocator : public ::ndk::ICInterface {
33 public:
34   typedef IGraphicBufferAllocatorDelegator DefaultDelegator;
35   static const char* descriptor;
36   IGraphicBufferAllocator();
37   virtual ~IGraphicBufferAllocator();
38 
39   class Allocation {
40   public:
41     typedef std::false_type fixed_size;
42     static const char* descriptor;
43 
44     ::aidl::android::hardware::HardwareBuffer buffer;
45     ::ndk::ScopedFileDescriptor fence;
46 
47     binder_status_t readFromParcel(const AParcel* parcel);
48     binder_status_t writeToParcel(AParcel* parcel) const;
49 
50     inline bool operator==(const Allocation& _rhs) const {
51       return std::tie(buffer, fence) == std::tie(_rhs.buffer, _rhs.fence);
52     }
53     inline bool operator<(const Allocation& _rhs) const {
54       return std::tie(buffer, fence) < std::tie(_rhs.buffer, _rhs.fence);
55     }
56     inline bool operator!=(const Allocation& _rhs) const {
57       return !(*this == _rhs);
58     }
59     inline bool operator>(const Allocation& _rhs) const {
60       return _rhs < *this;
61     }
62     inline bool operator>=(const Allocation& _rhs) const {
63       return !(*this < _rhs);
64     }
65     inline bool operator<=(const Allocation& _rhs) const {
66       return !(_rhs < *this);
67     }
68 
69     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()70     inline std::string toString() const {
71       std::ostringstream _aidl_os;
72       _aidl_os << "Allocation{";
73       _aidl_os << "buffer: " << ::android::internal::ToString(buffer);
74       _aidl_os << ", fence: " << ::android::internal::ToString(fence);
75       _aidl_os << "}";
76       return _aidl_os.str();
77     }
78   };
79   class Description {
80   public:
81     typedef std::false_type fixed_size;
82     static const char* descriptor;
83 
84     int32_t width = 0;
85     int32_t height = 0;
86     int32_t format = 0;
87     int64_t usage = 0L;
88 
89     binder_status_t readFromParcel(const AParcel* parcel);
90     binder_status_t writeToParcel(AParcel* parcel) const;
91 
92     inline bool operator==(const Description& _rhs) const {
93       return std::tie(width, height, format, usage) == std::tie(_rhs.width, _rhs.height, _rhs.format, _rhs.usage);
94     }
95     inline bool operator<(const Description& _rhs) const {
96       return std::tie(width, height, format, usage) < std::tie(_rhs.width, _rhs.height, _rhs.format, _rhs.usage);
97     }
98     inline bool operator!=(const Description& _rhs) const {
99       return !(*this == _rhs);
100     }
101     inline bool operator>(const Description& _rhs) const {
102       return _rhs < *this;
103     }
104     inline bool operator>=(const Description& _rhs) const {
105       return !(*this < _rhs);
106     }
107     inline bool operator<=(const Description& _rhs) const {
108       return !(_rhs < *this);
109     }
110 
111     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()112     inline std::string toString() const {
113       std::ostringstream _aidl_os;
114       _aidl_os << "Description{";
115       _aidl_os << "width: " << ::android::internal::ToString(width);
116       _aidl_os << ", height: " << ::android::internal::ToString(height);
117       _aidl_os << ", format: " << ::android::internal::ToString(format);
118       _aidl_os << ", usage: " << ::android::internal::ToString(usage);
119       _aidl_os << "}";
120       return _aidl_os.str();
121     }
122   };
123   static inline const int32_t version = 1;
124   static inline const std::string hash = "d4c3897135ef9475dee2021ac39a41ae79c7690e";
125   static constexpr uint32_t TRANSACTION_allocate = FIRST_CALL_TRANSACTION + 0;
126   static constexpr uint32_t TRANSACTION_deallocate = FIRST_CALL_TRANSACTION + 1;
127   static constexpr uint32_t TRANSACTION_getWaitableFd = FIRST_CALL_TRANSACTION + 2;
128 
129   static std::shared_ptr<IGraphicBufferAllocator> fromBinder(const ::ndk::SpAIBinder& binder);
130   static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IGraphicBufferAllocator>& instance);
131   static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IGraphicBufferAllocator>* instance);
132   static bool setDefaultImpl(const std::shared_ptr<IGraphicBufferAllocator>& impl);
133   static const std::shared_ptr<IGraphicBufferAllocator>& getDefaultImpl();
134   virtual ::ndk::ScopedAStatus allocate(const ::aidl::android::hardware::media::c2::IGraphicBufferAllocator::Description& in_desc, ::aidl::android::hardware::media::c2::IGraphicBufferAllocator::Allocation* _aidl_return) = 0;
135   virtual ::ndk::ScopedAStatus deallocate(int64_t in_id, bool* _aidl_return) = 0;
136   virtual ::ndk::ScopedAStatus getWaitableFd(::ndk::ScopedFileDescriptor* _aidl_return) = 0;
137   virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
138   virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
139 private:
140   static std::shared_ptr<IGraphicBufferAllocator> default_impl;
141 };
142 class IGraphicBufferAllocatorDefault : public IGraphicBufferAllocator {
143 public:
144   ::ndk::ScopedAStatus allocate(const ::aidl::android::hardware::media::c2::IGraphicBufferAllocator::Description& in_desc, ::aidl::android::hardware::media::c2::IGraphicBufferAllocator::Allocation* _aidl_return) override;
145   ::ndk::ScopedAStatus deallocate(int64_t in_id, bool* _aidl_return) override;
146   ::ndk::ScopedAStatus getWaitableFd(::ndk::ScopedFileDescriptor* _aidl_return) override;
147   ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
148   ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
149   ::ndk::SpAIBinder asBinder() override;
150   bool isRemote() override;
151 };
152 }  // namespace c2
153 }  // namespace media
154 }  // namespace hardware
155 }  // namespace android
156 }  // namespace aidl
157