Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: chromecast/media/cma/backend/alsa/audio_decoder_alsa.cc

Issue 1642143003: [Chromecast] Log sample rate changes and tweak audio logging output. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: sample rate logging fix Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/media/cma/backend/alsa/audio_decoder_alsa.h" 5 #include "chromecast/media/cma/backend/alsa/audio_decoder_alsa.h"
6 6
7 #include <time.h> 7 #include <time.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 224
225 AudioDecoderAlsa::RenderingDelay AudioDecoderAlsa::GetRenderingDelay() { 225 AudioDecoderAlsa::RenderingDelay AudioDecoderAlsa::GetRenderingDelay() {
226 TRACE_FUNCTION_ENTRY0(); 226 TRACE_FUNCTION_ENTRY0();
227 return last_known_delay_; 227 return last_known_delay_;
228 } 228 }
229 229
230 void AudioDecoderAlsa::OnDecoderInitialized(bool success) { 230 void AudioDecoderAlsa::OnDecoderInitialized(bool success) {
231 TRACE_FUNCTION_ENTRY0(); 231 TRACE_FUNCTION_ENTRY0();
232 DCHECK(task_runner_->BelongsToCurrentThread()); 232 DCHECK(task_runner_->BelongsToCurrentThread());
233 LOG(INFO) << "Decoder initialization returned with success = " << success; 233 LOG(INFO) << "Decoder initialization was "
234 << (success ? "successful" : "unsuccessful");
234 if (!success) 235 if (!success)
235 delegate_->OnDecoderError(); 236 delegate_->OnDecoderError();
236 } 237 }
237 238
238 void AudioDecoderAlsa::OnBufferDecoded( 239 void AudioDecoderAlsa::OnBufferDecoded(
239 uint64_t input_bytes, 240 uint64_t input_bytes,
240 CastAudioDecoder::Status status, 241 CastAudioDecoder::Status status,
241 const scoped_refptr<DecoderBufferBase>& decoded) { 242 const scoped_refptr<DecoderBufferBase>& decoded) {
242 TRACE_FUNCTION_ENTRY0(); 243 TRACE_FUNCTION_ENTRY0();
243 DCHECK(task_runner_->BelongsToCurrentThread()); 244 DCHECK(task_runner_->BelongsToCurrentThread());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 if (delay.timestamp_microseconds != kInvalidDelayTimestamp) 283 if (delay.timestamp_microseconds != kInvalidDelayTimestamp)
283 last_known_delay_ = delay; 284 last_known_delay_ = delay;
284 delegate_->OnPushBufferComplete(status); 285 delegate_->OnPushBufferComplete(status);
285 if (is_eos_) 286 if (is_eos_)
286 delegate_->OnEndOfStream(); 287 delegate_->OnEndOfStream();
287 } 288 }
288 289
289 void AudioDecoderAlsa::OnMixerError() { 290 void AudioDecoderAlsa::OnMixerError() {
290 TRACE_FUNCTION_ENTRY0(); 291 TRACE_FUNCTION_ENTRY0();
291 DCHECK(task_runner_->BelongsToCurrentThread()); 292 DCHECK(task_runner_->BelongsToCurrentThread());
292 LOG(ERROR) << "Mixer error occured."; 293 // TODO(jyw): properly avoid outputting this message when it isn't needed
294 LOG(ERROR) << "Mixer error occurred. Did the sample rate just change?";
293 error_ = true; 295 error_ = true;
294 delegate_->OnDecoderError(); 296 delegate_->OnDecoderError();
295 } 297 }
296 298
297 } // namespace media 299 } // namespace media
298 } // namespace chromecast 300 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/base/device_capabilities_impl_unittest.cc ('k') | chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698