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_; | |
112 | 111 |
113 // The pool of shared-memory buffers used for capturing. | 112 // The pool of shared-memory buffers used for capturing. |
114 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; | 113 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; |
115 | 114 |
116 #if DCHECK_IS_ON() | 115 #if DCHECK_IS_ON() |
117 // Counter used to track the number of times consecutive capture buffers are | 116 // Counter used to track the number of times consecutive capture buffers are |
118 // dropped. | 117 // dropped. |
119 int dropped_frame_counter_ = 0; | 118 int dropped_frame_counter_ = 0; |
120 | 119 |
121 static const int kMaxDroppedFrames = 150; | 120 static const int kMaxDroppedFrames = 150; |
122 #endif // DCHECK_IS_ON() | 121 #endif // DCHECK_IS_ON() |
123 | 122 |
124 media::VideoPixelFormat last_captured_pixel_format_; | 123 media::VideoPixelFormat last_captured_pixel_format_; |
125 | 124 |
126 // Thread collision warner to ensure that producer-facing API is not called | 125 // Thread collision warner to ensure that producer-facing API is not called |
127 // concurrently. Producers are allowed to call from multiple threads, but not | 126 // concurrently. Producers are allowed to call from multiple threads, but not |
128 // concurrently. | 127 // concurrently. |
129 DFAKE_MUTEX(call_from_producer_); | 128 DFAKE_MUTEX(call_from_producer_); |
130 | 129 |
131 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient); | 130 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient); |
132 }; | 131 }; |
133 | 132 |
134 } // namespace media | 133 } // namespace media |
135 | 134 |
136 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ | 135 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ |
OLD | NEW |