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

Commit b2f1c0f8 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

audio hal: Allow using multiple devices with IStream.get/setDevice

To retain compatibility with existing usages of the "routing"
parameter, IStream.setDevice method must accept multiple devices
(as DeviceAddress). This happens when the patch being created
has multiple sinks.

As a consequence, IStream.getDevices needs to return a vector of
DeviceAddress structs.

Bug: 73240607
Test: make
Change-Id: I77aedeb435988363d30325d045f791f3785c8bb5
parent 4899fba7
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -175,26 +175,26 @@ interface IStream {
    standby() generates (Result retval);

    /**
     * Return the set of device(s) which this stream is connected to.
     * Return the set of devices which this stream is connected to.
     * Optional method
     *
     * @return retval operation completion status: OK or NOT_SUPPORTED.
     * @return device set of device(s) which this stream is connected to.
     * @return device set of devices which this stream is connected to.
     */
    getDevice() generates (Result retval, bitfield<AudioDevice> device);
    getDevices() generates (Result retval, vec<DeviceAddress> devices);

    /**
     * Connects the stream to the device.
     * Connects the stream to one or multiple devices.
     *
     * This method must only be used for HALs that do not support
     * 'IDevice.createAudioPatch' method. Calling this method is
     * equivalent to setting AUDIO_PARAMETER_STREAM_ROUTING in the legacy HAL
     * interface.
     * equivalent to setting AUDIO_PARAMETER_STREAM_ROUTING preceeded
     * with a device address in the legacy HAL interface.
     *
     * @param address device to connect the stream to.
     * @return retval operation completion status.
     */
    setDevice(DeviceAddress address) generates (Result retval);
    setDevices(vec<DeviceAddress> devices) generates (Result retval);

    /**
     * Sets the HW synchronization source. Calling this method is equivalent to