OLD | NEW |
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/client_video_dispatcher.h" | 5 #include "remoting/protocol/client_video_dispatcher.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 ClientVideoDispatcher::ClientVideoDispatcher(VideoStub* video_stub, | 32 ClientVideoDispatcher::ClientVideoDispatcher(VideoStub* video_stub, |
33 ClientStub* client_stub) | 33 ClientStub* client_stub) |
34 : ChannelDispatcherBase(kVideoChannelName), | 34 : ChannelDispatcherBase(kVideoChannelName), |
35 video_stub_(video_stub), | 35 video_stub_(video_stub), |
36 client_stub_(client_stub), | 36 client_stub_(client_stub), |
37 weak_factory_(this) {} | 37 weak_factory_(this) {} |
38 | 38 |
39 ClientVideoDispatcher::~ClientVideoDispatcher() {} | 39 ClientVideoDispatcher::~ClientVideoDispatcher() {} |
40 | 40 |
41 void ClientVideoDispatcher::OnIncomingMessage( | 41 void ClientVideoDispatcher::OnIncomingMessage( |
42 scoped_ptr<CompoundBuffer> message) { | 42 std::unique_ptr<CompoundBuffer> message) { |
43 scoped_ptr<VideoPacket> video_packet = | 43 std::unique_ptr<VideoPacket> video_packet = |
44 ParseMessage<VideoPacket>(message.get()); | 44 ParseMessage<VideoPacket>(message.get()); |
45 if (!video_packet) | 45 if (!video_packet) |
46 return; | 46 return; |
47 | 47 |
48 int frame_id = video_packet->frame_id(); | 48 int frame_id = video_packet->frame_id(); |
49 | 49 |
50 if (!video_packet->has_frame_id()) { | 50 if (!video_packet->has_frame_id()) { |
51 video_stub_->ProcessVideoPacket(std::move(video_packet), | 51 video_stub_->ProcessVideoPacket(std::move(video_packet), |
52 base::Bind(&base::DoNothing)); | 52 base::Bind(&base::DoNothing)); |
53 return; | 53 return; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 while (!pending_frames_.empty() && pending_frames_.front().done) { | 110 while (!pending_frames_.empty() && pending_frames_.front().done) { |
111 VideoAck ack_message; | 111 VideoAck ack_message; |
112 ack_message.set_frame_id(pending_frames_.front().frame_id); | 112 ack_message.set_frame_id(pending_frames_.front().frame_id); |
113 message_pipe()->Send(&ack_message, base::Closure()); | 113 message_pipe()->Send(&ack_message, base::Closure()); |
114 pending_frames_.pop_front(); | 114 pending_frames_.pop_front(); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 } // namespace protocol | 118 } // namespace protocol |
119 } // namespace remoting | 119 } // namespace remoting |
OLD | NEW |