1a198a29250acb7c3e918f1566727190966bb336fEric Laurent/*
2a198a29250acb7c3e918f1566727190966bb336fEric Laurent * Copyright (C) 2014 The Android Open Source Project
3a198a29250acb7c3e918f1566727190966bb336fEric Laurent *
4a198a29250acb7c3e918f1566727190966bb336fEric Laurent * Licensed under the Apache License, Version 2.0 (the "License");
5a198a29250acb7c3e918f1566727190966bb336fEric Laurent * you may not use this file except in compliance with the License.
6a198a29250acb7c3e918f1566727190966bb336fEric Laurent * You may obtain a copy of the License at
7a198a29250acb7c3e918f1566727190966bb336fEric Laurent *
8a198a29250acb7c3e918f1566727190966bb336fEric Laurent *      http://www.apache.org/licenses/LICENSE-2.0
9a198a29250acb7c3e918f1566727190966bb336fEric Laurent *
10a198a29250acb7c3e918f1566727190966bb336fEric Laurent * Unless required by applicable law or agreed to in writing, software
11a198a29250acb7c3e918f1566727190966bb336fEric Laurent * distributed under the License is distributed on an "AS IS" BASIS,
12a198a29250acb7c3e918f1566727190966bb336fEric Laurent * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13a198a29250acb7c3e918f1566727190966bb336fEric Laurent * See the License for the specific language governing permissions and
14a198a29250acb7c3e918f1566727190966bb336fEric Laurent * limitations under the License.
15a198a29250acb7c3e918f1566727190966bb336fEric Laurent */
16a198a29250acb7c3e918f1566727190966bb336fEric Laurent
17a198a29250acb7c3e918f1566727190966bb336fEric Laurentpackage android.media;
18a198a29250acb7c3e918f1566727190966bb336fEric Laurent
19a198a29250acb7c3e918f1566727190966bb336fEric Laurent/**
20a198a29250acb7c3e918f1566727190966bb336fEric Laurent * An AudioDevicePortConfig describes a possible configuration of an output or input device
21a198a29250acb7c3e918f1566727190966bb336fEric Laurent * (speaker, headphone, microphone ...).
22a198a29250acb7c3e918f1566727190966bb336fEric Laurent * It is used to specify a sink or source when creating a connection with
23a198a29250acb7c3e918f1566727190966bb336fEric Laurent * AudioManager.connectAudioPatch().
24a198a29250acb7c3e918f1566727190966bb336fEric Laurent * An AudioDevicePortConfig is obtained from AudioDevicePort.buildConfig().
25a198a29250acb7c3e918f1566727190966bb336fEric Laurent * @hide
26a198a29250acb7c3e918f1566727190966bb336fEric Laurent */
27a198a29250acb7c3e918f1566727190966bb336fEric Laurent
28a198a29250acb7c3e918f1566727190966bb336fEric Laurentpublic class AudioDevicePortConfig extends AudioPortConfig {
29a198a29250acb7c3e918f1566727190966bb336fEric Laurent    AudioDevicePortConfig(AudioDevicePort devicePort, int samplingRate, int channelMask,
30a198a29250acb7c3e918f1566727190966bb336fEric Laurent            int format, AudioGainConfig gain) {
31a198a29250acb7c3e918f1566727190966bb336fEric Laurent        super((AudioPort)devicePort, samplingRate, channelMask, format, gain);
32a198a29250acb7c3e918f1566727190966bb336fEric Laurent    }
33a198a29250acb7c3e918f1566727190966bb336fEric Laurent
343ef181227245d437ee3f528fcffc9cfe1e5d7c1eJean-Michel Trivi    AudioDevicePortConfig(AudioDevicePortConfig config) {
353ef181227245d437ee3f528fcffc9cfe1e5d7c1eJean-Michel Trivi        this(config.port(), config.samplingRate(), config.channelMask(), config.format(),
363ef181227245d437ee3f528fcffc9cfe1e5d7c1eJean-Michel Trivi                config.gain());
373ef181227245d437ee3f528fcffc9cfe1e5d7c1eJean-Michel Trivi    }
383ef181227245d437ee3f528fcffc9cfe1e5d7c1eJean-Michel Trivi
39a198a29250acb7c3e918f1566727190966bb336fEric Laurent    /**
40a198a29250acb7c3e918f1566727190966bb336fEric Laurent     * Returns the audio device port this AudioDevicePortConfig is issued from.
41a198a29250acb7c3e918f1566727190966bb336fEric Laurent     */
42a198a29250acb7c3e918f1566727190966bb336fEric Laurent    public AudioDevicePort port() {
43a198a29250acb7c3e918f1566727190966bb336fEric Laurent        return (AudioDevicePort)mPort;
44a198a29250acb7c3e918f1566727190966bb336fEric Laurent    }
45a198a29250acb7c3e918f1566727190966bb336fEric Laurent}
46a198a29250acb7c3e918f1566727190966bb336fEric Laurent
47