| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 // static | 120 // static |
| 121 scoped_refptr<VideoFrame> VideoFrame::CreateColorFrame( | 121 scoped_refptr<VideoFrame> VideoFrame::CreateColorFrame( |
| 122 const gfx::Size& size, | 122 const gfx::Size& size, |
| 123 uint8 y, uint8 u, uint8 v, | 123 uint8 y, uint8 u, uint8 v, |
| 124 base::TimeDelta timestamp) { | 124 base::TimeDelta timestamp) { |
| 125 DCHECK(IsValidConfig(VideoFrame::YV12, size, gfx::Rect(size), size)); | 125 DCHECK(IsValidConfig(VideoFrame::YV12, size, gfx::Rect(size), size)); |
| 126 scoped_refptr<VideoFrame> frame = VideoFrame::CreateFrame( | 126 scoped_refptr<VideoFrame> frame = VideoFrame::CreateFrame( |
| 127 VideoFrame::YV12, size, gfx::Rect(size), size, timestamp); | 127 VideoFrame::YV12, size, gfx::Rect(size), size, timestamp); |
| 128 FillYUV(frame, y, u, v); | 128 FillYUV(frame.get(), y, u, v); |
| 129 return frame; | 129 return frame; |
| 130 } | 130 } |
| 131 | 131 |
| 132 // static | 132 // static |
| 133 scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(const gfx::Size& size) { | 133 scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(const gfx::Size& size) { |
| 134 const uint8 kBlackY = 0x00; | 134 const uint8 kBlackY = 0x00; |
| 135 const uint8 kBlackUV = 0x80; | 135 const uint8 kBlackUV = 0x80; |
| 136 const base::TimeDelta kZero; | 136 const base::TimeDelta kZero; |
| 137 return CreateColorFrame(size, kBlackY, kBlackUV, kBlackUV, kZero); | 137 return CreateColorFrame(size, kBlackY, kBlackUV, kBlackUV, kZero); |
| 138 } | 138 } |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 break; | 360 break; |
| 361 for (int row = 0; row < rows(plane); ++row) { | 361 for (int row = 0; row < rows(plane); ++row) { |
| 362 base::MD5Update(context, base::StringPiece( | 362 base::MD5Update(context, base::StringPiece( |
| 363 reinterpret_cast<char*>(data(plane) + stride(plane) * row), | 363 reinterpret_cast<char*>(data(plane) + stride(plane) * row), |
| 364 row_bytes(plane))); | 364 row_bytes(plane))); |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 } | 367 } |
| 368 | 368 |
| 369 } // namespace media | 369 } // namespace media |
| OLD | NEW |