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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // When requested |storage| is PIXEL_STORAGE_CPU, a single shared memory | 87 // When requested |storage| is PIXEL_STORAGE_CPU, a single shared memory |
88 // chunk is reserved. The output buffers stay reserved and mapped for use | 88 // chunk is reserved. The output buffers stay reserved and mapped for use |
89 // until the Buffer objects are destroyed or returned. | 89 // until the Buffer objects are destroyed or returned. |
90 std::unique_ptr<Buffer> ReserveI420OutputBuffer( | 90 std::unique_ptr<Buffer> ReserveI420OutputBuffer( |
91 const gfx::Size& dimensions, | 91 const gfx::Size& dimensions, |
92 media::VideoPixelStorage storage, | 92 media::VideoPixelStorage storage, |
93 uint8_t** y_plane_data, | 93 uint8_t** y_plane_data, |
94 uint8_t** u_plane_data, | 94 uint8_t** u_plane_data, |
95 uint8_t** v_plane_data); | 95 uint8_t** v_plane_data); |
96 | 96 |
| 97 // A branch of OnIncomingCapturedData for Y16 frame_format.pixel_format. |
| 98 void OnIncomingCapturedY16Data(const uint8_t* data, |
| 99 int length, |
| 100 const VideoCaptureFormat& frame_format, |
| 101 base::TimeTicks reference_time, |
| 102 base::TimeDelta timestamp); |
| 103 |
97 // The receiver to which we post events. | 104 // The receiver to which we post events. |
98 const std::unique_ptr<VideoFrameReceiver> receiver_; | 105 const std::unique_ptr<VideoFrameReceiver> receiver_; |
99 | 106 |
100 const VideoCaptureJpegDecoderFactoryCB jpeg_decoder_factory_callback_; | 107 const VideoCaptureJpegDecoderFactoryCB jpeg_decoder_factory_callback_; |
101 std::unique_ptr<VideoCaptureJpegDecoder> external_jpeg_decoder_; | 108 std::unique_ptr<VideoCaptureJpegDecoder> external_jpeg_decoder_; |
102 | 109 |
103 // Whether |external_jpeg_decoder_| has been initialized. | 110 // Whether |external_jpeg_decoder_| has been initialized. |
104 bool external_jpeg_decoder_initialized_; | 111 bool external_jpeg_decoder_initialized_; |
105 | 112 |
106 // The pool of shared-memory buffers used for capturing. | 113 // The pool of shared-memory buffers used for capturing. |
107 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; | 114 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; |
108 | 115 |
109 #if DCHECK_IS_ON() | 116 #if DCHECK_IS_ON() |
110 // 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 |
111 // dropped. | 118 // dropped. |
112 int dropped_frame_counter_ = 0; | 119 int dropped_frame_counter_ = 0; |
113 | 120 |
114 static const int kMaxDroppedFrames = 150; | 121 static const int kMaxDroppedFrames = 150; |
115 #endif // DCHECK_IS_ON() | 122 #endif // DCHECK_IS_ON() |
116 | 123 |
117 media::VideoPixelFormat last_captured_pixel_format_; | 124 media::VideoPixelFormat last_captured_pixel_format_; |
118 | 125 |
119 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient); | 126 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient); |
120 }; | 127 }; |
121 | 128 |
122 } // namespace media | 129 } // namespace media |
123 | 130 |
124 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ | 131 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ |
OLD | NEW |