| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ | 5 #ifndef DEVICE_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ |
| 6 #define MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ | 6 #define DEVICE_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "device/capture/capture_export.h" |
| 13 #include "device/capture/content/video_capture_oracle.h" |
| 14 #include "device/capture/video/video_capture_device.h" |
| 12 #include "media/base/video_frame.h" | 15 #include "media/base/video_frame.h" |
| 13 #include "media/capture/capture_export.h" | 16 |
| 14 #include "media/capture/content/video_capture_oracle.h" | 17 namespace media { |
| 15 #include "media/capture/video/video_capture_device.h" | 18 struct VideoCaptureParams; |
| 19 class VideoFrame; |
| 20 } // namespace media |
| 16 | 21 |
| 17 namespace tracked_objects { | 22 namespace tracked_objects { |
| 18 class Location; | 23 class Location; |
| 19 } // namespace tracked_objects | 24 } // namespace tracked_objects |
| 20 | 25 |
| 21 namespace media { | 26 namespace device { |
| 22 | |
| 23 struct VideoCaptureParams; | |
| 24 class VideoFrame; | |
| 25 | 27 |
| 26 // Thread-safe, refcounted proxy to the VideoCaptureOracle. This proxy wraps | 28 // Thread-safe, refcounted proxy to the VideoCaptureOracle. This proxy wraps |
| 27 // the VideoCaptureOracle, which decides which frames to capture, and a | 29 // the VideoCaptureOracle, which decides which frames to capture, and a |
| 28 // VideoCaptureDevice::Client, which allocates and receives the captured | 30 // VideoCaptureDevice::Client, which allocates and receives the captured |
| 29 // frames, in a lock to synchronize state between the two. | 31 // frames, in a lock to synchronize state between the two. |
| 30 class CAPTURE_EXPORT ThreadSafeCaptureOracle | 32 class CAPTURE_EXPORT ThreadSafeCaptureOracle |
| 31 : public base::RefCountedThreadSafe<ThreadSafeCaptureOracle> { | 33 : public base::RefCountedThreadSafe<ThreadSafeCaptureOracle> { |
| 32 public: | 34 public: |
| 33 ThreadSafeCaptureOracle(std::unique_ptr<VideoCaptureDevice::Client> client, | 35 ThreadSafeCaptureOracle(std::unique_ptr<VideoCaptureDevice::Client> client, |
| 34 const VideoCaptureParams& params, | 36 const VideoCaptureParams& params, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Recipient of our capture activity. | 117 // Recipient of our capture activity. |
| 116 std::unique_ptr<VideoCaptureDevice::Client> client_; | 118 std::unique_ptr<VideoCaptureDevice::Client> client_; |
| 117 | 119 |
| 118 // Makes the decision to capture a frame. | 120 // Makes the decision to capture a frame. |
| 119 VideoCaptureOracle oracle_; | 121 VideoCaptureOracle oracle_; |
| 120 | 122 |
| 121 // The video capture parameters used to construct the oracle proxy. | 123 // The video capture parameters used to construct the oracle proxy. |
| 122 const VideoCaptureParams params_; | 124 const VideoCaptureParams params_; |
| 123 }; | 125 }; |
| 124 | 126 |
| 125 } // namespace media | 127 } // namespace device |
| 126 | 128 |
| 127 #endif // MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ | 129 #endif // DEVICE_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ |
| OLD | NEW |