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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 captured_frame.fourcc = cricket::FOURCC_I420; | 68 captured_frame.fourcc = cricket::FOURCC_I420; |
69 captured_frame.pixel_width = 1; | 69 captured_frame.pixel_width = 1; |
70 captured_frame.pixel_height = 1; | 70 captured_frame.pixel_height = 1; |
71 captured_frame.elapsed_time = 1234; | 71 captured_frame.elapsed_time = 1234; |
72 captured_frame.time_stamp = 5678; | 72 captured_frame.time_stamp = 5678; |
73 captured_frame.rotation = frame_rotation; | 73 captured_frame.rotation = frame_rotation; |
74 captured_frame.width = frame_width; | 74 captured_frame.width = frame_width; |
75 captured_frame.height = frame_height; | 75 captured_frame.height = frame_height; |
76 captured_frame.data_size = (frame_width * frame_height) + | 76 captured_frame.data_size = (frame_width * frame_height) + |
77 ((frame_width + 1) / 2) * ((frame_height + 1) / 2) * 2; | 77 ((frame_width + 1) / 2) * ((frame_height + 1) / 2) * 2; |
78 rtc::scoped_ptr<uint8[]> captured_frame_buffer( | 78 rtc::scoped_ptr<uint8_t[]> captured_frame_buffer( |
79 new uint8[captured_frame.data_size]); | 79 new uint8_t[captured_frame.data_size]); |
80 // Initialize memory to satisfy DrMemory tests. | 80 // Initialize memory to satisfy DrMemory tests. |
81 memset(captured_frame_buffer.get(), 0, captured_frame.data_size); | 81 memset(captured_frame_buffer.get(), 0, captured_frame.data_size); |
82 captured_frame.data = captured_frame_buffer.get(); | 82 captured_frame.data = captured_frame_buffer.get(); |
83 | 83 |
84 // Create the new frame from the CapturedFrame. | 84 // Create the new frame from the CapturedFrame. |
85 cricket::WebRtcVideoFrame frame; | 85 cricket::WebRtcVideoFrame frame; |
86 EXPECT_TRUE( | 86 EXPECT_TRUE( |
87 frame.Init(&captured_frame, cropped_width, cropped_height, | 87 frame.Init(&captured_frame, cropped_width, cropped_height, |
88 apply_rotation)); | 88 apply_rotation)); |
89 | 89 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 351 |
352 // Claim the frame 2 needs to be rotated for another 270 degree. The output | 352 // Claim the frame 2 needs to be rotated for another 270 degree. The output |
353 // from frame 2 rotation should be the same as frame 1. | 353 // from frame 2 rotation should be the same as frame 1. |
354 applied90->SetRotation(webrtc::kVideoRotation_270); | 354 applied90->SetRotation(webrtc::kVideoRotation_270); |
355 const cricket::VideoFrame* applied360 = | 355 const cricket::VideoFrame* applied360 = |
356 applied90->GetCopyWithRotationApplied(); | 356 applied90->GetCopyWithRotationApplied(); |
357 EXPECT_TRUE(applied360); | 357 EXPECT_TRUE(applied360); |
358 EXPECT_EQ(applied360->GetVideoRotation(), webrtc::kVideoRotation_0); | 358 EXPECT_EQ(applied360->GetVideoRotation(), webrtc::kVideoRotation_0); |
359 EXPECT_TRUE(IsEqual(applied0, *applied360, 0)); | 359 EXPECT_TRUE(IsEqual(applied0, *applied360, 0)); |
360 } | 360 } |
OLD | NEW |