| 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 // Returns nullptr if no descriptor was found. | 33 virtual void OnDeviceStarted(VideoCaptureController* controller) = 0; |
| 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; | |
| 38 virtual void OnDeviceStartFailed(VideoCaptureController* controller) = 0; | 34 virtual void OnDeviceStartFailed(VideoCaptureController* controller) = 0; |
| 39 virtual void OnDeviceStartAborted() = 0; | 35 virtual void OnDeviceStartAborted() = 0; |
| 40 }; | 36 }; |
| 41 | 37 |
| 42 virtual ~BuildableVideoCaptureDevice() {} | 38 virtual ~BuildableVideoCaptureDevice() {} |
| 43 | 39 |
| 44 // Device management methods. | 40 // Device management methods. |
| 45 virtual void CreateAndStartDeviceAsync( | 41 virtual void CreateAndStartDeviceAsync( |
| 46 VideoCaptureController* controller, | 42 VideoCaptureController* controller, |
| 47 const media::VideoCaptureParams& params, | 43 const media::VideoCaptureParams& params, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 65 virtual void RequestRefreshFrame() = 0; | 61 virtual void RequestRefreshFrame() = 0; |
| 66 | 62 |
| 67 // Methods for specific types of devices. | 63 // Methods for specific types of devices. |
| 68 virtual void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id, | 64 virtual void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id, |
| 69 base::OnceClosure done_cb) = 0; | 65 base::OnceClosure done_cb) = 0; |
| 70 }; | 66 }; |
| 71 | 67 |
| 72 } // namespace content | 68 } // namespace content |
| 73 | 69 |
| 74 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ | 70 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |