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

Unified Diff: remoting/protocol/video_frame_pump.cc

Issue 1472873005: Add VideoStream interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_video_pump
Patch Set: Created 5 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 | « remoting/protocol/video_frame_pump.h ('k') | remoting/protocol/video_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9bd878f9f8ead9cafa9d46536026ba420b837332 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,12 @@ void VideoFramePump::OnCaptureCompleted(webrtc::DesktopFrame* frame) {
captured_frame_timestamps_->capture_ended_time = base::TimeTicks::Now();
+ if (frame && !frame_size_.equals(frame->size())) {
+ frame_size_ = frame->size();
+ if (!size_callback_.is_null())
+ size_callback_.Run(frame_size_);
+ }
+
// 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.
« no previous file with comments | « remoting/protocol/video_frame_pump.h ('k') | remoting/protocol/video_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698