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

Unified Diff: remoting/protocol/fake_connection_to_client.h

Issue 1472873005: Add VideoStream interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_video_pump
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/protocol/fake_connection_to_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/fake_connection_to_client.h
diff --git a/remoting/protocol/fake_connection_to_client.h b/remoting/protocol/fake_connection_to_client.h
index d389a37b99208fdb4e90a1616a567381340d4b6c..1176a68e8ca9c6d77d2b8a8c94a024456fe29a6d 100644
--- a/remoting/protocol/fake_connection_to_client.h
+++ b/remoting/protocol/fake_connection_to_client.h
@@ -5,12 +5,39 @@
#ifndef REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_
#define REMOTING_PROTOCOL_FAKE_CONNECTION_TO_CLIENT_H_
+#include "base/callback.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "remoting/protocol/connection_to_client.h"
+#include "remoting/protocol/video_stream.h"
namespace remoting {
namespace protocol {
+class FakeVideoStream : public protocol::VideoStream {
+ public:
+ FakeVideoStream();
+ ~FakeVideoStream() override;
+
+ // protocol::VideoStream interface.
+ void Pause(bool pause) override;
+ void OnInputEventReceived(int64_t event_timestamp) override;
+ void SetLosslessEncode(bool want_lossless) override;
+ void SetLosslessColor(bool want_lossless) override;
+ void SetSizeCallback(const SizeCallback& size_callback) override;
+
+ const SizeCallback& size_callback() { return size_callback_; }
+
+ base::WeakPtr<FakeVideoStream> GetWeakPtr();
+
+ private:
+ SizeCallback size_callback_;
+
+ base::WeakPtrFactory<FakeVideoStream> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeVideoStream);
+};
+
class FakeConnectionToClient : public ConnectionToClient {
public:
FakeConnectionToClient(scoped_ptr<Session> session);
@@ -18,7 +45,9 @@ class FakeConnectionToClient : public ConnectionToClient {
void SetEventHandler(EventHandler* event_handler) override;
- VideoStub* video_stub() override;
+ scoped_ptr<VideoStream> StartVideoStream(
+ scoped_ptr<webrtc::DesktopCapturer> desktop_capturer) override;
+
AudioStub* audio_stub() override;
ClientStub* client_stub() override;
void Disconnect(ErrorCode disconnect_error) override;
@@ -30,9 +59,10 @@ class FakeConnectionToClient : public ConnectionToClient {
void set_host_stub(HostStub* host_stub) override;
void set_input_stub(InputStub* input_stub) override;
- void set_video_feedback_stub(VideoFeedbackStub* video_feedback_stub) override;
+ base::WeakPtr<FakeVideoStream> last_video_stream() {
+ return last_video_stream_;
+ }
- void set_video_stub(VideoStub* video_stub) { video_stub_ = video_stub; }
void set_audio_stub(AudioStub* audio_stub) { audio_stub_ = audio_stub; }
void set_client_stub(ClientStub* client_stub) { client_stub_ = client_stub; }
@@ -41,8 +71,6 @@ class FakeConnectionToClient : public ConnectionToClient {
HostStub* host_stub() { return host_stub_; }
InputStub* input_stub() { return input_stub_; }
- VideoFeedbackStub* video_feedback_stub() { return video_feedback_stub_; }
-
bool is_connected() { return is_connected_; }
ErrorCode disconnect_error() { return disconnect_error_; }
@@ -50,14 +78,14 @@ class FakeConnectionToClient : public ConnectionToClient {
scoped_ptr<Session> session_;
EventHandler* event_handler_ = nullptr;
- VideoStub* video_stub_ = nullptr;
+ base::WeakPtr<FakeVideoStream> last_video_stream_;
+
AudioStub* audio_stub_ = nullptr;
ClientStub* client_stub_ = nullptr;
ClipboardStub* clipboard_stub_ = nullptr;
HostStub* host_stub_ = nullptr;
InputStub* input_stub_ = nullptr;
- VideoFeedbackStub* video_feedback_stub_ = nullptr;
bool is_connected_ = true;
ErrorCode disconnect_error_ = OK;
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/protocol/fake_connection_to_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698