Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // VideoCaptureDevice is the abstract base class for realizing video capture | 5 // VideoCaptureDevice is the abstract base class for realizing video capture |
| 6 // device support in Chromium. It provides the interface for OS dependent | 6 // device support in Chromium. It provides the interface for OS dependent |
| 7 // implementations. | 7 // implementations. |
| 8 // The class is created and functions are invoked on a thread owned by | 8 // The class is created and functions are invoked on a thread owned by |
| 9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS | 9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS |
| 10 // specific implementation. | 10 // specific implementation. |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 #include "media/capture/video/video_capture_device_descriptor.h" | 34 #include "media/capture/video/video_capture_device_descriptor.h" |
| 35 #include "media/capture/video_capture_types.h" | 35 #include "media/capture/video_capture_types.h" |
| 36 #include "ui/gfx/gpu_memory_buffer.h" | 36 #include "ui/gfx/gpu_memory_buffer.h" |
| 37 | 37 |
| 38 namespace tracked_objects { | 38 namespace tracked_objects { |
| 39 class Location; | 39 class Location; |
| 40 } // namespace tracked_objects | 40 } // namespace tracked_objects |
| 41 | 41 |
| 42 namespace media { | 42 namespace media { |
| 43 | 43 |
| 44 class CAPTURE_EXPORT FrameBufferPool { | |
| 45 public: | |
| 46 virtual ~FrameBufferPool() {} | |
| 47 | |
| 48 virtual void SetBufferHold(int buffer_id) = 0; | |
| 49 virtual void ReleaseBufferHold(int buffer_id) = 0; | |
| 50 }; | |
| 51 | |
| 52 class CAPTURE_EXPORT VideoFrameConsumerFeedbackObserver { | 44 class CAPTURE_EXPORT VideoFrameConsumerFeedbackObserver { |
| 53 public: | 45 public: |
| 54 virtual ~VideoFrameConsumerFeedbackObserver() {} | 46 virtual ~VideoFrameConsumerFeedbackObserver() {} |
| 55 | 47 |
| 56 // During processing of a video frame, consumers may report back their | 48 // During processing of a video frame, consumers may report back their |
| 57 // utilization level to the source device. The device may use this information | 49 // utilization level to the source device. The device may use this information |
| 58 // to adjust the rate of data it pushes out. Values are interpreted as | 50 // to adjust the rate of data it pushes out. Values are interpreted as |
| 59 // follows: | 51 // follows: |
| 60 // Less than 0.0 is meaningless and should be ignored. 1.0 indicates a | 52 // Less than 0.0 is meaningless and should be ignored. 1.0 indicates a |
| 61 // maximum sustainable utilization. Greater than 1.0 indicates the consumer | 53 // maximum sustainable utilization. Greater than 1.0 indicates the consumer |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 | 102 |
| 111 Buffer(); | 103 Buffer(); |
| 112 Buffer(int buffer_id, | 104 Buffer(int buffer_id, |
| 113 int frame_feedback_id, | 105 int frame_feedback_id, |
| 114 std::unique_ptr<HandleProvider> handle_provider, | 106 std::unique_ptr<HandleProvider> handle_provider, |
| 115 std::unique_ptr<ScopedAccessPermission> access_permission); | 107 std::unique_ptr<ScopedAccessPermission> access_permission); |
| 116 ~Buffer(); | 108 ~Buffer(); |
| 117 Buffer(Buffer&& other); | 109 Buffer(Buffer&& other); |
| 118 Buffer& operator=(Buffer&& other); | 110 Buffer& operator=(Buffer&& other); |
| 119 | 111 |
| 120 bool is_valid() const { return handle_provider_ != nullptr; } | 112 bool is_valid() const { return handle_provider != nullptr; } |
| 121 int id() const { return id_; } | 113 int id() const { return id_; } |
| 122 int frame_feedback_id() const { return frame_feedback_id_; } | 114 int frame_feedback_id() const { return frame_feedback_id_; } |
| 123 HandleProvider* handle_provider() const { return handle_provider_.get(); } | 115 |
| 116 std::unique_ptr<HandleProvider> handle_provider; | |
|
miu
2017/02/14 00:41:27
style: Classes shouldn't have public-access data m
chfremer
2017/02/14 21:15:16
I still feel this should be a plain struct. This w
| |
| 117 std::unique_ptr<ScopedAccessPermission> access_permission; | |
|
miu
2017/02/14 00:41:27
ditto
chfremer
2017/02/14 21:15:16
Acknowledged.
| |
| 124 | 118 |
| 125 private: | 119 private: |
| 126 std::unique_ptr<HandleProvider> handle_provider_; | |
| 127 std::unique_ptr<ScopedAccessPermission> access_permission_; | |
| 128 int id_; | 120 int id_; |
| 129 int frame_feedback_id_; | 121 int frame_feedback_id_; |
| 130 | 122 |
| 131 DISALLOW_COPY_AND_ASSIGN(Buffer); | 123 DISALLOW_COPY_AND_ASSIGN(Buffer); |
| 132 }; | 124 }; |
| 133 | 125 |
| 134 virtual ~Client() {} | 126 virtual ~Client() {} |
| 135 | 127 |
| 136 // Captured a new video frame, data for which is pointed to by |data|. | 128 // Captured a new video frame, data for which is pointed to by |data|. |
| 137 // | 129 // |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 | 294 |
| 303 private: | 295 private: |
| 304 // Gets the power line frequency from the current system time zone if this is | 296 // Gets the power line frequency from the current system time zone if this is |
| 305 // defined, otherwise returns 0. | 297 // defined, otherwise returns 0. |
| 306 PowerLineFrequency GetPowerLineFrequencyForLocation() const; | 298 PowerLineFrequency GetPowerLineFrequencyForLocation() const; |
| 307 }; | 299 }; |
| 308 | 300 |
| 309 } // namespace media | 301 } // namespace media |
| 310 | 302 |
| 311 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_ | 303 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |