summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/AudioPolicyManager.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-06-03 13:32:54 -0700
committerEric Laurent <elaurent@google.com>2014-06-04 09:30:28 -0700
commita121f90f388343dc48793cbc7eb899aba42e7664 (patch)
treea35526f7ec819e7e539c537fcf4b1b3b5d06a6fc /services/audiopolicy/AudioPolicyManager.h
parent1f2f2230900581e5de9cf01a883e5d9338f0df94 (diff)
downloadframeworks_av-a121f90f388343dc48793cbc7eb899aba42e7664.zip
frameworks_av-a121f90f388343dc48793cbc7eb899aba42e7664.tar.gz
frameworks_av-a121f90f388343dc48793cbc7eb899aba42e7664.tar.bz2
audio policy: new setAudioPortConfig implementation
Rewrite setAudioPortConfig() to take advantage of the new AudioPortConfig class. The configuration is now checked against AudioPort capabilities and stored in the AudioPortConfig. Fix a bug where the config mask was not set properly when calling setAudioPortConfig at the PatchPanel interface. Remove debug log in IAudioPolicyService. Bug: 14815883. Change-Id: I7eb7683a96e049581c13f2a212486507883d008d
Diffstat (limited to 'services/audiopolicy/AudioPolicyManager.h')
-rw-r--r--services/audiopolicy/AudioPolicyManager.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.h b/services/audiopolicy/AudioPolicyManager.h
index db0da24..4327949 100644
--- a/services/audiopolicy/AudioPolicyManager.h
+++ b/services/audiopolicy/AudioPolicyManager.h
@@ -195,20 +195,23 @@ protected:
class AudioGain: public RefBase
{
public:
- AudioGain();
+ AudioGain(int index, bool useInChannelMask);
virtual ~AudioGain() {}
void dump(int fd, int spaces, int index) const;
+ void getDefaultConfig(struct audio_gain_config *config);
+ status_t checkConfig(const struct audio_gain_config *config);
+ int mIndex;
struct audio_gain mGain;
+ bool mUseInChannelMask;
};
class AudioPort: public virtual RefBase
{
public:
AudioPort(const String8& name, audio_port_type_t type,
- audio_port_role_t role, const sp<HwModule>& module) :
- mName(name), mType(type), mRole(role), mModule(module) {}
+ audio_port_role_t role, const sp<HwModule>& module);
virtual ~AudioPort() {}
virtual void toAudioPort(struct audio_port *port) const;
@@ -219,14 +222,20 @@ protected:
void loadInChannels(char *name);
audio_gain_mode_t loadGainMode(char *name);
- void loadGain(cnode *root);
+ void loadGain(cnode *root, int index);
void loadGains(cnode *root);
+ status_t checkSamplingRate(uint32_t samplingRate) const;
+ status_t checkChannelMask(audio_channel_mask_t channelMask) const;
+ status_t checkFormat(audio_format_t format) const;
+ status_t checkGain(const struct audio_gain_config *gainConfig, int index) const;
+
void dump(int fd, int spaces) const;
String8 mName;
audio_port_type_t mType;
audio_port_role_t mRole;
+ bool mUseInChannelMask;
// by convention, "0' in the first entry in mSamplingRates, mChannelMasks or mFormats
// indicates the supported parameters should be read from the output stream
// after it is opened for the first time
@@ -243,6 +252,8 @@ protected:
AudioPortConfig();
virtual ~AudioPortConfig() {}
+ status_t applyAudioPortConfig(const struct audio_port_config *config,
+ struct audio_port_config *backupConfig = NULL);
virtual void toAudioPortConfig(struct audio_port_config *dstConfig,
const struct audio_port_config *srcConfig = NULL) const = 0;
sp<AudioPort> mAudioPort;