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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 client_(client), | 126 client_(client), |
127 delegate_(delegate), | 127 delegate_(delegate), |
128 defer_load_cb_(params.defer_load_cb()), | 128 defer_load_cb_(params.defer_load_cb()), |
129 context_3d_cb_(params.context_3d_cb()), | 129 context_3d_cb_(params.context_3d_cb()), |
130 supports_save_(true), | 130 supports_save_(true), |
131 chunk_demuxer_(NULL), | 131 chunk_demuxer_(NULL), |
132 // Threaded compositing isn't enabled universally yet. | 132 // Threaded compositing isn't enabled universally yet. |
133 compositor_task_runner_( | 133 compositor_task_runner_( |
134 params.compositor_task_runner() | 134 params.compositor_task_runner() |
135 ? params.compositor_task_runner() | 135 ? params.compositor_task_runner() |
136 : base::MessageLoop::current()->task_runner()), | 136 : static_cast<scoped_refptr<base::SingleThreadTaskRunner>>( |
| 137 base::MessageLoop::current()->task_runner())), |
137 compositor_(new VideoFrameCompositor( | 138 compositor_(new VideoFrameCompositor( |
138 compositor_task_runner_, | 139 compositor_task_runner_, |
139 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnNaturalSizeChanged), | 140 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnNaturalSizeChanged), |
140 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnOpacityChanged))), | 141 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnOpacityChanged))), |
141 encrypted_media_support_(cdm_factory, | 142 encrypted_media_support_(cdm_factory, |
142 client, | 143 client, |
143 params.media_permission(), | 144 params.media_permission(), |
144 base::Bind(&WebMediaPlayerImpl::SetCdm, | 145 base::Bind(&WebMediaPlayerImpl::SetCdm, |
145 AsWeakPtr(), | 146 AsWeakPtr(), |
146 base::Bind(&IgnoreCdmAttached))), | 147 base::Bind(&IgnoreCdmAttached))), |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 | 1032 |
1032 // pause() may be called after playback has ended and the HTMLMediaElement | 1033 // pause() may be called after playback has ended and the HTMLMediaElement |
1033 // requires that currentTime() == duration() after ending. We want to ensure | 1034 // requires that currentTime() == duration() after ending. We want to ensure |
1034 // |paused_time_| matches currentTime() in this case or a future seek() may | 1035 // |paused_time_| matches currentTime() in this case or a future seek() may |
1035 // incorrectly discard what it thinks is a seek to the existing time. | 1036 // incorrectly discard what it thinks is a seek to the existing time. |
1036 paused_time_ = | 1037 paused_time_ = |
1037 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); | 1038 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); |
1038 } | 1039 } |
1039 | 1040 |
1040 } // namespace media | 1041 } // namespace media |
OLD | NEW |