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

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

Issue 1678073003: Cleanup shared memory handling in DesktopCapturer interface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 631f119b5ffb6f24334c026b60ee7768b402266d..0490bc05b4e2f37dcebf402c133a50f386048919 100644
--- a/webrtc/modules/desktop_capture/shared_memory.h
+++ b/webrtc/modules/desktop_capture/shared_memory.h
@@ -17,6 +17,7 @@
#include <windows.h>
#endif
+#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/constructormagic.h"
#include "webrtc/typedefs.h"
@@ -26,8 +27,8 @@ namespace webrtc {
// parameters of the buffer, but doesn't have any logic to allocate or destroy
// the actual buffer. DesktopCapturer consumers that need to use shared memory
// for video frames must extend this class with creation and destruction logic
-// specific for the target platform and then implement
-// DesktopCapturer::Delegate::CreateSharedMemory() as appropriate.
+// specific for the target platform and then call
+// DesktopCapturer::SetSharedMemoryFactory().
class SharedMemory {
public:
#if defined(WEBRTC_WIN)
@@ -62,6 +63,18 @@ class SharedMemory {
RTC_DISALLOW_COPY_AND_ASSIGN(SharedMemory);
};
+// Interface used to create SharedMemory instances.
+class SharedMemoryFactory {
+ public:
+ SharedMemoryFactory() {}
+ virtual ~SharedMemoryFactory() {}
+
+ virtual rtc::scoped_ptr<SharedMemory> CreateSharedMemory(size_t size) = 0;
+
+ private:
+ RTC_DISALLOW_COPY_AND_ASSIGN(SharedMemoryFactory);
+};
+
} // namespace webrtc
#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_SHARED_MEMORY_H_

Powered by Google App Engine
This is Rietveld 408576698