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

Unified Diff: webrtc/test/fake_encoder.cc

Issue 2304363002: Let ViEEncoder express resolution requests as Sinkwants (Closed)
Patch Set: Rebased. Created 4 years, 1 month 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/test/fake_encoder.h ('k') | webrtc/test/frame_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/fake_encoder.cc
diff --git a/webrtc/test/fake_encoder.cc b/webrtc/test/fake_encoder.cc
index ac1c6dec691ea2f4522722e160dbabd5c988f529..065b5299cd2b8a3012e006862b516b4541c26bd7 100644
--- a/webrtc/test/fake_encoder.cc
+++ b/webrtc/test/fake_encoder.cc
@@ -109,6 +109,7 @@ int32_t FakeEncoder::Encode(const VideoFrame& input_image,
encoded._frameType = (*frame_types)[i];
encoded._encodedWidth = config_.simulcastStream[i].width;
encoded._encodedHeight = config_.simulcastStream[i].height;
+ encoded.rotation_ = input_image.rotation();
RTC_DCHECK(callback_ != NULL);
specifics.codec_name = ImplementationName();
if (callback_->Encoded(encoded, &specifics, NULL) != 0)
@@ -204,10 +205,20 @@ DelayedEncoder::DelayedEncoder(Clock* clock, int delay_ms)
: test::FakeEncoder(clock),
delay_ms_(delay_ms) {}
+void DelayedEncoder::SetDelay(int delay_ms) {
+ rtc::CritScope lock(&lock_);
+ delay_ms_ = delay_ms;
+}
+
int32_t DelayedEncoder::Encode(const VideoFrame& input_image,
const CodecSpecificInfo* codec_specific_info,
const std::vector<FrameType>* frame_types) {
- SleepMs(delay_ms_);
+ int delay_ms = 0;
+ {
+ rtc::CritScope lock(&lock_);
+ delay_ms = delay_ms_;
+ }
+ SleepMs(delay_ms);
return FakeEncoder::Encode(input_image, codec_specific_info, frame_types);
}
} // namespace test
« no previous file with comments | « webrtc/test/fake_encoder.h ('k') | webrtc/test/frame_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698