| 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_frame_provider_client_impl.h" | 16 #include "cc/layers/video_frame_provider_client_impl.h" |
| 16 #include "cc/layers/video_layer.h" | 17 #include "cc/layers/video_layer.h" |
| 17 #include "content/public/renderer/media_stream_audio_renderer.h" | 18 #include "content/public/renderer/media_stream_audio_renderer.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 if (audio_renderer_.get()) { | 259 if (audio_renderer_.get()) { |
| 259 media::OutputDevice* output_device = audio_renderer_->GetOutputDevice(); | 260 media::OutputDevice* output_device = audio_renderer_->GetOutputDevice(); |
| 260 if (output_device) { | 261 if (output_device) { |
| 261 const std::string device_id_str(device_id.utf8()); | 262 const std::string device_id_str(device_id.utf8()); |
| 262 const GURL security_origin(frame_->securityOrigin().toString().utf8()); | 263 const GURL security_origin(frame_->securityOrigin().toString().utf8()); |
| 263 output_device->SwitchOutputDevice(device_id_str, security_origin, | 264 output_device->SwitchOutputDevice(device_id_str, security_origin, |
| 264 callback); | 265 callback); |
| 265 return; | 266 return; |
| 266 } | 267 } |
| 267 } | 268 } |
| 268 callback.Run(media::SWITCH_OUTPUT_DEVICE_RESULT_ERROR_NOT_SUPPORTED); | 269 callback.Run(media::SWITCH_OUTPUT_DEVICE_RESULT_ERROR_INTERNAL); |
| 269 } | 270 } |
| 270 | 271 |
| 271 void WebMediaPlayerMS::setPreload(WebMediaPlayer::Preload preload) { | 272 void WebMediaPlayerMS::setPreload(WebMediaPlayer::Preload preload) { |
| 272 DCHECK(thread_checker_.CalledOnValidThread()); | 273 DCHECK(thread_checker_.CalledOnValidThread()); |
| 273 } | 274 } |
| 274 | 275 |
| 275 bool WebMediaPlayerMS::hasVideo() const { | 276 bool WebMediaPlayerMS::hasVideo() const { |
| 276 DCHECK(thread_checker_.CalledOnValidThread()); | 277 DCHECK(thread_checker_.CalledOnValidThread()); |
| 277 return (video_frame_provider_.get() != NULL); | 278 return (video_frame_provider_.get() != NULL); |
| 278 } | 279 } |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 } | 642 } |
| 642 | 643 |
| 643 unsigned WebMediaPlayerMS::Compositor::GetTotalFrameCount() { | 644 unsigned WebMediaPlayerMS::Compositor::GetTotalFrameCount() { |
| 644 return total_frame_count_; | 645 return total_frame_count_; |
| 645 } | 646 } |
| 646 | 647 |
| 647 unsigned WebMediaPlayerMS::Compositor::GetDroppedFrameCount() { | 648 unsigned WebMediaPlayerMS::Compositor::GetDroppedFrameCount() { |
| 648 return dropped_frame_count_; | 649 return dropped_frame_count_; |
| 649 } | 650 } |
| 650 } // namespace content | 651 } // namespace content |
| OLD | NEW |