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

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

Issue 1845113002: DirectX based screen capturer logic (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove width change in Texture::Capture 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_capture_frame_queue.cc
diff --git a/webrtc/modules/desktop_capture/screen_capture_frame_queue.cc b/webrtc/modules/desktop_capture/screen_capture_frame_queue.cc
index 94d8a27b137600db17dda571b3f5366ec5d637c4..b8bc1c609d60061d0cbd6bedae49cba26b92b12f 100644
--- a/webrtc/modules/desktop_capture/screen_capture_frame_queue.cc
+++ b/webrtc/modules/desktop_capture/screen_capture_frame_queue.cc
@@ -10,35 +10,23 @@
#include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h"
-#include <assert.h>
#include <algorithm>
-#include "webrtc/modules/desktop_capture/desktop_frame.h"
+#include "webrtc/base/checks.h"
#include "webrtc/modules/desktop_capture/shared_desktop_frame.h"
-#include "webrtc/system_wrappers/include/logging.h"
-#include "webrtc/typedefs.h"
namespace webrtc {
-ScreenCaptureFrameQueue::ScreenCaptureFrameQueue() : current_(0) {}
-
-ScreenCaptureFrameQueue::~ScreenCaptureFrameQueue() {}
-
void ScreenCaptureFrameQueue::MoveToNextFrame() {
- current_ = (current_ + 1) % kQueueLength;
+ MoveToNext();
// Verify that the frame is not shared, i.e. that consumer has released it
// before attempting to capture again.
- assert(!frames_[current_].get() || !frames_[current_]->IsShared());
+ RTC_DCHECK(!current() || !current()->IsShared());
Sergey Ulanov 2016/04/14 23:10:42 I don't think we need MoveToNextFrame() just for t
Hzj_jie 2016/04/15 19:42:17 It would be a large change, considering we have fi
Sergey Ulanov 2016/04/19 23:51:07 That's good point. I suggest refactoring ScreenCap
Hzj_jie 2016/04/26 23:00:07 Done.
}
void ScreenCaptureFrameQueue::ReplaceCurrentFrame(DesktopFrame* frame) {
- frames_[current_].reset(SharedDesktopFrame::Wrap(frame));
-}
-
-void ScreenCaptureFrameQueue::Reset() {
- for (int i = 0; i < kQueueLength; ++i)
- frames_[i].reset();
+ ReplaceCurrent(SharedDesktopFrame::Wrap(frame));
Sergey Ulanov 2016/04/14 23:10:42 Same here - make the caller responsible for wrappi
Hzj_jie 2016/04/15 19:42:17 Same as above, but I also have concern to your dec
}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698