summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/managerdefault/AudioPolicyManager.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2015-04-21 15:07:36 -0700
committerEric Laurent <elaurent@google.com>2015-04-22 08:12:53 -0700
commit493404d8c396e15ed73455acd39aa0f1940996e2 (patch)
treea07080e7733732fd7273963cca1c93436b86b997 /services/audiopolicy/managerdefault/AudioPolicyManager.h
parentc9c3804a2caf3c0f96e7a8985f82db7ceef490df (diff)
downloadframeworks_av-493404d8c396e15ed73455acd39aa0f1940996e2.zip
frameworks_av-493404d8c396e15ed73455acd39aa0f1940996e2.tar.gz
frameworks_av-493404d8c396e15ed73455acd39aa0f1940996e2.tar.bz2
audio policy: fix AudioTrack output device selection
Have AudioTrack::setOutputDevice() set CBLK_INVALID flag instead of calling restoreTrack_l(). This allows restoreTrack_l() to be called in a safe context. Allow device change while the AudioTrack is active by forcing a new device selection in startOutput() if the output route for this session was changed. Remove some warnings. Change-Id: I2d921a63c9bfa0e122233645e2d6d39f95f5f17d
Diffstat (limited to 'services/audiopolicy/managerdefault/AudioPolicyManager.h')
-rw-r--r--services/audiopolicy/managerdefault/AudioPolicyManager.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
index 146a7af..521f6c4 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
@@ -244,7 +244,10 @@ protected:
mStreamType(streamType),
mDeviceDescriptor(deviceDescriptor),
mRefCount(0),
- mActivityCount(0) {}
+ mActivityCount(0),
+ mChanged(false) {}
+
+ void log(const char* prefix);
audio_session_t mSession;
audio_stream_type_t mStreamType;
@@ -252,10 +255,9 @@ protected:
sp<DeviceDescriptor> mDeviceDescriptor;
// "reference" counting
- int mRefCount; // +/- on references
- int mActivityCount; // +/- on start/stop
-
- void log(const char* prefix);
+ int mRefCount; // +/- on references
+ int mActivityCount; // +/- on start/stop
+ bool mChanged;
};
class SessionRouteMap: public KeyedVector<audio_session_t, sp<SessionRoute>>
@@ -268,7 +270,7 @@ protected:
int incRouteActivity(audio_session_t session);
int decRouteActivity(audio_session_t session);
-
+ bool hasRouteChanged(audio_session_t session); // also clears the changed flag
void log(const char* caption);
};
@@ -510,6 +512,8 @@ protected:
void updateCallRouting(audio_devices_t rxDevice, int delayMs = 0);
+ // if argument "device" is different from AUDIO_DEVICE_NONE, startSource() will force
+ // the re-evaluation of the output device.
status_t startSource(sp<AudioOutputDescriptor> outputDesc,
audio_stream_type_t stream,
audio_devices_t device,