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

Unified Diff: webrtc/modules/desktop_capture/desktop_capturer.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/desktop_capturer.h
diff --git a/webrtc/modules/desktop_capture/desktop_capturer.h b/webrtc/modules/desktop_capture/desktop_capturer.h
index 7ad16364977416af3e1a79dc592cc0b9a0dd4a41..47f78dc3ff411510aabc417045419e010605487b 100644
--- a/webrtc/modules/desktop_capture/desktop_capturer.h
+++ b/webrtc/modules/desktop_capture/desktop_capturer.h
@@ -13,13 +13,14 @@
#include <stddef.h>
+#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/desktop_capture/desktop_capture_types.h"
+#include "webrtc/modules/desktop_capture/shared_memory.h"
namespace webrtc {
class DesktopFrame;
class DesktopRegion;
-class SharedMemory;
// Abstract interface for screen and window capturers.
class DesktopCapturer {
@@ -27,10 +28,10 @@ class DesktopCapturer {
// Interface that must be implemented by the DesktopCapturer consumers.
class Callback {
public:
- // Creates a new shared memory buffer for a frame create by the capturer.
- // Should return null shared memory is not used for captured frames (in that
- // case the capturer will allocate memory on the heap).
- virtual SharedMemory* CreateSharedMemory(size_t size) = 0;
+ // Deprecated.
+ // TODO(sergeyu): Remove this method once all references to it are removed
+ // from chromium.
+ virtual SharedMemory* CreateSharedMemory(size_t size) { return nullptr; }
// Called after a frame has been captured. Handler must take ownership of
// |frame|. If capture has failed for any reason |frame| is set to NULL
@@ -47,6 +48,13 @@ class DesktopCapturer {
// valid until capturer is destroyed.
virtual void Start(Callback* callback) = 0;
+ // Sets SharedMemoryFactory that will be used to create buffers for the
+ // captured frames. The factory can be invoked on a thread other than the one
+ // where Capture() is called. It will be destroyed on the same thread. Shared
+ // memory is currently supported only by some DesktopCapturer implementations.
+ virtual void SetSharedMemoryFactory(
+ rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {}
+
// Captures next frame. |region| specifies region of the capture target that
// should be fresh in the resulting frame. The frame may also include fresh
// data for areas outside |region|. In that case capturer will include these
« no previous file with comments | « webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc ('k') | webrtc/modules/desktop_capture/desktop_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698