blob: 4acc6ac503665dde3a0fe0d1bd3d32c5327901b8 [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
Mikhail Naganove2084702023-09-28 14:37:12 -0700210 // Always returns non-negative values.
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800211 status_t getObservablePosition(int64_t *frames, int64_t *timestamp);
212
Mikhail Naganove2084702023-09-28 14:37:12 -0700213 // Always returns non-negative values.
David Li9cf5e622023-03-21 00:51:10 +0800214 status_t getHardwarePosition(int64_t *frames, int64_t *timestamp);
215
Mikhail Naganove2084702023-09-28 14:37:12 -0700216 // Always returns non-negative values.
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800217 status_t getXruns(int32_t *frames);
218
219 status_t transfer(void *buffer, size_t bytes, size_t *transferred);
220
221 status_t pause(
222 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr);
223
224 status_t resume(
225 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr);
226
227 status_t drain(bool earlyNotify,
228 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr);
229
230 status_t flush(
231 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr);
232
233 status_t exit();
234
Mikhail Naganov31d46652023-01-10 18:29:25 +0000235 const bool mIsInput;
Mikhail Naganov5b1eed12023-01-25 11:29:11 -0800236 const audio_config_base_t mConfig;
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800237 const StreamContextAidl mContext;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000238
239 private:
Mikhail Naganov5b1eed12023-01-25 11:29:11 -0800240 static audio_config_base_t configToBase(const audio_config& config) {
241 audio_config_base_t result = AUDIO_CONFIG_BASE_INITIALIZER;
242 result.sample_rate = config.sample_rate;
243 result.channel_mask = config.channel_mask;
244 result.format = config.format;
245 return result;
246 }
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800247 ::aidl::android::hardware::audio::core::StreamDescriptor::State getState() {
248 std::lock_guard l(mLock);
249 return mLastReply.state;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000250 }
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800251 status_t sendCommand(
252 const ::aidl::android::hardware::audio::core::StreamDescriptor::Command &command,
253 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr,
254 bool safeFromNonWorkerThread = false);
255 status_t updateCountersIfNeeded(
256 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply* reply = nullptr);
Mikhail Naganov31d46652023-01-10 18:29:25 +0000257
Mikhail Naganov31d46652023-01-10 18:29:25 +0000258 const std::shared_ptr<::aidl::android::hardware::audio::core::IStreamCommon> mStream;
Mikhail Naganove7a26ad2023-05-25 17:36:48 -0700259 const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension> mVendorExt;
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800260 std::mutex mLock;
261 ::aidl::android::hardware::audio::core::StreamDescriptor::Reply mLastReply GUARDED_BY(mLock);
262 // mStreamPowerLog is used for audio signal power logging.
263 StreamPowerLog mStreamPowerLog;
264 std::atomic<pid_t> mWorkerTid = -1;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000265};
266
Mikhail Naganovdfd594e2023-02-08 16:59:41 -0800267class CallbackBroker;
268
Mikhail Naganov31d46652023-01-10 18:29:25 +0000269class StreamOutHalAidl : public StreamOutHalInterface, public StreamHalAidl {
270 public:
David Lia0ad9f02023-03-02 21:46:19 +0800271 // Extract the output stream parameters and set by AIDL APIs.
272 status_t setParameters(const String8& kvPairs) override;
273
Mikhail Naganov31d46652023-01-10 18:29:25 +0000274 // Return the audio hardware driver estimated latency in milliseconds.
275 status_t getLatency(uint32_t *latency) override;
276
277 // Use this method in situations where audio mixing is done in the hardware.
278 status_t setVolume(float left, float right) override;
279
280 // Selects the audio presentation (if available).
281 status_t selectPresentation(int presentationId, int programId) override;
282
283 // Write audio buffer to driver.
284 status_t write(const void *buffer, size_t bytes, size_t *written) override;
285
286 // Return the number of audio frames written by the audio dsp to DAC since
287 // the output has exited standby.
288 status_t getRenderPosition(uint32_t *dspFrames) override;
289
290 // Get the local time at which the next write to the audio driver will be presented.
291 status_t getNextWriteTimestamp(int64_t *timestamp) override;
292
293 // Set the callback for notifying completion of non-blocking write and drain.
294 status_t setCallback(wp<StreamOutHalInterfaceCallback> callback) override;
295
296 // Returns whether pause and resume operations are supported.
297 status_t supportsPauseAndResume(bool *supportsPause, bool *supportsResume) override;
298
299 // Notifies to the audio driver to resume playback following a pause.
300 status_t pause() override;
301
302 // Notifies to the audio driver to resume playback following a pause.
303 status_t resume() override;
304
305 // Returns whether drain operation is supported.
306 status_t supportsDrain(bool *supportsDrain) override;
307
308 // Requests notification when data buffered by the driver/hardware has been played.
309 status_t drain(bool earlyNotify) override;
310
311 // Notifies to the audio driver to flush the queued data.
312 status_t flush() override;
313
314 // Return a recent count of the number of audio frames presented to an external observer.
315 status_t getPresentationPosition(uint64_t *frames, struct timespec *timestamp) override;
316
317 // Called when the metadata of the stream's source has been changed.
318 status_t updateSourceMetadata(const SourceMetadata& sourceMetadata) override;
319
320 // Returns the Dual Mono mode presentation setting.
321 status_t getDualMonoMode(audio_dual_mono_mode_t* mode) override;
322
323 // Sets the Dual Mono mode presentation on the output device.
324 status_t setDualMonoMode(audio_dual_mono_mode_t mode) override;
325
326 // Returns the Audio Description Mix level in dB.
327 status_t getAudioDescriptionMixLevel(float* leveldB) override;
328
329 // Sets the Audio Description Mix level in dB.
330 status_t setAudioDescriptionMixLevel(float leveldB) override;
331
332 // Retrieves current playback rate parameters.
333 status_t getPlaybackRateParameters(audio_playback_rate_t* playbackRate) override;
334
335 // Sets the playback rate parameters that control playback behavior.
336 status_t setPlaybackRateParameters(const audio_playback_rate_t& playbackRate) override;
337
338 status_t setEventCallback(const sp<StreamOutHalInterfaceEventCallback>& callback) override;
339
340 status_t setLatencyMode(audio_latency_mode_t mode) override;
341 status_t getRecommendedLatencyModes(std::vector<audio_latency_mode_t> *modes) override;
342 status_t setLatencyModeCallback(
343 const sp<StreamOutHalInterfaceLatencyModeCallback>& callback) override;
344
Mikhail Naganov31d46652023-01-10 18:29:25 +0000345 status_t exit() override;
346
Mikhail Naganov31d46652023-01-10 18:29:25 +0000347 private:
348 friend class sp<StreamOutHalAidl>;
349
Mikhail Naganov19418e32023-03-10 17:55:14 -0800350 static ConversionResult<::aidl::android::hardware::audio::common::SourceMetadata>
Mikhail Naganovb6e57752023-03-08 18:12:47 -0800351 legacy2aidl_SourceMetadata(const StreamOutHalInterface::SourceMetadata& legacy);
352
Mikhail Naganov31d46652023-01-10 18:29:25 +0000353 const std::shared_ptr<::aidl::android::hardware::audio::core::IStreamOut> mStream;
Mikhail Naganovdfd594e2023-02-08 16:59:41 -0800354 const wp<CallbackBroker> mCallbackBroker;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000355
David Lia0ad9f02023-03-02 21:46:19 +0800356 AudioOffloadMetadata mOffloadMetadata;
357
Mikhail Naganov31d46652023-01-10 18:29:25 +0000358 // Can not be constructed directly by clients.
359 StreamOutHalAidl(
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800360 const audio_config& config, StreamContextAidl&& context, int32_t nominalLatency,
Mikhail Naganovdfd594e2023-02-08 16:59:41 -0800361 const std::shared_ptr<::aidl::android::hardware::audio::core::IStreamOut>& stream,
Mikhail Naganove7a26ad2023-05-25 17:36:48 -0700362 const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension>& vext,
Mikhail Naganovdfd594e2023-02-08 16:59:41 -0800363 const sp<CallbackBroker>& callbackBroker);
Mikhail Naganov31d46652023-01-10 18:29:25 +0000364
Mikhail Naganovdfd594e2023-02-08 16:59:41 -0800365 ~StreamOutHalAidl() override;
David Lia0ad9f02023-03-02 21:46:19 +0800366
367 // Filter and update the offload metadata. The parameters which are related to the offload
368 // metadata will be removed after filtering.
369 status_t filterAndUpdateOffloadMetadata(AudioParameter &parameters);
Mikhail Naganov31d46652023-01-10 18:29:25 +0000370};
371
Mikhail Naganovcad0afe2023-03-10 14:25:57 -0800372class MicrophoneInfoProvider;
373
Mikhail Naganov31d46652023-01-10 18:29:25 +0000374class StreamInHalAidl : public StreamInHalInterface, public StreamHalAidl {
375 public:
376 // Set the input gain for the audio driver.
377 status_t setGain(float gain) override;
378
379 // Read audio buffer in from driver.
380 status_t read(void *buffer, size_t bytes, size_t *read) override;
381
382 // Return the amount of input frames lost in the audio driver.
383 status_t getInputFramesLost(uint32_t *framesLost) override;
384
385 // Return a recent count of the number of audio frames received and
386 // the clock time associated with that frame count.
387 status_t getCapturePosition(int64_t *frames, int64_t *time) override;
388
389 // Get active microphones
Mikhail Naganov2a6a3012023-02-13 11:45:03 -0800390 status_t getActiveMicrophones(std::vector<media::MicrophoneInfoFw> *microphones) override;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000391
392 // Set microphone direction (for processing)
393 status_t setPreferredMicrophoneDirection(
394 audio_microphone_direction_t direction) override;
395
396 // Set microphone zoom (for processing)
397 status_t setPreferredMicrophoneFieldDimension(float zoom) override;
398
399 // Called when the metadata of the stream's sink has been changed.
400 status_t updateSinkMetadata(const SinkMetadata& sinkMetadata) override;
401
402 private:
403 friend class sp<StreamInHalAidl>;
404
Mikhail Naganov19418e32023-03-10 17:55:14 -0800405 static ConversionResult<::aidl::android::hardware::audio::common::SinkMetadata>
Mikhail Naganovb6e57752023-03-08 18:12:47 -0800406 legacy2aidl_SinkMetadata(const StreamInHalInterface::SinkMetadata& legacy);
407
Mikhail Naganov31d46652023-01-10 18:29:25 +0000408 const std::shared_ptr<::aidl::android::hardware::audio::core::IStreamIn> mStream;
Mikhail Naganovcad0afe2023-03-10 14:25:57 -0800409 const wp<MicrophoneInfoProvider> mMicInfoProvider;
Mikhail Naganov31d46652023-01-10 18:29:25 +0000410
411 // Can not be constructed directly by clients.
412 StreamInHalAidl(
Mikhail Naganov89a9f742023-01-30 12:33:18 -0800413 const audio_config& config, StreamContextAidl&& context, int32_t nominalLatency,
Mikhail Naganovcad0afe2023-03-10 14:25:57 -0800414 const std::shared_ptr<::aidl::android::hardware::audio::core::IStreamIn>& stream,
Mikhail Naganove7a26ad2023-05-25 17:36:48 -0700415 const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension>& vext,
Mikhail Naganovcad0afe2023-03-10 14:25:57 -0800416 const sp<MicrophoneInfoProvider>& micInfoProvider);
Mikhail Naganov31d46652023-01-10 18:29:25 +0000417
418 ~StreamInHalAidl() override = default;
419};
420
421} // namespace android