| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/media/webmediaplayer_ms.h" | 5 #include "content/renderer/media/webmediaplayer_ms.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 12 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 13 #include "cc/blink/context_provider_web_context.h" | 14 #include "cc/blink/context_provider_web_context.h" |
| 14 #include "cc/blink/web_layer_impl.h" | 15 #include "cc/blink/web_layer_impl.h" |
| 15 #include "cc/layers/video_layer.h" | 16 #include "cc/layers/video_layer.h" |
| 16 #include "content/public/renderer/media_stream_audio_renderer.h" | 17 #include "content/public/renderer/media_stream_audio_renderer.h" |
| 17 #include "content/public/renderer/media_stream_renderer_factory.h" | 18 #include "content/public/renderer/media_stream_renderer_factory.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 if (audio_renderer_.get()) { | 262 if (audio_renderer_.get()) { |
| 262 media::OutputDevice* output_device = audio_renderer_->GetOutputDevice(); | 263 media::OutputDevice* output_device = audio_renderer_->GetOutputDevice(); |
| 263 if (output_device) { | 264 if (output_device) { |
| 264 const std::string device_id_str(device_id.utf8()); | 265 const std::string device_id_str(device_id.utf8()); |
| 265 const GURL security_origin(frame_->securityOrigin().toString().utf8()); | 266 const GURL security_origin(frame_->securityOrigin().toString().utf8()); |
| 266 output_device->SwitchOutputDevice(device_id_str, security_origin, | 267 output_device->SwitchOutputDevice(device_id_str, security_origin, |
| 267 callback); | 268 callback); |
| 268 return; | 269 return; |
| 269 } | 270 } |
| 270 } | 271 } |
| 271 callback.Run(media::SWITCH_OUTPUT_DEVICE_RESULT_ERROR_NOT_SUPPORTED); | 272 callback.Run(media::SWITCH_OUTPUT_DEVICE_RESULT_ERROR_INTERNAL); |
| 272 } | 273 } |
| 273 | 274 |
| 274 void WebMediaPlayerMS::setPreload(WebMediaPlayer::Preload preload) { | 275 void WebMediaPlayerMS::setPreload(WebMediaPlayer::Preload preload) { |
| 275 DCHECK(thread_checker_.CalledOnValidThread()); | 276 DCHECK(thread_checker_.CalledOnValidThread()); |
| 276 } | 277 } |
| 277 | 278 |
| 278 bool WebMediaPlayerMS::hasVideo() const { | 279 bool WebMediaPlayerMS::hasVideo() const { |
| 279 DCHECK(thread_checker_.CalledOnValidThread()); | 280 DCHECK(thread_checker_.CalledOnValidThread()); |
| 280 return (video_frame_provider_.get() != NULL); | 281 return (video_frame_provider_.get() != NULL); |
| 281 } | 282 } |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 GetClient()->readyStateChanged(); | 557 GetClient()->readyStateChanged(); |
| 557 } | 558 } |
| 558 | 559 |
| 559 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { | 560 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { |
| 560 DCHECK(thread_checker_.CalledOnValidThread()); | 561 DCHECK(thread_checker_.CalledOnValidThread()); |
| 561 DCHECK(client_); | 562 DCHECK(client_); |
| 562 return client_; | 563 return client_; |
| 563 } | 564 } |
| 564 | 565 |
| 565 } // namespace content | 566 } // namespace content |
| OLD | NEW |