Loading media/libaaudio/src/core/AudioStream.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -314,8 +314,11 @@ aaudio_result_t AudioStream::safeRelease() { void AudioStream::setState(aaudio_stream_state_t state) { ALOGD("%s(s#%d) from %d to %d", __func__, getId(), mState, state); if (state == mState) { return; // no change } // Track transition to DISCONNECTED state. if (state == AAUDIO_STREAM_STATE_DISCONNECTED && mState != state) { if (state == AAUDIO_STREAM_STATE_DISCONNECTED) { android::mediametrics::LogItem(mMetricsId) .set(AMEDIAMETRICS_PROP_EVENT, AMEDIAMETRICS_PROP_EVENT_VALUE_DISCONNECT) .set(AMEDIAMETRICS_PROP_STATE, AudioGlobal_convertStreamStateToText(getState())) Loading @@ -323,18 +326,18 @@ void AudioStream::setState(aaudio_stream_state_t state) { } // CLOSED is a final state if (mState == AAUDIO_STREAM_STATE_CLOSED) { ALOGE("%s(%d) tried to set to %d but already CLOSED", __func__, getId(), state); ALOGW("%s(%d) tried to set to %d but already CLOSED", __func__, getId(), state); // Once CLOSING, we can only move to CLOSED state. } else if (mState == AAUDIO_STREAM_STATE_CLOSING && state != AAUDIO_STREAM_STATE_CLOSED) { ALOGE("%s(%d) tried to set to %d but already CLOSING", __func__, getId(), state); ALOGW("%s(%d) tried to set to %d but already CLOSING", __func__, getId(), state); // Once DISCONNECTED, we can only move to CLOSING or CLOSED state. } else if (mState == AAUDIO_STREAM_STATE_DISCONNECTED && !(state == AAUDIO_STREAM_STATE_CLOSING || state == AAUDIO_STREAM_STATE_CLOSED)) { ALOGE("%s(%d) tried to set to %d but already DISCONNECTED", __func__, getId(), state); ALOGW("%s(%d) tried to set to %d but already DISCONNECTED", __func__, getId(), state); } else { mState = state; Loading media/libaaudio/src/legacy/AudioStreamRecord.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -212,9 +212,6 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder) setSamplesPerFrame(mAudioRecord->channelCount()); int32_t actualSampleRate = mAudioRecord->getSampleRate(); ALOGW_IF(actualSampleRate != getSampleRate(), "open() sampleRate changed from %d to %d", getSampleRate(), actualSampleRate); setSampleRate(actualSampleRate); // We may need to pass the data through a block size adapter to guarantee constant size. Loading media/libaaudio/src/legacy/AudioStreamTrack.cpp +3 −6 Original line number Diff line number Diff line Loading @@ -195,9 +195,6 @@ aaudio_result_t AudioStreamTrack::open(const AudioStreamBuilder& builder) setDeviceFormat(mAudioTrack->format()); int32_t actualSampleRate = mAudioTrack->getSampleRate(); ALOGW_IF(actualSampleRate != getSampleRate(), "open() sampleRate changed from %d to %d", getSampleRate(), actualSampleRate); setSampleRate(actualSampleRate); // We may need to pass the data through a block size adapter to guarantee constant size. Loading Loading @@ -240,11 +237,11 @@ aaudio_result_t AudioStreamTrack::open(const AudioStreamBuilder& builder) setSharingMode(AAUDIO_SHARING_MODE_SHARED); // EXCLUSIVE mode not supported in legacy // Log warning if we did not get what we asked for. ALOGW_IF(actualFlags != flags, // Log if we did not get what we asked for. ALOGD_IF(actualFlags != flags, "open() flags changed from 0x%08X to 0x%08X", flags, actualFlags); ALOGW_IF(actualPerformanceMode != perfMode, ALOGD_IF(actualPerformanceMode != perfMode, "open() perfMode changed from %d to %d", perfMode, actualPerformanceMode); Loading Loading
media/libaaudio/src/core/AudioStream.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -314,8 +314,11 @@ aaudio_result_t AudioStream::safeRelease() { void AudioStream::setState(aaudio_stream_state_t state) { ALOGD("%s(s#%d) from %d to %d", __func__, getId(), mState, state); if (state == mState) { return; // no change } // Track transition to DISCONNECTED state. if (state == AAUDIO_STREAM_STATE_DISCONNECTED && mState != state) { if (state == AAUDIO_STREAM_STATE_DISCONNECTED) { android::mediametrics::LogItem(mMetricsId) .set(AMEDIAMETRICS_PROP_EVENT, AMEDIAMETRICS_PROP_EVENT_VALUE_DISCONNECT) .set(AMEDIAMETRICS_PROP_STATE, AudioGlobal_convertStreamStateToText(getState())) Loading @@ -323,18 +326,18 @@ void AudioStream::setState(aaudio_stream_state_t state) { } // CLOSED is a final state if (mState == AAUDIO_STREAM_STATE_CLOSED) { ALOGE("%s(%d) tried to set to %d but already CLOSED", __func__, getId(), state); ALOGW("%s(%d) tried to set to %d but already CLOSED", __func__, getId(), state); // Once CLOSING, we can only move to CLOSED state. } else if (mState == AAUDIO_STREAM_STATE_CLOSING && state != AAUDIO_STREAM_STATE_CLOSED) { ALOGE("%s(%d) tried to set to %d but already CLOSING", __func__, getId(), state); ALOGW("%s(%d) tried to set to %d but already CLOSING", __func__, getId(), state); // Once DISCONNECTED, we can only move to CLOSING or CLOSED state. } else if (mState == AAUDIO_STREAM_STATE_DISCONNECTED && !(state == AAUDIO_STREAM_STATE_CLOSING || state == AAUDIO_STREAM_STATE_CLOSED)) { ALOGE("%s(%d) tried to set to %d but already DISCONNECTED", __func__, getId(), state); ALOGW("%s(%d) tried to set to %d but already DISCONNECTED", __func__, getId(), state); } else { mState = state; Loading
media/libaaudio/src/legacy/AudioStreamRecord.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -212,9 +212,6 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder) setSamplesPerFrame(mAudioRecord->channelCount()); int32_t actualSampleRate = mAudioRecord->getSampleRate(); ALOGW_IF(actualSampleRate != getSampleRate(), "open() sampleRate changed from %d to %d", getSampleRate(), actualSampleRate); setSampleRate(actualSampleRate); // We may need to pass the data through a block size adapter to guarantee constant size. Loading
media/libaaudio/src/legacy/AudioStreamTrack.cpp +3 −6 Original line number Diff line number Diff line Loading @@ -195,9 +195,6 @@ aaudio_result_t AudioStreamTrack::open(const AudioStreamBuilder& builder) setDeviceFormat(mAudioTrack->format()); int32_t actualSampleRate = mAudioTrack->getSampleRate(); ALOGW_IF(actualSampleRate != getSampleRate(), "open() sampleRate changed from %d to %d", getSampleRate(), actualSampleRate); setSampleRate(actualSampleRate); // We may need to pass the data through a block size adapter to guarantee constant size. Loading Loading @@ -240,11 +237,11 @@ aaudio_result_t AudioStreamTrack::open(const AudioStreamBuilder& builder) setSharingMode(AAUDIO_SHARING_MODE_SHARED); // EXCLUSIVE mode not supported in legacy // Log warning if we did not get what we asked for. ALOGW_IF(actualFlags != flags, // Log if we did not get what we asked for. ALOGD_IF(actualFlags != flags, "open() flags changed from 0x%08X to 0x%08X", flags, actualFlags); ALOGW_IF(actualPerformanceMode != perfMode, ALOGD_IF(actualPerformanceMode != perfMode, "open() perfMode changed from %d to %d", perfMode, actualPerformanceMode); Loading