| 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 CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ | 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 using CaptureFrameCallback = | 82 using CaptureFrameCallback = |
| 83 media::ThreadSafeCaptureOracle::CaptureFrameCallback; | 83 media::ThreadSafeCaptureOracle::CaptureFrameCallback; |
| 84 | 84 |
| 85 // Response callback for cc::Layer::RequestCopyOfOutput(). | 85 // Response callback for cc::Layer::RequestCopyOfOutput(). |
| 86 void DidCopyOutput(scoped_refptr<media::VideoFrame> video_frame, | 86 void DidCopyOutput(scoped_refptr<media::VideoFrame> video_frame, |
| 87 base::TimeTicks start_time, | 87 base::TimeTicks start_time, |
| 88 const CaptureFrameCallback& capture_frame_cb, | 88 const CaptureFrameCallback& capture_frame_cb, |
| 89 std::unique_ptr<cc::CopyOutputResult> result); | 89 std::unique_ptr<cc::CopyOutputResult> result); |
| 90 | 90 |
| 91 // A helper which does the real work for DidCopyOutput. Returns true if | 91 // A helper which does the real work for DidCopyOutput. Returns true if |
| 92 // succeeded. | 92 // succeeded and |capture_frame_cb| will be run at some future point. Returns |
| 93 // false on error, and |capture_frame_cb| should be run by the caller (with |
| 94 // failure status). |
| 93 bool ProcessCopyOutputResponse(scoped_refptr<media::VideoFrame> video_frame, | 95 bool ProcessCopyOutputResponse(scoped_refptr<media::VideoFrame> video_frame, |
| 94 base::TimeTicks start_time, | 96 base::TimeTicks start_time, |
| 95 const CaptureFrameCallback& capture_frame_cb, | 97 const CaptureFrameCallback& capture_frame_cb, |
| 96 std::unique_ptr<cc::CopyOutputResult> result); | 98 std::unique_ptr<cc::CopyOutputResult> result); |
| 97 | 99 |
| 98 // Renders the cursor if needed and then delivers the captured frame. | 100 // Renders the cursor if needed and then delivers the captured frame. |
| 99 static void CopyOutputFinishedForVideo( | 101 static void CopyOutputFinishedForVideo( |
| 100 base::WeakPtr<AuraWindowCaptureMachine> machine, | 102 base::WeakPtr<AuraWindowCaptureMachine> machine, |
| 101 base::TimeTicks start_time, | 103 base::TimeTicks start_time, |
| 102 const CaptureFrameCallback& capture_frame_cb, | 104 const CaptureFrameCallback& capture_frame_cb, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 132 // immediately when InternalStop() is called to ensure that no more captured | 134 // immediately when InternalStop() is called to ensure that no more captured |
| 133 // frames will be delivered to the client. | 135 // frames will be delivered to the client. |
| 134 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_; | 136 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_; |
| 135 | 137 |
| 136 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine); | 138 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine); |
| 137 }; | 139 }; |
| 138 | 140 |
| 139 } // namespace content | 141 } // namespace content |
| 140 | 142 |
| 141 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ | 143 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ |
| OLD | NEW |