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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |