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

Unified Diff: webrtc/video/video_send_stream_tests.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/video_encoder_unittest.cc ('k') | webrtc/video_encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_send_stream_tests.cc
diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc
index 7e31ade39607edf897af0d6657d80bbebb2624ad..10f5055246251d70ba37146035e529fc508bcbf2 100644
--- a/webrtc/video/video_send_stream_tests.cc
+++ b/webrtc/video/video_send_stream_tests.cc
@@ -30,6 +30,7 @@
#include "webrtc/system_wrappers/interface/thread_wrapper.h"
#include "webrtc/test/call_test.h"
#include "webrtc/test/configurable_frame_size_encoder.h"
+#include "webrtc/test/fake_texture_frame.h"
#include "webrtc/test/null_transport.h"
#include "webrtc/test/testsupport/perf_test.h"
#include "webrtc/video/send_statistics_proxy.h"
@@ -50,16 +51,6 @@ void ExpectEqualFramesVector(const std::vector<VideoFrame>& frames1,
const std::vector<VideoFrame>& frames2);
VideoFrame CreateVideoFrame(int width, int height, uint8_t data);
-class FakeNativeHandle {
- public:
- FakeNativeHandle() {}
- ~FakeNativeHandle() {}
-};
-
-void DeleteNativeHandle(FakeNativeHandle* handle) {
- delete handle;
-}
-
class VideoSendStreamTest : public test::CallTest {
protected:
void TestNackRetransmission(uint32_t retransmit_ssrc,
@@ -1084,20 +1075,17 @@ TEST_F(VideoSendStreamTest, CapturesTextureAndVideoFrames) {
std::vector<VideoFrame> input_frames;
int width = static_cast<int>(encoder_config_.streams[0].width);
int height = static_cast<int>(encoder_config_.streams[0].height);
- FakeNativeHandle* handle1 = new FakeNativeHandle();
- FakeNativeHandle* handle2 = new FakeNativeHandle();
- FakeNativeHandle* handle3 = new FakeNativeHandle();
- input_frames.push_back(VideoFrame(handle1, width, height, 1, 1,
- kVideoRotation_0,
- rtc::Bind(&DeleteNativeHandle, handle1)));
- input_frames.push_back(VideoFrame(handle2, width, height, 2, 2,
- kVideoRotation_0,
- rtc::Bind(&DeleteNativeHandle, handle2)));
+ test::FakeNativeHandle* handle1 = new test::FakeNativeHandle();
+ test::FakeNativeHandle* handle2 = new test::FakeNativeHandle();
+ test::FakeNativeHandle* handle3 = new test::FakeNativeHandle();
+ input_frames.push_back(test::CreateFakeNativeHandleFrame(
+ handle1, width, height, 1, 1, kVideoRotation_0));
+ input_frames.push_back(test::CreateFakeNativeHandleFrame(
+ handle2, width, height, 2, 2, kVideoRotation_0));
input_frames.push_back(CreateVideoFrame(width, height, 3));
input_frames.push_back(CreateVideoFrame(width, height, 4));
- input_frames.push_back(VideoFrame(handle3, width, height, 5, 5,
- kVideoRotation_0,
- rtc::Bind(&DeleteNativeHandle, handle3)));
+ input_frames.push_back(test::CreateFakeNativeHandleFrame(
+ handle3, width, height, 5, 5, kVideoRotation_0));
send_stream_->Start();
for (size_t i = 0; i < input_frames.size(); i++) {
« no previous file with comments | « webrtc/video/video_encoder_unittest.cc ('k') | webrtc/video_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698