mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge changes from topic "upstream-hal-v7_1-p3" am: 4673d5ab25
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1978753 Change-Id: I55e6af1f9812f1810f74f55498535238fe488ca1
This commit is contained in:
@@ -17,7 +17,6 @@ hidl_interface {
|
||||
"IDevice.hal",
|
||||
"IDevicesFactory.hal",
|
||||
"IPrimaryDevice.hal",
|
||||
"IStreamIn.hal",
|
||||
"IStreamOut.hal",
|
||||
"IStreamOutLatencyModeCallback.hal",
|
||||
],
|
||||
|
||||
@@ -20,7 +20,6 @@ import android.hardware.audio.common@7.0;
|
||||
import @7.0::AudioInOutFlag;
|
||||
import @7.0::IDevice;
|
||||
import @7.0::Result;
|
||||
import IStreamIn;
|
||||
import IStreamOut;
|
||||
|
||||
interface IDevice extends @7.0::IDevice {
|
||||
@@ -55,37 +54,6 @@ interface IDevice extends @7.0::IDevice {
|
||||
IStreamOut outStream,
|
||||
AudioConfig suggestedConfig);
|
||||
|
||||
/**
|
||||
* This method creates and opens the audio hardware input stream.
|
||||
* If the stream can not be opened with the proposed audio config,
|
||||
* HAL must provide suggested values for the audio config.
|
||||
*
|
||||
* Note: INVALID_ARGUMENTS is returned both in the case when the
|
||||
* HAL can not use the provided config and in the case when
|
||||
* the value of any argument is invalid. In the latter case the
|
||||
* HAL must provide a default initialized suggested config.
|
||||
*
|
||||
* @param ioHandle handle assigned by AudioFlinger.
|
||||
* @param device device type and (if needed) address.
|
||||
* @param config stream configuration.
|
||||
* @param flags additional flags.
|
||||
* @param sinkMetadata Description of the audio that is suggested by the client.
|
||||
* May be used by implementations to configure processing effects.
|
||||
* @return retval operation completion status.
|
||||
* @return inStream in case of success, created input stream.
|
||||
* @return suggestedConfig in the case of rejection of the proposed config,
|
||||
* a config suggested by the HAL.
|
||||
*/
|
||||
openInputStream_7_1(
|
||||
AudioIoHandle ioHandle,
|
||||
DeviceAddress device,
|
||||
AudioConfig config,
|
||||
vec<AudioInOutFlag> flags,
|
||||
SinkMetadata sinkMetadata) generates (
|
||||
Result retval,
|
||||
IStreamIn inStream,
|
||||
AudioConfig suggestedConfig);
|
||||
|
||||
/**
|
||||
* Notifies the device module about the connection state of an input/output
|
||||
* device attached to it. The devicePort identifies the device and may also
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.audio@7.1;
|
||||
|
||||
import @7.0::IStreamIn;
|
||||
|
||||
interface IStreamIn extends @7.0::IStreamIn {
|
||||
};
|
||||
@@ -348,16 +348,6 @@ Return<void> Device::openOutputStream_7_1(int32_t ioHandle, const DeviceAddress&
|
||||
_hidl_cb(result, streamOut, suggestedConfig);
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> Device::openInputStream_7_1(int32_t ioHandle, const DeviceAddress& device,
|
||||
const AudioConfig& config, const AudioInputFlags& flags,
|
||||
const SinkMetadata& sinkMetadata,
|
||||
openInputStream_7_1_cb _hidl_cb) {
|
||||
auto [result, streamIn, suggestedConfig] =
|
||||
openInputStreamImpl(ioHandle, device, config, flags, sinkMetadata);
|
||||
_hidl_cb(result, streamIn, suggestedConfig);
|
||||
return Void();
|
||||
}
|
||||
#endif // V7.1
|
||||
|
||||
Return<bool> Device::supportsAudioPatches() {
|
||||
|
||||
@@ -123,10 +123,6 @@ struct Device : public IDevice, public ParametersUtil {
|
||||
const AudioConfig& config, const AudioOutputFlags& flags,
|
||||
const SourceMetadata& sourceMetadata,
|
||||
openOutputStream_7_1_cb _hidl_cb) override;
|
||||
Return<void> openInputStream_7_1(int32_t ioHandle, const DeviceAddress& device,
|
||||
const AudioConfig& config, const AudioInputFlags& flags,
|
||||
const SinkMetadata& sinkMetadata,
|
||||
openInputStream_7_1_cb _hidl_cb) override;
|
||||
#endif
|
||||
|
||||
Return<bool> supportsAudioPatches() override;
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
#ifndef ANDROID_HARDWARE_AUDIO_STREAMIN_H
|
||||
#define ANDROID_HARDWARE_AUDIO_STREAMIN_H
|
||||
|
||||
#include PATH(android/hardware/audio/FILE_VERSION/IStreamIn.h)
|
||||
// clang-format off
|
||||
#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/IStreamIn.h)
|
||||
// clang-format on
|
||||
|
||||
#include "Device.h"
|
||||
#include "Stream.h"
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
|
||||
// clang-format off
|
||||
#include PATH(android/hardware/audio/FILE_VERSION/IStreamIn.h)
|
||||
#include PATH(android/hardware/audio/FILE_VERSION/IStreamOut.h)
|
||||
#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/IStreamIn.h)
|
||||
#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h)
|
||||
#include PATH(android/hardware/audio/FILE_VERSION/IStreamOut.h)
|
||||
#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h)
|
||||
// clang-format on
|
||||
#include <hidl/HidlSupport.h>
|
||||
|
||||
@@ -91,8 +91,9 @@ using ::android::hardware::details::toHexString;
|
||||
using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION;
|
||||
using namespace ::android::hardware::audio::common::test::utility;
|
||||
using namespace ::android::hardware::audio::CPP_VERSION;
|
||||
using ReadParameters = ::android::hardware::audio::CPP_VERSION::IStreamIn::ReadParameters;
|
||||
using ReadStatus = ::android::hardware::audio::CPP_VERSION::IStreamIn::ReadStatus;
|
||||
using ReadParameters =
|
||||
::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn::ReadParameters;
|
||||
using ReadStatus = ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn::ReadStatus;
|
||||
using WriteCommand = ::android::hardware::audio::CPP_VERSION::IStreamOut::WriteCommand;
|
||||
using WriteStatus = ::android::hardware::audio::CPP_VERSION::IStreamOut::WriteStatus;
|
||||
#if MAJOR_VERSION >= 7
|
||||
@@ -1089,7 +1090,7 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(OutputStreamTest);
|
||||
|
||||
class StreamReader : public StreamWorker<StreamReader> {
|
||||
public:
|
||||
using IStreamIn = ::android::hardware::audio::CPP_VERSION::IStreamIn;
|
||||
using IStreamIn = ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn;
|
||||
|
||||
StreamReader(IStreamIn* stream, size_t bufferSize)
|
||||
: mStream(stream), mBufferSize(bufferSize), mData(mBufferSize) {}
|
||||
@@ -1204,7 +1205,8 @@ class StreamReader : public StreamWorker<StreamReader> {
|
||||
EventFlag* mEfGroup = nullptr;
|
||||
};
|
||||
|
||||
class InputStreamTest : public OpenStreamTest<::android::hardware::audio::CPP_VERSION::IStreamIn> {
|
||||
class InputStreamTest
|
||||
: public OpenStreamTest<::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn> {
|
||||
void SetUp() override {
|
||||
ASSERT_NO_FATAL_FAILURE(OpenStreamTest::SetUp()); // setup base
|
||||
#if MAJOR_VERSION <= 6
|
||||
@@ -1226,13 +1228,8 @@ class InputStreamTest : public OpenStreamTest<::android::hardware::audio::CPP_VE
|
||||
auto flags = getInputFlags();
|
||||
testOpen(
|
||||
[&](AudioIoHandle handle, AudioConfig config, auto cb) {
|
||||
#if MAJOR_VERSION < 7 || (MAJOR_VERSION == 7 && MINOR_VERSION == 0)
|
||||
return getDevice()->openInputStream(handle, address, config, flags,
|
||||
initMetadata, cb);
|
||||
#elif MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
||||
return getDevice()->openInputStream_7_1(handle, address, config, flags,
|
||||
initMetadata, cb);
|
||||
#endif
|
||||
},
|
||||
config);
|
||||
}
|
||||
@@ -1605,8 +1602,9 @@ TEST_P(InputStreamTest, SetGain) {
|
||||
"InputStream::setGain");
|
||||
}
|
||||
|
||||
static void testPrepareForReading(::android::hardware::audio::CPP_VERSION::IStreamIn* stream,
|
||||
uint32_t frameSize, uint32_t framesCount) {
|
||||
static void testPrepareForReading(
|
||||
::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn* stream, uint32_t frameSize,
|
||||
uint32_t framesCount) {
|
||||
Result res;
|
||||
// Ignore output parameters as the call should fail
|
||||
ASSERT_OK(stream->prepareForReading(frameSize, framesCount,
|
||||
|
||||
Reference in New Issue
Block a user