| 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 "cc/resources/video_resource_updater.h" | 5 #include "cc/resources/video_resource_updater.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "cc/output/gl_renderer.h" | 8 #include "cc/output/gl_renderer.h" |
| 9 #include "cc/resources/resource_provider.h" | 9 #include "cc/resources/resource_provider.h" |
| 10 #include "gpu/GLES2/gl2extchromium.h" | 10 #include "gpu/GLES2/gl2extchromium.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 case media::VideoFrame::I420: | 82 case media::VideoFrame::I420: |
| 83 break; | 83 break; |
| 84 } | 84 } |
| 85 return false; | 85 return false; |
| 86 } | 86 } |
| 87 | 87 |
| 88 // For frames that we receive in software format, determine the dimensions of | 88 // For frames that we receive in software format, determine the dimensions of |
| 89 // each plane in the frame. | 89 // each plane in the frame. |
| 90 static gfx::Size SoftwarePlaneDimension( | 90 static gfx::Size SoftwarePlaneDimension( |
| 91 media::VideoFrame::Format input_frame_format, | 91 media::VideoFrame::Format input_frame_format, |
| 92 gfx::Size coded_size, | 92 const gfx::Size& coded_size, |
| 93 ResourceFormat output_resource_format, | 93 ResourceFormat output_resource_format, |
| 94 int plane_index) { | 94 int plane_index) { |
| 95 if (output_resource_format == kYUVResourceFormat) { | 95 if (output_resource_format == kYUVResourceFormat) { |
| 96 if (plane_index == media::VideoFrame::kYPlane || | 96 if (plane_index == media::VideoFrame::kYPlane || |
| 97 plane_index == media::VideoFrame::kAPlane) | 97 plane_index == media::VideoFrame::kAPlane) |
| 98 return coded_size; | 98 return coded_size; |
| 99 | 99 |
| 100 switch (input_frame_format) { | 100 switch (input_frame_format) { |
| 101 case media::VideoFrame::YV12: | 101 case media::VideoFrame::YV12: |
| 102 case media::VideoFrame::YV12A: | 102 case media::VideoFrame::YV12A: |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 } | 399 } |
| 400 | 400 |
| 401 PlaneResource recycled_resource(data.resource_id, | 401 PlaneResource recycled_resource(data.resource_id, |
| 402 data.resource_size, | 402 data.resource_size, |
| 403 data.resource_format, | 403 data.resource_format, |
| 404 data.mailbox); | 404 data.mailbox); |
| 405 updater->recycled_resources_.push_back(recycled_resource); | 405 updater->recycled_resources_.push_back(recycled_resource); |
| 406 } | 406 } |
| 407 | 407 |
| 408 } // namespace cc | 408 } // namespace cc |
| OLD | NEW |