| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_SCREEN_CAPTURER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_SCREEN_CAPTURER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_SCREEN_CAPTURER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_SCREEN_CAPTURER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
| 11 #include "media/video/capture/screen/screen_capturer.h" | |
| 12 #include "media/video/capture/video_capture_device.h" | 11 #include "media/video/capture/video_capture_device.h" |
| 13 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
| 13 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class SequencedTaskRunner; | 16 class SequencedTaskRunner; |
| 17 } // namespace base | 17 } // namespace base |
| 18 | 18 |
| 19 namespace media { | 19 namespace media { |
| 20 | 20 |
| 21 // ScreenCaptureDevice implements VideoCaptureDevice for the screen. It's | 21 // ScreenCaptureDevice implements VideoCaptureDevice for the screen. It's |
| 22 // essentially an adapter between ScreenCapturer and VideoCaptureDevice. | 22 // essentially an adapter between ScreenCapturer and VideoCaptureDevice. |
| 23 class MEDIA_EXPORT ScreenCaptureDevice : public VideoCaptureDevice { | 23 class MEDIA_EXPORT ScreenCaptureDevice : public VideoCaptureDevice { |
| 24 public: | 24 public: |
| 25 explicit ScreenCaptureDevice( | 25 explicit ScreenCaptureDevice( |
| 26 scoped_refptr<base::SequencedTaskRunner> task_runner); | 26 scoped_refptr<base::SequencedTaskRunner> task_runner); |
| 27 virtual ~ScreenCaptureDevice(); | 27 virtual ~ScreenCaptureDevice(); |
| 28 | 28 |
| 29 // Helper used in tests to supply a fake capturer. | 29 // Helper used in tests to supply a fake capturer. |
| 30 void SetScreenCapturerForTest( | 30 void SetScreenCapturerForTest( |
| 31 scoped_ptr<media::ScreenCapturer> capturer); | 31 scoped_ptr<webrtc::ScreenCapturer> capturer); |
| 32 | 32 |
| 33 // VideoCaptureDevice interface. | 33 // VideoCaptureDevice interface. |
| 34 virtual void Allocate(int width, int height, | 34 virtual void Allocate(int width, int height, |
| 35 int frame_rate, | 35 int frame_rate, |
| 36 EventHandler* event_handler) OVERRIDE; | 36 EventHandler* event_handler) OVERRIDE; |
| 37 virtual void Start() OVERRIDE; | 37 virtual void Start() OVERRIDE; |
| 38 virtual void Stop() OVERRIDE; | 38 virtual void Stop() OVERRIDE; |
| 39 virtual void DeAllocate() OVERRIDE; | 39 virtual void DeAllocate() OVERRIDE; |
| 40 virtual const Name& device_name() OVERRIDE; | 40 virtual const Name& device_name() OVERRIDE; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 class Core; | 43 class Core; |
| 44 scoped_refptr<Core> core_; | 44 scoped_refptr<Core> core_; |
| 45 Name name_; | 45 Name name_; |
| 46 | 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureDevice); | 47 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureDevice); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace media | 50 } // namespace media |
| 51 | 51 |
| 52 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_SCREEN_CAPTURER_H_ | 52 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_SCREEN_CAPTURER_H_ |
| OLD | NEW |