| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ | 5 #ifndef REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ |
| 6 #define REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ | 6 #define REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
| 17 } // namespace base | 17 } // namespace base |
| 18 | 18 |
| 19 namespace media { |
| 20 class ScreenCapturer; |
| 21 } // namespace media |
| 22 |
| 19 namespace remoting { | 23 namespace remoting { |
| 20 | 24 |
| 21 class AudioCapturer; | 25 class AudioCapturer; |
| 22 class EventExecutor; | 26 class EventExecutor; |
| 23 class VideoFrameCapturer; | |
| 24 | 27 |
| 25 // Provides factory methods for creation of audio/video capturers and event | 28 // Provides factory methods for creation of audio/video capturers and event |
| 26 // executor for a given desktop environment. | 29 // executor for a given desktop environment. |
| 27 class DesktopEnvironment { | 30 class DesktopEnvironment { |
| 28 public: | 31 public: |
| 29 virtual ~DesktopEnvironment() {} | 32 virtual ~DesktopEnvironment() {} |
| 30 | 33 |
| 31 // Factory methods used to create audio/video capturers and event executor for | 34 // Factory methods used to create audio/video capturers and event executor for |
| 32 // a particular desktop environment. | 35 // a particular desktop environment. |
| 33 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer( | 36 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer( |
| 34 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) = 0; | 37 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) = 0; |
| 35 virtual scoped_ptr<EventExecutor> CreateEventExecutor( | 38 virtual scoped_ptr<EventExecutor> CreateEventExecutor( |
| 36 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 39 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 37 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) = 0; | 40 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) = 0; |
| 38 virtual scoped_ptr<VideoFrameCapturer> CreateVideoCapturer( | 41 virtual scoped_ptr<media::ScreenCapturer> CreateVideoCapturer( |
| 39 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, | 42 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
| 40 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) = 0; | 43 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) = 0; |
| 41 }; | 44 }; |
| 42 | 45 |
| 43 // Used to create |DesktopEnvironment| instances. | 46 // Used to create |DesktopEnvironment| instances. |
| 44 class DesktopEnvironmentFactory { | 47 class DesktopEnvironmentFactory { |
| 45 public: | 48 public: |
| 46 virtual ~DesktopEnvironmentFactory() {} | 49 virtual ~DesktopEnvironmentFactory() {} |
| 47 | 50 |
| 48 // Creates an instance of |DesktopEnvironment|. |disconnect_callback| may be | 51 // Creates an instance of |DesktopEnvironment|. |disconnect_callback| may be |
| 49 // used by the DesktopEnvironment to disconnect the client session. | 52 // used by the DesktopEnvironment to disconnect the client session. |
| 50 virtual scoped_ptr<DesktopEnvironment> Create( | 53 virtual scoped_ptr<DesktopEnvironment> Create( |
| 51 const std::string& client_jid, | 54 const std::string& client_jid, |
| 52 const base::Closure& disconnect_callback) = 0; | 55 const base::Closure& disconnect_callback) = 0; |
| 53 | 56 |
| 54 // Returns |true| if created |DesktopEnvironment| instances support audio | 57 // Returns |true| if created |DesktopEnvironment| instances support audio |
| 55 // capture. | 58 // capture. |
| 56 virtual bool SupportsAudioCapture() const = 0; | 59 virtual bool SupportsAudioCapture() const = 0; |
| 57 }; | 60 }; |
| 58 | 61 |
| 59 } // namespace remoting | 62 } // namespace remoting |
| 60 | 63 |
| 61 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ | 64 #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ |
| OLD | NEW |