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 VideoFrame* VideoFrame::Stretch(size_t dst_width, size_t dst_height, | |
152 bool interpolate, bool vert_crop) const { | |
153 VideoFrame* dest = CreateEmptyFrame(static_cast<int>(dst_width), | |
154 static_cast<int>(dst_height), | |
155 GetTimeStamp()); | |
156 if (dest) { | |
157 StretchToFrame(dest, interpolate, vert_crop); | |
158 } | |
159 return dest; | |
160 } | |
161 | |
162 bool VideoFrame::SetToBlack() { | 151 bool VideoFrame::SetToBlack() { |
163 return libyuv::I420Rect(video_frame_buffer()->MutableDataY(), | 152 return libyuv::I420Rect(video_frame_buffer()->MutableDataY(), |
164 video_frame_buffer()->StrideY(), | 153 video_frame_buffer()->StrideY(), |
165 video_frame_buffer()->MutableDataU(), | 154 video_frame_buffer()->MutableDataU(), |
166 video_frame_buffer()->StrideU(), | 155 video_frame_buffer()->StrideU(), |
167 video_frame_buffer()->MutableDataV(), | 156 video_frame_buffer()->MutableDataV(), |
168 video_frame_buffer()->StrideV(), | 157 video_frame_buffer()->StrideV(), |
169 0, 0, | 158 0, 0, |
170 width(), height(), | 159 width(), height(), |
171 16, 128, 128) == 0; | 160 16, 128, 128) == 0; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 << " expected: " << expected_size | 303 << " expected: " << expected_size |
315 << " sample[0..3]: " << static_cast<int>(four_samples[0]) | 304 << " sample[0..3]: " << static_cast<int>(four_samples[0]) |
316 << ", " << static_cast<int>(four_samples[1]) | 305 << ", " << static_cast<int>(four_samples[1]) |
317 << ", " << static_cast<int>(four_samples[2]) | 306 << ", " << static_cast<int>(four_samples[2]) |
318 << ", " << static_cast<int>(four_samples[3]); | 307 << ", " << static_cast<int>(four_samples[3]); |
319 } | 308 } |
320 return true; | 309 return true; |
321 } | 310 } |
322 | 311 |
323 } // namespace cricket | 312 } // namespace cricket |
OLD | NEW |