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

Unified Diff: webrtc/modules/desktop_capture/screen_capturer_mac.mm

Issue 1902323002: Modify ScreenCaptureFrameQueue into a template (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix build break in Chromium Created 4 years, 8 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/screen_capturer_mac.mm
diff --git a/webrtc/modules/desktop_capture/screen_capturer_mac.mm b/webrtc/modules/desktop_capture/screen_capturer_mac.mm
index c41dc4d7a3b4ba59e4ebe6880f1e090dae5386b5..76de59ef103fdcfebe8209d74ca90d2c04bb9391 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_mac.mm
+++ b/webrtc/modules/desktop_capture/screen_capturer_mac.mm
@@ -22,6 +22,7 @@
#include <OpenGL/CGLMacro.h>
#include <OpenGL/OpenGL.h>
+#include "webrtc/base/checks.h"
#include "webrtc/base/macutils.h"
#include "webrtc/modules/desktop_capture/desktop_capture_options.h"
#include "webrtc/modules/desktop_capture/desktop_frame.h"
@@ -32,6 +33,7 @@
#include "webrtc/modules/desktop_capture/mac/scoped_pixel_buffer_object.h"
#include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h"
#include "webrtc/modules/desktop_capture/screen_capturer_helper.h"
+#include "webrtc/modules/desktop_capture/shared_desktop_frame.h"
#include "webrtc/system_wrappers/include/logging.h"
#include "webrtc/system_wrappers/include/tick_util.h"
@@ -234,7 +236,7 @@ class ScreenCapturerMac : public ScreenCapturer {
ScopedPixelBufferObject pixel_buffer_object_;
// Queue of the frames buffers.
- ScreenCaptureFrameQueue queue_;
+ ScreenCaptureFrameQueue<SharedDesktopFrame> queue_;
// Current display configuration.
MacDesktopConfiguration desktop_config_;
@@ -384,6 +386,7 @@ void ScreenCapturerMac::Capture(const DesktopRegion& region_to_capture) {
TickTime capture_start_time = TickTime::Now();
queue_.MoveToNextFrame();
+ RTC_DCHECK(!queue_.current_frame() || !queue_.current_frame()->IsShared());
desktop_config_monitor_->Lock();
MacDesktopConfiguration new_config =
@@ -405,7 +408,7 @@ void ScreenCapturerMac::Capture(const DesktopRegion& region_to_capture) {
// Note that we can't reallocate other buffers at this point, since the caller
// may still be reading from them.
if (!queue_.current_frame())
- queue_.ReplaceCurrentFrame(CreateFrame());
+ queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(CreateFrame()));
DesktopFrame* current_frame = queue_.current_frame();
« no previous file with comments | « webrtc/modules/desktop_capture/screen_capture_frame_queue.cc ('k') | webrtc/modules/desktop_capture/screen_capturer_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698