summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRonghua Wu <ronghuawu@google.com>2015-05-21 12:20:21 -0700
committerRonghua Wu <ronghuawu@google.com>2015-05-22 10:36:31 -0700
commitfaeb0f291330134dc4468359a36e099aae508449 (patch)
tree028333c0801e03826c4162cb35880236eaae3b3b /include
parent8eddd88568fe4da0ca0ceab5072bc488827f01b5 (diff)
downloadframeworks_av-faeb0f291330134dc4468359a36e099aae508449.zip
frameworks_av-faeb0f291330134dc4468359a36e099aae508449.tar.gz
frameworks_av-faeb0f291330134dc4468359a36e099aae508449.tar.bz2
libmediaplayerservice: try to open audio sink in offload mode in error.
Bug: 19061432 Bug: 21370108 Change-Id: Iaa757555ef37fd1ac87b6e2d5a9969bb58cc5ebc
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioTrack.h15
-rw-r--r--include/media/MediaPlayerInterface.h3
2 files changed, 14 insertions, 4 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 458f4b4..e9f0131 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -183,6 +183,10 @@ public:
* pid: Process ID of the app which initially requested this AudioTrack
* for power management tracking, or -1 for current process ID.
* pAttributes: If not NULL, supersedes streamType for use case selection.
+ * doNotReconnect: If set to true, AudioTrack won't automatically recreate the IAudioTrack
+ binder to AudioFlinger.
+ It will return an error instead. The application will recreate
+ the track based on offloading or different channel configuration, etc.
* threadCanCallJava: Not present in parameter list, and so is fixed at false.
*/
@@ -200,7 +204,8 @@ public:
const audio_offload_info_t *offloadInfo = NULL,
int uid = -1,
pid_t pid = -1,
- const audio_attributes_t* pAttributes = NULL);
+ const audio_attributes_t* pAttributes = NULL,
+ bool doNotReconnect = false);
/* Creates an audio track and registers it with AudioFlinger.
* With this constructor, the track is configured for static buffer mode.
@@ -228,7 +233,8 @@ public:
const audio_offload_info_t *offloadInfo = NULL,
int uid = -1,
pid_t pid = -1,
- const audio_attributes_t* pAttributes = NULL);
+ const audio_attributes_t* pAttributes = NULL,
+ bool doNotReconnect = false);
/* Terminates the AudioTrack and unregisters it from AudioFlinger.
* Also destroys all resources associated with the AudioTrack.
@@ -272,7 +278,8 @@ public:
const audio_offload_info_t *offloadInfo = NULL,
int uid = -1,
pid_t pid = -1,
- const audio_attributes_t* pAttributes = NULL);
+ const audio_attributes_t* pAttributes = NULL,
+ bool doNotReconnect = false);
/* Result of constructing the AudioTrack. This must be checked for successful initialization
* before using any AudioTrack API (except for set()), because using
@@ -877,6 +884,8 @@ protected:
// const after set(), except for bits AUDIO_OUTPUT_FLAG_FAST and AUDIO_OUTPUT_FLAG_OFFLOAD.
// mLock must be held to read or write those bits reliably.
+ bool mDoNotReconnect;
+
int mSessionId;
int mAuxEffectId;
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index fa917f9..8c36f0e 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -113,7 +113,8 @@ public:
AudioCallback cb = NULL,
void *cookie = NULL,
audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE,
- const audio_offload_info_t *offloadInfo = NULL) = 0;
+ const audio_offload_info_t *offloadInfo = NULL,
+ bool doNotResuscitate = false) = 0;
virtual status_t start() = 0;