blob: 3b369bd9991b966072a0d6d69d9312b2d63aee18 [file] [log] [blame]
Mikhail Naganov31d46652023-01-10 18:29:25 +00001/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
Mikhail Naganov89a9f742023-01-30 12:33:18 -080019#include <atomic>
Mikhail Naganov31d46652023-01-10 18:29:25 +000020#include <memory>
Mikhail Naganov89a9f742023-01-30 12:33:18 -080021#include <mutex>
Mikhail Naganov31d46652023-01-10 18:29:25 +000022#include <string_view>
23
David Lia0ad9f02023-03-02 21:46:19 +080024#include <aidl/android/hardware/audio/common/AudioOffloadMetadata.h>
Mikhail Naganov31d46652023-01-10 18:29:25 +000025#include <aidl/android/hardware/audio/core/BpStreamCommon.h>
26#include <aidl/android/hardware/audio/core/BpStreamIn.h>
27#include <aidl/android/hardware/audio/core/BpStreamOut.h>
David Li9cf5e622023-03-21 00:51:10 +080028#include <aidl/android/hardware/audio/core/MmapBufferDescriptor.h>
Mikhail Naganove7a26ad2023-05-25 17:36:48 -070029#include <aidl/android/media/audio/IHalAdapterVendorExtension.h>
Mikhail Naganov31d46652023-01-10 18:29:25 +000030#include <fmq/AidlMessageQueue.h>
31#include <media/audiohal/EffectHalInterface.h>
32#include <media/audiohal/StreamHalInterface.h>
Mikhail Naganove7a26ad2023-05-25 17:36:48 -070033#include <media/AidlConversionUtil.h>
David Lia0ad9f02023-03-02 21:46:19 +080034#include <media/AudioParameter.h>
Mikhail Naganov31d46652023-01-10 18:29:25 +000035
36#include "ConversionHelperAidl.h"
37#include "StreamPowerLog.h"
38
David Lia0ad9f02023-03-02 21:46:19 +080039using ::aidl::android::hardware::audio::common::AudioOffloadMetadata;
David Li9cf5e622023-03-21 00:51:10 +080040using ::aidl::android::hardware::audio::core::MmapBufferDescriptor;
David Lia0ad9f02023-03-02 21:46:19 +080041
Mikhail Naganov31d46652023-01-10 18:29:25 +000042namespace android {
43
Mikhail Naganov89a9f742023-01-30 12:33:18 -080044class StreamContextAidl {
45 public:
46 typedef AidlMessageQueue<::aidl::android::hardware::audio::core::StreamDescriptor::Command,
47 ::aidl::android::hardware::common::fmq::SynchronizedReadWrite> CommandMQ;
48 typedef AidlMessageQueue<::aidl::android::hardware::audio::core::StreamDescriptor::Reply,
49 ::aidl::android::hardware::common::fmq::SynchronizedReadWrite> ReplyMQ;
50 typedef AidlMessageQueue<int8_t,
51 ::aidl::android::hardware::common::fmq::SynchronizedReadWrite> DataMQ;
52
Mikhail Naganove7a26ad2023-05-25 17:36:48 -070053 StreamContextAidl(
David Li9cf5e622023-03-21 00:51:10 +080054 ::aidl::android::hardware::audio::core::StreamDescriptor& descriptor,
Mikhail Naganov712d71b2023-02-23 17:57:16 -080055 bool isAsynchronous)
Mikhail Naganov89a9f742023-01-30 12:33:18 -080056 : mFrameSizeBytes(descriptor.frameSizeBytes),
57 mCommandMQ(new CommandMQ(descriptor.command)),
58 mReplyMQ(new ReplyMQ(descriptor.reply)),
59 mBufferSizeFrames(descriptor.bufferSizeFrames),
Mikhail Naganov712d71b2023-02-23 17:57:16 -080060 mDataMQ(maybeCreateDataMQ(descriptor)),
David Li9cf5e622023-03-21 00:51:10 +080061 mIsAsynchronous(isAsynchronous),
62 mIsMmapped(isMmapped(descriptor)),
63 mMmapBufferDescriptor(maybeGetMmapBuffer(descriptor)) {}
Mikhail Naganov89a9f742023-01-30 12:33:18 -080064 StreamContextAidl(StreamContextAidl&& other) :
65 mFrameSizeBytes(other.mFrameSizeBytes),
66 mCommandMQ(std::move(other.mCommandMQ)),
67 mReplyMQ(std::move(other.mReplyMQ)),
68 mBufferSizeFrames(other.mBufferSizeFrames),
Mikhail Naganov712d71b2023-02-23 17:57:16 -080069 mDataMQ(std::move(other.mDataMQ)),
David Li9cf5e622023-03-21 00:51:10 +080070 mIsAsynchronous(other.mIsAsynchronous),
71 mIsMmapped(other.mIsMmapped),
72 mMmapBufferDescriptor(std::move(other.mMmapBufferDescriptor)) {}
Mikhail Naganov89a9f742023-01-30 12:33:18 -080073 StreamContextAidl& operator=(StreamContextAidl&& other) {
74 mFrameSizeBytes = other.mFrameSizeBytes;
75 mCommandMQ = std::move(other.mCommandMQ);
76 mReplyMQ = std::move(other.mReplyMQ);
77 mBufferSizeFrames = other.mBufferSizeFrames;
78 mDataMQ = std::move(other.mDataMQ);
Mikhail Naganov712d71b2023-02-23 17:57:16 -080079 mIsAsynchronous = other.mIsAsynchronous;
David Li9cf5e622023-03-21 00:51:10 +080080 mIsMmapped = other.mIsMmapped;
81 mMmapBufferDescriptor = std::move(other.mMmapBufferDescriptor);
Mikhail Naganov89a9f742023-01-30 12:33:18 -080082 return *this;
83 }
84 bool isValid() const {
85 return mFrameSizeBytes != 0 &&
86 mCommandMQ != nullptr && mCommandMQ->isValid() &&
87 mReplyMQ != nullptr && mReplyMQ->isValid() &&
David Li9cf5e622023-03-21 00:51:10 +080088 (mDataMQ == nullptr || (
Mikhail Naganov89a9f742023-01-30 12:33:18 -080089 mDataMQ->isValid() &&
90 mDataMQ->getQuantumCount() * mDataMQ->getQuantumSize() >=
David Li9cf5e622023-03-21 00:51:10 +080091 mFrameSizeBytes * mBufferSizeFrames)) &&
92 (!mIsMmapped || mMmapBufferDescriptor.sharedMemory.fd.get() >= 0);
Mikhail Naganov89a9f742023-01-30 12:33:18 -080093 }
94 size_t getBufferSizeBytes() const { return mFrameSizeBytes * mBufferSizeFrames; }
95 size_t getBufferSizeFrames() const { return mBufferSizeFrames; }
96 CommandMQ* getCommandMQ() const { return mCommandMQ.get(); }
97 DataMQ* getDataMQ() const { return mDataMQ.get(); }
98 size_t getFrameSizeBytes() const { return mFrameSizeBytes; }
99 ReplyMQ* getReplyMQ() const { return mReplyMQ.get(); }
Mikhail Naganov712d71b2023-02-23 17:57:16 -0800100 bool isAsynchronous() const { return mIsAsynchronous; }
David Li9cf5e622023-03-21 00:51:10 +0800101 bool isMmapped() const { return mIsMmapped; }
102 const MmapBufferDescriptor& getMmapBufferDescriptor() const { return mMmapBufferDescriptor; }
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800103
104 private:
105 static std::unique_ptr<DataMQ> maybeCreateDataMQ(
106 const ::aidl::android::hardware::audio::core::StreamDescriptor& descriptor) {
107 using Tag = ::aidl::android::hardware::audio::core::StreamDescriptor::AudioBuffer::Tag;
108 if (descriptor.audio.getTag() == Tag::fmq) {
109 return std::make_unique<DataMQ>(descriptor.audio.get<Tag::fmq>());
110 }
111 return nullptr;
112 }
David Li9cf5e622023-03-21 00:51:10 +0800113 static bool isMmapped(
114 const ::aidl::android::hardware::audio::core::StreamDescriptor& descriptor) {
115 using Tag = ::aidl::android::hardware::audio::core::StreamDescriptor::AudioBuffer::Tag;
116 return descriptor.audio.getTag() == Tag::mmap;
117 }
118 static MmapBufferDescriptor maybeGetMmapBuffer(
119 ::aidl::android::hardware::audio::core::StreamDescriptor& descriptor) {
120 using Tag = ::aidl::android::hardware::audio::core::StreamDescriptor::AudioBuffer::Tag;
121 if (descriptor.audio.getTag() == Tag::mmap) {
122 return std::move(descriptor.audio.get<Tag::mmap>());
123 }
124 return {};
125 }
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800126
127 size_t mFrameSizeBytes;
128 std::unique_ptr<CommandMQ> mCommandMQ;
129 std::unique_ptr<ReplyMQ> mReplyMQ;
130 size_t mBufferSizeFrames;
131 std::unique_ptr<DataMQ> mDataMQ;
Mikhail Naganov712d71b2023-02-23 17:57:16 -0800132 bool mIsAsynchronous;
David Li9cf5e622023-03-21 00:51:10 +0800133 bool mIsMmapped;
134 MmapBufferDescriptor mMmapBufferDescriptor;
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800135};
Mikhail Naganov31d46652023-01-10 18:29:25 +0000136
137class StreamHalAidl : public virtual StreamHalInterface, public ConversionHelperAidl {
138 public:
139 // Return size of input/output buffer in bytes for this stream - eg. 4800.
140 status_t getBufferSize(size_t *size) override;
141
142 // Return the base configuration of the stream:
143 // - channel mask;
144 // - format - e.g. AUDIO_FORMAT_PCM_16_BIT;
145 // - sampling rate in Hz - eg. 44100.
146 status_t getAudioProperties(audio_config_base_t *configBase) override;
147
148 // Set audio stream parameters.
149 status_t setParameters(const String8& kvPairs) override;
150
151 // Get audio stream parameters.
152 status_t getParameters(const String8& keys, String8 *values) override;
153
154 // Return the frame size (number of bytes per sample) of a stream.
155 status_t getFrameSize(size_t *size) override;
156
157 // Add or remove the effect on the stream.
158 status_t addEffect(sp<EffectHalInterface> effect) override;
159 status_t removeEffect(sp<EffectHalInterface> effect) override;
160
161 // Put the audio hardware input/output into standby mode.
162 status_t standby() override;
163
164 status_t dump(int fd, const Vector<String16>& args) override;
165
166 // Start a stream operating in mmap mode.
167 status_t start() override;
168
169 // Stop a stream operating in mmap mode.
170 status_t stop() override;
171
172 // Retrieve information on the data buffer in mmap mode.
173 status_t createMmapBuffer(int32_t minSizeFrames,
174 struct audio_mmap_buffer_info *info) override;
175
176 // Get current read/write position in the mmap buffer
177 status_t getMmapPosition(struct audio_mmap_position *position) override;
178
179 // Set the priority of the thread that interacts with the HAL
180 // (must match the priority of the audioflinger's thread that calls 'read' / 'write')
181 status_t setHalThreadPriority(int priority) override;
182
183 status_t legacyCreateAudioPatch(const struct audio_port_config& port,
184 std::optional<audio_source_t> source,
185 audio_devices_t type) override;
186
187 status_t legacyReleaseAudioPatch() override;
188
189 protected:
Mikhail Naganove7a26ad2023-05-25 17:36:48 -0700190 // For tests.
191 friend class sp<StreamHalAidl>;
192
Mikhail Naganovfab697c2023-01-11 19:33:13 +0000193 template<class T>
194 static std::shared_ptr<::aidl::android::hardware::audio::core::IStreamCommon> getStreamCommon(
195 const std::shared_ptr<T>& stream);
196
Mikhail Naganov31d46652023-01-10 18:29:25 +0000197 // Subclasses can not be constructed directly by clients.
198 StreamHalAidl(std::string_view className,
199 bool isInput,
Mikhail Naganov5b1eed12023-01-25 11:29:11 -0800200 const audio_config& config,
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800201 int32_t nominalLatency,
202 StreamContextAidl&& context,
Mikhail Naganove7a26ad2023-05-25 17:36:48 -0700203 const std::shared_ptr<::aidl::android::hardware::audio::core::IStreamCommon>& stream,
204 const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension>& vext);
Mikhail Naganov31d46652023-01-10 18:29:25 +0000205
206 ~StreamHalAidl() override;
207
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800208 status_t getLatency(uint32_t *latency);
209
210 status_t getObservablePosition(int64_t *frames, int64_t *timestamp);
211
David Li9cf5e622023-03-21 00:51:10 +0800212 status_t getHardwarePosition(int64_t *frames, int64_t *timestamp);
213
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800214 status_t getXruns(int32_t *frames);
215
216 status_t transfer(void *buffer, size_t bytes, size_t *transferred);
217
218 status_t pause(
219 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr);
220
221 status_t resume(
222 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr);
223
224 status_t drain(bool earlyNotify,
225 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr);
226
227 status_t flush(
228 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr);
229
230 status_t exit();
231
Mikhail Naganov31d46652023-01-10 18:29:25 +0000232 const bool mIsInput;
Mikhail Naganov5b1eed12023-01-25 11:29:11 -0800233 const audio_config_base_t mConfig;
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800234 const StreamContextAidl mContext;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000235
236 private:
Mikhail Naganov5b1eed12023-01-25 11:29:11 -0800237 static audio_config_base_t configToBase(const audio_config& config) {
238 audio_config_base_t result = AUDIO_CONFIG_BASE_INITIALIZER;
239 result.sample_rate = config.sample_rate;
240 result.channel_mask = config.channel_mask;
241 result.format = config.format;
242 return result;
243 }
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800244 ::aidl::android::hardware::audio::core::StreamDescriptor::State getState() {
245 std::lock_guard l(mLock);
246 return mLastReply.state;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000247 }
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800248 status_t sendCommand(
249 const ::aidl::android::hardware::audio::core::StreamDescriptor::Command &command,
250 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr,
251 bool safeFromNonWorkerThread = false);
252 status_t updateCountersIfNeeded(
253 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr);
Mikhail Naganov31d46652023-01-10 18:29:25 +0000254
Mikhail Naganov31d46652023-01-10 18:29:25 +0000255 const std::shared_ptr<::aidl::android::hardware::audio::core::IStreamCommon> mStream;
Mikhail Naganove7a26ad2023-05-25 17:36:48 -0700256 const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension> mVendorExt;
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800257 std::mutex mLock;
258 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply mLastReply GUARDED_BY(mLock);
259 // mStreamPowerLog is used for audio signal power logging.
260 StreamPowerLog mStreamPowerLog;
261 std::atomic<pid_t> mWorkerTid = -1;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000262};
263
Mikhail Naganovdfd594e2023-02-08 16:59:41 -0800264class CallbackBroker;
265
Mikhail Naganov31d46652023-01-10 18:29:25 +0000266class StreamOutHalAidl : public StreamOutHalInterface, public StreamHalAidl {
267 public:
David Lia0ad9f02023-03-02 21:46:19 +0800268 // Extract the output stream parameters and set by AIDL APIs.
269 status_t setParameters(const String8& kvPairs) override;
270
Mikhail Naganov31d46652023-01-10 18:29:25 +0000271 // Return the audio hardware driver estimated latency in milliseconds.
272 status_t getLatency(uint32_t *latency) override;
273
274 // Use this method in situations where audio mixing is done in the hardware.
275 status_t setVolume(float left, float right) override;
276
277 // Selects the audio presentation (if available).
278 status_t selectPresentation(int presentationId, int programId) override;
279
280 // Write audio buffer to driver.
281 status_t write(const void *buffer, size_t bytes, size_t *written) override;
282
283 // Return the number of audio frames written by the audio dsp to DAC since
284 // the output has exited standby.
285 status_t getRenderPosition(uint32_t *dspFrames) override;
286
287 // Get the local time at which the next write to the audio driver will be presented.
288 status_t getNextWriteTimestamp(int64_t *timestamp) override;
289
290 // Set the callback for notifying completion of non-blocking write and drain.
291 status_t setCallback(wp<StreamOutHalInterfaceCallback> callback) override;
292
293 // Returns whether pause and resume operations are supported.
294 status_t supportsPauseAndResume(bool *supportsPause, bool *supportsResume) override;
295
296 // Notifies to the audio driver to resume playback following a pause.
297 status_t pause() override;
298
299 // Notifies to the audio driver to resume playback following a pause.
300 status_t resume() override;
301
302 // Returns whether drain operation is supported.
303 status_t supportsDrain(bool *supportsDrain) override;
304
305 // Requests notification when data buffered by the driver/hardware has been played.
306 status_t drain(bool earlyNotify) override;
307
308 // Notifies to the audio driver to flush the queued data.
309 status_t flush() override;
310
311 // Return a recent count of the number of audio frames presented to an external observer.
312 status_t getPresentationPosition(uint64_t *frames, struct timespec *timestamp) override;
313
314 // Called when the metadata of the stream's source has been changed.
315 status_t updateSourceMetadata(const SourceMetadata& sourceMetadata) override;
316
317 // Returns the Dual Mono mode presentation setting.
318 status_t getDualMonoMode(audio_dual_mono_mode_t* mode) override;
319
320 // Sets the Dual Mono mode presentation on the output device.
321 status_t setDualMonoMode(audio_dual_mono_mode_t mode) override;
322
323 // Returns the Audio Description Mix level in dB.
324 status_t getAudioDescriptionMixLevel(float* leveldB) override;
325
326 // Sets the Audio Description Mix level in dB.
327 status_t setAudioDescriptionMixLevel(float leveldB) override;
328
329 // Retrieves current playback rate parameters.
330 status_t getPlaybackRateParameters(audio_playback_rate_t* playbackRate) override;
331
332 // Sets the playback rate parameters that control playback behavior.
333 status_t setPlaybackRateParameters(const audio_playback_rate_t& playbackRate) override;
334
335 status_t setEventCallback(const sp<StreamOutHalInterfaceEventCallback>& callback) override;
336
337 status_t setLatencyMode(audio_latency_mode_t mode) override;
338 status_t getRecommendedLatencyModes(std::vector<audio_latency_mode_t> *modes) override;
339 status_t setLatencyModeCallback(
340 const sp<StreamOutHalInterfaceLatencyModeCallback>& callback) override;
341
Mikhail Naganov31d46652023-01-10 18:29:25 +0000342 status_t exit() override;
343
Mikhail Naganov31d46652023-01-10 18:29:25 +0000344 private:
345 friend class sp<StreamOutHalAidl>;
346
Mikhail Naganov19418e32023-03-10 17:55:14 -0800347 static ConversionResult<::aidl::android::hardware::audio::common::SourceMetadata>
Mikhail Naganovb6e57752023-03-08 18:12:47 -0800348 legacy2aidl_SourceMetadata(const StreamOutHalInterface::SourceMetadata& legacy);
349
Mikhail Naganov31d46652023-01-10 18:29:25 +0000350 const std::shared_ptr<::aidl::android::hardware::audio::core::IStreamOut> mStream;
Mikhail Naganovdfd594e2023-02-08 16:59:41 -0800351 const wp<CallbackBroker> mCallbackBroker;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000352
David Lia0ad9f02023-03-02 21:46:19 +0800353 AudioOffloadMetadata mOffloadMetadata;
354
Mikhail Naganov31d46652023-01-10 18:29:25 +0000355 // Can not be constructed directly by clients.
356 StreamOutHalAidl(
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800357 const audio_config& config, StreamContextAidl&& context, int32_t nominalLatency,
Mikhail Naganovdfd594e2023-02-08 16:59:41 -0800358 const std::shared_ptr<::aidl::android::hardware::audio::core::IStreamOut>& stream,
Mikhail Naganove7a26ad2023-05-25 17:36:48 -0700359 const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension>& vext,
Mikhail Naganovdfd594e2023-02-08 16:59:41 -0800360 const sp<CallbackBroker>& callbackBroker);
Mikhail Naganov31d46652023-01-10 18:29:25 +0000361
Mikhail Naganovdfd594e2023-02-08 16:59:41 -0800362 ~StreamOutHalAidl() override;
David Lia0ad9f02023-03-02 21:46:19 +0800363
364 // Filter and update the offload metadata. The parameters which are related to the offload
365 // metadata will be removed after filtering.
366 status_t filterAndUpdateOffloadMetadata(AudioParameter &parameters);
Mikhail Naganov31d46652023-01-10 18:29:25 +0000367};
368
Mikhail Naganovcad0afe2023-03-10 14:25:57 -0800369class MicrophoneInfoProvider;
370
Mikhail Naganov31d46652023-01-10 18:29:25 +0000371class StreamInHalAidl : public StreamInHalInterface, public StreamHalAidl {
372 public:
373 // Set the input gain for the audio driver.
374 status_t setGain(float gain) override;
375
376 // Read audio buffer in from driver.
377 status_t read(void *buffer, size_t bytes, size_t *read) override;
378
379 // Return the amount of input frames lost in the audio driver.
380 status_t getInputFramesLost(uint32_t *framesLost) override;
381
382 // Return a recent count of the number of audio frames received and
383 // the clock time associated with that frame count.
384 status_t getCapturePosition(int64_t *frames, int64_t *time) override;
385
386 // Get active microphones
Mikhail Naganov2a6a3012023-02-13 11:45:03 -0800387 status_t getActiveMicrophones(std::vector<media::MicrophoneInfoFw> *microphones) override;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000388
389 // Set microphone direction (for processing)
390 status_t setPreferredMicrophoneDirection(
391 audio_microphone_direction_t direction) override;
392
393 // Set microphone zoom (for processing)
394 status_t setPreferredMicrophoneFieldDimension(float zoom) override;
395
396 // Called when the metadata of the stream's sink has been changed.
397 status_t updateSinkMetadata(const SinkMetadata& sinkMetadata) override;
398
399 private:
400 friend class sp<StreamInHalAidl>;
401
Mikhail Naganov19418e32023-03-10 17:55:14 -0800402 static ConversionResult<::aidl::android::hardware::audio::common::SinkMetadata>
Mikhail Naganovb6e57752023-03-08 18:12:47 -0800403 legacy2aidl_SinkMetadata(const StreamInHalInterface::SinkMetadata& legacy);
404
Mikhail Naganov31d46652023-01-10 18:29:25 +0000405 const std::shared_ptr<::aidl::android::hardware::audio::core::IStreamIn> mStream;
Mikhail Naganovcad0afe2023-03-10 14:25:57 -0800406 const wp<MicrophoneInfoProvider> mMicInfoProvider;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000407
408 // Can not be constructed directly by clients.
409 StreamInHalAidl(
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800410 const audio_config& config, StreamContextAidl&& context, int32_t nominalLatency,
Mikhail Naganovcad0afe2023-03-10 14:25:57 -0800411 const std::shared_ptr<::aidl::android::hardware::audio::core::IStreamIn>& stream,
Mikhail Naganove7a26ad2023-05-25 17:36:48 -0700412 const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension>& vext,
Mikhail Naganovcad0afe2023-03-10 14:25:57 -0800413 const sp<MicrophoneInfoProvider>& micInfoProvider);
Mikhail Naganov31d46652023-01-10 18:29:25 +0000414
415 ~StreamInHalAidl() override = default;
416};
417
418} // namespace android