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

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

Issue 183113004: Make sure MediaStreamVideoSource support cropping. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Crop with origin 0,0 and temporary disable failing test. Created 6 years, 9 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 | Annotate | Revision Log
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_frame.h" 5 #include "media/base/video_frame.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 frame->data_[kYPlane] = y_data; 173 frame->data_[kYPlane] = y_data;
174 frame->data_[kUPlane] = u_data; 174 frame->data_[kUPlane] = u_data;
175 frame->data_[kVPlane] = v_data; 175 frame->data_[kVPlane] = v_data;
176 frame->no_longer_needed_cb_ = no_longer_needed_cb; 176 frame->no_longer_needed_cb_ = no_longer_needed_cb;
177 return frame; 177 return frame;
178 } 178 }
179 179
180 // static 180 // static
181 scoped_refptr<VideoFrame> VideoFrame::WrapVideoFrame( 181 scoped_refptr<VideoFrame> VideoFrame::WrapVideoFrame(
182 const scoped_refptr<VideoFrame>& frame, 182 const scoped_refptr<VideoFrame>& frame,
183 const gfx::Rect& visible_rect,
183 const base::Closure& no_longer_needed_cb) { 184 const base::Closure& no_longer_needed_cb) {
184 scoped_refptr<VideoFrame> wrapped_frame(new VideoFrame( 185 scoped_refptr<VideoFrame> wrapped_frame(new VideoFrame(
185 frame->format(), frame->coded_size(), frame->visible_rect(), 186 frame->format(), frame->coded_size(), visible_rect,
186 frame->natural_size(), frame->GetTimestamp(), frame->end_of_stream())); 187 frame->natural_size(), frame->GetTimestamp(), frame->end_of_stream()));
187 188
188 for (size_t i = 0; i < NumPlanes(frame->format()); ++i) { 189 for (size_t i = 0; i < NumPlanes(frame->format()); ++i) {
189 wrapped_frame->strides_[i] = frame->stride(i); 190 wrapped_frame->strides_[i] = frame->stride(i);
190 wrapped_frame->data_[i] = frame->data(i); 191 wrapped_frame->data_[i] = frame->data(i);
191 } 192 }
192 193
193 wrapped_frame->no_longer_needed_cb_ = no_longer_needed_cb; 194 wrapped_frame->no_longer_needed_cb_ = no_longer_needed_cb;
194 return wrapped_frame; 195 return wrapped_frame;
195 } 196 }
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 break; 501 break;
501 for (int row = 0; row < rows(plane); ++row) { 502 for (int row = 0; row < rows(plane); ++row) {
502 base::MD5Update(context, base::StringPiece( 503 base::MD5Update(context, base::StringPiece(
503 reinterpret_cast<char*>(data(plane) + stride(plane) * row), 504 reinterpret_cast<char*>(data(plane) + stride(plane) * row),
504 row_bytes(plane))); 505 row_bytes(plane)));
505 } 506 }
506 } 507 }
507 } 508 }
508 509
509 } // namespace media 510 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698