| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ |
| 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ | 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 // The receiver to which we post events. | 102 // The receiver to which we post events. |
| 103 const std::unique_ptr<VideoFrameReceiver> receiver_; | 103 const std::unique_ptr<VideoFrameReceiver> receiver_; |
| 104 std::vector<int> buffer_ids_known_by_receiver_; | 104 std::vector<int> buffer_ids_known_by_receiver_; |
| 105 | 105 |
| 106 const VideoCaptureJpegDecoderFactoryCB jpeg_decoder_factory_callback_; | 106 const VideoCaptureJpegDecoderFactoryCB jpeg_decoder_factory_callback_; |
| 107 std::unique_ptr<VideoCaptureJpegDecoder> external_jpeg_decoder_; | 107 std::unique_ptr<VideoCaptureJpegDecoder> external_jpeg_decoder_; |
| 108 | 108 |
| 109 // Whether |external_jpeg_decoder_| has been initialized. | 109 // Whether |external_jpeg_decoder_| has been initialized. |
| 110 bool external_jpeg_decoder_initialized_; | 110 bool external_jpeg_decoder_initialized_; |
| 111 base::OnceClosure on_started_using_gpu_cb_; |
| 111 | 112 |
| 112 // The pool of shared-memory buffers used for capturing. | 113 // The pool of shared-memory buffers used for capturing. |
| 113 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; | 114 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; |
| 114 | 115 |
| 115 #if DCHECK_IS_ON() | 116 #if DCHECK_IS_ON() |
| 116 // Counter used to track the number of times consecutive capture buffers are | 117 // Counter used to track the number of times consecutive capture buffers are |
| 117 // dropped. | 118 // dropped. |
| 118 int dropped_frame_counter_ = 0; | 119 int dropped_frame_counter_ = 0; |
| 119 | 120 |
| 120 static const int kMaxDroppedFrames = 150; | 121 static const int kMaxDroppedFrames = 150; |
| 121 #endif // DCHECK_IS_ON() | 122 #endif // DCHECK_IS_ON() |
| 122 | 123 |
| 123 media::VideoPixelFormat last_captured_pixel_format_; | 124 media::VideoPixelFormat last_captured_pixel_format_; |
| 124 | 125 |
| 125 // Thread collision warner to ensure that producer-facing API is not called | 126 // Thread collision warner to ensure that producer-facing API is not called |
| 126 // concurrently. Producers are allowed to call from multiple threads, but not | 127 // concurrently. Producers are allowed to call from multiple threads, but not |
| 127 // concurrently. | 128 // concurrently. |
| 128 DFAKE_MUTEX(call_from_producer_); | 129 DFAKE_MUTEX(call_from_producer_); |
| 129 | 130 |
| 130 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient); | 131 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient); |
| 131 }; | 132 }; |
| 132 | 133 |
| 133 } // namespace media | 134 } // namespace media |
| 134 | 135 |
| 135 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ | 136 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ |
| OLD | NEW |