| 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 MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ |
| 6 #define MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ | 6 #define MEDIA_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 "media/base/media_export.h" |
| 12 #include "media/base/video_frame.h" | 13 #include "media/base/video_frame.h" |
| 13 #include "media/capture/capture_export.h" | |
| 14 #include "media/capture/content/video_capture_oracle.h" | 14 #include "media/capture/content/video_capture_oracle.h" |
| 15 #include "media/capture/video/video_capture_device.h" | 15 #include "media/capture/video/video_capture_device.h" |
| 16 | 16 |
| 17 namespace tracked_objects { | 17 namespace tracked_objects { |
| 18 class Location; | 18 class Location; |
| 19 } // namespace tracked_objects | 19 } // namespace tracked_objects |
| 20 | 20 |
| 21 namespace media { | 21 namespace media { |
| 22 | 22 |
| 23 struct VideoCaptureParams; | 23 struct VideoCaptureParams; |
| 24 class VideoFrame; | 24 class VideoFrame; |
| 25 | 25 |
| 26 // Thread-safe, refcounted proxy to the VideoCaptureOracle. This proxy wraps | 26 // Thread-safe, refcounted proxy to the VideoCaptureOracle. This proxy wraps |
| 27 // the VideoCaptureOracle, which decides which frames to capture, and a | 27 // the VideoCaptureOracle, which decides which frames to capture, and a |
| 28 // VideoCaptureDevice::Client, which allocates and receives the captured | 28 // VideoCaptureDevice::Client, which allocates and receives the captured |
| 29 // frames, in a lock to synchronize state between the two. | 29 // frames, in a lock to synchronize state between the two. |
| 30 class CAPTURE_EXPORT ThreadSafeCaptureOracle | 30 class MEDIA_EXPORT ThreadSafeCaptureOracle |
| 31 : public base::RefCountedThreadSafe<ThreadSafeCaptureOracle> { | 31 : public base::RefCountedThreadSafe<ThreadSafeCaptureOracle> { |
| 32 public: | 32 public: |
| 33 ThreadSafeCaptureOracle(std::unique_ptr<VideoCaptureDevice::Client> client, | 33 ThreadSafeCaptureOracle(std::unique_ptr<VideoCaptureDevice::Client> client, |
| 34 const VideoCaptureParams& params, | 34 const VideoCaptureParams& params, |
| 35 bool enable_auto_throttling); | 35 bool enable_auto_throttling); |
| 36 | 36 |
| 37 // Called when a captured frame is available or an error has occurred. | 37 // Called when a captured frame is available or an error has occurred. |
| 38 // If |success| is true then |frame| is valid and |timestamp| indicates when | 38 // If |success| is true then |frame| is valid and |timestamp| indicates when |
| 39 // the frame was painted. | 39 // the frame was painted. |
| 40 // If |success| is false, all other parameters are invalid. | 40 // If |success| is false, all other parameters are invalid. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // Makes the decision to capture a frame. | 118 // Makes the decision to capture a frame. |
| 119 VideoCaptureOracle oracle_; | 119 VideoCaptureOracle oracle_; |
| 120 | 120 |
| 121 // The video capture parameters used to construct the oracle proxy. | 121 // The video capture parameters used to construct the oracle proxy. |
| 122 const VideoCaptureParams params_; | 122 const VideoCaptureParams params_; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace media | 125 } // namespace media |
| 126 | 126 |
| 127 #endif // MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ | 127 #endif // MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ |
| OLD | NEW |