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