Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc

Issue 2354223002: Revert of Move MutableDataY{,U,V} methods to I420Buffer only. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 &codec_, static_cast<const int*>(kTestTemporalLayerProfile)); 528 &codec_, static_cast<const int*>(kTestTemporalLayerProfile));
529 codec_.numberOfSimulcastStreams = 3; 529 codec_.numberOfSimulcastStreams = 3;
530 EXPECT_EQ(0, adapter_->InitEncode(&codec_, 1, 1200)); 530 EXPECT_EQ(0, adapter_->InitEncode(&codec_, 1, 1200));
531 adapter_->RegisterEncodeCompleteCallback(this); 531 adapter_->RegisterEncodeCompleteCallback(this);
532 ASSERT_EQ(3u, helper_->factory()->encoders().size()); 532 ASSERT_EQ(3u, helper_->factory()->encoders().size());
533 // Tell the 2nd encoder to request software fallback. 533 // Tell the 2nd encoder to request software fallback.
534 EXPECT_CALL(*helper_->factory()->encoders()[1], Encode(_, _, _)) 534 EXPECT_CALL(*helper_->factory()->encoders()[1], Encode(_, _, _))
535 .WillOnce(Return(WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE)); 535 .WillOnce(Return(WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE));
536 536
537 // Send a fake frame and assert the return is software fallback. 537 // Send a fake frame and assert the return is software fallback.
538 VideoFrame input_frame;
538 int half_width = (kDefaultWidth + 1) / 2; 539 int half_width = (kDefaultWidth + 1) / 2;
539 rtc::scoped_refptr<I420Buffer> input_buffer = I420Buffer::Create( 540 input_frame.CreateEmptyFrame(kDefaultWidth, kDefaultHeight, kDefaultWidth,
540 kDefaultWidth, kDefaultHeight, kDefaultWidth, half_width, half_width); 541 half_width, half_width);
541 input_buffer->InitializeData(); 542 memset(input_frame.video_frame_buffer()->MutableDataY(), 0,
542 VideoFrame input_frame(input_buffer, 0, 0, webrtc::kVideoRotation_0); 543 input_frame.allocated_size(kYPlane));
544 memset(input_frame.video_frame_buffer()->MutableDataU(), 0,
545 input_frame.allocated_size(kUPlane));
546 memset(input_frame.video_frame_buffer()->MutableDataV(), 0,
547 input_frame.allocated_size(kVPlane));
548
543 std::vector<FrameType> frame_types(3, kVideoFrameKey); 549 std::vector<FrameType> frame_types(3, kVideoFrameKey);
544 EXPECT_EQ(WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE, 550 EXPECT_EQ(WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE,
545 adapter_->Encode(input_frame, nullptr, &frame_types)); 551 adapter_->Encode(input_frame, nullptr, &frame_types));
546 } 552 }
547 553
548 } // namespace testing 554 } // namespace testing
549 } // namespace webrtc 555 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698