1 #ifndef HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_EFFECT_V7_0_IEFFECTBUFFERPROVIDERCALLBACK_H
2 #define HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_EFFECT_V7_0_IEFFECTBUFFERPROVIDERCALLBACK_H
3 
4 #include <android/hardware/audio/effect/7.0/types.h>
5 #include <android/hidl/base/1.0/IBase.h>
6 
7 #include <android/hidl/manager/1.0/IServiceNotification.h>
8 
9 #include <hidl/HidlSupport.h>
10 #include <hidl/MQDescriptor.h>
11 #include <hidl/Status.h>
12 #include <utils/NativeHandle.h>
13 #include <utils/misc.h>
14 
15 namespace android {
16 namespace hardware {
17 namespace audio {
18 namespace effect {
19 namespace V7_0 {
20 
21 /**
22  * This callback interface contains functions that can be used by the effect
23  * engine 'process' function to exchange input and output audio buffers.
24  */
25 struct IEffectBufferProviderCallback : public ::android::hidl::base::V1_0::IBase {
26     /**
27      * Type tag for use in template logic that indicates this is a 'pure' class.
28      */
29     typedef ::android::hardware::details::i_tag _hidl_tag;
30 
31     /**
32      * Fully qualified interface name: "[email protected]::IEffectBufferProviderCallback"
33      */
34     static const char* descriptor;
35 
36     /**
37      * Returns whether this object's implementation is outside of the current process.
38      */
isRemoteIEffectBufferProviderCallback39     virtual bool isRemote() const override { return false; }
40 
41     /**
42      * Return callback for getBuffer
43      */
44     using getBuffer_cb = std::function<void(const ::android::hardware::audio::effect::V7_0::AudioBuffer& buffer)>;
45     /**
46      * Called to retrieve a buffer where data should read from by 'process'
47      * function.
48      *
49      * @return buffer audio buffer for processing
50      */
51     virtual ::android::hardware::Return<void> getBuffer(getBuffer_cb _hidl_cb) = 0;
52 
53     /**
54      * Called to provide a buffer with the data written by 'process' function.
55      *
56      * @param buffer audio buffer for processing
57      */
58     virtual ::android::hardware::Return<void> putBuffer(const ::android::hardware::audio::effect::V7_0::AudioBuffer& buffer) = 0;
59 
60     /**
61      * Return callback for interfaceChain
62      */
63     using interfaceChain_cb = std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& descriptors)>;
64     /*
65      * Provides run-time type information for this object.
66      * For example, for the following interface definition:
67      *     package [email protected];
68      *     interface IParent {};
69      *     interface IChild extends IParent {};
70      * Calling interfaceChain on an IChild object must yield the following:
71      *     ["[email protected]::IChild",
72      *      "[email protected]::IParent"
73      *      "[email protected]::IBase"]
74      *
75      * @return descriptors a vector of descriptors of the run-time type of the
76      *         object.
77      */
78     virtual ::android::hardware::Return<void> interfaceChain(interfaceChain_cb _hidl_cb) override;
79 
80     /*
81      * Emit diagnostic information to the given file.
82      *
83      * Optionally overriden.
84      *
85      * @param fd      File descriptor to dump data to.
86      *                Must only be used for the duration of this call.
87      * @param options Arguments for debugging.
88      *                Must support empty for default debug information.
89      */
90     virtual ::android::hardware::Return<void> debug(const ::android::hardware::hidl_handle& fd, const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& options) override;
91 
92     /**
93      * Return callback for interfaceDescriptor
94      */
95     using interfaceDescriptor_cb = std::function<void(const ::android::hardware::hidl_string& descriptor)>;
96     /*
97      * Provides run-time type information for this object.
98      * For example, for the following interface definition:
99      *     package [email protected];
100      *     interface IParent {};
101      *     interface IChild extends IParent {};
102      * Calling interfaceDescriptor on an IChild object must yield
103      *     "[email protected]::IChild"
104      *
105      * @return descriptor a descriptor of the run-time type of the
106      *         object (the first element of the vector returned by
107      *         interfaceChain())
108      */
109     virtual ::android::hardware::Return<void> interfaceDescriptor(interfaceDescriptor_cb _hidl_cb) override;
110 
111     /**
112      * Return callback for getHashChain
113      */
114     using getHashChain_cb = std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_array<uint8_t, 32>>& hashchain)>;
115     /*
116      * Returns hashes of the source HAL files that define the interfaces of the
117      * runtime type information on the object.
118      * For example, for the following interface definition:
119      *     package [email protected];
120      *     interface IParent {};
121      *     interface IChild extends IParent {};
122      * Calling interfaceChain on an IChild object must yield the following:
123      *     [(hash of IChild.hal),
124      *      (hash of IParent.hal)
125      *      (hash of IBase.hal)].
126      *
127      * SHA-256 is used as the hashing algorithm. Each hash has 32 bytes
128      * according to SHA-256 standard.
129      *
130      * @return hashchain a vector of SHA-1 digests
131      */
132     virtual ::android::hardware::Return<void> getHashChain(getHashChain_cb _hidl_cb) override;
133 
134     /*
135      * This method trigger the interface to enable/disable instrumentation based
136      * on system property hal.instrumentation.enable.
137      */
138     virtual ::android::hardware::Return<void> setHALInstrumentation() override;
139 
140     /*
141      * Registers a death recipient, to be called when the process hosting this
142      * interface dies.
143      *
144      * @param recipient a hidl_death_recipient callback object
145      * @param cookie a cookie that must be returned with the callback
146      * @return success whether the death recipient was registered successfully.
147      */
148     virtual ::android::hardware::Return<bool> linkToDeath(const ::android::sp<::android::hardware::hidl_death_recipient>& recipient, uint64_t cookie) override;
149 
150     /*
151      * Provides way to determine if interface is running without requesting
152      * any functionality.
153      */
154     virtual ::android::hardware::Return<void> ping() override;
155 
156     /**
157      * Return callback for getDebugInfo
158      */
159     using getDebugInfo_cb = std::function<void(const ::android::hidl::base::V1_0::DebugInfo& info)>;
160     /*
161      * Get debug information on references on this interface.
162      * @return info debugging information. See comments of DebugInfo.
163      */
164     virtual ::android::hardware::Return<void> getDebugInfo(getDebugInfo_cb _hidl_cb) override;
165 
166     /*
167      * This method notifies the interface that one or more system properties
168      * have changed. The default implementation calls
169      * (C++)  report_sysprop_change() in libcutils or
170      * (Java) android.os.SystemProperties.reportSyspropChanged,
171      * which in turn calls a set of registered callbacks (eg to update trace
172      * tags).
173      */
174     virtual ::android::hardware::Return<void> notifySyspropsChanged() override;
175 
176     /*
177      * Unregisters the registered death recipient. If this service was registered
178      * multiple times with the same exact death recipient, this unlinks the most
179      * recently registered one.
180      *
181      * @param recipient a previously registered hidl_death_recipient callback
182      * @return success whether the death recipient was unregistered successfully.
183      */
184     virtual ::android::hardware::Return<bool> unlinkToDeath(const ::android::sp<::android::hardware::hidl_death_recipient>& recipient) override;
185 
186     // cast static functions
187     /**
188      * This performs a checked cast based on what the underlying implementation actually is.
189      */
190     static ::android::hardware::Return<::android::sp<::android::hardware::audio::effect::V7_0::IEffectBufferProviderCallback>> castFrom(const ::android::sp<::android::hardware::audio::effect::V7_0::IEffectBufferProviderCallback>& parent, bool emitError = false);
191     /**
192      * This performs a checked cast based on what the underlying implementation actually is.
193      */
194     static ::android::hardware::Return<::android::sp<::android::hardware::audio::effect::V7_0::IEffectBufferProviderCallback>> castFrom(const ::android::sp<::android::hidl::base::V1_0::IBase>& parent, bool emitError = false);
195 
196     // helper methods for interactions with the hwservicemanager
197     /**
198      * This gets the service of this type with the specified instance name. If the
199      * service is currently not available or not in the VINTF manifest on a Trebilized
200      * device, this will return nullptr. This is useful when you don't want to block
201      * during device boot. If getStub is true, this will try to return an unwrapped
202      * passthrough implementation in the same process. This is useful when getting an
203      * implementation from the same partition/compilation group.
204      *
205      * In general, prefer getService(std::string,bool)
206      */
207     static ::android::sp<IEffectBufferProviderCallback> tryGetService(const std::string &serviceName="default", bool getStub=false);
208     /**
209      * Deprecated. See tryGetService(std::string, bool)
210      */
211     static ::android::sp<IEffectBufferProviderCallback> tryGetService(const char serviceName[], bool getStub=false)  { std::string str(serviceName ? serviceName : "");      return tryGetService(str, getStub); }
212     /**
213      * Deprecated. See tryGetService(std::string, bool)
214      */
215     static ::android::sp<IEffectBufferProviderCallback> tryGetService(const ::android::hardware::hidl_string& serviceName, bool getStub=false)  { std::string str(serviceName.c_str());      return tryGetService(str, getStub); }
216     /**
217      * Calls tryGetService("default", bool). This is the recommended instance name for singleton services.
218      */
tryGetServiceIEffectBufferProviderCallback219     static ::android::sp<IEffectBufferProviderCallback> tryGetService(bool getStub) { return tryGetService("default", getStub); }
220     /**
221      * This gets the service of this type with the specified instance name. If the
222      * service is not in the VINTF manifest on a Trebilized device, this will return
223      * nullptr. If the service is not available, this will wait for the service to
224      * become available. If the service is a lazy service, this will start the service
225      * and return when it becomes available. If getStub is true, this will try to
226      * return an unwrapped passthrough implementation in the same process. This is
227      * useful when getting an implementation from the same partition/compilation group.
228      */
229     static ::android::sp<IEffectBufferProviderCallback> getService(const std::string &serviceName="default", bool getStub=false);
230     /**
231      * Deprecated. See getService(std::string, bool)
232      */
233     static ::android::sp<IEffectBufferProviderCallback> getService(const char serviceName[], bool getStub=false)  { std::string str(serviceName ? serviceName : "");      return getService(str, getStub); }
234     /**
235      * Deprecated. See getService(std::string, bool)
236      */
237     static ::android::sp<IEffectBufferProviderCallback> getService(const ::android::hardware::hidl_string& serviceName, bool getStub=false)  { std::string str(serviceName.c_str());      return getService(str, getStub); }
238     /**
239      * Calls getService("default", bool). This is the recommended instance name for singleton services.
240      */
getServiceIEffectBufferProviderCallback241     static ::android::sp<IEffectBufferProviderCallback> getService(bool getStub) { return getService("default", getStub); }
242     /**
243      * Registers a service with the service manager. For Trebilized devices, the service
244      * must also be in the VINTF manifest.
245      */
246     __attribute__ ((warn_unused_result))::android::status_t registerAsService(const std::string &serviceName="default");
247     /**
248      * Registers for notifications for when a service is registered.
249      */
250     static bool registerForNotifications(
251             const std::string &serviceName,
252             const ::android::sp<::android::hidl::manager::V1_0::IServiceNotification> &notification);
253 };
254 
255 //
256 // type declarations for package
257 //
258 
259 static inline std::string toString(const ::android::sp<::android::hardware::audio::effect::V7_0::IEffectBufferProviderCallback>& o);
260 
261 //
262 // type header definitions for package
263 //
264 
toString(const::android::sp<::android::hardware::audio::effect::V7_0::IEffectBufferProviderCallback> & o)265 static inline std::string toString(const ::android::sp<::android::hardware::audio::effect::V7_0::IEffectBufferProviderCallback>& o) {
266     std::string os = "[class or subclass of ";
267     os += ::android::hardware::audio::effect::V7_0::IEffectBufferProviderCallback::descriptor;
268     os += "]";
269     os += o->isRemote() ? "@remote" : "@local";
270     return os;
271 }
272 
273 
274 }  // namespace V7_0
275 }  // namespace effect
276 }  // namespace audio
277 }  // namespace hardware
278 }  // namespace android
279 
280 //
281 // global type declarations for package
282 //
283 
284 
285 #endif  // HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_EFFECT_V7_0_IEFFECTBUFFERPROVIDERCALLBACK_H
286