Index: remoting/protocol/video_frame_pump.cc |
diff --git a/remoting/protocol/video_frame_pump.cc b/remoting/protocol/video_frame_pump.cc |
index 8e286deeaa834b4574b7e7bf78d78c9a915781d8..e0e16a11ec8802d2d0e9ebde38d52ee302fba6ad 100644 |
--- a/remoting/protocol/video_frame_pump.cc |
+++ b/remoting/protocol/video_frame_pump.cc |
@@ -104,6 +104,11 @@ void VideoFramePump::SetLosslessColor(bool want_lossless) { |
base::Unretained(encoder_.get()), want_lossless)); |
} |
+void VideoFramePump::SetSizeCallback(const SizeCallback& size_callback) { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ size_callback_ = size_callback; |
+} |
+ |
webrtc::SharedMemory* VideoFramePump::CreateSharedMemory(size_t size) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
return nullptr; |
@@ -116,6 +121,9 @@ void VideoFramePump::OnCaptureCompleted(webrtc::DesktopFrame* frame) { |
captured_frame_timestamps_->capture_ended_time = base::TimeTicks::Now(); |
+ if (!size_callback_.is_null()) |
+ size_callback_.Run(frame->size()); |
Jamie
2015/11/25 01:32:46
You're calling this on every capture, not just whe
Sergey Ulanov
2015/11/27 22:11:34
Done.
|
+ |
// Even when |frame| is nullptr we still need to post it to the encode thread |
// to make sure frames are freed in the same order they are received and |
// that we don't start capturing frame n+2 before frame n is freed. |