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