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