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

Unified Diff: remoting/codec/codec_test.cc

Issue 1150163002: Update VideoFramePump to pass un-changed frames to encoders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Work-around Visual Studio issue w/ undefined references 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 | « remoting/codec/codec_test.h ('k') | remoting/codec/video_encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/codec/codec_test.cc
diff --git a/remoting/codec/codec_test.cc b/remoting/codec/codec_test.cc
index 8b9511ce7bea16809d286058e00ce7fc7a95144e..51b52f03ee2358b8073051ba330e61d5bffafde2 100644
--- a/remoting/codec/codec_test.cc
+++ b/remoting/codec/codec_test.cc
@@ -247,7 +247,7 @@ scoped_ptr<DesktopFrame> PrepareFrame(const DesktopSize& size) {
static void TestEncodingRects(VideoEncoder* encoder,
VideoEncoderTester* tester,
- webrtc::DesktopFrame* frame,
+ DesktopFrame* frame,
const DesktopRect* rects,
int count) {
frame->mutable_updated_region()->Clear();
@@ -267,7 +267,7 @@ void TestVideoEncoder(VideoEncoder* encoder, bool strict) {
for (size_t xi = 0; xi < arraysize(kSizes); ++xi) {
for (size_t yi = 0; yi < arraysize(kSizes); ++yi) {
DesktopSize size = DesktopSize(kSizes[xi], kSizes[yi]);
- scoped_ptr<webrtc::DesktopFrame> frame = PrepareFrame(size);
+ scoped_ptr<DesktopFrame> frame = PrepareFrame(size);
std::vector<std::vector<DesktopRect> > test_rect_lists =
MakeTestRectLists(size);
for (size_t i = 0; i < test_rect_lists.size(); ++i) {
@@ -275,10 +275,31 @@ void TestVideoEncoder(VideoEncoder* encoder, bool strict) {
TestEncodingRects(encoder, &tester, frame.get(),
&test_rects[0], test_rects.size());
}
+
+ // Pass some empty frames through the encoder.
+ for (int i = 0; i < 10; ++i) {
+ TestEncodingRects(encoder, &tester, frame.get(), nullptr, 0);
+ }
}
}
}
+void TestVideoEncoderEmptyFrames(VideoEncoder* encoder, int topoff_frames) {
+ const DesktopSize kSize(640, 480);
+ scoped_ptr<DesktopFrame> frame(PrepareFrame(kSize));
+
+ frame->mutable_updated_region()->SetRect(
+ webrtc::DesktopRect::MakeSize(kSize));
+ EXPECT_TRUE(encoder->Encode(*frame));
+
+ frame->mutable_updated_region()->Clear();
+ for (int i=0; i < topoff_frames; ++i) {
+ EXPECT_TRUE(encoder->Encode(*frame));
+ }
+
+ EXPECT_FALSE(encoder->Encode(*frame));
+}
+
static void TestEncodeDecodeRects(VideoEncoder* encoder,
VideoEncoderTester* encoder_tester,
VideoDecoderTester* decoder_tester,
« no previous file with comments | « remoting/codec/codec_test.h ('k') | remoting/codec/video_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698