| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/base/video_util.h" | 5 #include "media/base/video_util.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 ptr += stride; | 137 ptr += stride; |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 void LetterboxYUV(VideoFrame* frame, const gfx::Rect& view_area) { | 141 void LetterboxYUV(VideoFrame* frame, const gfx::Rect& view_area) { |
| 142 DCHECK(!(view_area.x() & 1)); | 142 DCHECK(!(view_area.x() & 1)); |
| 143 DCHECK(!(view_area.y() & 1)); | 143 DCHECK(!(view_area.y() & 1)); |
| 144 DCHECK(!(view_area.width() & 1)); | 144 DCHECK(!(view_area.width() & 1)); |
| 145 DCHECK(!(view_area.height() & 1)); | 145 DCHECK(!(view_area.height() & 1)); |
| 146 DCHECK(frame->format() == VideoFrame::YV12 || | 146 DCHECK(frame->format() == VideoFrame::YV12 || |
| 147 frame->format() == VideoFrame::YV12J || |
| 147 frame->format() == VideoFrame::I420); | 148 frame->format() == VideoFrame::I420); |
| 148 LetterboxPlane(frame, VideoFrame::kYPlane, view_area, 0x00); | 149 LetterboxPlane(frame, VideoFrame::kYPlane, view_area, 0x00); |
| 149 gfx::Rect half_view_area(view_area.x() / 2, | 150 gfx::Rect half_view_area(view_area.x() / 2, |
| 150 view_area.y() / 2, | 151 view_area.y() / 2, |
| 151 view_area.width() / 2, | 152 view_area.width() / 2, |
| 152 view_area.height() / 2); | 153 view_area.height() / 2); |
| 153 LetterboxPlane(frame, VideoFrame::kUPlane, half_view_area, 0x80); | 154 LetterboxPlane(frame, VideoFrame::kUPlane, half_view_area, 0x80); |
| 154 LetterboxPlane(frame, VideoFrame::kVPlane, half_view_area, 0x80); | 155 LetterboxPlane(frame, VideoFrame::kVPlane, half_view_area, 0x80); |
| 155 } | 156 } |
| 156 | 157 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 frame->data(kU) + uv_offset, | 300 frame->data(kU) + uv_offset, |
| 300 frame->data(kV) + uv_offset, | 301 frame->data(kV) + uv_offset, |
| 301 region_in_frame.width(), | 302 region_in_frame.width(), |
| 302 region_in_frame.height(), | 303 region_in_frame.height(), |
| 303 stride, | 304 stride, |
| 304 frame->stride(kY), | 305 frame->stride(kY), |
| 305 uv_stride); | 306 uv_stride); |
| 306 } | 307 } |
| 307 | 308 |
| 308 } // namespace media | 309 } // namespace media |
| OLD | NEW |