| 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_impl.h" | 5 #include "content/renderer/media/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 | 473 |
| 474 double WebMediaPlayerImpl::duration() const { | 474 double WebMediaPlayerImpl::duration() const { |
| 475 DCHECK(main_loop_->BelongsToCurrentThread()); | 475 DCHECK(main_loop_->BelongsToCurrentThread()); |
| 476 | 476 |
| 477 if (ready_state_ == WebMediaPlayer::ReadyStateHaveNothing) | 477 if (ready_state_ == WebMediaPlayer::ReadyStateHaveNothing) |
| 478 return std::numeric_limits<double>::quiet_NaN(); | 478 return std::numeric_limits<double>::quiet_NaN(); |
| 479 | 479 |
| 480 return GetPipelineDuration(); | 480 return GetPipelineDuration(); |
| 481 } | 481 } |
| 482 | 482 |
| 483 double WebMediaPlayerImpl::timelineOffset() const { |
| 484 DCHECK(main_loop_->BelongsToCurrentThread()); |
| 485 |
| 486 if (pipeline_metadata_.timeline_offset.is_null()) |
| 487 return std::numeric_limits<double>::quiet_NaN(); |
| 488 |
| 489 return pipeline_metadata_.timeline_offset.ToJsTime(); |
| 490 } |
| 491 |
| 483 double WebMediaPlayerImpl::currentTime() const { | 492 double WebMediaPlayerImpl::currentTime() const { |
| 484 DCHECK(main_loop_->BelongsToCurrentThread()); | 493 DCHECK(main_loop_->BelongsToCurrentThread()); |
| 485 return (paused_ ? paused_time_ : pipeline_.GetMediaTime()).InSecondsF(); | 494 return (paused_ ? paused_time_ : pipeline_.GetMediaTime()).InSecondsF(); |
| 486 } | 495 } |
| 487 | 496 |
| 488 WebMediaPlayer::NetworkState WebMediaPlayerImpl::networkState() const { | 497 WebMediaPlayer::NetworkState WebMediaPlayerImpl::networkState() const { |
| 489 DCHECK(main_loop_->BelongsToCurrentThread()); | 498 DCHECK(main_loop_->BelongsToCurrentThread()); |
| 490 return network_state_; | 499 return network_state_; |
| 491 } | 500 } |
| 492 | 501 |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 | 1334 |
| 1326 if (web_cdm_) { | 1335 if (web_cdm_) { |
| 1327 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); | 1336 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); |
| 1328 return; | 1337 return; |
| 1329 } | 1338 } |
| 1330 | 1339 |
| 1331 decryptor_ready_cb_ = decryptor_ready_cb; | 1340 decryptor_ready_cb_ = decryptor_ready_cb; |
| 1332 } | 1341 } |
| 1333 | 1342 |
| 1334 } // namespace content | 1343 } // namespace content |
| OLD | NEW |