| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  | // Copyright (c) 2019 GitHub, Inc.
 | 
					
						
							|  |  |  | // Use of this source code is governed by the MIT license that can be
 | 
					
						
							|  |  |  | // found in the LICENSE file.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-22 08:34:31 +01:00
										 |  |  | #ifndef ELECTRON_SHELL_BROWSER_OSR_OSR_VIDEO_CONSUMER_H_
 | 
					
						
							|  |  |  | #define ELECTRON_SHELL_BROWSER_OSR_OSR_VIDEO_CONSUMER_H_
 | 
					
						
							| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <memory>
 | 
					
						
							| 
									
										
										
										
											2020-04-13 16:39:26 -07:00
										 |  |  | #include <string>
 | 
					
						
							| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-29 12:42:57 -05:00
										 |  |  | #include "base/functional/callback_forward.h"
 | 
					
						
							| 
									
										
										
										
											2023-05-11 16:07:39 -04:00
										 |  |  | #include "base/memory/raw_ptr.h"
 | 
					
						
							| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  | #include "base/memory/weak_ptr.h"
 | 
					
						
							|  |  |  | #include "components/viz/host/client_frame_sink_video_capturer.h"
 | 
					
						
							| 
									
										
										
										
											2022-01-10 17:31:39 -05:00
										 |  |  | #include "media/capture/mojom/video_capture_buffer.mojom-forward.h"
 | 
					
						
							| 
									
										
										
										
											2020-02-27 11:00:07 -08:00
										 |  |  | #include "media/capture/mojom/video_capture_types.mojom.h"
 | 
					
						
							| 
									
										
										
										
											2024-08-23 08:23:13 +08:00
										 |  |  | #include "shell/browser/osr/osr_paint_event.h"
 | 
					
						
							| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-19 14:23:04 -07:00
										 |  |  | namespace electron { | 
					
						
							| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | class OffScreenRenderWidgetHostView; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OffScreenVideoConsumer : public viz::mojom::FrameSinkVideoConsumer { | 
					
						
							|  |  |  |  public: | 
					
						
							|  |  |  |   OffScreenVideoConsumer(OffScreenRenderWidgetHostView* view, | 
					
						
							|  |  |  |                          OnPaintCallback callback); | 
					
						
							|  |  |  |   ~OffScreenVideoConsumer() override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-03 12:41:45 +01:00
										 |  |  |   // disable copy
 | 
					
						
							|  |  |  |   OffScreenVideoConsumer(const OffScreenVideoConsumer&) = delete; | 
					
						
							|  |  |  |   OffScreenVideoConsumer& operator=(const OffScreenVideoConsumer&) = delete; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  |   void SetActive(bool active); | 
					
						
							|  |  |  |   void SetFrameRate(int frame_rate); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  private: | 
					
						
							|  |  |  |   // viz::mojom::FrameSinkVideoConsumer implementation.
 | 
					
						
							|  |  |  |   void OnFrameCaptured( | 
					
						
							| 
									
										
										
										
											2022-01-10 17:31:39 -05:00
										 |  |  |       ::media::mojom::VideoBufferHandlePtr data, | 
					
						
							| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  |       ::media::mojom::VideoFrameInfoPtr info, | 
					
						
							|  |  |  |       const gfx::Rect& content_rect, | 
					
						
							| 
									
										
										
										
											2020-02-27 11:00:07 -08:00
										 |  |  |       mojo::PendingRemote<viz::mojom::FrameSinkVideoConsumerFrameCallbacks> | 
					
						
							|  |  |  |           callbacks) override; | 
					
						
							| 
									
										
											  
											
												refactor: put empty virtual function definitions in header (#43285)
* refactor: in FramelessView, move empty function decls to header
* refactor: in electron::api::WebContents, move empty function decls to header
* refactor: in electron::api::NativeWindow, move empty function decls to header
* refactor: in electron::OffScreenWebContentsView, move empty function decls to header
* refactor: in electron::OffScreenRenderWidgetHostView, move empty function decls to header
* refactor: in auto_updater::AutoUpdater, move empty function decls to header
* refactor: in electorn::api::FrameSubscriber, move empty function decls to header
* refactor: in electorn::api::SimpleURLLoaderWrapper, move empty function decls to header
* refactor: in electorn::InspectableWebContents, move empty function decls to header
* refactor: in electorn::OffScreenVideoConsumer, move empty function decls to header
* refactor: in electron::OffScreenWebContentsView, move empty function decls to header
* refactor: in electron::TrayIcon, move empty function decls to header
* refactor: in electron::ViewsDelegate, move empty function decls to header
* refactor: in electron::MediaCaptureDevicesDispatcher, move empty function decls to header
* refactor: in electron::UsbChooserContext::DeviceObserver, move empty function decls to header
* refactor: in electron::ProxyingWebSocket, move empty function decls to header
* refactor: in electron::Notification, move empty function decls to header
* refactor: in electron::PlatformNotificationService, move empty function decls to header
* Revert "refactor: in electron::PlatformNotificationService, move empty function decls to header"
This reverts commit 9103750d03b9ba1ceccba43d11dfdc2404ff6191.
* refactor: in electron::ElectronPDFDocumentHelperClient, move empty function decls to header
* refactor: in electron::api::SpellCheckClient, move empty function decls to header
* refactor: in electron::ElectronExtensionHostDelegate, move empty function decls to header
* refactor: in electron::PlatformNotificationService, move empty function decls to header
* refactor: in electron::NativeWindowViews, move empty function decls to header
* chore: move SetTouchBar() back to cc
* Revert "refactor: in auto_updater::AutoUpdater, move empty function decls to header"
This reverts commit c43d6862d32c74f63f82700a7546a732ac05ecb8.
											
										 
											2024-08-12 02:56:51 -05:00
										 |  |  |   void OnNewSubCaptureTargetVersion(uint32_t crop_version) override {} | 
					
						
							|  |  |  |   void OnFrameWithEmptyRegionCapture() override {} | 
					
						
							|  |  |  |   void OnStopped() override {} | 
					
						
							|  |  |  |   void OnLog(const std::string& message) override {} | 
					
						
							| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |   OnPaintCallback callback_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-11 16:07:39 -04:00
										 |  |  |   raw_ptr<OffScreenRenderWidgetHostView> view_; | 
					
						
							| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  |   std::unique_ptr<viz::ClientFrameSinkVideoCapturer> video_capturer_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-26 19:16:21 +01:00
										 |  |  |   base::WeakPtrFactory<OffScreenVideoConsumer> weak_ptr_factory_{this}; | 
					
						
							| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-19 14:23:04 -07:00
										 |  |  | }  // namespace electron
 | 
					
						
							| 
									
										
										
										
											2019-04-17 23:10:04 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-22 08:34:31 +01:00
										 |  |  | #endif  // ELECTRON_SHELL_BROWSER_OSR_OSR_VIDEO_CONSUMER_H_
 |