1 #ifndef HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_V7_0_ISTREAMOUT_H
2 #define HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_V7_0_ISTREAMOUT_H
3
4 #include <android/hardware/audio/common/7.0/types.h>
5 #include <android/hardware/audio/7.0/IStream.h>
6 #include <android/hardware/audio/7.0/IStreamOutCallback.h>
7 #include <android/hardware/audio/7.0/IStreamOutEventCallback.h>
8 #include <android/hardware/audio/7.0/types.h>
9
10 #include <android/hidl/manager/1.0/IServiceNotification.h>
11
12 #include <hidl/HidlSupport.h>
13 #include <hidl/MQDescriptor.h>
14 #include <hidl/Status.h>
15 #include <utils/NativeHandle.h>
16 #include <utils/misc.h>
17
18 namespace android {
19 namespace hardware {
20 namespace audio {
21 namespace V7_0 {
22
23 struct IStreamOut : public ::android::hardware::audio::V7_0::IStream {
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]::IStreamOut"
31 */
32 static const char* descriptor;
33
34 // Forward declaration for forward reference support:
35 enum class WriteCommand : int32_t;
36 struct WriteStatus;
37
38 /**
39 * Commands that can be executed on the driver writer thread.
40 */
41 enum class WriteCommand : int32_t {
42 WRITE = 0,
43 GET_PRESENTATION_POSITION = 1 /* ::android::hardware::audio::V7_0::IStreamOut::WriteCommand.WRITE implicitly + 1 */,
44 GET_LATENCY = 2 /* ::android::hardware::audio::V7_0::IStreamOut::WriteCommand.GET_PRESENTATION_POSITION implicitly + 1 */,
45 };
46
47 /**
48 * Data structure passed back to the client via status message queue
49 * of 'write' operation.
50 *
51 * Possible values of 'retval' field:
52 * - OK, write operation was successful;
53 * - INVALID_ARGUMENTS, stream was not configured properly;
54 * - INVALID_STATE, stream is in a state that doesn't allow writes;
55 * - INVALID_OPERATION, retrieving presentation position isn't supported.
56 */
57 struct WriteStatus final {
58 // Forward declaration for forward reference support:
59 union Reply;
60
61 union Reply final {
62 // Forward declaration for forward reference support:
63 struct PresentationPosition;
64
65 struct PresentationPosition final {
66 uint64_t frames __attribute__ ((aligned(8)));
67 ::android::hardware::audio::V7_0::TimeSpec timeStamp __attribute__ ((aligned(8)));
68 };
69
70 static_assert(offsetof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition, frames) == 0, "wrong offset");
71 static_assert(offsetof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition, timeStamp) == 8, "wrong offset");
72 static_assert(sizeof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition) == 24, "wrong size");
73 static_assert(__alignof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition) == 8, "wrong alignment");
74
75 uint64_t written __attribute__ ((aligned(8)));
76 ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition presentationPosition __attribute__ ((aligned(8)));
77 uint32_t latencyMs __attribute__ ((aligned(4)));
78 };
79
80 static_assert(offsetof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply, written) == 0, "wrong offset");
81 static_assert(offsetof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply, presentationPosition) == 0, "wrong offset");
82 static_assert(offsetof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply, latencyMs) == 0, "wrong offset");
83 static_assert(sizeof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply) == 24, "wrong size");
84 static_assert(__alignof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply) == 8, "wrong alignment");
85
86 ::android::hardware::audio::V7_0::Result retval __attribute__ ((aligned(4)));
87 ::android::hardware::audio::V7_0::IStreamOut::WriteCommand replyTo __attribute__ ((aligned(4)));
88 ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply reply __attribute__ ((aligned(8)));
89 };
90
91 static_assert(offsetof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus, retval) == 0, "wrong offset");
92 static_assert(offsetof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus, replyTo) == 4, "wrong offset");
93 static_assert(offsetof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus, reply) == 8, "wrong offset");
94 static_assert(sizeof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus) == 32, "wrong size");
95 static_assert(__alignof(::android::hardware::audio::V7_0::IStreamOut::WriteStatus) == 8, "wrong alignment");
96
97 /**
98 * Returns whether this object's implementation is outside of the current process.
99 */
isRemoteIStreamOut100 virtual bool isRemote() const override { return false; }
101
102 /**
103 * Return the frame size (number of bytes per sample).
104 *
105 * @return frameSize frame size in bytes.
106 */
107 virtual ::android::hardware::Return<uint64_t> getFrameSize() override = 0;
108
109 /**
110 * Return the frame count of the buffer. Calling this method is equivalent
111 * to getting AUDIO_PARAMETER_STREAM_FRAME_COUNT on the legacy HAL.
112 *
113 * @return count frame count.
114 */
115 virtual ::android::hardware::Return<uint64_t> getFrameCount() override = 0;
116
117 /**
118 * Return the size of input/output buffer in bytes for this stream.
119 * It must be a multiple of the frame size.
120 *
121 * @return buffer buffer size in bytes.
122 */
123 virtual ::android::hardware::Return<uint64_t> getBufferSize() override = 0;
124
125 /**
126 * Return callback for getSupportedProfiles
127 */
128 using getSupportedProfiles_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, const ::android::hardware::hidl_vec<::android::hardware::audio::common::V7_0::AudioProfile>& profiles)>;
129 /**
130 * Return supported audio profiles for this particular stream. This method
131 * is normally called for streams opened on devices that use dynamic
132 * profiles, e.g. HDMI and USB interfaces. Please note that supported
133 * profiles of the stream may differ from the capabilities of the connected
134 * physical device.
135 *
136 * For devices with fixed configurations, e.g. built-in audio devices, all
137 * the profiles are specified in the audio_policy_configuration.xml
138 * file. For such devices, this method must return the configuration from
139 * the config file, or NOT_SUPPORTED retval.
140 *
141 * @return retval operation completion status.
142 * @return formats supported audio profiles.
143 * Must be non empty if retval is OK.
144 */
145 virtual ::android::hardware::Return<void> getSupportedProfiles(getSupportedProfiles_cb _hidl_cb) override = 0;
146
147 /**
148 * Return callback for getAudioProperties
149 */
150 using getAudioProperties_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, const ::android::hardware::audio::common::V7_0::AudioConfigBase& config)>;
151 /**
152 * Retrieves basic stream configuration: sample rate, audio format,
153 * channel mask.
154 *
155 * @return retval operation completion status.
156 * @return config basic stream configuration.
157 */
158 virtual ::android::hardware::Return<void> getAudioProperties(getAudioProperties_cb _hidl_cb) override = 0;
159
160 /**
161 * Sets stream parameters. Only sets parameters that are specified.
162 *
163 * Optional method. If implemented, only called on a stopped stream.
164 *
165 * @param config basic stream configuration.
166 * @return retval operation completion status.
167 */
168 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> setAudioProperties(const ::android::hardware::audio::common::V7_0::AudioConfigBaseOptional& config) override = 0;
169
170 /**
171 * Applies audio effect to the stream.
172 *
173 * @param effectId effect ID (obtained from IEffectsFactory.createEffect) of
174 * the effect to apply.
175 * @return retval operation completion status.
176 */
177 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> addEffect(uint64_t effectId) override = 0;
178
179 /**
180 * Stops application of the effect to the stream.
181 *
182 * @param effectId effect ID (obtained from IEffectsFactory.createEffect) of
183 * the effect to remove.
184 * @return retval operation completion status.
185 */
186 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> removeEffect(uint64_t effectId) override = 0;
187
188 /**
189 * Put the audio hardware input/output into standby mode.
190 * Driver must exit from standby mode at the next I/O operation.
191 *
192 * @return retval operation completion status.
193 */
194 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> standby() override = 0;
195
196 /**
197 * Return callback for getDevices
198 */
199 using getDevices_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, const ::android::hardware::hidl_vec<::android::hardware::audio::common::V7_0::DeviceAddress>& devices)>;
200 /**
201 * Return the set of devices which this stream is connected to.
202 *
203 * Optional method
204 *
205 * @return retval operation completion status: OK or NOT_SUPPORTED.
206 * @return device set of devices which this stream is connected to.
207 */
208 virtual ::android::hardware::Return<void> getDevices(getDevices_cb _hidl_cb) override = 0;
209
210 /**
211 * Connects the stream to one or multiple devices.
212 *
213 * This method must only be used for HALs that do not support
214 * 'IDevice.createAudioPatch' method. Calling this method is
215 * equivalent to setting AUDIO_PARAMETER_STREAM_ROUTING preceded
216 * with a device address in the legacy HAL interface.
217 *
218 * @param address device to connect the stream to.
219 * @return retval operation completion status.
220 */
221 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> setDevices(const ::android::hardware::hidl_vec<::android::hardware::audio::common::V7_0::DeviceAddress>& devices) override = 0;
222
223 /**
224 * Sets the HW synchronization source. Calling this method is equivalent to
225 * setting AUDIO_PARAMETER_STREAM_HW_AV_SYNC on the legacy HAL.
226 *
227 * Optional method
228 *
229 * @param hwAvSync HW synchronization source
230 * @return retval operation completion status.
231 */
232 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> setHwAvSync(uint32_t hwAvSync) override = 0;
233
234 /**
235 * Return callback for getParameters
236 */
237 using getParameters_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, const ::android::hardware::hidl_vec<::android::hardware::audio::V7_0::ParameterValue>& parameters)>;
238 /**
239 * Generic method for retrieving vendor-specific parameter values.
240 * The framework does not interpret the parameters, they are passed
241 * in an opaque manner between a vendor application and HAL.
242 *
243 * Multiple parameters can be retrieved at the same time.
244 * The implementation should return as many requested parameters
245 * as possible, even if one or more is not supported
246 *
247 * @param context provides more information about the request
248 * @param keys keys of the requested parameters
249 * @return retval operation completion status.
250 * OK must be returned if keys is empty.
251 * NOT_SUPPORTED must be returned if at least one key is unknown.
252 * @return parameters parameter key value pairs.
253 * Must contain the value of all requested keys if retval == OK
254 */
255 virtual ::android::hardware::Return<void> getParameters(const ::android::hardware::hidl_vec<::android::hardware::audio::V7_0::ParameterValue>& context, const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& keys, getParameters_cb _hidl_cb) override = 0;
256
257 /**
258 * Generic method for setting vendor-specific parameter values.
259 * The framework does not interpret the parameters, they are passed
260 * in an opaque manner between a vendor application and HAL.
261 *
262 * Multiple parameters can be set at the same time though this is
263 * discouraged as it make failure analysis harder.
264 *
265 * If possible, a failed setParameters should not impact the platform state.
266 *
267 * @param context provides more information about the request
268 * @param parameters parameter key value pairs.
269 * @return retval operation completion status.
270 * All parameters must be successfully set for OK to be returned
271 */
272 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> setParameters(const ::android::hardware::hidl_vec<::android::hardware::audio::V7_0::ParameterValue>& context, const ::android::hardware::hidl_vec<::android::hardware::audio::V7_0::ParameterValue>& parameters) override = 0;
273
274 /**
275 * Called by the framework to start a stream operating in mmap mode.
276 * createMmapBuffer() must be called before calling start().
277 * Function only implemented by streams operating in mmap mode.
278 *
279 * @return retval OK in case the success.
280 * NOT_SUPPORTED on non mmap mode streams
281 * INVALID_STATE if called out of sequence
282 */
283 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> start() override = 0;
284
285 /**
286 * Called by the framework to stop a stream operating in mmap mode.
287 * Function only implemented by streams operating in mmap mode.
288 *
289 * @return retval OK in case the success.
290 * NOT_SUPPORTED on non mmap mode streams
291 * INVALID_STATE if called out of sequence
292 */
293 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> stop() override = 0;
294
295 /**
296 * Return callback for createMmapBuffer
297 */
298 using createMmapBuffer_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, const ::android::hardware::audio::V7_0::MmapBufferInfo& info)>;
299 /**
300 * Called by the framework to retrieve information on the mmap buffer used for audio
301 * samples transfer.
302 * Function only implemented by streams operating in mmap mode.
303 *
304 * @param minSizeFrames minimum buffer size requested. The actual buffer
305 * size returned in struct MmapBufferInfo can be larger.
306 * The size must be a positive value.
307 * @return retval OK in case the success.
308 * NOT_SUPPORTED on non mmap mode streams
309 * NOT_INITIALIZED in case of memory allocation error
310 * INVALID_ARGUMENTS if the requested buffer size is invalid
311 * INVALID_STATE if called out of sequence
312 * @return info a MmapBufferInfo struct containing information on the MMMAP buffer created.
313 */
314 virtual ::android::hardware::Return<void> createMmapBuffer(int32_t minSizeFrames, createMmapBuffer_cb _hidl_cb) override = 0;
315
316 /**
317 * Return callback for getMmapPosition
318 */
319 using getMmapPosition_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, const ::android::hardware::audio::V7_0::MmapPosition& position)>;
320 /**
321 * Called by the framework to read current read/write position in the mmap buffer
322 * with associated time stamp.
323 * Function only implemented by streams operating in mmap mode.
324 *
325 * @return retval OK in case the success.
326 * NOT_SUPPORTED on non mmap mode streams
327 * INVALID_STATE if called out of sequence
328 * @return position a MmapPosition struct containing current HW read/write position in frames
329 * with associated time stamp.
330 */
331 virtual ::android::hardware::Return<void> getMmapPosition(getMmapPosition_cb _hidl_cb) override = 0;
332
333 /**
334 * Called by the framework to deinitialize the stream and free up
335 * all currently allocated resources. It is recommended to close
336 * the stream on the client side as soon as it is becomes unused.
337 *
338 * The client must ensure that this function is not called while
339 * audio data is being transferred through the stream's message queues.
340 *
341 * @return retval OK in case the success.
342 * NOT_SUPPORTED if called on IStream instead of input or
343 * output stream interface.
344 * INVALID_STATE if the stream was already closed.
345 */
346 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> close() override = 0;
347
348 /**
349 * Return the audio hardware driver estimated latency in milliseconds.
350 *
351 * @return latencyMs latency in milliseconds.
352 */
353 virtual ::android::hardware::Return<uint32_t> getLatency() = 0;
354
355 /**
356 * This method is used in situations where audio mixing is done in the
357 * hardware. This method serves as a direct interface with hardware,
358 * allowing to directly set the volume as apposed to via the framework.
359 * This method might produce multiple PCM outputs or hardware accelerated
360 * codecs, such as MP3 or AAC.
361 *
362 * Optional method
363 *
364 * @param left left channel attenuation, 1.0f is unity, 0.0f is zero.
365 * @param right right channel attenuation, 1.0f is unity, 0.0f is zero.
366 * @return retval operation completion status.
367 * If a volume is outside [0,1], return INVALID_ARGUMENTS
368 */
369 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> setVolume(float left, float right) = 0;
370
371 /**
372 * Called when the metadata of the stream's source has been changed.
373 *
374 * Optional method
375 *
376 * @param sourceMetadata Description of the audio that is played by the clients.
377 * @return retval operation completion status.
378 * If any of the metadata fields contains an invalid value,
379 * returns INVALID_ARGUMENTS.
380 * If method isn't supported by the HAL returns NOT_SUPPORTED.
381 */
382 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> updateSourceMetadata(const ::android::hardware::audio::common::V7_0::SourceMetadata& sourceMetadata) = 0;
383
384 /**
385 * Return callback for prepareForWriting
386 */
387 using prepareForWriting_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, const ::android::hardware::MQDescriptorSync<::android::hardware::audio::V7_0::IStreamOut::WriteCommand>& commandMQ, const ::android::hardware::MQDescriptorSync<uint8_t>& dataMQ, const ::android::hardware::MQDescriptorSync<::android::hardware::audio::V7_0::IStreamOut::WriteStatus>& statusMQ, int32_t threadId)>;
388 /**
389 * Set up required transports for passing audio buffers to the driver.
390 *
391 * The transport consists of three message queues:
392 * -- command queue is used to instruct the writer thread what operation
393 * to perform;
394 * -- data queue is used for passing audio data from the client
395 * to the driver;
396 * -- status queue is used for reporting operation status
397 * (e.g. amount of bytes actually written or error code).
398 *
399 * The driver operates on a dedicated thread. The client must ensure that
400 * the thread is given an appropriate priority and assigned to correct
401 * scheduler and cgroup. For this purpose, the method returns the identifier
402 * of the driver thread.
403 *
404 * @param frameSize the size of a single frame, in bytes.
405 * @param framesCount the number of frames in a buffer.
406 * @return retval OK if both message queues were created successfully.
407 * INVALID_STATE if the method was already called.
408 * INVALID_ARGUMENTS if there was a problem setting up
409 * the queues.
410 * @return commandMQ a message queue used for passing commands.
411 * @return dataMQ a message queue used for passing audio data in the format
412 * specified at the stream opening.
413 * @return statusMQ a message queue used for passing status from the driver
414 * using WriteStatus structures.
415 * @return threadId identifier of the driver's dedicated thread; the caller
416 * may adjust the thread priority to match the priority
417 * of the thread that provides audio data.
418 */
419 virtual ::android::hardware::Return<void> prepareForWriting(uint32_t frameSize, uint32_t framesCount, prepareForWriting_cb _hidl_cb) = 0;
420
421 /**
422 * Return callback for getRenderPosition
423 */
424 using getRenderPosition_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, uint32_t dspFrames)>;
425 /**
426 * Return the number of audio frames written by the audio DSP to DAC since
427 * the output has exited standby.
428 *
429 * Optional method
430 *
431 * @return retval operation completion status.
432 * @return dspFrames number of audio frames written.
433 */
434 virtual ::android::hardware::Return<void> getRenderPosition(getRenderPosition_cb _hidl_cb) = 0;
435
436 /**
437 * Return callback for getNextWriteTimestamp
438 */
439 using getNextWriteTimestamp_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, int64_t timestampUs)>;
440 /**
441 * Get the local time at which the next write to the audio driver will be
442 * presented. The units are microseconds, where the epoch is decided by the
443 * local audio HAL.
444 *
445 * Optional method
446 *
447 * @return retval operation completion status.
448 * @return timestampUs time of the next write.
449 */
450 virtual ::android::hardware::Return<void> getNextWriteTimestamp(getNextWriteTimestamp_cb _hidl_cb) = 0;
451
452 /**
453 * Set the callback interface for notifying completion of non-blocking
454 * write and drain.
455 *
456 * Calling this function implies that all future 'write' and 'drain'
457 * must be non-blocking and use the callback to signal completion.
458 *
459 * 'clearCallback' method needs to be called in order to release the local
460 * callback proxy on the server side and thus dereference the callback
461 * implementation on the client side.
462 *
463 * @return retval operation completion status.
464 */
465 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> setCallback(const ::android::sp<::android::hardware::audio::V7_0::IStreamOutCallback>& callback) = 0;
466
467 /**
468 * Clears the callback previously set via 'setCallback' method.
469 *
470 * Warning: failure to call this method results in callback implementation
471 * on the client side being held until the HAL server termination.
472 *
473 * If no callback was previously set, the method should be a no-op
474 * and return OK.
475 *
476 * @return retval operation completion status: OK or NOT_SUPPORTED.
477 */
478 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> clearCallback() = 0;
479
480 /**
481 * Set the callback interface for notifying about an output stream event.
482 *
483 * Calling this method with a null pointer will result in releasing
484 * the local callback proxy on the server side and thus dereference
485 * the callback implementation on the client side.
486 *
487 * @return retval operation completion status.
488 */
489 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> setEventCallback(const ::android::sp<::android::hardware::audio::V7_0::IStreamOutEventCallback>& callback) = 0;
490
491 /**
492 * Return callback for supportsPauseAndResume
493 */
494 using supportsPauseAndResume_cb = std::function<void(bool supportsPause, bool supportsResume)>;
495 /**
496 * Returns whether HAL supports pausing and resuming of streams.
497 *
498 * @return supportsPause true if pausing is supported.
499 * @return supportsResume true if resume is supported.
500 */
501 virtual ::android::hardware::Return<void> supportsPauseAndResume(supportsPauseAndResume_cb _hidl_cb) = 0;
502
503 /**
504 * Notifies to the audio driver to stop playback however the queued buffers
505 * are retained by the hardware. Useful for implementing pause/resume. Empty
506 * implementation if not supported however must be implemented for hardware
507 * with non-trivial latency. In the pause state, some audio hardware may
508 * still be using power. Client code may consider calling 'suspend' after a
509 * timeout to prevent that excess power usage.
510 *
511 * Implementation of this function is mandatory for offloaded playback.
512 *
513 * @return retval operation completion status.
514 */
515 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> pause() = 0;
516
517 /**
518 * Notifies to the audio driver to resume playback following a pause.
519 * Returns error INVALID_STATE if called without matching pause.
520 *
521 * Implementation of this function is mandatory for offloaded playback.
522 *
523 * @return retval operation completion status.
524 */
525 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> resume() = 0;
526
527 /**
528 * Returns whether HAL supports draining of streams.
529 *
530 * @return supports true if draining is supported.
531 */
532 virtual ::android::hardware::Return<bool> supportsDrain() = 0;
533
534 /**
535 * Requests notification when data buffered by the driver/hardware has been
536 * played. If 'setCallback' has previously been called to enable
537 * non-blocking mode, then 'drain' must not block, instead it must return
538 * quickly and completion of the drain is notified through the callback. If
539 * 'setCallback' has not been called, then 'drain' must block until
540 * completion.
541 *
542 * If 'type' is 'ALL', the drain completes when all previously written data
543 * has been played.
544 *
545 * If 'type' is 'EARLY_NOTIFY', the drain completes shortly before all data
546 * for the current track has played to allow time for the framework to
547 * perform a gapless track switch.
548 *
549 * Drain must return immediately on 'stop' and 'flush' calls.
550 *
551 * Implementation of this function is mandatory for offloaded playback.
552 *
553 * @param type type of drain.
554 * @return retval operation completion status.
555 */
556 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> drain(::android::hardware::audio::V7_0::AudioDrain type) = 0;
557
558 /**
559 * Notifies to the audio driver to flush (that is, drop) the queued
560 * data. Stream must already be paused before calling 'flush'. For
561 * compressed and offload streams the frame count returned by
562 * 'getPresentationPosition' must reset after flush.
563 *
564 * Optional method
565 *
566 * Implementation of this function is mandatory for offloaded playback.
567 *
568 * @return retval operation completion status.
569 */
570 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> flush() = 0;
571
572 /**
573 * Return callback for getPresentationPosition
574 */
575 using getPresentationPosition_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, uint64_t frames, const ::android::hardware::audio::V7_0::TimeSpec& timeStamp)>;
576 /**
577 * Return a recent count of the number of audio frames presented to an
578 * external observer. This excludes frames which have been written but are
579 * still in the pipeline. The count must not reset to zero when a PCM output
580 * enters standby. For compressed and offload streams it is recommended that
581 * HAL resets the frame count.
582 *
583 * This method also returns the value of CLOCK_MONOTONIC as of this
584 * presentation count. The returned count is expected to be 'recent', but
585 * does not need to be the most recent possible value. However, the
586 * associated time must correspond to whatever count is returned.
587 * Example: assume that N+M frames have been presented, where M is a 'small'
588 * number. Then it is permissible to return N instead of N+M, and the
589 * timestamp must correspond to N rather than N+M. The terms 'recent' and
590 * 'small' are not defined. They reflect the quality of the implementation.
591 *
592 * @return retval operation completion status.
593 * @return frames count of presented audio frames.
594 * @return timeStamp associated clock time.
595 */
596 virtual ::android::hardware::Return<void> getPresentationPosition(getPresentationPosition_cb _hidl_cb) = 0;
597
598 /**
599 * Selects a presentation for decoding from a next generation media stream
600 * (as defined per ETSI TS 103 190-2) and a program within the presentation.
601 *
602 * Optional method
603 *
604 * @param presentationId selected audio presentation.
605 * @param programId refinement for the presentation.
606 * @return retval operation completion status.
607 */
608 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> selectPresentation(int32_t presentationId, int32_t programId) = 0;
609
610 /**
611 * Return callback for getDualMonoMode
612 */
613 using getDualMonoMode_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, ::android::hardware::audio::V7_0::DualMonoMode mode)>;
614 /**
615 * Returns the Dual Mono mode presentation setting.
616 *
617 * Optional method
618 *
619 * @return retval operation completion status.
620 * @return mode current setting of Dual Mono mode.
621 */
622 virtual ::android::hardware::Return<void> getDualMonoMode(getDualMonoMode_cb _hidl_cb) = 0;
623
624 /**
625 * Sets the Dual Mono mode presentation on the output device.
626 *
627 * The Dual Mono mode is generally applied to stereo audio streams
628 * where the left and right channels come from separate sources.
629 *
630 * Optional method
631 *
632 * @param mode selected Dual Mono mode.
633 * @return retval operation completion status.
634 */
635 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> setDualMonoMode(::android::hardware::audio::V7_0::DualMonoMode mode) = 0;
636
637 /**
638 * Return callback for getAudioDescriptionMixLevel
639 */
640 using getAudioDescriptionMixLevel_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, float leveldB)>;
641 /**
642 * Returns the Audio Description Mix level in dB.
643 *
644 * The level is applied to streams incorporating a secondary Audio
645 * Description stream. It specifies the relative level of mixing for
646 * the Audio Description with a reference to the Main Audio.
647 *
648 * Optional method
649 *
650 * The value of the relative level is in the range from negative infinity
651 * to +48.
652 *
653 * @return retval operation completion status.
654 * @return leveldB the current Audio Description Mix Level in dB.
655 */
656 virtual ::android::hardware::Return<void> getAudioDescriptionMixLevel(getAudioDescriptionMixLevel_cb _hidl_cb) = 0;
657
658 /**
659 * Sets the Audio Description Mix level in dB.
660 *
661 * For streams incorporating a secondary Audio Description stream
662 * the relative level of mixing of the Audio Description to the Main Audio
663 * is controlled by this method.
664 *
665 * Optional method
666 *
667 * The value of the relative level must be in the range from negative
668 * infinity to +48.
669 *
670 * @param leveldB Audio Description Mix Level in dB
671 * @return retval operation completion status.
672 */
673 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> setAudioDescriptionMixLevel(float leveldB) = 0;
674
675 /**
676 * Return callback for getPlaybackRateParameters
677 */
678 using getPlaybackRateParameters_cb = std::function<void(::android::hardware::audio::V7_0::Result retval, const ::android::hardware::audio::V7_0::PlaybackRate& playbackRate)>;
679 /**
680 * Retrieves current playback rate parameters.
681 *
682 * Optional method
683 *
684 * @return retval operation completion status.
685 * @return playbackRate current playback parameters
686 */
687 virtual ::android::hardware::Return<void> getPlaybackRateParameters(getPlaybackRateParameters_cb _hidl_cb) = 0;
688
689 /**
690 * Sets the playback rate parameters that control playback behavior.
691 * This is normally used when playing encoded content and decoding
692 * is performed in hardware. Otherwise, the framework can apply
693 * necessary transformations.
694 *
695 * Optional method
696 *
697 * If the HAL supports setting the playback rate, it is recommended
698 * to support speed and pitch values at least in the range
699 * from 0.5f to 2.0f, inclusive (see the definition of PlaybackRate struct).
700 *
701 * @param playbackRate playback parameters
702 * @return retval operation completion status.
703 */
704 virtual ::android::hardware::Return<::android::hardware::audio::V7_0::Result> setPlaybackRateParameters(const ::android::hardware::audio::V7_0::PlaybackRate& playbackRate) = 0;
705
706 /**
707 * Return callback for interfaceChain
708 */
709 using interfaceChain_cb = std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& descriptors)>;
710 /*
711 * Provides run-time type information for this object.
712 * For example, for the following interface definition:
713 * package [email protected];
714 * interface IParent {};
715 * interface IChild extends IParent {};
716 * Calling interfaceChain on an IChild object must yield the following:
717 * ["[email protected]::IChild",
718 * "[email protected]::IParent"
719 * "[email protected]::IBase"]
720 *
721 * @return descriptors a vector of descriptors of the run-time type of the
722 * object.
723 */
724 virtual ::android::hardware::Return<void> interfaceChain(interfaceChain_cb _hidl_cb) override;
725
726 /*
727 * Emit diagnostic information to the given file.
728 *
729 * Optionally overriden.
730 *
731 * @param fd File descriptor to dump data to.
732 * Must only be used for the duration of this call.
733 * @param options Arguments for debugging.
734 * Must support empty for default debug information.
735 */
736 virtual ::android::hardware::Return<void> debug(const ::android::hardware::hidl_handle& fd, const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& options) override;
737
738 /**
739 * Return callback for interfaceDescriptor
740 */
741 using interfaceDescriptor_cb = std::function<void(const ::android::hardware::hidl_string& descriptor)>;
742 /*
743 * Provides run-time type information for this object.
744 * For example, for the following interface definition:
745 * package [email protected];
746 * interface IParent {};
747 * interface IChild extends IParent {};
748 * Calling interfaceDescriptor on an IChild object must yield
749 * "[email protected]::IChild"
750 *
751 * @return descriptor a descriptor of the run-time type of the
752 * object (the first element of the vector returned by
753 * interfaceChain())
754 */
755 virtual ::android::hardware::Return<void> interfaceDescriptor(interfaceDescriptor_cb _hidl_cb) override;
756
757 /**
758 * Return callback for getHashChain
759 */
760 using getHashChain_cb = std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_array<uint8_t, 32>>& hashchain)>;
761 /*
762 * Returns hashes of the source HAL files that define the interfaces of the
763 * runtime type information on the object.
764 * For example, for the following interface definition:
765 * package [email protected];
766 * interface IParent {};
767 * interface IChild extends IParent {};
768 * Calling interfaceChain on an IChild object must yield the following:
769 * [(hash of IChild.hal),
770 * (hash of IParent.hal)
771 * (hash of IBase.hal)].
772 *
773 * SHA-256 is used as the hashing algorithm. Each hash has 32 bytes
774 * according to SHA-256 standard.
775 *
776 * @return hashchain a vector of SHA-1 digests
777 */
778 virtual ::android::hardware::Return<void> getHashChain(getHashChain_cb _hidl_cb) override;
779
780 /*
781 * This method trigger the interface to enable/disable instrumentation based
782 * on system property hal.instrumentation.enable.
783 */
784 virtual ::android::hardware::Return<void> setHALInstrumentation() override;
785
786 /*
787 * Registers a death recipient, to be called when the process hosting this
788 * interface dies.
789 *
790 * @param recipient a hidl_death_recipient callback object
791 * @param cookie a cookie that must be returned with the callback
792 * @return success whether the death recipient was registered successfully.
793 */
794 virtual ::android::hardware::Return<bool> linkToDeath(const ::android::sp<::android::hardware::hidl_death_recipient>& recipient, uint64_t cookie) override;
795
796 /*
797 * Provides way to determine if interface is running without requesting
798 * any functionality.
799 */
800 virtual ::android::hardware::Return<void> ping() override;
801
802 /**
803 * Return callback for getDebugInfo
804 */
805 using getDebugInfo_cb = std::function<void(const ::android::hidl::base::V1_0::DebugInfo& info)>;
806 /*
807 * Get debug information on references on this interface.
808 * @return info debugging information. See comments of DebugInfo.
809 */
810 virtual ::android::hardware::Return<void> getDebugInfo(getDebugInfo_cb _hidl_cb) override;
811
812 /*
813 * This method notifies the interface that one or more system properties
814 * have changed. The default implementation calls
815 * (C++) report_sysprop_change() in libcutils or
816 * (Java) android.os.SystemProperties.reportSyspropChanged,
817 * which in turn calls a set of registered callbacks (eg to update trace
818 * tags).
819 */
820 virtual ::android::hardware::Return<void> notifySyspropsChanged() override;
821
822 /*
823 * Unregisters the registered death recipient. If this service was registered
824 * multiple times with the same exact death recipient, this unlinks the most
825 * recently registered one.
826 *
827 * @param recipient a previously registered hidl_death_recipient callback
828 * @return success whether the death recipient was unregistered successfully.
829 */
830 virtual ::android::hardware::Return<bool> unlinkToDeath(const ::android::sp<::android::hardware::hidl_death_recipient>& recipient) override;
831
832 // cast static functions
833 /**
834 * This performs a checked cast based on what the underlying implementation actually is.
835 */
836 static ::android::hardware::Return<::android::sp<::android::hardware::audio::V7_0::IStreamOut>> castFrom(const ::android::sp<::android::hardware::audio::V7_0::IStreamOut>& parent, bool emitError = false);
837 /**
838 * This performs a checked cast based on what the underlying implementation actually is.
839 */
840 static ::android::hardware::Return<::android::sp<::android::hardware::audio::V7_0::IStreamOut>> castFrom(const ::android::sp<::android::hardware::audio::V7_0::IStream>& parent, bool emitError = false);
841 /**
842 * This performs a checked cast based on what the underlying implementation actually is.
843 */
844 static ::android::hardware::Return<::android::sp<::android::hardware::audio::V7_0::IStreamOut>> castFrom(const ::android::sp<::android::hidl::base::V1_0::IBase>& parent, bool emitError = false);
845
846 // helper methods for interactions with the hwservicemanager
847 /**
848 * This gets the service of this type with the specified instance name. If the
849 * service is currently not available or not in the VINTF manifest on a Trebilized
850 * device, this will return nullptr. This is useful when you don't want to block
851 * during device boot. If getStub is true, this will try to return an unwrapped
852 * passthrough implementation in the same process. This is useful when getting an
853 * implementation from the same partition/compilation group.
854 *
855 * In general, prefer getService(std::string,bool)
856 */
857 static ::android::sp<IStreamOut> tryGetService(const std::string &serviceName="default", bool getStub=false);
858 /**
859 * Deprecated. See tryGetService(std::string, bool)
860 */
861 static ::android::sp<IStreamOut> tryGetService(const char serviceName[], bool getStub=false) { std::string str(serviceName ? serviceName : ""); return tryGetService(str, getStub); }
862 /**
863 * Deprecated. See tryGetService(std::string, bool)
864 */
865 static ::android::sp<IStreamOut> tryGetService(const ::android::hardware::hidl_string& serviceName, bool getStub=false) { std::string str(serviceName.c_str()); return tryGetService(str, getStub); }
866 /**
867 * Calls tryGetService("default", bool). This is the recommended instance name for singleton services.
868 */
tryGetServiceIStreamOut869 static ::android::sp<IStreamOut> tryGetService(bool getStub) { return tryGetService("default", getStub); }
870 /**
871 * This gets the service of this type with the specified instance name. If the
872 * service is not in the VINTF manifest on a Trebilized device, this will return
873 * nullptr. If the service is not available, this will wait for the service to
874 * become available. If the service is a lazy service, this will start the service
875 * and return when it becomes available. If getStub is true, this will try to
876 * return an unwrapped passthrough implementation in the same process. This is
877 * useful when getting an implementation from the same partition/compilation group.
878 */
879 static ::android::sp<IStreamOut> getService(const std::string &serviceName="default", bool getStub=false);
880 /**
881 * Deprecated. See getService(std::string, bool)
882 */
883 static ::android::sp<IStreamOut> getService(const char serviceName[], bool getStub=false) { std::string str(serviceName ? serviceName : ""); return getService(str, getStub); }
884 /**
885 * Deprecated. See getService(std::string, bool)
886 */
887 static ::android::sp<IStreamOut> getService(const ::android::hardware::hidl_string& serviceName, bool getStub=false) { std::string str(serviceName.c_str()); return getService(str, getStub); }
888 /**
889 * Calls getService("default", bool). This is the recommended instance name for singleton services.
890 */
getServiceIStreamOut891 static ::android::sp<IStreamOut> getService(bool getStub) { return getService("default", getStub); }
892 /**
893 * Registers a service with the service manager. For Trebilized devices, the service
894 * must also be in the VINTF manifest.
895 */
896 __attribute__ ((warn_unused_result))::android::status_t registerAsService(const std::string &serviceName="default");
897 /**
898 * Registers for notifications for when a service is registered.
899 */
900 static bool registerForNotifications(
901 const std::string &serviceName,
902 const ::android::sp<::android::hidl::manager::V1_0::IServiceNotification> ¬ification);
903 };
904
905 //
906 // type declarations for package
907 //
908
909 template<typename>
910 static inline std::string toString(int32_t o);
911 static inline std::string toString(::android::hardware::audio::V7_0::IStreamOut::WriteCommand o);
912 static inline void PrintTo(::android::hardware::audio::V7_0::IStreamOut::WriteCommand o, ::std::ostream* os);
913 constexpr int32_t operator|(const ::android::hardware::audio::V7_0::IStreamOut::WriteCommand lhs, const ::android::hardware::audio::V7_0::IStreamOut::WriteCommand rhs) {
914 return static_cast<int32_t>(static_cast<int32_t>(lhs) | static_cast<int32_t>(rhs));
915 }
916 constexpr int32_t operator|(const int32_t lhs, const ::android::hardware::audio::V7_0::IStreamOut::WriteCommand rhs) {
917 return static_cast<int32_t>(lhs | static_cast<int32_t>(rhs));
918 }
919 constexpr int32_t operator|(const ::android::hardware::audio::V7_0::IStreamOut::WriteCommand lhs, const int32_t rhs) {
920 return static_cast<int32_t>(static_cast<int32_t>(lhs) | rhs);
921 }
922 constexpr int32_t operator&(const ::android::hardware::audio::V7_0::IStreamOut::WriteCommand lhs, const ::android::hardware::audio::V7_0::IStreamOut::WriteCommand rhs) {
923 return static_cast<int32_t>(static_cast<int32_t>(lhs) & static_cast<int32_t>(rhs));
924 }
925 constexpr int32_t operator&(const int32_t lhs, const ::android::hardware::audio::V7_0::IStreamOut::WriteCommand rhs) {
926 return static_cast<int32_t>(lhs & static_cast<int32_t>(rhs));
927 }
928 constexpr int32_t operator&(const ::android::hardware::audio::V7_0::IStreamOut::WriteCommand lhs, const int32_t rhs) {
929 return static_cast<int32_t>(static_cast<int32_t>(lhs) & rhs);
930 }
931 constexpr int32_t &operator|=(int32_t& v, const ::android::hardware::audio::V7_0::IStreamOut::WriteCommand e) {
932 v |= static_cast<int32_t>(e);
933 return v;
934 }
935 constexpr int32_t &operator&=(int32_t& v, const ::android::hardware::audio::V7_0::IStreamOut::WriteCommand e) {
936 v &= static_cast<int32_t>(e);
937 return v;
938 }
939
940 static inline std::string toString(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& o);
941 static inline void PrintTo(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& o, ::std::ostream*);
942 static inline bool operator==(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& lhs, const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& rhs);
943 static inline bool operator!=(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& lhs, const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& rhs);
944
945 static inline std::string toString(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply& o);
946 static inline void PrintTo(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply& o, ::std::ostream*);
947 // operator== and operator!= are not generated for Reply
948
949 static inline std::string toString(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus& o);
950 static inline void PrintTo(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus& o, ::std::ostream*);
951 // operator== and operator!= are not generated for WriteStatus
952
953 static inline std::string toString(const ::android::sp<::android::hardware::audio::V7_0::IStreamOut>& o);
954
955 //
956 // type header definitions for package
957 //
958
959 template<>
960 inline std::string toString<::android::hardware::audio::V7_0::IStreamOut::WriteCommand>(int32_t o) {
961 using ::android::hardware::details::toHexString;
962 std::string os;
963 ::android::hardware::hidl_bitfield<::android::hardware::audio::V7_0::IStreamOut::WriteCommand> flipped = 0;
964 bool first = true;
965 if ((o & ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::WRITE) == static_cast<int32_t>(::android::hardware::audio::V7_0::IStreamOut::WriteCommand::WRITE)) {
966 os += (first ? "" : " | ");
967 os += "WRITE";
968 first = false;
969 flipped |= ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::WRITE;
970 }
971 if ((o & ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::GET_PRESENTATION_POSITION) == static_cast<int32_t>(::android::hardware::audio::V7_0::IStreamOut::WriteCommand::GET_PRESENTATION_POSITION)) {
972 os += (first ? "" : " | ");
973 os += "GET_PRESENTATION_POSITION";
974 first = false;
975 flipped |= ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::GET_PRESENTATION_POSITION;
976 }
977 if ((o & ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::GET_LATENCY) == static_cast<int32_t>(::android::hardware::audio::V7_0::IStreamOut::WriteCommand::GET_LATENCY)) {
978 os += (first ? "" : " | ");
979 os += "GET_LATENCY";
980 first = false;
981 flipped |= ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::GET_LATENCY;
982 }
983 if (o != flipped) {
984 os += (first ? "" : " | ");
985 os += toHexString(o & (~flipped));
986 }os += " (";
987 os += toHexString(o);
988 os += ")";
989 return os;
990 }
991
toString(::android::hardware::audio::V7_0::IStreamOut::WriteCommand o)992 static inline std::string toString(::android::hardware::audio::V7_0::IStreamOut::WriteCommand o) {
993 using ::android::hardware::details::toHexString;
994 if (o == ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::WRITE) {
995 return "WRITE";
996 }
997 if (o == ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::GET_PRESENTATION_POSITION) {
998 return "GET_PRESENTATION_POSITION";
999 }
1000 if (o == ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::GET_LATENCY) {
1001 return "GET_LATENCY";
1002 }
1003 std::string os;
1004 os += toHexString(static_cast<int32_t>(o));
1005 return os;
1006 }
1007
PrintTo(::android::hardware::audio::V7_0::IStreamOut::WriteCommand o,::std::ostream * os)1008 static inline void PrintTo(::android::hardware::audio::V7_0::IStreamOut::WriteCommand o, ::std::ostream* os) {
1009 *os << toString(o);
1010 }
1011
toString(const::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition & o)1012 static inline std::string toString(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& o) {
1013 using ::android::hardware::toString;
1014 std::string os;
1015 os += "{";
1016 os += ".frames = ";
1017 os += ::android::hardware::toString(o.frames);
1018 os += ", .timeStamp = ";
1019 os += ::android::hardware::audio::V7_0::toString(o.timeStamp);
1020 os += "}"; return os;
1021 }
1022
PrintTo(const::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition & o,::std::ostream * os)1023 static inline void PrintTo(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& o, ::std::ostream* os) {
1024 *os << toString(o);
1025 }
1026
1027 static inline bool operator==(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& lhs, const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& rhs) {
1028 if (lhs.frames != rhs.frames) {
1029 return false;
1030 }
1031 if (lhs.timeStamp != rhs.timeStamp) {
1032 return false;
1033 }
1034 return true;
1035 }
1036
1037 static inline bool operator!=(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& lhs, const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply::PresentationPosition& rhs){
1038 return !(lhs == rhs);
1039 }
1040
toString(const::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply & o)1041 static inline std::string toString(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply& o) {
1042 using ::android::hardware::toString;
1043 std::string os;
1044 os += "{";
1045 os += ".written = ";
1046 os += ::android::hardware::toString(o.written);
1047 os += ", .presentationPosition = ";
1048 os += ::android::hardware::audio::V7_0::toString(o.presentationPosition);
1049 os += ", .latencyMs = ";
1050 os += ::android::hardware::toString(o.latencyMs);
1051 os += "}"; return os;
1052 }
1053
PrintTo(const::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply & o,::std::ostream * os)1054 static inline void PrintTo(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus::Reply& o, ::std::ostream* os) {
1055 *os << toString(o);
1056 }
1057
1058 // operator== and operator!= are not generated for Reply
1059
toString(const::android::hardware::audio::V7_0::IStreamOut::WriteStatus & o)1060 static inline std::string toString(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus& o) {
1061 using ::android::hardware::toString;
1062 std::string os;
1063 os += "{";
1064 os += ".retval = ";
1065 os += ::android::hardware::audio::V7_0::toString(o.retval);
1066 os += ", .replyTo = ";
1067 os += ::android::hardware::audio::V7_0::toString(o.replyTo);
1068 os += ", .reply = ";
1069 os += ::android::hardware::audio::V7_0::toString(o.reply);
1070 os += "}"; return os;
1071 }
1072
PrintTo(const::android::hardware::audio::V7_0::IStreamOut::WriteStatus & o,::std::ostream * os)1073 static inline void PrintTo(const ::android::hardware::audio::V7_0::IStreamOut::WriteStatus& o, ::std::ostream* os) {
1074 *os << toString(o);
1075 }
1076
1077 // operator== and operator!= are not generated for WriteStatus
1078
toString(const::android::sp<::android::hardware::audio::V7_0::IStreamOut> & o)1079 static inline std::string toString(const ::android::sp<::android::hardware::audio::V7_0::IStreamOut>& o) {
1080 std::string os = "[class or subclass of ";
1081 os += ::android::hardware::audio::V7_0::IStreamOut::descriptor;
1082 os += "]";
1083 os += o->isRemote() ? "@remote" : "@local";
1084 return os;
1085 }
1086
1087
1088 } // namespace V7_0
1089 } // namespace audio
1090 } // namespace hardware
1091 } // namespace android
1092
1093 //
1094 // global type declarations for package
1095 //
1096
1097 namespace android {
1098 namespace hardware {
1099 namespace details {
1100 #pragma clang diagnostic push
1101 #pragma clang diagnostic ignored "-Wc++17-extensions"
1102 template<> inline constexpr std::array<::android::hardware::audio::V7_0::IStreamOut::WriteCommand, 3> hidl_enum_values<::android::hardware::audio::V7_0::IStreamOut::WriteCommand> = {
1103 ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::WRITE,
1104 ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::GET_PRESENTATION_POSITION,
1105 ::android::hardware::audio::V7_0::IStreamOut::WriteCommand::GET_LATENCY,
1106 };
1107 #pragma clang diagnostic pop
1108 } // namespace details
1109 } // namespace hardware
1110 } // namespace android
1111
1112
1113 #endif // HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_V7_0_ISTREAMOUT_H
1114