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. |
joedow
2016/02/09 17:21:15
Does this TODO need a bug to track the work?
Sergey Ulanov
2016/02/09 20:07:23
I don't think it's worth opening bugs for simple c
|
+ 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 |