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

Unified Diff: media/capture/video/video_capture_buffer_pool_impl.h

Issue 2607203002: [Mojo Video Capture] Retire buffers when Android Chromium goes to the background (Closed)
Patch Set: Added tests and fixed a bug uncovered by the tests. Created 3 years, 11 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: media/capture/video/video_capture_buffer_pool_impl.h
diff --git a/media/capture/video/video_capture_buffer_pool_impl.h b/media/capture/video/video_capture_buffer_pool_impl.h
index b5073df7d742ce986effddcfb35ddfce42050e91..ab6cd518eb98330ba9783e47cd5e8bd1819b7cc3 100644
--- a/media/capture/video/video_capture_buffer_pool_impl.h
+++ b/media/capture/video/video_capture_buffer_pool_impl.h
@@ -27,6 +27,9 @@
namespace media {
+// This implementation guarantees that, even when creating new instances,
+// a previously used |buffer_id| is never reused without first cycling through
+// the complete int range.
class CAPTURE_EXPORT VideoCaptureBufferPoolImpl
: public VideoCaptureBufferPool {
public:
@@ -73,7 +76,7 @@ class CAPTURE_EXPORT VideoCaptureBufferPoolImpl
mutable base::Lock lock_;
// The ID of the next buffer.
- int next_buffer_id_;
+ static int next_buffer_id_;
// The ID of the buffer last relinquished by the producer (a candidate for
// resurrection).

Powered by Google App Engine
This is Rietveld 408576698