summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h
diff options
context:
space:
mode:
authorFrançois Gaffie <francois.gaffie@intel.com>2015-03-19 09:24:12 +0100
committerJean-Michel Trivi <jmtrivi@google.com>2015-04-01 10:22:42 -0700
commit53615e29c99c5e9d2ca77aaefd7bf5c770513120 (patch)
tree18a576affc2dcecdc1431027f6d348ef0678cae0 /services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h
parent98cc191247388132b6fd8a4ecd07abd6e4c5a0ed (diff)
downloadframeworks_av-53615e29c99c5e9d2ca77aaefd7bf5c770513120.zip
frameworks_av-53615e29c99c5e9d2ca77aaefd7bf5c770513120.tar.gz
frameworks_av-53615e29c99c5e9d2ca77aaefd7bf5c770513120.tar.bz2
Migrate helper functions from managerdefault to common
This patch moves from manager to common: -parse helper functions of the policy configuration file -collection helper function on -output / input descriptors -DeviceDescriptor -AudioPatch / Audio Port -IO Profile -HwModule Change-Id: If45e53418db75af1af198f43c4ef27884499055f Signed-off-by: François Gaffie <francois.gaffie@intel.com>
Diffstat (limited to 'services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h')
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h b/services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h
index 8469b81..e2f1bbf 100644
--- a/services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h
+++ b/services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h
@@ -20,6 +20,7 @@
#include "ApmImplDefinitions.h"
#include <utils/Errors.h>
#include <utils/Timers.h>
+#include <utils/KeyedVector.h>
#include <system/audio.h>
namespace android {
@@ -54,6 +55,8 @@ public:
virtual sp<AudioPort> getAudioPort() const { return mProfile; }
void toAudioPort(struct audio_port *port) const;
+ audio_module_handle_t getModuleHandle() const;
+
audio_port_handle_t mId;
audio_io_handle_t mIoHandle; // output handle
uint32_t mLatency; //
@@ -73,4 +76,38 @@ public:
uint32_t mDirectOpenCount; // number of clients using this output (direct outputs only)
};
+class AudioOutputCollection :
+ public DefaultKeyedVector< audio_io_handle_t, sp<AudioOutputDescriptor> >
+{
+public:
+ bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const;
+
+ /**
+ * return whether a stream is playing remotely, override to change the definition of
+ * local/remote playback, used for instance by notification manager to not make
+ * media players lose audio focus when not playing locally
+ * For the base implementation, "remotely" means playing during screen mirroring which
+ * uses an output for playback with a non-empty, non "0" address.
+ */
+ bool isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs = 0) const;
+
+ /**
+ * returns the A2DP output handle if it is open or 0 otherwise
+ */
+ audio_io_handle_t getA2dpOutput() const;
+
+ sp<AudioOutputDescriptor> getOutputFromId(audio_port_handle_t id) const;
+
+ sp<AudioOutputDescriptor> getPrimaryOutput() const;
+
+ /**
+ * return true if any output is playing anything besides the stream to ignore
+ */
+ bool isAnyOutputActive(audio_stream_type_t streamToIgnore) const;
+
+ audio_devices_t getSupportedDevices(audio_io_handle_t handle) const;
+
+ status_t dump(int fd) const;
+};
+
}; // namespace android