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

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

Issue 2607203002: [Mojo Video Capture] Retire buffers when Android Chromium goes to the background (Closed)
Patch Set: mcasas comments Created 3 years, 10 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_device_client.h
diff --git a/media/capture/video/video_capture_device_client.h b/media/capture/video/video_capture_device_client.h
index b2dcb0a15b188d6364b2e9142ee3bab264ac2b58..02ed78747b8216cfbbb955d3bf59efa7bfab8f07 100644
--- a/media/capture/video/video_capture_device_client.h
+++ b/media/capture/video/video_capture_device_client.h
@@ -9,10 +9,12 @@
#include <stdint.h>
#include <memory>
+#include <vector>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "base/threading/thread_collision_warner.h"
#include "media/capture/capture_export.h"
#include "media/capture/video/video_capture_device.h"
@@ -34,11 +36,6 @@ using VideoCaptureJpegDecoderFactoryCB =
// v4l2_thread on Linux, and the UI thread for tab capture.
// The owner is responsible for making sure that the instance outlives these
// calls.
-//
-// It has an internal ref counted TextureWrapHelper class used to wrap incoming
-// GpuMemoryBuffers into Texture backed VideoFrames. This class creates and
-// manages the necessary entities to interact with the GPU process, notably an
-// offscreen Context to avoid janking the UI thread.
class CAPTURE_EXPORT VideoCaptureDeviceClient
: public media::VideoCaptureDevice::Client,
public base::SupportsWeakPtr<VideoCaptureDeviceClient> {
@@ -103,6 +100,7 @@ class CAPTURE_EXPORT VideoCaptureDeviceClient
// The receiver to which we post events.
const std::unique_ptr<VideoFrameReceiver> receiver_;
+ std::vector<int> buffer_ids_known_by_receiver_;
const VideoCaptureJpegDecoderFactoryCB jpeg_decoder_factory_callback_;
std::unique_ptr<VideoCaptureJpegDecoder> external_jpeg_decoder_;
@@ -123,6 +121,11 @@ class CAPTURE_EXPORT VideoCaptureDeviceClient
media::VideoPixelFormat last_captured_pixel_format_;
+ // Thread collision warner to ensure that producer-facing API is not called
+ // concurrently. Producers are allowed to call from multiple threads, but not
+ // concurrently.
+ DFAKE_MUTEX(call_from_producer_);
+
DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient);
};

Powered by Google App Engine
This is Rietveld 408576698