OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ms_compositor.h" | 5 #include "content/renderer/media/webmediaplayer_ms_compositor.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 base::AutoLock auto_lock(current_frame_lock_); | 171 base::AutoLock auto_lock(current_frame_lock_); |
172 return current_frame_ ? current_frame_->natural_size() : gfx::Size(); | 172 return current_frame_ ? current_frame_->natural_size() : gfx::Size(); |
173 } | 173 } |
174 | 174 |
175 base::TimeDelta WebMediaPlayerMSCompositor::GetCurrentTime() { | 175 base::TimeDelta WebMediaPlayerMSCompositor::GetCurrentTime() { |
176 DCHECK(thread_checker_.CalledOnValidThread()); | 176 DCHECK(thread_checker_.CalledOnValidThread()); |
177 base::AutoLock auto_lock(current_frame_lock_); | 177 base::AutoLock auto_lock(current_frame_lock_); |
178 return current_frame_.get() ? current_frame_->timestamp() : base::TimeDelta(); | 178 return current_frame_.get() ? current_frame_->timestamp() : base::TimeDelta(); |
179 } | 179 } |
180 | 180 |
181 size_t WebMediaPlayerMSCompositor::total_frame_count() { | 181 size_t WebMediaPlayerMSCompositor::total_frame_count() const { |
182 base::AutoLock auto_lock(current_frame_lock_); | |
183 DVLOG(1) << __func__ << ", " << total_frame_count_; | 182 DVLOG(1) << __func__ << ", " << total_frame_count_; |
184 DCHECK(thread_checker_.CalledOnValidThread()); | 183 DCHECK(thread_checker_.CalledOnValidThread()); |
185 return total_frame_count_; | 184 return total_frame_count_; |
186 } | 185 } |
187 | 186 |
188 size_t WebMediaPlayerMSCompositor::dropped_frame_count() { | 187 size_t WebMediaPlayerMSCompositor::dropped_frame_count() const { |
189 base::AutoLock auto_lock(current_frame_lock_); | |
190 DVLOG(1) << __func__ << ", " << dropped_frame_count_; | 188 DVLOG(1) << __func__ << ", " << dropped_frame_count_; |
191 DCHECK(thread_checker_.CalledOnValidThread()); | 189 DCHECK(thread_checker_.CalledOnValidThread()); |
192 return dropped_frame_count_; | 190 return dropped_frame_count_; |
193 } | 191 } |
194 | 192 |
195 void WebMediaPlayerMSCompositor::SetVideoFrameProviderClient( | 193 void WebMediaPlayerMSCompositor::SetVideoFrameProviderClient( |
196 cc::VideoFrameProvider::Client* client) { | 194 cc::VideoFrameProvider::Client* client) { |
197 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 195 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
198 if (video_frame_provider_client_) | 196 if (video_frame_provider_client_) |
199 video_frame_provider_client_->StopUsingProvider(); | 197 video_frame_provider_client_->StopUsingProvider(); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 } | 452 } |
455 | 453 |
456 if (!rendering_frame_buffer_) { | 454 if (!rendering_frame_buffer_) { |
457 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( | 455 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( |
458 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, | 456 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, |
459 base::Unretained(this)))); | 457 base::Unretained(this)))); |
460 } | 458 } |
461 } | 459 } |
462 | 460 |
463 } // namespace content | 461 } // namespace content |
OLD | NEW |