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

Unified Diff: webrtc/video/video_encoder_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/video_encoder.cc ('k') | webrtc/video/video_send_stream_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_encoder_unittest.cc
diff --git a/webrtc/video/video_encoder_unittest.cc b/webrtc/video/video_encoder_unittest.cc
index 99cf64312060c352724daee68510f57d69cb8ecf..be0170cdbeb3cbb5c3cfe99ff981ba7e304ab462 100644
--- a/webrtc/video/video_encoder_unittest.cc
+++ b/webrtc/video/video_encoder_unittest.cc
@@ -60,6 +60,11 @@ class VideoEncoderSoftwareFallbackWrapperTest : public ::testing::Test {
void OnDroppedFrame() override { ++on_dropped_frame_count_; }
+ bool SupportsNativeHandle() const override {
+ ++supports_native_handle_count_;
+ return false;
+ }
+
int init_encode_count_ = 0;
int32_t init_encode_return_code_ = WEBRTC_VIDEO_CODEC_OK;
int encode_count_ = 0;
@@ -68,6 +73,7 @@ class VideoEncoderSoftwareFallbackWrapperTest : public ::testing::Test {
int set_channel_parameters_count_ = 0;
int set_rates_count_ = 0;
int on_dropped_frame_count_ = 0;
+ mutable int supports_native_handle_count_ = 0;
};
class FakeEncodedImageCallback : public EncodedImageCallback {
@@ -197,4 +203,18 @@ TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.Release());
}
+TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
+ SupportsNativeHandleForwardedWithoutFallback) {
+ fallback_wrapper_.SupportsNativeHandle();
+ EXPECT_EQ(1, fake_encoder_.supports_native_handle_count_);
+}
+
+TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
+ SupportsNativeHandleNotForwardedDuringFallback) {
+ UtilizeFallbackEncoder();
+ fallback_wrapper_.SupportsNativeHandle();
+ EXPECT_EQ(0, fake_encoder_.supports_native_handle_count_);
+ EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.Release());
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/video/video_encoder.cc ('k') | webrtc/video/video_send_stream_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698