| 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_SCREEN_CAPTURE_DEVICE_CORE_H_ | 5 #ifndef MEDIA_CAPTURE_SCREEN_CAPTURE_DEVICE_CORE_H_ |
| 6 #define MEDIA_CAPTURE_SCREEN_CAPTURE_DEVICE_CORE_H_ | 6 #define MEDIA_CAPTURE_SCREEN_CAPTURE_DEVICE_CORE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 13 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
| 14 #include "media/capture/thread_safe_capture_oracle.h" | 14 #include "media/capture/thread_safe_capture_oracle.h" |
| 15 #include "media/video/capture/video_capture_device.h" | 15 #include "media/video/capture/video_capture_device.h" |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 struct VideoCaptureParams; | 19 struct VideoCaptureParams; |
| 20 | 20 |
| 21 class ThreadSafeCaptureOracle; | 21 class ThreadSafeCaptureOracle; |
| 22 | 22 |
| 23 // Keeps track of the video capture source frames and executes copying. | 23 // Keeps track of the video capture source frames and executes copying. |
| 24 class VideoCaptureMachine { | 24 class MEDIA_EXPORT VideoCaptureMachine { |
| 25 public: | 25 public: |
| 26 VideoCaptureMachine() {} | 26 VideoCaptureMachine(); |
| 27 virtual ~VideoCaptureMachine() {} | 27 virtual ~VideoCaptureMachine(); |
| 28 | 28 |
| 29 // Starts capturing. | 29 // Starts capturing. |
| 30 // |callback| is invoked with true if succeeded. Otherwise, with false. | 30 // |callback| is invoked with true if succeeded. Otherwise, with false. |
| 31 virtual void Start(const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy, | 31 virtual void Start(const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy, |
| 32 const VideoCaptureParams& params, | 32 const VideoCaptureParams& params, |
| 33 const base::Callback<void(bool)> callback) = 0; | 33 const base::Callback<void(bool)> callback) = 0; |
| 34 | 34 |
| 35 // Stops capturing. | 35 // Stops capturing. |
| 36 // |callback| is invoked after the capturing has stopped. | 36 // |callback| is invoked after the capturing has stopped. |
| 37 virtual void Stop(const base::Closure& callback) = 0; | 37 virtual void Stop(const base::Closure& callback) = 0; |
| 38 | 38 |
| 39 // Returns true if the video capture is configured to monitor end-to-end |
| 40 // system utilization, and alter frame sizes and/or frame rates to mitigate |
| 41 // overloading or under-utilization. |
| 42 virtual bool IsAutoThrottlingEnabled() const; |
| 43 |
| 39 private: | 44 private: |
| 40 DISALLOW_COPY_AND_ASSIGN(VideoCaptureMachine); | 45 DISALLOW_COPY_AND_ASSIGN(VideoCaptureMachine); |
| 41 }; | 46 }; |
| 42 | 47 |
| 43 // The "meat" of a content video capturer. | 48 // The "meat" of a content video capturer. |
| 44 // | 49 // |
| 45 // Separating this from the "shell classes" WebContentsVideoCaptureDevice and | 50 // Separating this from the "shell classes" WebContentsVideoCaptureDevice and |
| 46 // DesktopCaptureDeviceAura allows safe destruction without needing to block any | 51 // DesktopCaptureDeviceAura allows safe destruction without needing to block any |
| 47 // threads, as well as code sharing. | 52 // threads, as well as code sharing. |
| 48 // | 53 // |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // component of the system with direct access to |client_|. | 100 // component of the system with direct access to |client_|. |
| 96 scoped_refptr<ThreadSafeCaptureOracle> oracle_proxy_; | 101 scoped_refptr<ThreadSafeCaptureOracle> oracle_proxy_; |
| 97 | 102 |
| 98 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureDeviceCore); | 103 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureDeviceCore); |
| 99 }; | 104 }; |
| 100 | 105 |
| 101 | 106 |
| 102 } // namespace media | 107 } // namespace media |
| 103 | 108 |
| 104 #endif // MEDIA_CAPTURE_SCREEN_CAPTURE_DEVICE_CORE_H_ | 109 #endif // MEDIA_CAPTURE_SCREEN_CAPTURE_DEVICE_CORE_H_ |
| OLD | NEW |