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

Unified Diff: webrtc/video_engine/vie_capturer_unittest.cc

Issue 1158273010: Re-land "Convert native handles to buffers before encoding." (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video_encoder.h ('k') | webrtc/video_engine/vie_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video_engine/vie_capturer_unittest.cc
diff --git a/webrtc/video_engine/vie_capturer_unittest.cc b/webrtc/video_engine/vie_capturer_unittest.cc
index f144c2de0cfd3974baca9b894dfcab7275b5b1eb..3733b3d68c4c80417afb2a8d4520bb27f03ad429 100644
--- a/webrtc/video_engine/vie_capturer_unittest.cc
+++ b/webrtc/video_engine/vie_capturer_unittest.cc
@@ -24,6 +24,7 @@
#include "webrtc/system_wrappers/interface/event_wrapper.h"
#include "webrtc/system_wrappers/interface/ref_count.h"
#include "webrtc/system_wrappers/interface/scoped_vector.h"
+#include "webrtc/test/fake_texture_frame.h"
using ::testing::_;
using ::testing::Invoke;
@@ -159,11 +160,10 @@ TEST_F(ViECapturerTest, TestRtpTimeStampSet) {
TEST_F(ViECapturerTest, TestTextureFrames) {
const int kNumFrame = 3;
for (int i = 0 ; i < kNumFrame; ++i) {
- void* dummy_handle = reinterpret_cast<void*>(i+1);
+ test::FakeNativeHandle* dummy_handle = new test::FakeNativeHandle();
// Add one to |i| so that width/height > 0.
- input_frames_.push_back(new VideoFrame(dummy_handle, i + 1, i + 1, i + 1,
- i + 1, webrtc::kVideoRotation_0,
- rtc::Callback0<void>()));
+ input_frames_.push_back(new VideoFrame(test::CreateFakeNativeHandleFrame(
+ dummy_handle, i + 1, i + 1, i + 1, i + 1, webrtc::kVideoRotation_0)));
AddInputFrame(input_frames_[i]);
WaitOutputFrame();
EXPECT_EQ(dummy_handle, output_frames_[i]->native_handle());
@@ -190,10 +190,9 @@ TEST_F(ViECapturerTest, TestI420Frames) {
}
TEST_F(ViECapturerTest, TestI420FrameAfterTextureFrame) {
- void* dummy_handle = &input_frames_;
- input_frames_.push_back(new VideoFrame(dummy_handle, 1, 1, 1, 1,
- webrtc::kVideoRotation_0,
- rtc::Callback0<void>()));
+ test::FakeNativeHandle* dummy_handle = new test::FakeNativeHandle();
+ input_frames_.push_back(new VideoFrame(test::CreateFakeNativeHandleFrame(
+ dummy_handle, 1, 1, 1, 1, webrtc::kVideoRotation_0)));
AddInputFrame(input_frames_[0]);
WaitOutputFrame();
EXPECT_EQ(dummy_handle, output_frames_[0]->native_handle());
@@ -210,10 +209,9 @@ TEST_F(ViECapturerTest, TestTextureFrameAfterI420Frame) {
AddInputFrame(input_frames_[0]);
WaitOutputFrame();
- void* dummy_handle = &input_frames_;
- input_frames_.push_back(new VideoFrame(dummy_handle, 1, 1, 2, 2,
- webrtc::kVideoRotation_0,
- rtc::Callback0<void>()));
+ test::FakeNativeHandle* dummy_handle = new test::FakeNativeHandle();
+ input_frames_.push_back(new VideoFrame(test::CreateFakeNativeHandleFrame(
+ dummy_handle, 1, 1, 2, 2, webrtc::kVideoRotation_0)));
AddInputFrame(input_frames_[1]);
WaitOutputFrame();
« no previous file with comments | « webrtc/video_encoder.h ('k') | webrtc/video_engine/vie_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698