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" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // instance of Callbacks. Once the device has been built successfully, the | 23 // instance of Callbacks. Once the device has been built successfully, the |
24 // "Device operation methods", are allowed to be called. ReleaseDeviceAsync() | 24 // "Device operation methods", are allowed to be called. ReleaseDeviceAsync() |
25 // must be called in order to release the device if it has before been built | 25 // must be called in order to release the device if it has before been built |
26 // successfully. After calling ReleaseDeviceAsync(), it is legal to call | 26 // successfully. After calling ReleaseDeviceAsync(), it is legal to call |
27 // CreateAndStartDeviceAsync() to rebuild and start the device again. | 27 // CreateAndStartDeviceAsync() to rebuild and start the device again. |
28 class CONTENT_EXPORT BuildableVideoCaptureDevice { | 28 class CONTENT_EXPORT BuildableVideoCaptureDevice { |
29 public: | 29 public: |
30 class CONTENT_EXPORT Callbacks { | 30 class CONTENT_EXPORT Callbacks { |
31 public: | 31 public: |
32 virtual ~Callbacks() {} | 32 virtual ~Callbacks() {} |
33 virtual void OnDeviceStarted(VideoCaptureController* controller) = 0; | 33 // Returns nullptr if no descriptor was found. |
| 34 virtual const media::VideoCaptureDeviceDescriptor* LookupDeviceDescriptor( |
| 35 const std::string& id) = 0; |
| 36 virtual void WillStartDevice(media::VideoFacingMode facing_mode) = 0; |
| 37 virtual void DidStartDevice(VideoCaptureController* controller) = 0; |
34 virtual void OnDeviceStartFailed(VideoCaptureController* controller) = 0; | 38 virtual void OnDeviceStartFailed(VideoCaptureController* controller) = 0; |
35 virtual void OnDeviceStartAborted() = 0; | 39 virtual void OnDeviceStartAborted() = 0; |
36 }; | 40 }; |
37 | 41 |
38 virtual ~BuildableVideoCaptureDevice() {} | 42 virtual ~BuildableVideoCaptureDevice() {} |
39 | 43 |
40 // Device management methods. | 44 // Device management methods. |
41 virtual void CreateAndStartDeviceAsync( | 45 virtual void CreateAndStartDeviceAsync( |
42 VideoCaptureController* controller, | 46 VideoCaptureController* controller, |
43 const media::VideoCaptureParams& params, | 47 const media::VideoCaptureParams& params, |
(...skipping 17 matching lines...) Expand all Loading... |
61 virtual void RequestRefreshFrame() = 0; | 65 virtual void RequestRefreshFrame() = 0; |
62 | 66 |
63 // Methods for specific types of devices. | 67 // Methods for specific types of devices. |
64 virtual void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id, | 68 virtual void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id, |
65 base::OnceClosure done_cb) = 0; | 69 base::OnceClosure done_cb) = 0; |
66 }; | 70 }; |
67 | 71 |
68 } // namespace content | 72 } // namespace content |
69 | 73 |
70 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ | 74 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ |
OLD | NEW |