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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 return current_frame_ ? current_frame_->natural_size() : gfx::Size(); | 175 return current_frame_ ? current_frame_->natural_size() : gfx::Size(); |
176 } | 176 } |
177 | 177 |
178 base::TimeDelta WebMediaPlayerMSCompositor::GetCurrentTime() { | 178 base::TimeDelta WebMediaPlayerMSCompositor::GetCurrentTime() { |
179 DCHECK(thread_checker_.CalledOnValidThread()); | 179 DCHECK(thread_checker_.CalledOnValidThread()); |
180 base::AutoLock auto_lock(current_frame_lock_); | 180 base::AutoLock auto_lock(current_frame_lock_); |
181 return current_frame_.get() ? current_frame_->timestamp() : base::TimeDelta(); | 181 return current_frame_.get() ? current_frame_->timestamp() : base::TimeDelta(); |
182 } | 182 } |
183 | 183 |
184 size_t WebMediaPlayerMSCompositor::total_frame_count() const { | 184 size_t WebMediaPlayerMSCompositor::total_frame_count() const { |
185 DVLOG(1) << __FUNCTION__ << ", " << total_frame_count_; | 185 DVLOG(1) << __func__ << ", " << total_frame_count_; |
186 DCHECK(thread_checker_.CalledOnValidThread()); | 186 DCHECK(thread_checker_.CalledOnValidThread()); |
187 return total_frame_count_; | 187 return total_frame_count_; |
188 } | 188 } |
189 | 189 |
190 size_t WebMediaPlayerMSCompositor::dropped_frame_count() const { | 190 size_t WebMediaPlayerMSCompositor::dropped_frame_count() const { |
191 DVLOG(1) << __FUNCTION__ << ", " << dropped_frame_count_; | 191 DVLOG(1) << __func__ << ", " << dropped_frame_count_; |
192 DCHECK(thread_checker_.CalledOnValidThread()); | 192 DCHECK(thread_checker_.CalledOnValidThread()); |
193 return dropped_frame_count_; | 193 return dropped_frame_count_; |
194 } | 194 } |
195 | 195 |
196 void WebMediaPlayerMSCompositor::SetVideoFrameProviderClient( | 196 void WebMediaPlayerMSCompositor::SetVideoFrameProviderClient( |
197 cc::VideoFrameProvider::Client* client) { | 197 cc::VideoFrameProvider::Client* client) { |
198 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 198 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
199 if (video_frame_provider_client_) | 199 if (video_frame_provider_client_) |
200 video_frame_provider_client_->StopUsingProvider(); | 200 video_frame_provider_client_->StopUsingProvider(); |
201 | 201 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 return !current_frame_used_by_compositor_; | 293 return !current_frame_used_by_compositor_; |
294 } | 294 } |
295 | 295 |
296 bool WebMediaPlayerMSCompositor::HasCurrentFrame() { | 296 bool WebMediaPlayerMSCompositor::HasCurrentFrame() { |
297 base::AutoLock auto_lock(current_frame_lock_); | 297 base::AutoLock auto_lock(current_frame_lock_); |
298 return current_frame_.get() != nullptr; | 298 return current_frame_.get() != nullptr; |
299 } | 299 } |
300 | 300 |
301 scoped_refptr<media::VideoFrame> WebMediaPlayerMSCompositor::GetCurrentFrame() { | 301 scoped_refptr<media::VideoFrame> WebMediaPlayerMSCompositor::GetCurrentFrame() { |
302 DVLOG(3) << __FUNCTION__; | 302 DVLOG(3) << __func__; |
303 base::AutoLock auto_lock(current_frame_lock_); | 303 base::AutoLock auto_lock(current_frame_lock_); |
304 current_frame_used_by_compositor_ = true; | 304 current_frame_used_by_compositor_ = true; |
305 return current_frame_; | 305 return current_frame_; |
306 } | 306 } |
307 | 307 |
308 void WebMediaPlayerMSCompositor::PutCurrentFrame() { | 308 void WebMediaPlayerMSCompositor::PutCurrentFrame() { |
309 DVLOG(3) << __FUNCTION__; | 309 DVLOG(3) << __func__; |
310 } | 310 } |
311 | 311 |
312 scoped_refptr<media::VideoFrame> | 312 scoped_refptr<media::VideoFrame> |
313 WebMediaPlayerMSCompositor::GetCurrentFrameWithoutUpdatingStatistics() { | 313 WebMediaPlayerMSCompositor::GetCurrentFrameWithoutUpdatingStatistics() { |
314 DVLOG(3) << __FUNCTION__; | 314 DVLOG(3) << __func__; |
315 base::AutoLock auto_lock(current_frame_lock_); | 315 base::AutoLock auto_lock(current_frame_lock_); |
316 return current_frame_; | 316 return current_frame_; |
317 } | 317 } |
318 | 318 |
319 void WebMediaPlayerMSCompositor::StartRendering() { | 319 void WebMediaPlayerMSCompositor::StartRendering() { |
320 DCHECK(thread_checker_.CalledOnValidThread()); | 320 DCHECK(thread_checker_.CalledOnValidThread()); |
321 compositor_task_runner_->PostTask( | 321 compositor_task_runner_->PostTask( |
322 FROM_HERE, base::Bind(&WebMediaPlayerMSCompositor::StartRenderingInternal, | 322 FROM_HERE, base::Bind(&WebMediaPlayerMSCompositor::StartRenderingInternal, |
323 weak_ptr_factory_.GetWeakPtr())); | 323 weak_ptr_factory_.GetWeakPtr())); |
324 } | 324 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 } | 440 } |
441 | 441 |
442 if (!rendering_frame_buffer_) { | 442 if (!rendering_frame_buffer_) { |
443 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( | 443 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( |
444 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, | 444 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, |
445 base::Unretained(this)))); | 445 base::Unretained(this)))); |
446 } | 446 } |
447 } | 447 } |
448 | 448 |
449 } // namespace content | 449 } // namespace content |
OLD | NEW |