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 | 10 |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 demuxer_.reset(new FFmpegDemuxer(media_task_runner_, data_source_.get(), | 882 demuxer_.reset(new FFmpegDemuxer(media_task_runner_, data_source_.get(), |
883 encrypted_media_init_data_cb, media_log_)); | 883 encrypted_media_init_data_cb, media_log_)); |
884 } else { | 884 } else { |
885 DCHECK(!chunk_demuxer_); | 885 DCHECK(!chunk_demuxer_); |
886 DCHECK(!data_source_); | 886 DCHECK(!data_source_); |
887 | 887 |
888 mse_log_cb = base::Bind(&MediaLog::AddLogEvent, media_log_); | 888 mse_log_cb = base::Bind(&MediaLog::AddLogEvent, media_log_); |
889 | 889 |
890 chunk_demuxer_ = new ChunkDemuxer( | 890 chunk_demuxer_ = new ChunkDemuxer( |
891 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnDemuxerOpened), | 891 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnDemuxerOpened), |
892 encrypted_media_init_data_cb, mse_log_cb, media_log_, true); | 892 encrypted_media_init_data_cb, mse_log_cb, |
| 893 base::Bind(&Pipeline::GetMediaTime, base::Unretained(&pipeline_)), |
| 894 media_log_, true); |
893 demuxer_.reset(chunk_demuxer_); | 895 demuxer_.reset(chunk_demuxer_); |
894 } | 896 } |
895 | 897 |
896 // ... and we're ready to go! | 898 // ... and we're ready to go! |
897 seeking_ = true; | 899 seeking_ = true; |
898 | 900 |
899 pipeline_.Start( | 901 pipeline_.Start( |
900 demuxer_.get(), | 902 demuxer_.get(), |
901 renderer_factory_->CreateRenderer( | 903 renderer_factory_->CreateRenderer( |
902 media_task_runner_, audio_source_provider_.get(), compositor_), | 904 media_task_runner_, audio_source_provider_.get(), compositor_), |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 | 1010 |
1009 // pause() may be called after playback has ended and the HTMLMediaElement | 1011 // pause() may be called after playback has ended and the HTMLMediaElement |
1010 // requires that currentTime() == duration() after ending. We want to ensure | 1012 // requires that currentTime() == duration() after ending. We want to ensure |
1011 // |paused_time_| matches currentTime() in this case or a future seek() may | 1013 // |paused_time_| matches currentTime() in this case or a future seek() may |
1012 // incorrectly discard what it thinks is a seek to the existing time. | 1014 // incorrectly discard what it thinks is a seek to the existing time. |
1013 paused_time_ = | 1015 paused_time_ = |
1014 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); | 1016 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); |
1015 } | 1017 } |
1016 | 1018 |
1017 } // namespace media | 1019 } // namespace media |
OLD | NEW |