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

Unified Diff: remoting/protocol/video_frame_pump.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/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 e2882ad7613f188d761d3860725e8ad018c5c442..c68fff84d5ba41cfabcf25543b2d9b1ae228e694 100644
--- a/remoting/protocol/video_frame_pump.cc
+++ b/remoting/protocol/video_frame_pump.cc
@@ -107,9 +107,9 @@ void VideoFramePump::SetLosslessColor(bool want_lossless) {
base::Unretained(encoder_.get()), want_lossless));
}
-void VideoFramePump::SetSizeCallback(const SizeCallback& size_callback) {
+void VideoFramePump::SetObserver(Observer* observer) {
DCHECK(thread_checker_.CalledOnValidThread());
- size_callback_ = size_callback;
+ observer_ = observer;
}
void VideoFramePump::OnCaptureResult(
@@ -128,8 +128,8 @@ void VideoFramePump::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_);
}
}
@@ -208,6 +208,12 @@ void VideoFramePump::SendPacket(std::unique_ptr<PacketWithTimestamps> packet) {
packet->timestamps->can_send_time = base::TimeTicks::Now();
UpdateFrameTimers(packet->packet.get(), packet->timestamps.get());
+ if (observer_) {
+ observer_->OnVideoFrameSent(
+ this, packet->packet->frame_id(),
+ packet->timestamps->input_event_client_timestamp);
+ }
+
send_pending_ = true;
video_stub_->ProcessVideoPacket(std::move(packet->packet),
base::Bind(&VideoFramePump::OnVideoPacketSent,
« 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