| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 bool interpolate, bool vert_crop) const { | 194 bool interpolate, bool vert_crop) const { |
| 195 if (!dst) { | 195 if (!dst) { |
| 196 LOG(LS_ERROR) << "NULL dst pointer."; | 196 LOG(LS_ERROR) << "NULL dst pointer."; |
| 197 return; | 197 return; |
| 198 } | 198 } |
| 199 | 199 |
| 200 StretchToPlanes(dst->GetYPlane(), dst->GetUPlane(), dst->GetVPlane(), | 200 StretchToPlanes(dst->GetYPlane(), dst->GetUPlane(), dst->GetVPlane(), |
| 201 dst->GetYPitch(), dst->GetUPitch(), dst->GetVPitch(), | 201 dst->GetYPitch(), dst->GetUPitch(), dst->GetVPitch(), |
| 202 dst->GetWidth(), dst->GetHeight(), | 202 dst->GetWidth(), dst->GetHeight(), |
| 203 interpolate, vert_crop); | 203 interpolate, vert_crop); |
| 204 dst->SetElapsedTime(GetElapsedTime()); | |
| 205 dst->SetTimeStamp(GetTimeStamp()); | 204 dst->SetTimeStamp(GetTimeStamp()); |
| 206 // Stretched frame should have the same rotation as the source. | 205 // Stretched frame should have the same rotation as the source. |
| 207 dst->SetRotation(GetVideoRotation()); | 206 dst->SetRotation(GetVideoRotation()); |
| 208 } | 207 } |
| 209 | 208 |
| 210 VideoFrame* VideoFrame::Stretch(size_t dst_width, size_t dst_height, | 209 VideoFrame* VideoFrame::Stretch(size_t dst_width, size_t dst_height, |
| 211 bool interpolate, bool vert_crop) const { | 210 bool interpolate, bool vert_crop) const { |
| 212 VideoFrame* dest = CreateEmptyFrame(static_cast<int>(dst_width), | 211 VideoFrame* dest = CreateEmptyFrame(static_cast<int>(dst_width), |
| 213 static_cast<int>(dst_height), | 212 static_cast<int>(dst_height), |
| 214 GetPixelWidth(), GetPixelHeight(), | 213 GetPixelWidth(), GetPixelHeight(), |
| 215 GetElapsedTime(), GetTimeStamp()); | 214 GetTimeStamp()); |
| 216 if (dest) { | 215 if (dest) { |
| 217 StretchToFrame(dest, interpolate, vert_crop); | 216 StretchToFrame(dest, interpolate, vert_crop); |
| 218 } | 217 } |
| 219 return dest; | 218 return dest; |
| 220 } | 219 } |
| 221 | 220 |
| 222 bool VideoFrame::SetToBlack() { | 221 bool VideoFrame::SetToBlack() { |
| 223 return libyuv::I420Rect(GetYPlane(), GetYPitch(), | 222 return libyuv::I420Rect(GetYPlane(), GetYPitch(), |
| 224 GetUPlane(), GetUPitch(), | 223 GetUPlane(), GetUPitch(), |
| 225 GetVPlane(), GetVPitch(), | 224 GetVPlane(), GetVPitch(), |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 << " expected: " << expected_size | 368 << " expected: " << expected_size |
| 370 << " sample[0..3]: " << static_cast<int>(four_samples[0]) | 369 << " sample[0..3]: " << static_cast<int>(four_samples[0]) |
| 371 << ", " << static_cast<int>(four_samples[1]) | 370 << ", " << static_cast<int>(four_samples[1]) |
| 372 << ", " << static_cast<int>(four_samples[2]) | 371 << ", " << static_cast<int>(four_samples[2]) |
| 373 << ", " << static_cast<int>(four_samples[3]); | 372 << ", " << static_cast<int>(four_samples[3]); |
| 374 } | 373 } |
| 375 return true; | 374 return true; |
| 376 } | 375 } |
| 377 | 376 |
| 378 } // namespace cricket | 377 } // namespace cricket |
| OLD | NEW |