OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 interpolate, vert_crop); | 213 interpolate, vert_crop); |
214 dst->SetTimeStamp(GetTimeStamp()); | 214 dst->SetTimeStamp(GetTimeStamp()); |
215 // Stretched frame should have the same rotation as the source. | 215 // Stretched frame should have the same rotation as the source. |
216 dst->SetRotation(GetVideoRotation()); | 216 dst->SetRotation(GetVideoRotation()); |
217 } | 217 } |
218 | 218 |
219 VideoFrame* VideoFrame::Stretch(size_t dst_width, size_t dst_height, | 219 VideoFrame* VideoFrame::Stretch(size_t dst_width, size_t dst_height, |
220 bool interpolate, bool vert_crop) const { | 220 bool interpolate, bool vert_crop) const { |
221 VideoFrame* dest = CreateEmptyFrame(static_cast<int>(dst_width), | 221 VideoFrame* dest = CreateEmptyFrame(static_cast<int>(dst_width), |
222 static_cast<int>(dst_height), | 222 static_cast<int>(dst_height), |
223 GetPixelWidth(), GetPixelHeight(), | |
224 GetTimeStamp()); | 223 GetTimeStamp()); |
225 if (dest) { | 224 if (dest) { |
226 StretchToFrame(dest, interpolate, vert_crop); | 225 StretchToFrame(dest, interpolate, vert_crop); |
227 } | 226 } |
228 return dest; | 227 return dest; |
229 } | 228 } |
230 | 229 |
231 bool VideoFrame::SetToBlack() { | 230 bool VideoFrame::SetToBlack() { |
232 return libyuv::I420Rect(GetYPlane(), GetYPitch(), | 231 return libyuv::I420Rect(GetYPlane(), GetYPitch(), |
233 GetUPlane(), GetUPitch(), | 232 GetUPlane(), GetUPitch(), |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 << " expected: " << expected_size | 380 << " expected: " << expected_size |
382 << " sample[0..3]: " << static_cast<int>(four_samples[0]) | 381 << " sample[0..3]: " << static_cast<int>(four_samples[0]) |
383 << ", " << static_cast<int>(four_samples[1]) | 382 << ", " << static_cast<int>(four_samples[1]) |
384 << ", " << static_cast<int>(four_samples[2]) | 383 << ", " << static_cast<int>(four_samples[2]) |
385 << ", " << static_cast<int>(four_samples[3]); | 384 << ", " << static_cast<int>(four_samples[3]); |
386 } | 385 } |
387 return true; | 386 return true; |
388 } | 387 } |
389 | 388 |
390 } // namespace cricket | 389 } // namespace cricket |
OLD | NEW |