Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(755)

Side by Side Diff: media/base/video_util.cc

Issue 22645005: media::VideoFrame::WrapExternalSharedMemory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: 87b7a18a Rebase, added TODO Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/video_frame.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 memset(ptr, fill_byte, row_bytes); 136 memset(ptr, fill_byte, row_bytes);
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_EQ(frame->format(), VideoFrame::YV12); 146 DCHECK(frame->format() == VideoFrame::YV12 ||
147 frame->format() == VideoFrame::I420);
147 LetterboxPlane(frame, VideoFrame::kYPlane, view_area, 0x00); 148 LetterboxPlane(frame, VideoFrame::kYPlane, view_area, 0x00);
148 gfx::Rect half_view_area(view_area.x() / 2, 149 gfx::Rect half_view_area(view_area.x() / 2,
149 view_area.y() / 2, 150 view_area.y() / 2,
150 view_area.width() / 2, 151 view_area.width() / 2,
151 view_area.height() / 2); 152 view_area.height() / 2);
152 LetterboxPlane(frame, VideoFrame::kUPlane, half_view_area, 0x80); 153 LetterboxPlane(frame, VideoFrame::kUPlane, half_view_area, 0x80);
153 LetterboxPlane(frame, VideoFrame::kVPlane, half_view_area, 0x80); 154 LetterboxPlane(frame, VideoFrame::kVPlane, half_view_area, 0x80);
154 } 155 }
155 156
156 void RotatePlaneByPixels( 157 void RotatePlaneByPixels(
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 frame->data(kU) + uv_offset, 299 frame->data(kU) + uv_offset,
299 frame->data(kV) + uv_offset, 300 frame->data(kV) + uv_offset,
300 region_in_frame.width(), 301 region_in_frame.width(),
301 region_in_frame.height(), 302 region_in_frame.height(),
302 stride, 303 stride,
303 frame->stride(kY), 304 frame->stride(kY),
304 uv_stride); 305 uv_stride);
305 } 306 }
306 307
307 } // namespace media 308 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698