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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_piece.h" | 8 #include "base/string_piece.h" |
9 #include "media/base/limits.h" | 9 #include "media/base/limits.h" |
10 #include "media/base/video_util.h" | 10 #include "media/base/video_util.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 // static | 87 // static |
88 scoped_refptr<VideoFrame> VideoFrame::CreateColorFrame( | 88 scoped_refptr<VideoFrame> VideoFrame::CreateColorFrame( |
89 const gfx::Size& size, | 89 const gfx::Size& size, |
90 uint8 y, uint8 u, uint8 v, | 90 uint8 y, uint8 u, uint8 v, |
91 base::TimeDelta timestamp) { | 91 base::TimeDelta timestamp) { |
92 DCHECK(IsValidConfig(VideoFrame::YV12, size, size)); | 92 DCHECK(IsValidConfig(VideoFrame::YV12, size, size)); |
93 scoped_refptr<VideoFrame> frame = VideoFrame::CreateFrame( | 93 scoped_refptr<VideoFrame> frame = VideoFrame::CreateFrame( |
94 VideoFrame::YV12, size, size, timestamp); | 94 VideoFrame::YV12, size, size, timestamp); |
95 FillYUV(frame, y, u, v); | 95 FillYUV(frame.get(), y, u, v); |
96 return frame; | 96 return frame; |
97 } | 97 } |
98 | 98 |
99 // static | 99 // static |
100 scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(const gfx::Size& size) { | 100 scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(const gfx::Size& size) { |
101 const uint8 kBlackY = 0x00; | 101 const uint8 kBlackY = 0x00; |
102 const uint8 kBlackUV = 0x80; | 102 const uint8 kBlackUV = 0x80; |
103 const base::TimeDelta kZero; | 103 const base::TimeDelta kZero; |
104 return CreateColorFrame(size, kBlackY, kBlackUV, kBlackUV, kZero); | 104 return CreateColorFrame(size, kBlackY, kBlackUV, kBlackUV, kZero); |
105 } | 105 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 break; | 307 break; |
308 for(int row = 0; row < rows(plane); row++) { | 308 for(int row = 0; row < rows(plane); row++) { |
309 base::MD5Update(context, base::StringPiece( | 309 base::MD5Update(context, base::StringPiece( |
310 reinterpret_cast<char*>(data(plane) + stride(plane) * row), | 310 reinterpret_cast<char*>(data(plane) + stride(plane) * row), |
311 row_bytes(plane))); | 311 row_bytes(plane))); |
312 } | 312 } |
313 } | 313 } |
314 } | 314 } |
315 | 315 |
316 } // namespace media | 316 } // namespace media |
OLD | NEW |