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(), |
223 GetTimeStamp()); | 224 GetTimeStamp()); |
224 if (dest) { | 225 if (dest) { |
225 StretchToFrame(dest, interpolate, vert_crop); | 226 StretchToFrame(dest, interpolate, vert_crop); |
226 } | 227 } |
227 return dest; | 228 return dest; |
228 } | 229 } |
229 | 230 |
230 bool VideoFrame::SetToBlack() { | 231 bool VideoFrame::SetToBlack() { |
231 return libyuv::I420Rect(GetYPlane(), GetYPitch(), | 232 return libyuv::I420Rect(GetYPlane(), GetYPitch(), |
232 GetUPlane(), GetUPitch(), | 233 GetUPlane(), GetUPitch(), |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 << " expected: " << expected_size | 381 << " expected: " << expected_size |
381 << " sample[0..3]: " << static_cast<int>(four_samples[0]) | 382 << " sample[0..3]: " << static_cast<int>(four_samples[0]) |
382 << ", " << static_cast<int>(four_samples[1]) | 383 << ", " << static_cast<int>(four_samples[1]) |
383 << ", " << static_cast<int>(four_samples[2]) | 384 << ", " << static_cast<int>(four_samples[2]) |
384 << ", " << static_cast<int>(four_samples[3]); | 385 << ", " << static_cast<int>(four_samples[3]); |
385 } | 386 } |
386 return true; | 387 return true; |
387 } | 388 } |
388 | 389 |
389 } // namespace cricket | 390 } // namespace cricket |
OLD | NEW |