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() const { | 181 size_t WebMediaPlayerMSCompositor::total_frame_count() { |
| 182 base::AutoLock auto_lock(current_frame_lock_); |
182 DVLOG(1) << __func__ << ", " << total_frame_count_; | 183 DVLOG(1) << __func__ << ", " << total_frame_count_; |
183 DCHECK(thread_checker_.CalledOnValidThread()); | 184 DCHECK(thread_checker_.CalledOnValidThread()); |
184 return total_frame_count_; | 185 return total_frame_count_; |
185 } | 186 } |
186 | 187 |
187 size_t WebMediaPlayerMSCompositor::dropped_frame_count() const { | 188 size_t WebMediaPlayerMSCompositor::dropped_frame_count() { |
| 189 base::AutoLock auto_lock(current_frame_lock_); |
188 DVLOG(1) << __func__ << ", " << dropped_frame_count_; | 190 DVLOG(1) << __func__ << ", " << dropped_frame_count_; |
189 DCHECK(thread_checker_.CalledOnValidThread()); | 191 DCHECK(thread_checker_.CalledOnValidThread()); |
190 return dropped_frame_count_; | 192 return dropped_frame_count_; |
191 } | 193 } |
192 | 194 |
193 void WebMediaPlayerMSCompositor::SetVideoFrameProviderClient( | 195 void WebMediaPlayerMSCompositor::SetVideoFrameProviderClient( |
194 cc::VideoFrameProvider::Client* client) { | 196 cc::VideoFrameProvider::Client* client) { |
195 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 197 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
196 if (video_frame_provider_client_) | 198 if (video_frame_provider_client_) |
197 video_frame_provider_client_->StopUsingProvider(); | 199 video_frame_provider_client_->StopUsingProvider(); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 } | 454 } |
453 | 455 |
454 if (!rendering_frame_buffer_) { | 456 if (!rendering_frame_buffer_) { |
455 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( | 457 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( |
456 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, | 458 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, |
457 base::Unretained(this)))); | 459 base::Unretained(this)))); |
458 } | 460 } |
459 } | 461 } |
460 | 462 |
461 } // namespace content | 463 } // namespace content |
OLD | NEW |