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

Unified Diff: webrtc/modules/desktop_capture/screen_capturer_x11.cc

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_x11.cc
diff --git a/webrtc/modules/desktop_capture/screen_capturer_x11.cc b/webrtc/modules/desktop_capture/screen_capturer_x11.cc
index 65e682b6f8bdc1bd28ba99d515077122fc105adb..4848235e3f70baf647912c353344face73e704e7 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_x11.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_x11.cc
@@ -26,6 +26,7 @@
#include "webrtc/modules/desktop_capture/differ.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/modules/desktop_capture/x11/x_server_pixel_buffer.h"
#include "webrtc/system_wrappers/include/logging.h"
#include "webrtc/system_wrappers/include/tick_util.h"
@@ -106,7 +107,7 @@ class ScreenCapturerLinux : public ScreenCapturer,
ScreenCapturerHelper helper_;
// Queue of the frames buffers.
- ScreenCaptureFrameQueue queue_;
+ ScreenCaptureFrameQueue<SharedDesktopFrame> queue_;
// Invalid region from the previous capture. This is used to synchronize the
// current with the last buffer used.
@@ -237,6 +238,7 @@ void ScreenCapturerLinux::Capture(const DesktopRegion& region) {
TickTime capture_start_time = TickTime::Now();
queue_.MoveToNextFrame();
+ RTC_DCHECK(!queue_.current_frame() || !queue_.current_frame()->IsShared());
// Process XEvents for XDamage and cursor shape tracking.
options_.x_display()->ProcessPendingXEvents();
@@ -256,7 +258,7 @@ void ScreenCapturerLinux::Capture(const DesktopRegion& region) {
if (!queue_.current_frame()) {
std::unique_ptr<DesktopFrame> frame(
new BasicDesktopFrame(x_server_pixel_buffer_.window_size()));
- queue_.ReplaceCurrentFrame(frame.release());
+ queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(frame.release()));
}
// Refresh the Differ helper used by CaptureFrame(), if needed.
« no previous file with comments | « webrtc/modules/desktop_capture/screen_capturer_mac.mm ('k') | webrtc/modules/desktop_capture/shared_desktop_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698