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 "content/renderer/media/webmediaplayer_ms.h" | 5 #include "content/renderer/media/webmediaplayer_ms.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 450 |
451 void WebMediaPlayerMS::SetVideoFrameProviderClient( | 451 void WebMediaPlayerMS::SetVideoFrameProviderClient( |
452 cc::VideoFrameProvider::Client* client) { | 452 cc::VideoFrameProvider::Client* client) { |
453 // This is called from both the main renderer thread and the compositor | 453 // This is called from both the main renderer thread and the compositor |
454 // thread (when the main thread is blocked). | 454 // thread (when the main thread is blocked). |
455 if (video_frame_provider_client_) | 455 if (video_frame_provider_client_) |
456 video_frame_provider_client_->StopUsingProvider(); | 456 video_frame_provider_client_->StopUsingProvider(); |
457 video_frame_provider_client_ = client; | 457 video_frame_provider_client_ = client; |
458 } | 458 } |
459 | 459 |
| 460 bool WebMediaPlayerMS::Render(base::TimeTicks deadline_min, |
| 461 base::TimeTicks deadline_max) { |
| 462 // TODO(dalecurtis): This should make use of the deadline interval to ensure |
| 463 // the painted frame is correct for the given interval. |
| 464 NOTREACHED(); |
| 465 return false; |
| 466 } |
| 467 |
460 scoped_refptr<media::VideoFrame> WebMediaPlayerMS::GetCurrentFrame() { | 468 scoped_refptr<media::VideoFrame> WebMediaPlayerMS::GetCurrentFrame() { |
461 DVLOG(3) << "WebMediaPlayerMS::GetCurrentFrame"; | 469 DVLOG(3) << "WebMediaPlayerMS::GetCurrentFrame"; |
462 base::AutoLock auto_lock(current_frame_lock_); | 470 base::AutoLock auto_lock(current_frame_lock_); |
463 DCHECK(!pending_repaint_); | 471 DCHECK(!pending_repaint_); |
464 if (!current_frame_.get()) | 472 if (!current_frame_.get()) |
465 return NULL; | 473 return NULL; |
466 pending_repaint_ = true; | 474 pending_repaint_ = true; |
467 current_frame_used_ = true; | 475 current_frame_used_ = true; |
468 return current_frame_; | 476 return current_frame_; |
469 } | 477 } |
470 | 478 |
471 void WebMediaPlayerMS::PutCurrentFrame( | 479 void WebMediaPlayerMS::PutCurrentFrame() { |
472 const scoped_refptr<media::VideoFrame>& frame) { | |
473 DVLOG(3) << "WebMediaPlayerMS::PutCurrentFrame"; | 480 DVLOG(3) << "WebMediaPlayerMS::PutCurrentFrame"; |
474 DCHECK(pending_repaint_); | 481 DCHECK(pending_repaint_); |
475 pending_repaint_ = false; | 482 pending_repaint_ = false; |
476 } | 483 } |
477 | 484 |
| 485 void WebMediaPlayerMS::SetVisible(bool visible) { |
| 486 } |
| 487 |
478 void WebMediaPlayerMS::OnFrameAvailable( | 488 void WebMediaPlayerMS::OnFrameAvailable( |
479 const scoped_refptr<media::VideoFrame>& frame) { | 489 const scoped_refptr<media::VideoFrame>& frame) { |
480 DVLOG(3) << "WebMediaPlayerMS::OnFrameAvailable"; | 490 DVLOG(3) << "WebMediaPlayerMS::OnFrameAvailable"; |
481 DCHECK(thread_checker_.CalledOnValidThread()); | 491 DCHECK(thread_checker_.CalledOnValidThread()); |
482 ++total_frame_count_; | 492 ++total_frame_count_; |
483 if (!received_first_frame_) { | 493 if (!received_first_frame_) { |
484 received_first_frame_ = true; | 494 received_first_frame_ = true; |
485 { | 495 { |
486 base::AutoLock auto_lock(current_frame_lock_); | 496 base::AutoLock auto_lock(current_frame_lock_); |
487 DCHECK(!current_frame_used_); | 497 DCHECK(!current_frame_used_); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 GetClient()->readyStateChanged(); | 558 GetClient()->readyStateChanged(); |
549 } | 559 } |
550 | 560 |
551 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { | 561 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { |
552 DCHECK(thread_checker_.CalledOnValidThread()); | 562 DCHECK(thread_checker_.CalledOnValidThread()); |
553 DCHECK(client_); | 563 DCHECK(client_); |
554 return client_; | 564 return client_; |
555 } | 565 } |
556 | 566 |
557 } // namespace content | 567 } // namespace content |
OLD | NEW |