| Index: remoting/host/desktop_environment.h
|
| diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h
|
| index 74b1d8e71b0e833a2b8df4026204b78173d06c79..06b0b3736a37b88700721b3a2294f907dd8a498a 100644
|
| --- a/remoting/host/desktop_environment.h
|
| +++ b/remoting/host/desktop_environment.h
|
| @@ -9,51 +9,51 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/callback_forward.h"
|
| +#include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
|
|
| +namespace base {
|
| +class SingleThreadTaskRunner;
|
| +} // namespace base
|
| +
|
| namespace remoting {
|
|
|
| class AudioCapturer;
|
| class EventExecutor;
|
| class VideoFrameCapturer;
|
|
|
| -namespace protocol {
|
| -class ClipboardStub;
|
| -}
|
| -
|
| +// Provides factory methods for creation of audio/video capturers and event
|
| +// executor for a given desktop environment.
|
| class DesktopEnvironment {
|
| 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);
|
| -
|
| - private:
|
| - // Used to capture audio to deliver to clients.
|
| - scoped_ptr<AudioCapturer> audio_capturer_;
|
| + virtual ~DesktopEnvironment() {}
|
| +
|
| + // Factory methods used to create audio/video capturers and event executor for
|
| + // a particular desktop environment.
|
| + virtual scoped_ptr<AudioCapturer> CreateAudioCapturer(
|
| + scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) = 0;
|
| + virtual scoped_ptr<EventExecutor> CreateEventExecutor(
|
| + scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
|
| + scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) = 0;
|
| + virtual scoped_ptr<VideoFrameCapturer> CreateVideoCapturer(
|
| + scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
|
| + scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) = 0;
|
| +};
|
|
|
| - // Executes input and clipboard events received from the client.
|
| - scoped_ptr<EventExecutor> event_executor_;
|
| +// Used to create |DesktopEnvironment| instances.
|
| +class DesktopEnvironmentFactory {
|
| + public:
|
| + virtual ~DesktopEnvironmentFactory() {}
|
|
|
| - // Used to capture video to deliver to clients.
|
| - scoped_ptr<VideoFrameCapturer> video_capturer_;
|
| + // Creates an instance of |DesktopEnvironment|. |disconnect_callback| may be
|
| + // used by the DesktopEnvironment to disconnect the client session.
|
| + virtual scoped_ptr<DesktopEnvironment> Create(
|
| + const std::string& client_jid,
|
| + const base::Closure& disconnect_callback) = 0;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment);
|
| + // Returns |true| if created |DesktopEnvironment| instances support audio
|
| + // capture.
|
| + virtual bool SupportsAudioCapture() const = 0;
|
| };
|
|
|
| } // namespace remoting
|
|
|