| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 int OpenSLESPlayer::StopPlayout() { | 134 int OpenSLESPlayer::StopPlayout() { |
| 135 ALOGD("StopPlayout%s", GetThreadInfo().c_str()); | 135 ALOGD("StopPlayout%s", GetThreadInfo().c_str()); |
| 136 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 136 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 137 if (!initialized_ || !playing_) { | 137 if (!initialized_ || !playing_) { |
| 138 return 0; | 138 return 0; |
| 139 } | 139 } |
| 140 // Stop playing by setting the play state to SL_PLAYSTATE_STOPPED. | 140 // Stop playing by setting the play state to SL_PLAYSTATE_STOPPED. |
| 141 RETURN_ON_ERROR((*player_)->SetPlayState(player_, SL_PLAYSTATE_STOPPED), -1); | 141 RETURN_ON_ERROR((*player_)->SetPlayState(player_, SL_PLAYSTATE_STOPPED), -1); |
| 142 // Clear the buffer queue to flush out any remaining data. | 142 // Clear the buffer queue to flush out any remaining data. |
| 143 RETURN_ON_ERROR((*simple_buffer_queue_)->Clear(simple_buffer_queue_), -1); | 143 RETURN_ON_ERROR((*simple_buffer_queue_)->Clear(simple_buffer_queue_), -1); |
| 144 #ifndef NDEBUG | 144 #if RTC_DCHECK_IS_ON |
| 145 // Verify that the buffer queue is in fact cleared as it should. | 145 // Verify that the buffer queue is in fact cleared as it should. |
| 146 SLAndroidSimpleBufferQueueState buffer_queue_state; | 146 SLAndroidSimpleBufferQueueState buffer_queue_state; |
| 147 (*simple_buffer_queue_)->GetState(simple_buffer_queue_, &buffer_queue_state); | 147 (*simple_buffer_queue_)->GetState(simple_buffer_queue_, &buffer_queue_state); |
| 148 RTC_DCHECK_EQ(0u, buffer_queue_state.count); | 148 RTC_DCHECK_EQ(0u, buffer_queue_state.count); |
| 149 RTC_DCHECK_EQ(0u, buffer_queue_state.index); | 149 RTC_DCHECK_EQ(0u, buffer_queue_state.index); |
| 150 #endif | 150 #endif |
| 151 // The number of lower latency audio players is limited, hence we create the | 151 // The number of lower latency audio players is limited, hence we create the |
| 152 // audio player in Start() and destroy it in Stop(). | 152 // audio player in Start() and destroy it in Stop(). |
| 153 DestroyAudioPlayer(); | 153 DestroyAudioPlayer(); |
| 154 thread_checker_opensles_.DetachFromThread(); | 154 thread_checker_opensles_.DetachFromThread(); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 RTC_DCHECK(player_); | 408 RTC_DCHECK(player_); |
| 409 SLuint32 state; | 409 SLuint32 state; |
| 410 SLresult err = (*player_)->GetPlayState(player_, &state); | 410 SLresult err = (*player_)->GetPlayState(player_, &state); |
| 411 if (SL_RESULT_SUCCESS != err) { | 411 if (SL_RESULT_SUCCESS != err) { |
| 412 ALOGE("GetPlayState failed: %d", err); | 412 ALOGE("GetPlayState failed: %d", err); |
| 413 } | 413 } |
| 414 return state; | 414 return state; |
| 415 } | 415 } |
| 416 | 416 |
| 417 } // namespace webrtc | 417 } // namespace webrtc |
| OLD | NEW |