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

Unified Diff: remoting/protocol/webrtc_video_stream.cc

Issue 2083843002: Replace VideoStream::SizeCallback with VideoStream::Observer interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@merge-sched-stream
Patch Set: Created 4 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/protocol/webrtc_video_stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_video_stream.cc
diff --git a/remoting/protocol/webrtc_video_stream.cc b/remoting/protocol/webrtc_video_stream.cc
index 84edbfb267ac4577814ab041592c9176bf06ce92..dc24ecb934cc3994088a94ec6781fa3ab231393b 100644
--- a/remoting/protocol/webrtc_video_stream.cc
+++ b/remoting/protocol/webrtc_video_stream.cc
@@ -166,9 +166,9 @@ void WebrtcVideoStream::SetLosslessColor(bool want_lossless) {
NOTIMPLEMENTED();
}
-void WebrtcVideoStream::SetSizeCallback(const SizeCallback& size_callback) {
+void WebrtcVideoStream::SetObserver(Observer* observer) {
DCHECK(thread_checker_.CalledOnValidThread());
- size_callback_ = size_callback;
+ observer_ = observer;
}
void WebrtcVideoStream::SetKeyFrameRequest() {
@@ -230,8 +230,8 @@ void WebrtcVideoStream::OnCaptureResult(
if (!frame_size_.equals(frame->size()) || !frame_dpi_.equals(dpi)) {
frame_size_ = frame->size();
frame_dpi_ = dpi;
- if (!size_callback_.is_null())
- size_callback_.Run(frame_size_, frame_dpi_);
+ if (observer_)
+ observer_->OnVideoSizeChanged(this, frame_size_, frame_dpi_);
}
encode_pending_ = true;
base::PostTaskAndReplyWithResult(
« no previous file with comments | « remoting/protocol/webrtc_video_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698