| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 #if defined(GOOGLE_TV) | 73 #if defined(GOOGLE_TV) |
| 74 case media::VideoFrame::HOLE: | 74 case media::VideoFrame::HOLE: |
| 75 #endif | 75 #endif |
| 76 return true; | 76 return true; |
| 77 | 77 |
| 78 // Unacceptable inputs. ¯\(°_o)/¯ | 78 // Unacceptable inputs. ¯\(°_o)/¯ |
| 79 case media::VideoFrame::INVALID: | 79 case media::VideoFrame::INVALID: |
| 80 case media::VideoFrame::RGB32: | 80 case media::VideoFrame::RGB32: |
| 81 case media::VideoFrame::EMPTY: | 81 case media::VideoFrame::EMPTY: |
| 82 case media::VideoFrame::I420: | 82 case media::VideoFrame::I420: |
| 83 case media::VideoFrame::FORMAT_HISTOGRAM_MAX: |
| 83 break; | 84 break; |
| 84 } | 85 } |
| 85 return false; | 86 return false; |
| 86 } | 87 } |
| 87 | 88 |
| 88 // For frames that we receive in software format, determine the dimensions of | 89 // For frames that we receive in software format, determine the dimensions of |
| 89 // each plane in the frame. | 90 // each plane in the frame. |
| 90 static gfx::Size SoftwarePlaneDimension( | 91 static gfx::Size SoftwarePlaneDimension( |
| 91 media::VideoFrame::Format input_frame_format, | 92 media::VideoFrame::Format input_frame_format, |
| 92 gfx::Size coded_size, | 93 gfx::Size coded_size, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 105 return gfx::ToFlooredSize(gfx::ScaleSize(coded_size, 0.5f, 1.f)); | 106 return gfx::ToFlooredSize(gfx::ScaleSize(coded_size, 0.5f, 1.f)); |
| 106 | 107 |
| 107 case media::VideoFrame::INVALID: | 108 case media::VideoFrame::INVALID: |
| 108 case media::VideoFrame::RGB32: | 109 case media::VideoFrame::RGB32: |
| 109 case media::VideoFrame::EMPTY: | 110 case media::VideoFrame::EMPTY: |
| 110 case media::VideoFrame::I420: | 111 case media::VideoFrame::I420: |
| 111 case media::VideoFrame::NATIVE_TEXTURE: | 112 case media::VideoFrame::NATIVE_TEXTURE: |
| 112 #if defined(GOOGLE_TV) | 113 #if defined(GOOGLE_TV) |
| 113 case media::VideoFrame::HOLE: | 114 case media::VideoFrame::HOLE: |
| 114 #endif | 115 #endif |
| 116 case media::VideoFrame::FORMAT_HISTOGRAM_MAX: |
| 115 NOTREACHED(); | 117 NOTREACHED(); |
| 116 } | 118 } |
| 117 } | 119 } |
| 118 | 120 |
| 119 DCHECK_EQ(output_resource_format, kRGBResourceFormat); | 121 DCHECK_EQ(output_resource_format, kRGBResourceFormat); |
| 120 return coded_size; | 122 return coded_size; |
| 121 } | 123 } |
| 122 | 124 |
| 123 VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes( | 125 VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes( |
| 124 const scoped_refptr<media::VideoFrame>& video_frame) { | 126 const scoped_refptr<media::VideoFrame>& video_frame) { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 } | 402 } |
| 401 | 403 |
| 402 PlaneResource recycled_resource(data.resource_id, | 404 PlaneResource recycled_resource(data.resource_id, |
| 403 data.resource_size, | 405 data.resource_size, |
| 404 data.resource_format, | 406 data.resource_format, |
| 405 data.mailbox); | 407 data.mailbox); |
| 406 updater->recycled_resources_.push_back(recycled_resource); | 408 updater->recycled_resources_.push_back(recycled_resource); |
| 407 } | 409 } |
| 408 | 410 |
| 409 } // namespace cc | 411 } // namespace cc |
| OLD | NEW |