OLD | NEW |
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/protocol/fake_connection_to_client.h" | 5 #include "remoting/protocol/fake_connection_to_client.h" |
6 | 6 |
7 #include "remoting/protocol/session.h" | 7 #include "remoting/protocol/session.h" |
8 | 8 |
9 namespace remoting { | 9 namespace remoting { |
10 namespace protocol { | 10 namespace protocol { |
11 | 11 |
| 12 FakeVideoStream::FakeVideoStream() : weak_factory_(this) {} |
| 13 FakeVideoStream::~FakeVideoStream() {} |
| 14 |
| 15 void FakeVideoStream::Pause(bool pause) {} |
| 16 |
| 17 void FakeVideoStream::OnInputEventReceived(int64_t event_timestamp) {} |
| 18 |
| 19 void FakeVideoStream::SetLosslessEncode(bool want_lossless) {} |
| 20 |
| 21 void FakeVideoStream::SetLosslessColor(bool want_lossless) {} |
| 22 |
| 23 void FakeVideoStream::SetSizeCallback(const SizeCallback& size_callback) { |
| 24 size_callback_ = size_callback; |
| 25 } |
| 26 |
| 27 base::WeakPtr<FakeVideoStream> FakeVideoStream::GetWeakPtr() { |
| 28 return weak_factory_.GetWeakPtr(); |
| 29 } |
| 30 |
12 FakeConnectionToClient::FakeConnectionToClient(scoped_ptr<Session> session) | 31 FakeConnectionToClient::FakeConnectionToClient(scoped_ptr<Session> session) |
13 : session_(session.Pass()) {} | 32 : session_(session.Pass()) {} |
14 | 33 |
15 FakeConnectionToClient::~FakeConnectionToClient() {} | 34 FakeConnectionToClient::~FakeConnectionToClient() {} |
16 | 35 |
17 void FakeConnectionToClient::SetEventHandler(EventHandler* event_handler) { | 36 void FakeConnectionToClient::SetEventHandler(EventHandler* event_handler) { |
18 event_handler_ = event_handler; | 37 event_handler_ = event_handler; |
19 } | 38 } |
20 | 39 |
21 VideoStub* FakeConnectionToClient::video_stub() { | 40 scoped_ptr<VideoStream> FakeConnectionToClient::StartVideoStream( |
22 return video_stub_; | 41 scoped_ptr<webrtc::DesktopCapturer> desktop_capturer) { |
| 42 scoped_ptr<FakeVideoStream> result(new FakeVideoStream()); |
| 43 last_video_stream_ = result->GetWeakPtr(); |
| 44 return result.Pass(); |
23 } | 45 } |
24 | 46 |
25 AudioStub* FakeConnectionToClient::audio_stub() { | 47 AudioStub* FakeConnectionToClient::audio_stub() { |
26 return audio_stub_; | 48 return audio_stub_; |
27 } | 49 } |
28 | 50 |
29 ClientStub* FakeConnectionToClient::client_stub() { | 51 ClientStub* FakeConnectionToClient::client_stub() { |
30 return client_stub_; | 52 return client_stub_; |
31 } | 53 } |
32 | 54 |
(...skipping 17 matching lines...) Expand all Loading... |
50 } | 72 } |
51 | 73 |
52 void FakeConnectionToClient::set_host_stub(HostStub* host_stub) { | 74 void FakeConnectionToClient::set_host_stub(HostStub* host_stub) { |
53 host_stub_ = host_stub; | 75 host_stub_ = host_stub; |
54 } | 76 } |
55 | 77 |
56 void FakeConnectionToClient::set_input_stub(InputStub* input_stub) { | 78 void FakeConnectionToClient::set_input_stub(InputStub* input_stub) { |
57 input_stub_ = input_stub; | 79 input_stub_ = input_stub; |
58 } | 80 } |
59 | 81 |
60 void FakeConnectionToClient::set_video_feedback_stub( | |
61 VideoFeedbackStub* video_feedback_stub) { | |
62 video_feedback_stub_ = video_feedback_stub; | |
63 } | |
64 | |
65 } // namespace protocol | 82 } // namespace protocol |
66 } // namespace remoting | 83 } // namespace remoting |
OLD | NEW |