1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2022 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerimport @7.0::Result; 20*4d7e907cSAndroid Build Coastguard Workerimport @7.0::IStreamOut; 21*4d7e907cSAndroid Build Coastguard Worker 22*4d7e907cSAndroid Build Coastguard Workerimport IStreamOutLatencyModeCallback; 23*4d7e907cSAndroid Build Coastguard Worker 24*4d7e907cSAndroid Build Coastguard Workerinterface IStreamOut extends @7.0::IStreamOut { 25*4d7e907cSAndroid Build Coastguard Worker /** 26*4d7e907cSAndroid Build Coastguard Worker * Indicates the requested latency mode for this output stream. 27*4d7e907cSAndroid Build Coastguard Worker * 28*4d7e907cSAndroid Build Coastguard Worker * The requested mode can be one of the modes returned by 29*4d7e907cSAndroid Build Coastguard Worker * getRecommendedLatencyModes() API. 30*4d7e907cSAndroid Build Coastguard Worker * 31*4d7e907cSAndroid Build Coastguard Worker * Optional method. 32*4d7e907cSAndroid Build Coastguard Worker * Mandated only on specific spatial audio streams indicated by 33*4d7e907cSAndroid Build Coastguard Worker * AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can be routed to a BT classic sink. 34*4d7e907cSAndroid Build Coastguard Worker * 35*4d7e907cSAndroid Build Coastguard Worker * @return retval operation completion status. 36*4d7e907cSAndroid Build Coastguard Worker */ 37*4d7e907cSAndroid Build Coastguard Worker setLatencyMode(LatencyMode mode) generates (Result retval); 38*4d7e907cSAndroid Build Coastguard Worker 39*4d7e907cSAndroid Build Coastguard Worker /** 40*4d7e907cSAndroid Build Coastguard Worker * Indicates which latency modes are currently supported on this output stream. 41*4d7e907cSAndroid Build Coastguard Worker * If the transport protocol (e.g Bluetooth A2DP) used by this output stream to reach 42*4d7e907cSAndroid Build Coastguard Worker * the output device supports variable latency modes, the HAL indicates which 43*4d7e907cSAndroid Build Coastguard Worker * modes are currently supported. 44*4d7e907cSAndroid Build Coastguard Worker * The framework can then call setLatencyMode() with one of the supported modes to select 45*4d7e907cSAndroid Build Coastguard Worker * the desired operation mode. 46*4d7e907cSAndroid Build Coastguard Worker * 47*4d7e907cSAndroid Build Coastguard Worker * Optional method. 48*4d7e907cSAndroid Build Coastguard Worker * Mandated only on specific spatial audio streams indicated by 49*4d7e907cSAndroid Build Coastguard Worker * AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can be routed to a BT classic sink. 50*4d7e907cSAndroid Build Coastguard Worker * 51*4d7e907cSAndroid Build Coastguard Worker * @return retval operation completion status. 52*4d7e907cSAndroid Build Coastguard Worker * @return modes currrently supported latency modes. 53*4d7e907cSAndroid Build Coastguard Worker */ 54*4d7e907cSAndroid Build Coastguard Worker getRecommendedLatencyModes() generates (Result retval, vec<LatencyMode> modes); 55*4d7e907cSAndroid Build Coastguard Worker 56*4d7e907cSAndroid Build Coastguard Worker /** 57*4d7e907cSAndroid Build Coastguard Worker * Set the callback interface for notifying changes in supported latency modes. 58*4d7e907cSAndroid Build Coastguard Worker * 59*4d7e907cSAndroid Build Coastguard Worker * Calling this method with a null pointer will result in releasing 60*4d7e907cSAndroid Build Coastguard Worker * the callback. 61*4d7e907cSAndroid Build Coastguard Worker * 62*4d7e907cSAndroid Build Coastguard Worker * Optional method. 63*4d7e907cSAndroid Build Coastguard Worker * Mandated only on specific spatial audio streams indicated by 64*4d7e907cSAndroid Build Coastguard Worker * AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can be routed to a BT classic sink. 65*4d7e907cSAndroid Build Coastguard Worker * 66*4d7e907cSAndroid Build Coastguard Worker * @return retval operation completion status. 67*4d7e907cSAndroid Build Coastguard Worker */ 68*4d7e907cSAndroid Build Coastguard Worker setLatencyModeCallback(IStreamOutLatencyModeCallback callback) generates (Result retval); 69*4d7e907cSAndroid Build Coastguard Worker}; 70