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_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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 gfx::Rect& visible_rect, |
| 184 const gfx::Size& natural_size, |
184 const base::Closure& no_longer_needed_cb) { | 185 const base::Closure& no_longer_needed_cb) { |
185 DCHECK(frame->visible_rect().Contains(visible_rect)); | 186 DCHECK(frame->visible_rect().Contains(visible_rect)); |
186 scoped_refptr<VideoFrame> wrapped_frame(new VideoFrame( | 187 scoped_refptr<VideoFrame> wrapped_frame(new VideoFrame( |
187 frame->format(), frame->coded_size(), visible_rect, | 188 frame->format(), frame->coded_size(), visible_rect, natural_size, |
188 frame->natural_size(), frame->GetTimestamp(), frame->end_of_stream())); | 189 frame->GetTimestamp(), frame->end_of_stream())); |
189 | 190 |
190 for (size_t i = 0; i < NumPlanes(frame->format()); ++i) { | 191 for (size_t i = 0; i < NumPlanes(frame->format()); ++i) { |
191 wrapped_frame->strides_[i] = frame->stride(i); | 192 wrapped_frame->strides_[i] = frame->stride(i); |
192 wrapped_frame->data_[i] = frame->data(i); | 193 wrapped_frame->data_[i] = frame->data(i); |
193 } | 194 } |
194 | 195 |
195 wrapped_frame->no_longer_needed_cb_ = no_longer_needed_cb; | 196 wrapped_frame->no_longer_needed_cb_ = no_longer_needed_cb; |
196 return wrapped_frame; | 197 return wrapped_frame; |
197 } | 198 } |
198 | 199 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 break; | 503 break; |
503 for (int row = 0; row < rows(plane); ++row) { | 504 for (int row = 0; row < rows(plane); ++row) { |
504 base::MD5Update(context, base::StringPiece( | 505 base::MD5Update(context, base::StringPiece( |
505 reinterpret_cast<char*>(data(plane) + stride(plane) * row), | 506 reinterpret_cast<char*>(data(plane) + stride(plane) * row), |
506 row_bytes(plane))); | 507 row_bytes(plane))); |
507 } | 508 } |
508 } | 509 } |
509 } | 510 } |
510 | 511 |
511 } // namespace media | 512 } // namespace media |
OLD | NEW |