Index: webrtc/modules/desktop_capture/win/callback_shared_memory_factory.h |
diff --git a/webrtc/modules/desktop_capture/win/callback_shared_memory_factory.h b/webrtc/modules/desktop_capture/win/callback_shared_memory_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..48274d17ffdd7134a6665be851364aaeadcba06d |
--- /dev/null |
+++ b/webrtc/modules/desktop_capture/win/callback_shared_memory_factory.h |
@@ -0,0 +1,40 @@ |
+/* |
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+#ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_CALLBACK_SHARED_MEMORY_FACTORY_H_ |
+#define WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_CALLBACK_SHARED_MEMORY_FACTORY_H_ |
+ |
+#include <stddef.h> |
+ |
+#include "webrtc/base/scoped_ptr.h" |
+#include "webrtc/modules/desktop_capture/desktop_capturer.h" |
+#include "webrtc/modules/desktop_capture/shared_memory.h" |
+ |
+namespace webrtc { |
+ |
+// SharedMemoryFactory that creates SharedMemory using the deprecated |
+// DesktopCapturer::Callback::CreateSharedMemory(). |
+class CallbackSharedMemoryFactory : public SharedMemoryFactory { |
Sergey Ulanov
2016/03/31 18:41:15
why do you need this?
I think DesktopCapturer::Cal
Hzj_jie
2016/04/05 23:15:17
Done.
|
+ public: |
+ CallbackSharedMemoryFactory(DesktopCapturer::Callback* callback) |
+ : callback_(callback) {} |
+ ~CallbackSharedMemoryFactory() override {} |
+ |
+ rtc::scoped_ptr<SharedMemory> CreateSharedMemory(size_t size) override { |
+ return rtc::scoped_ptr<SharedMemory>(callback_->CreateSharedMemory(size)); |
+ } |
+ |
+ private: |
+ DesktopCapturer::Callback* callback_; |
+}; |
+ |
+} // namespace webrtc |
+ |
+#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_CALLBACK_SHARED_MEMORY_FACTORY_H_ |