Chromium Code Reviews| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 242 is_encrypted_(false), | 242 is_encrypted_(false), |
| 243 preroll_attempt_pending_(false), | 243 preroll_attempt_pending_(false), |
| 244 observer_(params->media_observer()), | 244 observer_(params->media_observer()), |
| 245 max_keyframe_distance_to_disable_background_video_( | 245 max_keyframe_distance_to_disable_background_video_( |
| 246 params->max_keyframe_distance_to_disable_background_video()), | 246 params->max_keyframe_distance_to_disable_background_video()), |
| 247 max_keyframe_distance_to_disable_background_video_mse_( | 247 max_keyframe_distance_to_disable_background_video_mse_( |
| 248 params->max_keyframe_distance_to_disable_background_video_mse()), | 248 params->max_keyframe_distance_to_disable_background_video_mse()), |
| 249 enable_instant_source_buffer_gc_( | 249 enable_instant_source_buffer_gc_( |
| 250 params->enable_instant_source_buffer_gc()), | 250 params->enable_instant_source_buffer_gc()), |
| 251 embedded_media_experience_enabled_( | 251 embedded_media_experience_enabled_( |
| 252 params->embedded_media_experience_enabled()) { | 252 params->embedded_media_experience_enabled()), |
| 253 request_routing_token_cb_(params->request_routing_token_cb()), | |
| 254 overlay_routing_token_(base::UnguessableToken()) { | |
| 253 DVLOG(1) << __func__; | 255 DVLOG(1) << __func__; |
| 254 DCHECK(!adjust_allocated_memory_cb_.is_null()); | 256 DCHECK(!adjust_allocated_memory_cb_.is_null()); |
| 255 DCHECK(renderer_factory_selector_); | 257 DCHECK(renderer_factory_selector_); |
| 256 DCHECK(client_); | 258 DCHECK(client_); |
| 257 DCHECK(delegate_); | 259 DCHECK(delegate_); |
| 258 | 260 |
| 259 force_video_overlays_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 261 force_video_overlays_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 260 switches::kForceVideoOverlays); | 262 switches::kForceVideoOverlays); |
| 261 | 263 |
| 262 enable_fullscreen_video_overlays_ = | 264 if (base::FeatureList::IsEnabled(media::kOverlayFullscreenVideo)) { |
| 263 base::FeatureList::IsEnabled(media::kOverlayFullscreenVideo); | 265 bool use_android_overlay = |
| 266 base::FeatureList::IsEnabled(media::kUseAndroidOverlay); | |
| 267 overlay_mode_ = use_android_overlay ? OverlayMode::kUseAndroidOverlay | |
| 268 : OverlayMode::kUseContentVideoView; | |
| 269 } else { | |
| 270 overlay_mode_ = OverlayMode::kNoOverlays; | |
| 271 } | |
| 264 | 272 |
| 265 delegate_id_ = delegate_->AddObserver(this); | 273 delegate_id_ = delegate_->AddObserver(this); |
| 266 delegate_->SetIdle(delegate_id_, true); | 274 delegate_->SetIdle(delegate_id_, true); |
| 267 | 275 |
| 268 media_log_->AddEvent( | 276 media_log_->AddEvent( |
| 269 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_CREATED)); | 277 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
| 270 | 278 |
| 271 if (params->initial_cdm()) | 279 if (params->initial_cdm()) |
| 272 SetCdm(params->initial_cdm()); | 280 SetCdm(params->initial_cdm()); |
| 273 | 281 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 334 bool WebMediaPlayerImpl::SupportsOverlayFullscreenVideo() { | 342 bool WebMediaPlayerImpl::SupportsOverlayFullscreenVideo() { |
| 335 #if defined(OS_ANDROID) | 343 #if defined(OS_ANDROID) |
| 336 return !using_media_player_renderer_; | 344 return !using_media_player_renderer_; |
| 337 #else | 345 #else |
| 338 return false; | 346 return false; |
| 339 #endif | 347 #endif |
| 340 } | 348 } |
| 341 | 349 |
| 342 void WebMediaPlayerImpl::EnableOverlay() { | 350 void WebMediaPlayerImpl::EnableOverlay() { |
| 343 overlay_enabled_ = true; | 351 overlay_enabled_ = true; |
| 344 if (surface_manager_) { | 352 if (surface_manager_ && overlay_mode_ == OverlayMode::kUseContentVideoView) { |
| 345 overlay_surface_id_.reset(); | 353 overlay_surface_id_.reset(); |
| 346 surface_created_cb_.Reset( | 354 surface_created_cb_.Reset( |
| 347 base::Bind(&WebMediaPlayerImpl::OnSurfaceCreated, AsWeakPtr())); | 355 base::Bind(&WebMediaPlayerImpl::OnSurfaceCreated, AsWeakPtr())); |
| 348 surface_manager_->CreateFullscreenSurface(pipeline_metadata_.natural_size, | 356 surface_manager_->CreateFullscreenSurface(pipeline_metadata_.natural_size, |
| 349 surface_created_cb_.callback()); | 357 surface_created_cb_.callback()); |
| 358 } else if (!request_routing_token_cb_.is_null() && | |
|
tguilbert
2017/05/08 23:10:29
NIT: can you remove the is_null (and the negation)
liberato (no reviews please)
2017/05/09 16:55:37
Done.
| |
| 359 overlay_mode_ == OverlayMode::kUseAndroidOverlay) { | |
| 360 overlay_routing_token_.reset(); | |
| 361 token_available_cb_.Reset( | |
| 362 base::Bind(&WebMediaPlayerImpl::OnOverlayRoutingToken, AsWeakPtr())); | |
| 363 request_routing_token_cb_.Run(token_available_cb_.callback()); | |
| 350 } | 364 } |
| 351 | 365 |
| 366 // We have requested (and maybe already have) overlay information. If the | |
| 367 // restarted decoder requests overlay information, then we'll defer providing | |
| 368 // it if it hasn't arrived yet. Otherwise, this would be a race, since we | |
| 369 // don't know if the request for overlay info or restart will complete first. | |
| 352 if (decoder_requires_restart_for_overlay_) | 370 if (decoder_requires_restart_for_overlay_) |
| 353 ScheduleRestart(); | 371 ScheduleRestart(); |
| 354 } | 372 } |
| 355 | 373 |
| 356 void WebMediaPlayerImpl::DisableOverlay() { | 374 void WebMediaPlayerImpl::DisableOverlay() { |
| 357 overlay_enabled_ = false; | 375 overlay_enabled_ = false; |
| 358 surface_created_cb_.Cancel(); | 376 if (overlay_mode_ == OverlayMode::kUseContentVideoView) { |
| 359 overlay_surface_id_ = SurfaceManager::kNoSurfaceID; | 377 surface_created_cb_.Cancel(); |
| 378 overlay_surface_id_ = SurfaceManager::kNoSurfaceID; | |
| 379 } else if (overlay_mode_ == OverlayMode::kUseAndroidOverlay) { | |
| 380 token_available_cb_.Cancel(); | |
| 381 overlay_routing_token_ = base::UnguessableToken(); | |
| 382 } | |
| 360 | 383 |
| 361 if (decoder_requires_restart_for_overlay_) | 384 if (decoder_requires_restart_for_overlay_) |
| 362 ScheduleRestart(); | 385 ScheduleRestart(); |
| 363 else if (!set_surface_cb_.is_null()) | 386 else |
| 364 set_surface_cb_.Run(*overlay_surface_id_); | 387 SendOverlayInfoToDecoder(); |
| 365 } | 388 } |
| 366 | 389 |
| 367 void WebMediaPlayerImpl::EnteredFullscreen() { | 390 void WebMediaPlayerImpl::EnteredFullscreen() { |
| 368 // |force_video_overlays_| implies that we're already in overlay mode, so take | 391 // |force_video_overlays_| implies that we're already in overlay mode, so take |
| 369 // no action here. Otherwise, switch to an overlay if it's allowed and if | 392 // no action here. Otherwise, switch to an overlay if it's allowed and if |
| 370 // it will display properly. | 393 // it will display properly. |
| 371 if (!force_video_overlays_ && enable_fullscreen_video_overlays_ && | 394 if (!force_video_overlays_ && overlay_mode_ != OverlayMode::kNoOverlays && |
| 372 DoesOverlaySupportMetadata()) { | 395 DoesOverlaySupportMetadata()) { |
| 373 EnableOverlay(); | 396 EnableOverlay(); |
| 374 } | 397 } |
| 375 if (observer_) | 398 if (observer_) |
| 376 observer_->OnEnteredFullscreen(); | 399 observer_->OnEnteredFullscreen(); |
| 400 | |
| 401 // TODO(liberato): if the decoder provided a callback for fullscreen state, | |
| 402 // then notify it now. | |
| 377 } | 403 } |
| 378 | 404 |
| 379 void WebMediaPlayerImpl::ExitedFullscreen() { | 405 void WebMediaPlayerImpl::ExitedFullscreen() { |
| 380 // If we're in overlay mode, then exit it unless we're supposed to be in | 406 // If we're in overlay mode, then exit it unless we're supposed to be in |
| 381 // overlay mode all the time. | 407 // overlay mode all the time. |
| 382 if (!force_video_overlays_ && overlay_enabled_) | 408 if (!force_video_overlays_ && overlay_enabled_) |
| 383 DisableOverlay(); | 409 DisableOverlay(); |
| 384 if (observer_) | 410 if (observer_) |
| 385 observer_->OnExitedFullscreen(); | 411 observer_->OnExitedFullscreen(); |
| 412 | |
| 413 // TODO(liberato): if the decoder provided a callback for fullscreen state, | |
| 414 // then notify it now. | |
| 386 } | 415 } |
| 387 | 416 |
| 388 void WebMediaPlayerImpl::BecameDominantVisibleContent(bool isDominant) { | 417 void WebMediaPlayerImpl::BecameDominantVisibleContent(bool isDominant) { |
| 389 if (observer_) | 418 if (observer_) |
| 390 observer_->OnBecameDominantVisibleContent(isDominant); | 419 observer_->OnBecameDominantVisibleContent(isDominant); |
| 391 } | 420 } |
| 392 | 421 |
| 393 void WebMediaPlayerImpl::SetIsEffectivelyFullscreen( | 422 void WebMediaPlayerImpl::SetIsEffectivelyFullscreen( |
| 394 bool isEffectivelyFullscreen) { | 423 bool isEffectivelyFullscreen) { |
| 395 delegate_->SetIsEffectivelyFullscreen(delegate_id_, isEffectivelyFullscreen); | 424 delegate_->SetIsEffectivelyFullscreen(delegate_id_, isEffectivelyFullscreen); |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1435 if (rotated_size == old_size) | 1464 if (rotated_size == old_size) |
| 1436 return; | 1465 return; |
| 1437 | 1466 |
| 1438 pipeline_metadata_.natural_size = rotated_size; | 1467 pipeline_metadata_.natural_size = rotated_size; |
| 1439 | 1468 |
| 1440 // Re-create |watch_time_reporter_| if we didn't originally know the video | 1469 // Re-create |watch_time_reporter_| if we didn't originally know the video |
| 1441 // size or the previous size was too small for reporting. | 1470 // size or the previous size was too small for reporting. |
| 1442 if (!watch_time_reporter_->IsSizeLargeEnoughToReportWatchTime()) | 1471 if (!watch_time_reporter_->IsSizeLargeEnoughToReportWatchTime()) |
| 1443 CreateWatchTimeReporter(); | 1472 CreateWatchTimeReporter(); |
| 1444 | 1473 |
| 1445 if (overlay_enabled_ && surface_manager_) | 1474 if (overlay_enabled_ && surface_manager_ && |
| 1475 overlay_mode_ == OverlayMode::kUseContentVideoView) { | |
| 1446 surface_manager_->NaturalSizeChanged(rotated_size); | 1476 surface_manager_->NaturalSizeChanged(rotated_size); |
| 1477 } | |
| 1447 | 1478 |
| 1448 client_->SizeChanged(); | 1479 client_->SizeChanged(); |
| 1449 | 1480 |
| 1450 if (observer_) | 1481 if (observer_) |
| 1451 observer_->OnMetadataChanged(pipeline_metadata_); | 1482 observer_->OnMetadataChanged(pipeline_metadata_); |
| 1452 } | 1483 } |
| 1453 | 1484 |
| 1454 void WebMediaPlayerImpl::OnVideoOpacityChange(bool opaque) { | 1485 void WebMediaPlayerImpl::OnVideoOpacityChange(bool opaque) { |
| 1455 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1486 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1456 DCHECK_NE(ready_state_, WebMediaPlayer::kReadyStateHaveNothing); | 1487 DCHECK_NE(ready_state_, WebMediaPlayer::kReadyStateHaveNothing); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1676 network_state_ == WebMediaPlayer::kNetworkStateIdle) | 1707 network_state_ == WebMediaPlayer::kNetworkStateIdle) |
| 1677 SetNetworkState(WebMediaPlayer::kNetworkStateLoading); | 1708 SetNetworkState(WebMediaPlayer::kNetworkStateLoading); |
| 1678 if (ready_state_ == ReadyState::kReadyStateHaveFutureData && !is_downloading) | 1709 if (ready_state_ == ReadyState::kReadyStateHaveFutureData && !is_downloading) |
| 1679 SetReadyState(WebMediaPlayer::kReadyStateHaveEnoughData); | 1710 SetReadyState(WebMediaPlayer::kReadyStateHaveEnoughData); |
| 1680 media_log_->AddEvent( | 1711 media_log_->AddEvent( |
| 1681 media_log_->CreateBooleanEvent(MediaLogEvent::NETWORK_ACTIVITY_SET, | 1712 media_log_->CreateBooleanEvent(MediaLogEvent::NETWORK_ACTIVITY_SET, |
| 1682 "is_downloading_data", is_downloading)); | 1713 "is_downloading_data", is_downloading)); |
| 1683 } | 1714 } |
| 1684 | 1715 |
| 1685 void WebMediaPlayerImpl::OnSurfaceCreated(int surface_id) { | 1716 void WebMediaPlayerImpl::OnSurfaceCreated(int surface_id) { |
| 1717 DCHECK(overlay_mode_ == OverlayMode::kUseContentVideoView); | |
| 1686 overlay_surface_id_ = surface_id; | 1718 overlay_surface_id_ = surface_id; |
| 1687 if (!set_surface_cb_.is_null()) { | 1719 SendOverlayInfoToDecoder(); |
| 1688 // If restart is required, the callback is one-shot only. | |
| 1689 if (decoder_requires_restart_for_overlay_) | |
| 1690 base::ResetAndReturn(&set_surface_cb_).Run(surface_id); | |
| 1691 else | |
| 1692 set_surface_cb_.Run(surface_id); | |
| 1693 } | |
| 1694 } | 1720 } |
| 1695 | 1721 |
| 1696 void WebMediaPlayerImpl::OnSurfaceRequested( | 1722 void WebMediaPlayerImpl::OnOverlayRoutingToken( |
| 1723 const base::UnguessableToken& token) { | |
| 1724 DCHECK(overlay_mode_ == OverlayMode::kUseAndroidOverlay); | |
| 1725 overlay_routing_token_ = token; | |
| 1726 SendOverlayInfoToDecoder(); | |
| 1727 } | |
| 1728 | |
| 1729 void WebMediaPlayerImpl::OnOverlayInfoRequested( | |
| 1697 bool decoder_requires_restart_for_overlay, | 1730 bool decoder_requires_restart_for_overlay, |
| 1698 const SurfaceCreatedCB& set_surface_cb) { | 1731 const ProvideOverlayInfoCB& provide_overlay_info_cb) { |
| 1699 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1732 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1700 DCHECK(surface_manager_); | 1733 DCHECK(surface_manager_); |
| 1701 | 1734 |
| 1702 // A null callback indicates that the decoder is going away. | 1735 // A null callback indicates that the decoder is going away. |
| 1703 if (set_surface_cb.is_null()) { | 1736 if (provide_overlay_info_cb.is_null()) { |
| 1704 decoder_requires_restart_for_overlay_ = false; | 1737 decoder_requires_restart_for_overlay_ = false; |
| 1705 set_surface_cb_.Reset(); | 1738 provide_overlay_info_cb_.Reset(); |
| 1706 return; | 1739 return; |
| 1707 } | 1740 } |
| 1708 | 1741 |
| 1709 // If we get a surface request it means GpuVideoDecoder is initializing, so | 1742 // If we get a surface request it means GpuVideoDecoder is initializing, so |
| 1710 // until we get a null surface request, GVD is the active decoder. | 1743 // until we get a null surface request, GVD is the active decoder. |
| 1711 // | 1744 // |
| 1712 // If |decoder_requires_restart_for_overlay| is true, we must restart the | 1745 // If |decoder_requires_restart_for_overlay| is true, we must restart the |
| 1713 // pipeline for fullscreen transitions. The decoder is unable to switch | 1746 // pipeline for fullscreen transitions. The decoder is unable to switch |
| 1714 // surfaces otherwise. If false, we simply need to tell the decoder about the | 1747 // surfaces otherwise. If false, we simply need to tell the decoder about the |
| 1715 // new surface and it will handle things seamlessly. | 1748 // new surface and it will handle things seamlessly. |
| 1716 decoder_requires_restart_for_overlay_ = decoder_requires_restart_for_overlay; | 1749 decoder_requires_restart_for_overlay_ = decoder_requires_restart_for_overlay; |
| 1717 set_surface_cb_ = set_surface_cb; | 1750 provide_overlay_info_cb_ = provide_overlay_info_cb; |
| 1718 | 1751 |
| 1719 // If we're waiting for the surface to arrive, OnSurfaceCreated() will be | 1752 // If we're waiting for the surface to arrive, OnSurfaceCreated() will be |
| 1720 // called later when it arrives; so do nothing for now. | 1753 // called later when it arrives; so do nothing for now. For AndroidOverlay, |
| 1721 if (!overlay_surface_id_) | 1754 // if we're waiting for the token then... OnOverlayRoutingToken()... |
| 1755 // We do this so that a request for a surface will block if we're in the | |
| 1756 // process of getting one. Otherwise, on pre-M, the decoder would be stuck | |
| 1757 // without an overlay if the restart that happens on entering fullscreen | |
| 1758 // succeeds before we have the overlay info. Post-M, we could send what we | |
| 1759 // have unconditionally. When the info arrives, it will be sent. | |
| 1760 if (overlay_enabled_ && !HaveOverlayInfo()) | |
| 1722 return; | 1761 return; |
| 1723 | 1762 |
| 1724 OnSurfaceCreated(*overlay_surface_id_); | 1763 // Either overlays are not enabled, or they're enabled and we have info for |
| 1764 // them. Send it. | |
| 1765 SendOverlayInfoToDecoder(); | |
| 1766 } | |
| 1767 | |
| 1768 bool WebMediaPlayerImpl::HaveOverlayInfo() { | |
| 1769 if (overlay_mode_ == OverlayMode::kUseContentVideoView) | |
| 1770 return overlay_surface_id_.has_value(); | |
| 1771 else if (overlay_mode_ == OverlayMode::kUseAndroidOverlay) | |
| 1772 return !overlay_routing_token_.has_value(); | |
| 1773 | |
| 1774 return false; | |
| 1775 } | |
| 1776 | |
| 1777 void WebMediaPlayerImpl::SendOverlayInfoToDecoder() { | |
| 1778 if (provide_overlay_info_cb_.is_null()) | |
|
tguilbert
2017/05/08 23:10:29
NIT: remove is_null and add negation?
liberato (no reviews please)
2017/05/09 16:55:37
Done.
| |
| 1779 return; | |
| 1780 | |
| 1781 // Note that it's up to our caller to guarantee that the info we're sending | |
| 1782 // matches whether we want the client to use overlays. | |
| 1783 | |
| 1784 // Note that we're guaranteed that both |overlay_surface_id_| and | |
| 1785 // |overlay_routing_token_| have values, since both have values unless there | |
| 1786 // is a request pending. Nobody calls us if a request is pending. | |
| 1787 | |
| 1788 // Since we represent "no token" as a null UnguessableToken, we translate it | |
| 1789 // into an optional here. Alternatively, we could represent it as a | |
| 1790 // base::Optional in |overlay_routing_token_|, but then we'd have a | |
| 1791 // base::Optional<base::Optional<base::UnguessableToken> >. We don't do that | |
| 1792 // because... just because. | |
| 1793 base::Optional<base::UnguessableToken> routing_token; | |
| 1794 if (overlay_routing_token_.has_value() && !overlay_routing_token_->is_empty()) | |
| 1795 routing_token = *overlay_routing_token_; | |
| 1796 | |
| 1797 // If restart is required, the callback is one-shot only. | |
| 1798 if (decoder_requires_restart_for_overlay_) { | |
| 1799 base::ResetAndReturn(&provide_overlay_info_cb_) | |
| 1800 .Run(*overlay_surface_id_, routing_token); | |
| 1801 } else { | |
| 1802 provide_overlay_info_cb_.Run(*overlay_surface_id_, routing_token); | |
| 1803 } | |
| 1725 } | 1804 } |
| 1726 | 1805 |
| 1727 std::unique_ptr<Renderer> WebMediaPlayerImpl::CreateRenderer() { | 1806 std::unique_ptr<Renderer> WebMediaPlayerImpl::CreateRenderer() { |
| 1728 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1807 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1729 | 1808 |
| 1809 // TODO(liberato): Re-evaluate this as AndroidVideoSurfaceChooser gets smarter | |
| 1810 // about turning off overlays. Either we should verify that it is not | |
| 1811 // breaking this use-case if it does so, or we should notify it that using | |
| 1812 // the overlay is required. | |
| 1730 if (force_video_overlays_) | 1813 if (force_video_overlays_) |
| 1731 EnableOverlay(); | 1814 EnableOverlay(); |
| 1732 | 1815 |
| 1733 RequestSurfaceCB request_surface_cb; | 1816 RequestOverlayInfoCB request_overlay_info_cb; |
| 1734 #if defined(OS_ANDROID) | 1817 #if defined(OS_ANDROID) |
| 1735 request_surface_cb = BindToCurrentLoop( | 1818 request_overlay_info_cb = BindToCurrentLoop( |
| 1736 base::Bind(&WebMediaPlayerImpl::OnSurfaceRequested, AsWeakPtr())); | 1819 base::Bind(&WebMediaPlayerImpl::OnOverlayInfoRequested, AsWeakPtr())); |
| 1737 #endif | 1820 #endif |
| 1738 return renderer_factory_selector_->GetCurrentFactory()->CreateRenderer( | 1821 return renderer_factory_selector_->GetCurrentFactory()->CreateRenderer( |
| 1739 media_task_runner_, worker_task_runner_, audio_source_provider_.get(), | 1822 media_task_runner_, worker_task_runner_, audio_source_provider_.get(), |
| 1740 compositor_, request_surface_cb); | 1823 compositor_, request_overlay_info_cb); |
| 1741 } | 1824 } |
| 1742 | 1825 |
| 1743 void WebMediaPlayerImpl::StartPipeline() { | 1826 void WebMediaPlayerImpl::StartPipeline() { |
| 1744 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1827 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1745 | 1828 |
| 1746 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb = | 1829 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb = |
| 1747 BindToCurrentLoop(base::Bind( | 1830 BindToCurrentLoop(base::Bind( |
| 1748 &WebMediaPlayerImpl::OnEncryptedMediaInitData, AsWeakPtr())); | 1831 &WebMediaPlayerImpl::OnEncryptedMediaInitData, AsWeakPtr())); |
| 1749 | 1832 |
| 1750 if (renderer_factory_selector_->GetCurrentFactory() | 1833 if (renderer_factory_selector_->GetCurrentFactory() |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2421 } | 2504 } |
| 2422 | 2505 |
| 2423 #undef UMA_HISTOGRAM_VIDEO_HEIGHT | 2506 #undef UMA_HISTOGRAM_VIDEO_HEIGHT |
| 2424 | 2507 |
| 2425 void WebMediaPlayerImpl::SetTickClockForTest(base::TickClock* tick_clock) { | 2508 void WebMediaPlayerImpl::SetTickClockForTest(base::TickClock* tick_clock) { |
| 2426 tick_clock_.reset(tick_clock); | 2509 tick_clock_.reset(tick_clock); |
| 2427 buffered_data_source_host_.SetTickClockForTest(tick_clock); | 2510 buffered_data_source_host_.SetTickClockForTest(tick_clock); |
| 2428 } | 2511 } |
| 2429 | 2512 |
| 2430 } // namespace media | 2513 } // namespace media |
| OLD | NEW |