Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3903e9f5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AudioFlinger: provide downstream sink device to software patch source"

parents aa1523c1 b4e037e0
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -268,6 +268,8 @@ status_t DeviceHalHidl::openInputStream(
        audio_input_flags_t flags,
        const char *address,
        audio_source_t source,
        audio_devices_t outputDevice,
        const char *outputDeviceAddress,
        sp<StreamInHalInterface> *inStream) {
    if (mDevice == 0) return NO_INIT;
    DeviceAddress hidlDevice;
@@ -282,6 +284,17 @@ status_t DeviceHalHidl::openInputStream(
    // TODO: correctly propagate the tracks sources and volume
    //       for now, only send the main source at 1dbfs
    SinkMetadata sinkMetadata = {{{ .source = AudioSource(source), .gain = 1 }}};
#endif
#if MAJOR_VERSION < 5
    (void)outputDevice;
    (void)outputDeviceAddress;
#else
    if (outputDevice != AUDIO_DEVICE_NONE) {
        DeviceAddress hidlOutputDevice;
        status = deviceAddressFromHal(outputDevice, outputDeviceAddress, &hidlOutputDevice);
        if (status != OK) return status;
        sinkMetadata.tracks[0].destination.device(std::move(hidlOutputDevice));
    }
#endif
    Return<void> ret = mDevice->openInputStream(
            handle,
+2 −0
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@ class DeviceHalHidl : public DeviceHalInterface, public ConversionHelperHidl
            audio_input_flags_t flags,
            const char *address,
            audio_source_t source,
            audio_devices_t outputDevice,
            const char *outputDeviceAddress,
            sp<StreamInHalInterface> *inStream);

    // Returns whether createAudioPatch and releaseAudioPatch operations are supported.
+2 −0
Original line number Diff line number Diff line
@@ -131,6 +131,8 @@ status_t DeviceHalLocal::openInputStream(
        audio_input_flags_t flags,
        const char *address,
        audio_source_t source,
        audio_devices_t /*outputDevice*/,
        const char */*outputDeviceAddress*/,
        sp<StreamInHalInterface> *inStream) {
    audio_stream_in_t *halStream;
    ALOGV("open_input_stream handle: %d devices: %x flags: %#x "
+2 −0
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@ class DeviceHalLocal : public DeviceHalInterface
            audio_input_flags_t flags,
            const char *address,
            audio_source_t source,
            audio_devices_t outputDevice,
            const char *outputDeviceAddress,
            sp<StreamInHalInterface> *inStream);

    // Returns whether createAudioPatch and releaseAudioPatch operations are supported.
+2 −0
Original line number Diff line number Diff line
@@ -84,6 +84,8 @@ class DeviceHalInterface : public RefBase
            audio_input_flags_t flags,
            const char *address,
            audio_source_t source,
            audio_devices_t outputDevice,
            const char *outputDeviceAddress,
            sp<StreamInHalInterface> *inStream) = 0;

    // Returns whether createAudioPatch and releaseAudioPatch operations are supported.
Loading