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, |