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

Side by Side Diff: remoting/host/video_frame_pump.cc

Issue 850983002: Implement video frame acknowledgements in the chromoting protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « remoting/host/video_frame_pump.h ('k') | remoting/proto/video.proto » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/video_frame_pump.h" 5 #include "remoting/host/video_frame_pump.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void VideoFramePump::SendEncodedFrame(int64 latest_event_timestamp, 139 void VideoFramePump::SendEncodedFrame(int64 latest_event_timestamp,
140 base::TimeTicks timestamp, 140 base::TimeTicks timestamp,
141 scoped_ptr<VideoPacket> packet) { 141 scoped_ptr<VideoPacket> packet) {
142 DCHECK(thread_checker_.CalledOnValidThread()); 142 DCHECK(thread_checker_.CalledOnValidThread());
143 143
144 if (g_enable_timestamps) 144 if (g_enable_timestamps)
145 packet->set_timestamp(timestamp.ToInternalValue()); 145 packet->set_timestamp(timestamp.ToInternalValue());
146 146
147 packet->set_latest_event_timestamp(latest_event_timestamp); 147 packet->set_latest_event_timestamp(latest_event_timestamp);
148 148
149 capture_scheduler_.OnFrameEncoded( 149 capture_scheduler_.OnFrameEncoded(packet.get());
150 base::TimeDelta::FromMilliseconds(packet->encode_time_ms()));
151 150
152 video_stub_->ProcessVideoPacket(packet.Pass(), 151 video_stub_->ProcessVideoPacket(packet.Pass(),
153 base::Bind(&VideoFramePump::OnVideoPacketSent, 152 base::Bind(&VideoFramePump::OnVideoPacketSent,
154 weak_factory_.GetWeakPtr())); 153 weak_factory_.GetWeakPtr()));
155 } 154 }
156 155
157 void VideoFramePump::OnVideoPacketSent() { 156 void VideoFramePump::OnVideoPacketSent() {
158 DCHECK(thread_checker_.CalledOnValidThread()); 157 DCHECK(thread_checker_.CalledOnValidThread());
159 158
160 capture_scheduler_.OnFrameSent(); 159 capture_scheduler_.OnFrameSent();
161 keep_alive_timer_.Reset(); 160 keep_alive_timer_.Reset();
162 } 161 }
163 162
164 void VideoFramePump::SendKeepAlivePacket() { 163 void VideoFramePump::SendKeepAlivePacket() {
165 DCHECK(thread_checker_.CalledOnValidThread()); 164 DCHECK(thread_checker_.CalledOnValidThread());
166 165
167 video_stub_->ProcessVideoPacket( 166 video_stub_->ProcessVideoPacket(
168 make_scoped_ptr(new VideoPacket()), 167 make_scoped_ptr(new VideoPacket()),
169 base::Bind(&VideoFramePump::OnKeepAlivePacketSent, 168 base::Bind(&VideoFramePump::OnKeepAlivePacketSent,
170 weak_factory_.GetWeakPtr())); 169 weak_factory_.GetWeakPtr()));
171 } 170 }
172 171
173 void VideoFramePump::OnKeepAlivePacketSent() { 172 void VideoFramePump::OnKeepAlivePacketSent() {
174 DCHECK(thread_checker_.CalledOnValidThread()); 173 DCHECK(thread_checker_.CalledOnValidThread());
175 174
176 keep_alive_timer_.Reset(); 175 keep_alive_timer_.Reset();
177 } 176 }
178 177
179 } // namespace remoting 178 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/video_frame_pump.h ('k') | remoting/proto/video.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698