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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2533443002: fallback to null sink in WebAudioSourceProvider::Initialize() + UMA stats for device status (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index cd6091ddd3ccfcfc26d03a634d700428c75ac598..8f03ae3df43cfbf0cbfd77559ffd7e3f6584a3f9 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -265,14 +265,22 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
// TODO(xhwang): When we use an external Renderer, many methods won't work,
// e.g. GetCurrentFrameFromCompositor(). See http://crbug.com/434861
+ if (params.audio_renderer_sink().get()) {
Guido Urdaneta 2016/11/24 17:30:09 nit: Should a stat be collected if params.audio_re
+ media::OutputDeviceStatus device_status =
+ params.audio_renderer_sink()->GetOutputDeviceInfo().device_status();
DaleCurtis 2016/11/28 18:58:17 In retrospect we probably shouldn't do this since
o1ka 2016/11/29 13:55:58 It's not new in this CL, we have already been doin
DaleCurtis 2016/11/29 20:32:02 I know, sorry I wasn't clear, I was saying it's no
o1ka 2016/11/30 16:13:47 Ah I see. We can probably defer fallback until Web
+ UMA_HISTOGRAM_ENUMERATION("Media.AudioSinkStatus", device_status,
DaleCurtis 2016/11/28 18:58:17 Maybe Media.WebMediaPlayer.SinkStatus?
o1ka 2016/11/30 16:13:48 Done.
+ OUTPUT_DEVICE_STATUS_MAX + 1);
+
+ if (device_status == OUTPUT_DEVICE_STATUS_OK) {
+ audio_source_provider_ =
+ new WebAudioSourceProviderImpl(params.audio_renderer_sink());
+ return;
+ }
+ LOG(WARNING) << "Output device error, falling back to null sink";
DaleCurtis 2016/11/28 18:58:17 This should be a MEDIA_LOG() so it shows up in chr
o1ka 2016/11/30 16:13:47 Done.
+ }
// Use the null sink if no valid sink was provided.
- audio_source_provider_ = new WebAudioSourceProviderImpl(
- params.audio_renderer_sink().get() &&
- params.audio_renderer_sink()
- ->GetOutputDeviceInfo()
- .device_status() == OUTPUT_DEVICE_STATUS_OK
- ? params.audio_renderer_sink()
- : new NullAudioSink(media_task_runner_));
+ audio_source_provider_ =
+ new WebAudioSourceProviderImpl(new NullAudioSink(media_task_runner_));
}
WebMediaPlayerImpl::~WebMediaPlayerImpl() {

Powered by Google App Engine
This is Rietveld 408576698