summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/common/managerdefinitions/include/AudioPort.h
diff options
context:
space:
mode:
Diffstat (limited to 'services/audiopolicy/common/managerdefinitions/include/AudioPort.h')
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/AudioPort.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/services/audiopolicy/common/managerdefinitions/include/AudioPort.h b/services/audiopolicy/common/managerdefinitions/include/AudioPort.h
index 4f7f2bc..1c2c27e 100644
--- a/services/audiopolicy/common/managerdefinitions/include/AudioPort.h
+++ b/services/audiopolicy/common/managerdefinitions/include/AudioPort.h
@@ -32,13 +32,11 @@ class AudioPort : public virtual RefBase
{
public:
AudioPort(const String8& name, audio_port_type_t type,
- audio_port_role_t role, const sp<HwModule>& module);
+ audio_port_role_t role);
virtual ~AudioPort() {}
- audio_port_handle_t getHandle() { return mId; }
-
- void attach(const sp<HwModule>& module);
- bool isAttached() { return mId != 0; }
+ virtual void attach(const sp<HwModule>& module);
+ bool isAttached() { return mModule != 0; }
static audio_port_handle_t getNextUniqueId();
@@ -64,8 +62,12 @@ public:
// searches for an exact match
status_t checkExactChannelMask(audio_channel_mask_t channelMask) const;
// searches for a compatible match, currently implemented for input channel masks only
- status_t checkCompatibleChannelMask(audio_channel_mask_t channelMask) const;
- status_t checkFormat(audio_format_t format) const;
+ status_t checkCompatibleChannelMask(audio_channel_mask_t channelMask,
+ audio_channel_mask_t *updatedChannelMask) const;
+
+ status_t checkExactFormat(audio_format_t format) const;
+ // searches for a compatible match, currently implemented for input formats only
+ status_t checkCompatibleFormat(audio_format_t format, audio_format_t *updatedFormat) const;
status_t checkGain(const struct audio_gain_config *gainConfig, int index) const;
uint32_t pickSamplingRate() const;
@@ -73,11 +75,19 @@ public:
audio_format_t pickFormat() const;
static const audio_format_t sPcmFormatCompareTable[];
+ static int compareFormatsGoodToBad(
+ const audio_format_t *format1, const audio_format_t *format2) {
+ // compareFormats sorts from bad to good, we reverse it here
+ return compareFormats(*format2, *format1);
+ }
static int compareFormats(audio_format_t format1, audio_format_t format2);
audio_module_handle_t getModuleHandle() const;
+ uint32_t getModuleVersion() const;
+ const char *getModuleName() const;
void dump(int fd, int spaces) const;
+ void log(const char* indent) const;
String8 mName;
audio_port_type_t mType;
@@ -94,13 +104,6 @@ public:
uint32_t mFlags; // attribute flags (e.g primary output,
// direct output...).
-
-protected:
- //TODO - clarify the role of mId in this case, both an "attached" indicator
- // and a unique ID for identifying a port to the (upcoming) selection API,
- // and its relationship to the mId in AudioOutputDescriptor and AudioInputDescriptor.
- audio_port_handle_t mId;
-
private:
static volatile int32_t mNextUniqueId;
};