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

Unified Diff: remoting/host/video_frame_pump.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: Tweak comments Created 5 years, 7 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
« remoting/codec/video_encoder_vpx.cc ('K') | « remoting/host/client_session.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/video_frame_pump.cc
diff --git a/remoting/host/video_frame_pump.cc b/remoting/host/video_frame_pump.cc
index 526615c9215c7dad07d90ed84dcca9f7f42dc080..37d9da7c25e1ff47bc6b8bda8bf9488eac436be7 100644
--- a/remoting/host/video_frame_pump.cc
+++ b/remoting/host/video_frame_pump.cc
@@ -22,18 +22,22 @@ namespace remoting {
namespace {
-// Helper used to encode frames on the encode thread.
-//
-// TODO(sergeyu): This functions doesn't do much beside calling
-// VideoEncoder::Encode(). It's only needed to handle empty frames properly and
-// that logic can be moved to VideoEncoder implementations.
scoped_ptr<VideoPacket> EncodeFrame(VideoEncoder* encoder,
scoped_ptr<webrtc::DesktopFrame> frame) {
- // If there is nothing to encode then send an empty packet.
- if (!frame || frame->updated_region().is_empty())
- return make_scoped_ptr(new VideoPacket());
+ scoped_ptr<VideoPacket> packet;
- return encoder->Encode(*frame);
+ // If |frame| is non-NULL then let the encoder process it.
+ if (frame) {
+ packet = encoder->Encode(*frame);
+ }
+
+ // If |frame| is NULL, or the encoder returned nothing, return an empty
+ // packet.
+ if (!packet) {
+ packet.reset(new VideoPacket());
+ }
+
+ return packet.Pass();
}
} // namespace
« remoting/codec/video_encoder_vpx.cc ('K') | « remoting/host/client_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698