Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Unified Diff: webrtc/modules/desktop_capture/shared_memory.h

Issue 2697453002: [DesktopCapturer] FallbackDesktopCapturerWrapper and its tests (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/desktop_capture/shared_memory.h
diff --git a/webrtc/modules/desktop_capture/shared_memory.h b/webrtc/modules/desktop_capture/shared_memory.h
index 6e15f23f6b8a4a0429f2d4aa2c09228f447d03bc..df4a91973e66fab65357ea71d115162c991070ba 100644
--- a/webrtc/modules/desktop_capture/shared_memory.h
+++ b/webrtc/modules/desktop_capture/shared_memory.h
@@ -76,6 +76,24 @@ class SharedMemoryFactory {
RTC_DISALLOW_COPY_AND_ASSIGN(SharedMemoryFactory);
};
+// Implementation to share a SharedMemoryFactory between DesktopCapturer
+// instances.
+class SharedMemoryFactoryWrapper : public SharedMemoryFactory {
+ public:
+ ~SharedMemoryFactoryWrapper() override;
+
+ // |factory| must not be nullptr, and it must overlive this instance.
+ static std::unique_ptr<SharedMemoryFactory> Wrap(
+ const std::unique_ptr<SharedMemoryFactory>& factory);
+
+ std::unique_ptr<SharedMemory> CreateSharedMemory(size_t size) override;
+
+ private:
+ SharedMemoryFactoryWrapper(SharedMemoryFactory* factory);
+
+ SharedMemoryFactory* factory_;
+};
+
} // namespace webrtc
#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_SHARED_MEMORY_H_

Powered by Google App Engine
This is Rietveld 408576698