Chromium Code Reviews| 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..a7a8d0cdf30f8a5d4d2c374ceb3dc3ef8318f9de 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 <set> |
| #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" |
| @@ -103,6 +105,7 @@ class CAPTURE_EXPORT VideoCaptureDeviceClient |
| // The receiver to which we post events. |
| const std::unique_ptr<VideoFrameReceiver> receiver_; |
| + std::set<int> buffer_ids_known_by_receiver_; |
| const VideoCaptureJpegDecoderFactoryCB jpeg_decoder_factory_callback_; |
| std::unique_ptr<VideoCaptureJpegDecoder> external_jpeg_decoder_; |
| @@ -123,6 +126,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_); |
|
mcasas
2017/01/20 22:41:32
Ooooh this is brilliant!
chfremer
2017/01/25 23:45:23
Acknowledged.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient); |
| }; |