OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 dst->video_frame_buffer()->StrideY(), | 141 dst->video_frame_buffer()->StrideY(), |
142 dst->video_frame_buffer()->StrideU(), | 142 dst->video_frame_buffer()->StrideU(), |
143 dst->video_frame_buffer()->StrideV(), | 143 dst->video_frame_buffer()->StrideV(), |
144 dst->width(), dst->height(), | 144 dst->width(), dst->height(), |
145 interpolate, vert_crop); | 145 interpolate, vert_crop); |
146 dst->SetTimeStamp(GetTimeStamp()); | 146 dst->SetTimeStamp(GetTimeStamp()); |
147 // Stretched frame should have the same rotation as the source. | 147 // Stretched frame should have the same rotation as the source. |
148 dst->set_rotation(rotation()); | 148 dst->set_rotation(rotation()); |
149 } | 149 } |
150 | 150 |
| 151 bool VideoFrame::SetToBlack() { |
| 152 return libyuv::I420Rect(video_frame_buffer()->MutableDataY(), |
| 153 video_frame_buffer()->StrideY(), |
| 154 video_frame_buffer()->MutableDataU(), |
| 155 video_frame_buffer()->StrideU(), |
| 156 video_frame_buffer()->MutableDataV(), |
| 157 video_frame_buffer()->StrideV(), |
| 158 0, 0, |
| 159 width(), height(), |
| 160 16, 128, 128) == 0; |
| 161 } |
| 162 |
151 static const size_t kMaxSampleSize = 1000000000u; | 163 static const size_t kMaxSampleSize = 1000000000u; |
152 // Returns whether a sample is valid. | 164 // Returns whether a sample is valid. |
153 bool VideoFrame::Validate(uint32_t fourcc, | 165 bool VideoFrame::Validate(uint32_t fourcc, |
154 int w, | 166 int w, |
155 int h, | 167 int h, |
156 const uint8_t* sample, | 168 const uint8_t* sample, |
157 size_t sample_size) { | 169 size_t sample_size) { |
158 if (h < 0) { | 170 if (h < 0) { |
159 h = -h; | 171 h = -h; |
160 } | 172 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 << " expected: " << expected_size | 303 << " expected: " << expected_size |
292 << " sample[0..3]: " << static_cast<int>(four_samples[0]) | 304 << " sample[0..3]: " << static_cast<int>(four_samples[0]) |
293 << ", " << static_cast<int>(four_samples[1]) | 305 << ", " << static_cast<int>(four_samples[1]) |
294 << ", " << static_cast<int>(four_samples[2]) | 306 << ", " << static_cast<int>(four_samples[2]) |
295 << ", " << static_cast<int>(four_samples[3]); | 307 << ", " << static_cast<int>(four_samples[3]); |
296 } | 308 } |
297 return true; | 309 return true; |
298 } | 310 } |
299 | 311 |
300 } // namespace cricket | 312 } // namespace cricket |
OLD | NEW |