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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_SCREEN_CAPTURE_DEVICE_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_SCREEN_CAPTURE_DEVICE_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "content/common/content_export.h"
11 #include "media/video/capture/video_capture_device.h"
14 class SequencedTaskRunner
;
23 // ScreenCaptureDevice implements VideoCaptureDevice for the screen. It's
24 // essentially an adapter between ScreenCapturer and VideoCaptureDevice.
25 class CONTENT_EXPORT ScreenCaptureDevice
: public media::VideoCaptureDevice
{
27 explicit ScreenCaptureDevice(
28 scoped_refptr
<base::SequencedTaskRunner
> task_runner
);
29 virtual ~ScreenCaptureDevice();
31 // Helper used in tests to supply a fake capturer.
32 void SetScreenCapturerForTest(
33 scoped_ptr
<webrtc::ScreenCapturer
> capturer
);
35 // VideoCaptureDevice interface.
36 virtual void Allocate(int width
, int height
,
38 EventHandler
* event_handler
) OVERRIDE
;
39 virtual void Start() OVERRIDE
;
40 virtual void Stop() OVERRIDE
;
41 virtual void DeAllocate() OVERRIDE
;
42 virtual const Name
& device_name() OVERRIDE
;
46 scoped_refptr
<Core
> core_
;
49 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureDevice
);
52 } // namespace content
54 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_SCREEN_CAPTURE_DEVICE_H_