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