OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/video_frame_compositor.h" | 5 #include "content/renderer/media/video_frame_compositor.h" |
6 | 6 |
7 #include "media/base/video_frame.h" | 7 #include "media/base/video_frame.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
11 static bool IsOpaque(const scoped_refptr<media::VideoFrame>& frame) { | 11 static bool IsOpaque(const scoped_refptr<media::VideoFrame>& frame) { |
12 switch (frame->format()) { | 12 switch (frame->format()) { |
13 case media::VideoFrame::UNKNOWN: | 13 case media::VideoFrame::UNKNOWN: |
14 case media::VideoFrame::YV12: | 14 case media::VideoFrame::YV12: |
15 case media::VideoFrame::YV12J: | 15 case media::VideoFrame::YV12J: |
16 case media::VideoFrame::YV16: | 16 case media::VideoFrame::YV16: |
17 case media::VideoFrame::I420: | 17 case media::VideoFrame::I420: |
| 18 case media::VideoFrame::YV24: |
18 case media::VideoFrame::NV12: | 19 case media::VideoFrame::NV12: |
19 return true; | 20 return true; |
20 | 21 |
21 case media::VideoFrame::YV12A: | 22 case media::VideoFrame::YV12A: |
22 #if defined(VIDEO_HOLE) | 23 #if defined(VIDEO_HOLE) |
23 case media::VideoFrame::HOLE: | 24 case media::VideoFrame::HOLE: |
24 #endif // defined(VIDEO_HOLE) | 25 #endif // defined(VIDEO_HOLE) |
25 case media::VideoFrame::NATIVE_TEXTURE: | 26 case media::VideoFrame::NATIVE_TEXTURE: |
26 break; | 27 break; |
27 } | 28 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 opacity_changed_cb_.Run(IsOpaque(frame)); | 68 opacity_changed_cb_.Run(IsOpaque(frame)); |
68 } | 69 } |
69 | 70 |
70 current_frame_ = frame; | 71 current_frame_ = frame; |
71 | 72 |
72 if (client_) | 73 if (client_) |
73 client_->DidReceiveFrame(); | 74 client_->DidReceiveFrame(); |
74 } | 75 } |
75 | 76 |
76 } // namespace content | 77 } // namespace content |
OLD | NEW |