Loading services/audioflinger/AudioFlinger.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ status_t AudioFlinger::openMmapStream(MmapStreamInterface::stream_direction_t di sp<MmapThread> thread = mMmapThreads.valueFor(io); if (thread != 0) { interface = new MmapThreadHandle(thread); thread->configure(attr, streamType, sessionId, callback, portId); thread->configure(attr, streamType, sessionId, callback, *deviceId, portId); *handle = portId; } else { ret = NO_INIT; Loading services/audioflinger/Threads.cpp +12 −5 Original line number Diff line number Diff line Loading @@ -7545,6 +7545,8 @@ AudioFlinger::MmapThread::MmapThread( AudioHwDevice *hwDev, sp<StreamHalInterface> stream, audio_devices_t outDevice, audio_devices_t inDevice, bool systemReady) : ThreadBase(audioFlinger, id, outDevice, inDevice, MMAP, systemReady), mSessionId(AUDIO_SESSION_NONE), mDeviceId(AUDIO_PORT_HANDLE_NONE), mPortId(AUDIO_PORT_HANDLE_NONE), mHalStream(stream), mHalDevice(hwDev->hwDevice()), mAudioHwDev(hwDev), mActiveTracks(&this->mLocalLog) { Loading Loading @@ -7580,11 +7582,13 @@ void AudioFlinger::MmapThread::configure(const audio_attributes_t *attr, audio_stream_type_t streamType __unused, audio_session_t sessionId, const sp<MmapStreamCallback>& callback, audio_port_handle_t deviceId, audio_port_handle_t portId) { mAttr = *attr; mSessionId = sessionId; mCallback = callback; mDeviceId = deviceId; mPortId = portId; } Loading Loading @@ -7640,7 +7644,7 @@ status_t AudioFlinger::MmapThread::start(const AudioClient& client, audio_stream_type_t stream = streamType(); audio_output_flags_t flags = (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_MMAP_NOIRQ | AUDIO_OUTPUT_FLAG_DIRECT); audio_port_handle_t deviceId = AUDIO_PORT_HANDLE_NONE; audio_port_handle_t deviceId = mDeviceId; ret = AudioSystem::getOutputForAttr(&mAttr, &io, mSessionId, &stream, Loading @@ -7654,7 +7658,7 @@ status_t AudioFlinger::MmapThread::start(const AudioClient& client, config.sample_rate = mSampleRate; config.channel_mask = mChannelMask; config.format = mFormat; audio_port_handle_t deviceId = AUDIO_PORT_HANDLE_NONE; audio_port_handle_t deviceId = mDeviceId; ret = AudioSystem::getInputForAttr(&mAttr, &io, mSessionId, client.clientPid, Loading Loading @@ -7991,17 +7995,19 @@ status_t AudioFlinger::MmapThread::createAudioPatch_l(const struct audio_patch * mPrevOutDevice = type; sendIoConfigEvent_l(AUDIO_OUTPUT_CONFIG_CHANGED); sp<MmapStreamCallback> callback = mCallback.promote(); if (callback != 0) { if (mDeviceId != deviceId && callback != 0) { callback->onRoutingChanged(deviceId); } mDeviceId = deviceId; } if (!isOutput() && mPrevInDevice != mInDevice) { mPrevInDevice = type; sendIoConfigEvent_l(AUDIO_INPUT_CONFIG_CHANGED); sp<MmapStreamCallback> callback = mCallback.promote(); if (callback != 0) { if (mDeviceId != deviceId && callback != 0) { callback->onRoutingChanged(deviceId); } mDeviceId = deviceId; } return status; } Loading Loading @@ -8242,9 +8248,10 @@ void AudioFlinger::MmapPlaybackThread::configure(const audio_attributes_t *attr, audio_stream_type_t streamType, audio_session_t sessionId, const sp<MmapStreamCallback>& callback, audio_port_handle_t deviceId, audio_port_handle_t portId) { MmapThread::configure(attr, streamType, sessionId, callback, portId); MmapThread::configure(attr, streamType, sessionId, callback, deviceId, portId); mStreamType = streamType; } Loading services/audioflinger/Threads.h +3 −0 Original line number Diff line number Diff line Loading @@ -1479,6 +1479,7 @@ class MmapThread : public ThreadBase audio_stream_type_t streamType, audio_session_t sessionId, const sp<MmapStreamCallback>& callback, audio_port_handle_t deviceId, audio_port_handle_t portId); void disconnect(); Loading Loading @@ -1540,6 +1541,7 @@ class MmapThread : public ThreadBase audio_attributes_t mAttr; audio_session_t mSessionId; audio_port_handle_t mDeviceId; audio_port_handle_t mPortId; wp<MmapStreamCallback> mCallback; Loading @@ -1562,6 +1564,7 @@ public: audio_stream_type_t streamType, audio_session_t sessionId, const sp<MmapStreamCallback>& callback, audio_port_handle_t deviceId, audio_port_handle_t portId); AudioStreamOut* clearOutput(); Loading Loading
services/audioflinger/AudioFlinger.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ status_t AudioFlinger::openMmapStream(MmapStreamInterface::stream_direction_t di sp<MmapThread> thread = mMmapThreads.valueFor(io); if (thread != 0) { interface = new MmapThreadHandle(thread); thread->configure(attr, streamType, sessionId, callback, portId); thread->configure(attr, streamType, sessionId, callback, *deviceId, portId); *handle = portId; } else { ret = NO_INIT; Loading
services/audioflinger/Threads.cpp +12 −5 Original line number Diff line number Diff line Loading @@ -7545,6 +7545,8 @@ AudioFlinger::MmapThread::MmapThread( AudioHwDevice *hwDev, sp<StreamHalInterface> stream, audio_devices_t outDevice, audio_devices_t inDevice, bool systemReady) : ThreadBase(audioFlinger, id, outDevice, inDevice, MMAP, systemReady), mSessionId(AUDIO_SESSION_NONE), mDeviceId(AUDIO_PORT_HANDLE_NONE), mPortId(AUDIO_PORT_HANDLE_NONE), mHalStream(stream), mHalDevice(hwDev->hwDevice()), mAudioHwDev(hwDev), mActiveTracks(&this->mLocalLog) { Loading Loading @@ -7580,11 +7582,13 @@ void AudioFlinger::MmapThread::configure(const audio_attributes_t *attr, audio_stream_type_t streamType __unused, audio_session_t sessionId, const sp<MmapStreamCallback>& callback, audio_port_handle_t deviceId, audio_port_handle_t portId) { mAttr = *attr; mSessionId = sessionId; mCallback = callback; mDeviceId = deviceId; mPortId = portId; } Loading Loading @@ -7640,7 +7644,7 @@ status_t AudioFlinger::MmapThread::start(const AudioClient& client, audio_stream_type_t stream = streamType(); audio_output_flags_t flags = (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_MMAP_NOIRQ | AUDIO_OUTPUT_FLAG_DIRECT); audio_port_handle_t deviceId = AUDIO_PORT_HANDLE_NONE; audio_port_handle_t deviceId = mDeviceId; ret = AudioSystem::getOutputForAttr(&mAttr, &io, mSessionId, &stream, Loading @@ -7654,7 +7658,7 @@ status_t AudioFlinger::MmapThread::start(const AudioClient& client, config.sample_rate = mSampleRate; config.channel_mask = mChannelMask; config.format = mFormat; audio_port_handle_t deviceId = AUDIO_PORT_HANDLE_NONE; audio_port_handle_t deviceId = mDeviceId; ret = AudioSystem::getInputForAttr(&mAttr, &io, mSessionId, client.clientPid, Loading Loading @@ -7991,17 +7995,19 @@ status_t AudioFlinger::MmapThread::createAudioPatch_l(const struct audio_patch * mPrevOutDevice = type; sendIoConfigEvent_l(AUDIO_OUTPUT_CONFIG_CHANGED); sp<MmapStreamCallback> callback = mCallback.promote(); if (callback != 0) { if (mDeviceId != deviceId && callback != 0) { callback->onRoutingChanged(deviceId); } mDeviceId = deviceId; } if (!isOutput() && mPrevInDevice != mInDevice) { mPrevInDevice = type; sendIoConfigEvent_l(AUDIO_INPUT_CONFIG_CHANGED); sp<MmapStreamCallback> callback = mCallback.promote(); if (callback != 0) { if (mDeviceId != deviceId && callback != 0) { callback->onRoutingChanged(deviceId); } mDeviceId = deviceId; } return status; } Loading Loading @@ -8242,9 +8248,10 @@ void AudioFlinger::MmapPlaybackThread::configure(const audio_attributes_t *attr, audio_stream_type_t streamType, audio_session_t sessionId, const sp<MmapStreamCallback>& callback, audio_port_handle_t deviceId, audio_port_handle_t portId) { MmapThread::configure(attr, streamType, sessionId, callback, portId); MmapThread::configure(attr, streamType, sessionId, callback, deviceId, portId); mStreamType = streamType; } Loading
services/audioflinger/Threads.h +3 −0 Original line number Diff line number Diff line Loading @@ -1479,6 +1479,7 @@ class MmapThread : public ThreadBase audio_stream_type_t streamType, audio_session_t sessionId, const sp<MmapStreamCallback>& callback, audio_port_handle_t deviceId, audio_port_handle_t portId); void disconnect(); Loading Loading @@ -1540,6 +1541,7 @@ class MmapThread : public ThreadBase audio_attributes_t mAttr; audio_session_t mSessionId; audio_port_handle_t mDeviceId; audio_port_handle_t mPortId; wp<MmapStreamCallback> mCallback; Loading @@ -1562,6 +1564,7 @@ public: audio_stream_type_t streamType, audio_session_t sessionId, const sp<MmapStreamCallback>& callback, audio_port_handle_t deviceId, audio_port_handle_t portId); AudioStreamOut* clearOutput(); Loading