OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ |
7 | 7 |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/public/common/media_stream_request.h" | 10 #include "content/public/common/media_stream_request.h" |
11 #include "media/capture/video/video_capture_device.h" | 11 #include "media/capture/video/video_capture_device.h" |
| 12 #include "media/capture/video/video_capture_device_info.h" |
12 #include "media/capture/video_capture_types.h" | 13 #include "media/capture/video_capture_types.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 class VideoCaptureController; | 17 class VideoCaptureController; |
17 | 18 |
18 // Abstraction for a video capture device that must be "built" before it can be | 19 // Abstraction for a video capture device that must be "built" before it can be |
19 // operated and must be "stopped", before it can be released. Typical operation | 20 // operated and must be "stopped", before it can be released. Typical operation |
20 // is that a newly created instance initially reports IsDeviceAlive() == false. | 21 // is that a newly created instance initially reports IsDeviceAlive() == false. |
21 // Clients call CreateAndStartDeviceAsync(), which kicks off the asynchronous | 22 // Clients call CreateAndStartDeviceAsync(), which kicks off the asynchronous |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 media::VideoCaptureDevice::TakePhotoCallback callback) = 0; | 59 media::VideoCaptureDevice::TakePhotoCallback callback) = 0; |
59 virtual void MaybeSuspendDevice() = 0; | 60 virtual void MaybeSuspendDevice() = 0; |
60 virtual void ResumeDevice() = 0; | 61 virtual void ResumeDevice() = 0; |
61 virtual void RequestRefreshFrame() = 0; | 62 virtual void RequestRefreshFrame() = 0; |
62 | 63 |
63 // Methods for specific types of devices. | 64 // Methods for specific types of devices. |
64 virtual void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id, | 65 virtual void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id, |
65 base::OnceClosure done_cb) = 0; | 66 base::OnceClosure done_cb) = 0; |
66 }; | 67 }; |
67 | 68 |
| 69 class CONTENT_EXPORT VideoCaptureProvider { |
| 70 public: |
| 71 virtual ~VideoCaptureProvider() {} |
| 72 |
| 73 // The passed-in |result_callback| must guarantee that the called |
| 74 // instance stays alive until |result_callback| is invoked. |
| 75 virtual void GetDeviceInfosAsync( |
| 76 const base::Callback< |
| 77 void(const std::vector<media::VideoCaptureDeviceInfo>&)>& |
| 78 result_callback) = 0; |
| 79 |
| 80 virtual std::unique_ptr<BuildableVideoCaptureDevice> CreateBuildableDevice( |
| 81 const std::string& device_id, |
| 82 MediaStreamType stream_type) = 0; |
| 83 }; |
| 84 |
68 } // namespace content | 85 } // namespace content |
69 | 86 |
70 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ | 87 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ |
OLD | NEW |