| 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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 return video_weblayer_->Bounds(); | 1602 return video_weblayer_->Bounds(); |
| 1603 } | 1603 } |
| 1604 | 1604 |
| 1605 void WebMediaPlayerImpl::SetDeviceScaleFactor(float scale_factor) { | 1605 void WebMediaPlayerImpl::SetDeviceScaleFactor(float scale_factor) { |
| 1606 cast_impl_.SetDeviceScaleFactor(scale_factor); | 1606 cast_impl_.SetDeviceScaleFactor(scale_factor); |
| 1607 } | 1607 } |
| 1608 | 1608 |
| 1609 void WebMediaPlayerImpl::SetUseFallbackPath(bool use_fallback_path) { | 1609 void WebMediaPlayerImpl::SetUseFallbackPath(bool use_fallback_path) { |
| 1610 use_fallback_path_ = use_fallback_path; | 1610 use_fallback_path_ = use_fallback_path; |
| 1611 } | 1611 } |
| 1612 #endif // defined(OS_ANDROID) // WMPI_CAST | |
| 1613 | 1612 |
| 1614 void WebMediaPlayerImpl::SetPoster(const blink::WebURL& poster) { | 1613 void WebMediaPlayerImpl::SetPoster(const blink::WebURL& poster) { |
| 1615 #if defined(OS_ANDROID) | |
| 1616 cast_impl_.setPoster(poster); | 1614 cast_impl_.setPoster(poster); |
| 1617 #endif | |
| 1618 | |
| 1619 if (observer_) | |
| 1620 observer_->OnSetPoster(poster); | |
| 1621 } | 1615 } |
| 1616 #endif // defined(OS_ANDROID) // WMPI_CAST |
| 1622 | 1617 |
| 1623 void WebMediaPlayerImpl::DataSourceInitialized(bool success) { | 1618 void WebMediaPlayerImpl::DataSourceInitialized(bool success) { |
| 1624 DVLOG(1) << __func__; | 1619 DVLOG(1) << __func__; |
| 1625 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1620 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1626 | 1621 |
| 1627 #if defined(OS_ANDROID) | 1622 #if defined(OS_ANDROID) |
| 1628 // We can't play HLS URLs with WebMediaPlayerImpl, so in cases where they are | 1623 // We can't play HLS URLs with WebMediaPlayerImpl, so in cases where they are |
| 1629 // encountered, instruct the HTML media element to create a new WebMediaPlayer | 1624 // encountered, instruct the HTML media element to create a new WebMediaPlayer |
| 1630 // instance with the correct URL to trigger the creation of WMPI with a | 1625 // instance with the correct URL to trigger the creation of WMPI with a |
| 1631 // MediaPlayerRendererFactory instead. | 1626 // MediaPlayerRendererFactory instead. |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2348 | 2343 |
| 2349 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { | 2344 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { |
| 2350 DCHECK(data_source_ || chunk_demuxer_); | 2345 DCHECK(data_source_ || chunk_demuxer_); |
| 2351 if (data_source_) | 2346 if (data_source_) |
| 2352 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); | 2347 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); |
| 2353 else | 2348 else |
| 2354 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); | 2349 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); |
| 2355 } | 2350 } |
| 2356 | 2351 |
| 2357 } // namespace media | 2352 } // namespace media |
| OLD | NEW |