| 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 23 matching lines...) Expand all Loading... |
| 34 using blink::WebRect; | 34 using blink::WebRect; |
| 35 using blink::WebSize; | 35 using blink::WebSize; |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 // This function copies a YV12 or NATIVE_TEXTURE to a new YV12 | 39 // This function copies a YV12 or NATIVE_TEXTURE to a new YV12 |
| 40 // media::VideoFrame. | 40 // media::VideoFrame. |
| 41 scoped_refptr<media::VideoFrame> CopyFrameToYV12( | 41 scoped_refptr<media::VideoFrame> CopyFrameToYV12( |
| 42 const scoped_refptr<media::VideoFrame>& frame) { | 42 const scoped_refptr<media::VideoFrame>& frame) { |
| 43 DCHECK(frame->format() == media::VideoFrame::YV12 || | 43 DCHECK(frame->format() == media::VideoFrame::YV12 || |
| 44 frame->format() == media::VideoFrame::I420 || |
| 44 frame->format() == media::VideoFrame::NATIVE_TEXTURE); | 45 frame->format() == media::VideoFrame::NATIVE_TEXTURE); |
| 45 scoped_refptr<media::VideoFrame> new_frame = | 46 scoped_refptr<media::VideoFrame> new_frame = |
| 46 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, | 47 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, |
| 47 frame->coded_size(), | 48 frame->coded_size(), |
| 48 frame->visible_rect(), | 49 frame->visible_rect(), |
| 49 frame->natural_size(), | 50 frame->natural_size(), |
| 50 frame->GetTimestamp()); | 51 frame->GetTimestamp()); |
| 51 | 52 |
| 52 if (frame->format() == media::VideoFrame::NATIVE_TEXTURE) { | 53 if (frame->format() == media::VideoFrame::NATIVE_TEXTURE) { |
| 53 SkBitmap bitmap; | 54 SkBitmap bitmap; |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 GetClient()->readyStateChanged(); | 474 GetClient()->readyStateChanged(); |
| 474 } | 475 } |
| 475 | 476 |
| 476 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { | 477 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { |
| 477 DCHECK(thread_checker_.CalledOnValidThread()); | 478 DCHECK(thread_checker_.CalledOnValidThread()); |
| 478 DCHECK(client_); | 479 DCHECK(client_); |
| 479 return client_; | 480 return client_; |
| 480 } | 481 } |
| 481 | 482 |
| 482 } // namespace content | 483 } // namespace content |
| OLD | NEW |