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

Side by Side Diff: remoting/protocol/monitored_video_stub.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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/protocol/monitored_video_stub.h" 5 #include "remoting/protocol/monitored_video_stub.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "remoting/codec/video_decoder.h" 9 #include "remoting/codec/video_decoder.h"
10 #include "remoting/codec/video_decoder_verbatim.h" 10 #include "remoting/codec/video_decoder_verbatim.h"
(...skipping 11 matching lines...) Expand all
22 connectivity_check_timer_( 22 connectivity_check_timer_(
23 FROM_HERE, 23 FROM_HERE,
24 connectivity_check_delay, 24 connectivity_check_delay,
25 this, 25 this,
26 &MonitoredVideoStub::OnConnectivityCheckTimeout) { 26 &MonitoredVideoStub::OnConnectivityCheckTimeout) {
27 } 27 }
28 28
29 MonitoredVideoStub::~MonitoredVideoStub() { 29 MonitoredVideoStub::~MonitoredVideoStub() {
30 } 30 }
31 31
32 void MonitoredVideoStub::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, 32 void MonitoredVideoStub::ProcessVideoPacket(
33 const base::Closure& done) { 33 scoped_ptr<VideoPacket> packet,
34 const ProgressCallback& progress_callback) {
34 DCHECK(thread_checker_.CalledOnValidThread()); 35 DCHECK(thread_checker_.CalledOnValidThread());
35 36
36 connectivity_check_timer_.Reset(); 37 connectivity_check_timer_.Reset();
37 38
38 NotifyChannelState(true); 39 NotifyChannelState(true);
39 40
40 video_stub_->ProcessVideoPacket(packet.Pass(), done); 41 video_stub_->ProcessVideoPacket(packet.Pass(), progress_callback);
41 } 42 }
42 43
43 void MonitoredVideoStub::OnConnectivityCheckTimeout() { 44 void MonitoredVideoStub::OnConnectivityCheckTimeout() {
44 DCHECK(thread_checker_.CalledOnValidThread()); 45 DCHECK(thread_checker_.CalledOnValidThread());
45 NotifyChannelState(false); 46 NotifyChannelState(false);
46 } 47 }
47 48
48 void MonitoredVideoStub::NotifyChannelState(bool connected) { 49 void MonitoredVideoStub::NotifyChannelState(bool connected) {
49 if (is_connected_ != connected) { 50 if (is_connected_ != connected) {
50 is_connected_ = connected; 51 is_connected_ = connected;
51 callback_.Run(is_connected_); 52 callback_.Run(is_connected_);
52 } 53 }
53 } 54 }
54 55
55 } // namespace protocol 56 } // namespace protocol
56 } // namespace remoting 57 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698