1 /* 2 * Copyright (C) 2014 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 package android.media.tv; 18 19 import android.media.tv.TvStreamConfig; 20 import android.view.KeyEvent; 21 import android.view.Surface; 22 23 /** 24 * TvInputService representing a physical port should connect to HAL through this interface. 25 * Framework will take care of communication among system services including TvInputManagerService, 26 * HdmiControlService, AudioService, etc. 27 * 28 * @hide 29 */ 30 interface ITvInputHardware { 31 /** 32 * Make the input render on the surface according to the config. In case of HDMI, this will 33 * trigger CEC commands for adjusting active HDMI source. Returns true on success. 34 */ setSurface(in Surface surface, in TvStreamConfig config)35 boolean setSurface(in Surface surface, in TvStreamConfig config); 36 37 /** 38 * Set volume for this stream via AudioGain. 39 */ setStreamVolume(float volume)40 void setStreamVolume(float volume); 41 42 /** 43 * Override default audio sink from audio policy. When override is on, it is 44 * TvInputService's responsibility to adjust to audio configuration change 45 * (for example, when the audio sink becomes unavailable or more desirable 46 * audio sink is detected). 47 * 48 * @param audioType one of AudioManager.DEVICE_* values. When it's * DEVICE_NONE, override 49 * becomes off. 50 * @param audioAddress audio address of the overriding device. 51 * @param samplingRate desired sampling rate. Use default when it's 0. 52 * @param channelMask desired channel mask. Use default when it's 53 * AudioFormat.CHANNEL_OUT_DEFAULT. 54 * @param format desired format. Use default when it's AudioFormat.ENCODING_DEFAULT. 55 */ overrideAudioSink(int audioType, String audioAddress, int samplingRate, int channelMask, int format)56 void overrideAudioSink(int audioType, String audioAddress, int samplingRate, int channelMask, 57 int format); 58 } 59