summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioTrack.cpp
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 /media/libmedia/AudioTrack.cpp
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 'media/libmedia/AudioTrack.cpp')
-rw-r--r--media/libmedia/AudioTrack.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index db316b0..faf5935 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -178,7 +178,8 @@ AudioTrack::AudioTrack(
const audio_offload_info_t *offloadInfo,
int uid,
pid_t pid,
- const audio_attributes_t* pAttributes)
+ const audio_attributes_t* pAttributes,
+ bool doNotReconnect)
: mStatus(NO_INIT),
mIsTimed(false),
mPreviousPriority(ANDROID_PRIORITY_NORMAL),
@@ -189,7 +190,7 @@ AudioTrack::AudioTrack(
mStatus = set(streamType, sampleRate, format, channelMask,
frameCount, flags, cbf, user, notificationFrames,
0 /*sharedBuffer*/, false /*threadCanCallJava*/, sessionId, transferType,
- offloadInfo, uid, pid, pAttributes);
+ offloadInfo, uid, pid, pAttributes, doNotReconnect);
}
AudioTrack::AudioTrack(
@@ -207,7 +208,8 @@ AudioTrack::AudioTrack(
const audio_offload_info_t *offloadInfo,
int uid,
pid_t pid,
- const audio_attributes_t* pAttributes)
+ const audio_attributes_t* pAttributes,
+ bool doNotReconnect)
: mStatus(NO_INIT),
mIsTimed(false),
mPreviousPriority(ANDROID_PRIORITY_NORMAL),
@@ -218,7 +220,7 @@ AudioTrack::AudioTrack(
mStatus = set(streamType, sampleRate, format, channelMask,
0 /*frameCount*/, flags, cbf, user, notificationFrames,
sharedBuffer, false /*threadCanCallJava*/, sessionId, transferType, offloadInfo,
- uid, pid, pAttributes);
+ uid, pid, pAttributes, doNotReconnect);
}
AudioTrack::~AudioTrack()
@@ -266,7 +268,8 @@ status_t AudioTrack::set(
const audio_offload_info_t *offloadInfo,
int uid,
pid_t pid,
- const audio_attributes_t* pAttributes)
+ const audio_attributes_t* pAttributes,
+ bool doNotReconnect)
{
ALOGV("set(): streamType %d, sampleRate %u, format %#x, channelMask %#x, frameCount %zu, "
"flags #%x, notificationFrames %u, sessionId %d, transferType %d, uid %d, pid %d",
@@ -308,6 +311,7 @@ status_t AudioTrack::set(
}
mSharedBuffer = sharedBuffer;
mTransfer = transferType;
+ mDoNotReconnect = doNotReconnect;
ALOGV_IF(sharedBuffer != 0, "sharedBuffer: %p, size: %d", sharedBuffer->pointer(),
sharedBuffer->size());
@@ -2006,7 +2010,7 @@ status_t AudioTrack::restoreTrack_l(const char *from)
// output parameters and new IAudioFlinger in createTrack_l()
AudioSystem::clearAudioConfigCache();
- if (isOffloadedOrDirect_l()) {
+ if (isOffloadedOrDirect_l() || mDoNotReconnect) {
// FIXME re-creation of offloaded tracks is not yet implemented
return DEAD_OBJECT;
}