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_capture_types.h" | 12 #include "media/capture/video_capture_types.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 class VideoCaptureController; | 16 class VideoCaptureController; |
17 | 17 |
18 class CONTENT_EXPORT BuildableDeviceCallbacks { | 18 class CONTENT_EXPORT BuildableDeviceCallbacks { |
19 public: | 19 public: |
20 virtual ~BuildableDeviceCallbacks() {} | 20 virtual ~BuildableDeviceCallbacks() {} |
21 // Returns false if no descriptor was found. | 21 virtual void OnDeviceStarted(VideoCaptureController* controller) = 0; |
22 virtual const media::VideoCaptureDeviceDescriptor* LookupDeviceDescriptor( | |
23 const std::string& id) = 0; | |
24 virtual void WillStartDevice(media::VideoFacingMode facing_mode) = 0; | |
25 virtual void DidStartDevice(VideoCaptureController* controller) = 0; | |
26 virtual void OnDeviceStartFailed(VideoCaptureController* controller) = 0; | 22 virtual void OnDeviceStartFailed(VideoCaptureController* controller) = 0; |
27 virtual void OnDeviceStartAborted() = 0; | 23 virtual void OnDeviceStartAborted() = 0; |
28 }; | 24 }; |
29 | 25 |
30 // Abstraction for a video capture device that must be "built" before it can be | 26 // Abstraction for a video capture device that must be "built" before it can be |
31 // operated and must be "stopped", before it can be released. Typical operation | 27 // operated and must be "stopped", before it can be released. Typical operation |
32 // is that a newly created instance initially reports IsDeviceAlive() == false. | 28 // is that a newly created instance initially reports IsDeviceAlive() == false. |
33 // Clients call CreateAndStartDeviceAsync(), which kicks off the asynchronous | 29 // Clients call CreateAndStartDeviceAsync(), which kicks off the asynchronous |
34 // building of the device. The outcome of the device building is typically | 30 // building of the device. The outcome of the device building is typically |
35 // reported to an instance of BuildableDeviceCallbacks (see above). Once the | 31 // reported to an instance of BuildableDeviceCallbacks (see above). Once the |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 virtual void RequestRefreshFrame() = 0; | 67 virtual void RequestRefreshFrame() = 0; |
72 | 68 |
73 // Methods for specific types of devices. | 69 // Methods for specific types of devices. |
74 virtual void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id, | 70 virtual void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id, |
75 base::OnceClosure done_cb) = 0; | 71 base::OnceClosure done_cb) = 0; |
76 }; | 72 }; |
77 | 73 |
78 } // namespace content | 74 } // namespace content |
79 | 75 |
80 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ | 76 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ |
OLD | NEW |