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; 18 19 /** 20 * An AudioDevicePortConfig describes a possible configuration of an output or input device 21 * (speaker, headphone, microphone ...). 22 * It is used to specify a sink or source when creating a connection with 23 * AudioManager.connectAudioPatch(). 24 * An AudioDevicePortConfig is obtained from AudioDevicePort.buildConfig(). 25 * @hide 26 */ 27 28 public class AudioDevicePortConfig extends AudioPortConfig { AudioDevicePortConfig(AudioDevicePort devicePort, int samplingRate, int channelMask, int format, AudioGainConfig gain)29 AudioDevicePortConfig(AudioDevicePort devicePort, int samplingRate, int channelMask, 30 int format, AudioGainConfig gain) { 31 super((AudioPort)devicePort, samplingRate, channelMask, format, gain); 32 } 33 AudioDevicePortConfig(AudioDevicePortConfig config)34 AudioDevicePortConfig(AudioDevicePortConfig config) { 35 this(config.port(), config.samplingRate(), config.channelMask(), config.format(), 36 config.gain()); 37 } 38 39 /** 40 * Returns the audio device port this AudioDevicePortConfig is issued from. 41 */ port()42 public AudioDevicePort port() { 43 return (AudioDevicePort)mPort; 44 } 45 } 46 47