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

Unified Diff: remoting/host/desktop_environment.h

Issue 11761019: Tiny little refactoring of DesktopEnvironment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/client_session_unittest.cc ('k') | remoting/host/desktop_environment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_environment.h
diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h
index 74b1d8e71b0e833a2b8df4026204b78173d06c79..12ebe2f6b4dc4e366efcd847462f573de7b57662 100644
--- a/remoting/host/desktop_environment.h
+++ b/remoting/host/desktop_environment.h
@@ -9,50 +9,80 @@
#include "base/basictypes.h"
#include "base/callback_forward.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "remoting/protocol/clipboard_stub.h"
+#include "remoting/protocol/input_stub.h"
+#include "third_party/skia/include/core/SkSize.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+} // namespace base
namespace remoting {
-class AudioCapturer;
-class EventExecutor;
-class VideoFrameCapturer;
+class AudioEncoder;
+class VideoEncoder;
namespace protocol {
-class ClipboardStub;
-}
+class AudioStub;
+class CursorShapeStub;
+class VideoStub;
+} // namespace protocol
-class DesktopEnvironment {
+// This interface provides audio/video capturing, input injection and clipboard
+// handling capatilities utilized by ClientSession. All public methods of
+// DesktopEnvironment must be called on the network thread.
+class DesktopEnvironment
+ : public protocol::ClipboardStub,
+ public protocol::InputStub {
public:
- DesktopEnvironment(scoped_ptr<AudioCapturer> audio_capturer,
- scoped_ptr<EventExecutor> event_executor,
- scoped_ptr<VideoFrameCapturer> video_capturer);
- virtual ~DesktopEnvironment();
-
- AudioCapturer* audio_capturer() const { return audio_capturer_.get(); }
- EventExecutor* event_executor() const { return event_executor_.get(); }
- VideoFrameCapturer* video_capturer() const { return video_capturer_.get(); }
-
- // Starts the desktop environment passing |client_jid| of the attached
- // authenticated session. Registers |client_clipboard| to receive
- // notifications about local clipboard changes. |disconnect_callback| can be
- // invoked by the DesktopEnvironment to request the client session to be
- // disconnected. |disconnect_callback| is invoked on the same thread Start()
- // has been called on.
- virtual void Start(
- scoped_ptr<protocol::ClipboardStub> client_clipboard,
- const std::string& client_jid,
- const base::Closure& disconnect_callback);
+ DesktopEnvironment() {}
+ virtual ~DesktopEnvironment() {}
- private:
- // Used to capture audio to deliver to clients.
- scoped_ptr<AudioCapturer> audio_capturer_;
+ // Starts recording audio. Recorded audio packets are ecoded by
+ // |audio_encoder| and passed to |audio_stub|. |audio_stub| must outlive
+ // |this|.
+ virtual void StartAudio(
+ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
+ scoped_ptr<AudioEncoder> audio_encoder,
+ protocol::AudioStub* audio_stub) = 0;
+
+ // Enable or disable audio on a running session.
+ // This leaves the audio capturer running, and only affects whether or not the
+ // captured audio is encoded and sent on the wire.
+ virtual void PauseAudio(bool pause) = 0;
+
+ // Starts input injection and registers |clipboard_stub| to receive local
+ // clipboard updates. |clipboard_stub| must outlive |this|.
+ virtual void StartInput(
+ scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
+ protocol::ClipboardStub* clipboard_stub) = 0;
- // Executes input and clipboard events received from the client.
- scoped_ptr<EventExecutor> event_executor_;
+ // Starts capturing video frames and track cursor share updates. Captured
+ // video frames are encoded by |video_encoder| and passed to |video_stub|.
+ // |cursor_shape_stub| will be notified about cursor shape changes. Both
+ // |cursor_shape_stub| and |video_stub| must outlive |this|.
+ virtual void StartVideo(
+ scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner,
+ scoped_ptr<VideoEncoder> video_encoder,
+ protocol::CursorShapeStub* cursor_shape_stub,
+ protocol::VideoStub* video_stub) = 0;
- // Used to capture video to deliver to clients.
- scoped_ptr<VideoFrameCapturer> video_capturer_;
+ // Returns the screen size for the most recently captured video frame.
+ virtual SkISize GetScreenSize() const = 0;
+ // Pauses or resumes scheduling of frame captures. Pausing/resuming captures
+ // only affects capture scheduling and does not stop/start the capturer.
+ virtual void PauseVideo(bool pause) = 0;
+
+ // Updates the sequence number (used for performance measurements) embedded in
+ // VideoPackets.
+ virtual void UpdateSequenceNumber(int64 sequence_number) = 0;
+
+ private:
DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment);
};
« no previous file with comments | « remoting/host/client_session_unittest.cc ('k') | remoting/host/desktop_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698