Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: media/capture/content/thread_safe_capture_oracle.h

Issue 1865283003: Revert of Tab/Desktop Capture: Use requests instead of timer-based refreshing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@video_refresh_from_sinks
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 24 matching lines...) Expand all
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.
41 typedef base::Callback<void(const scoped_refptr<VideoFrame>& frame, 41 typedef base::Callback<void(const scoped_refptr<VideoFrame>& frame,
42 base::TimeTicks timestamp, 42 base::TimeTicks timestamp,
43 bool success)> CaptureFrameCallback; 43 bool success)> CaptureFrameCallback;
44 44
45 // Record a change |event| along with its |damage_rect| and |event_time|, and
46 // then make a decision whether to proceed with capture. The decision is based
47 // on recent event history, capture activity, and the availability of
48 // resources.
49 //
50 // If this method returns false, the caller should take no further action.
51 // Otherwise, |storage| is set to the destination for the video frame capture;
52 // and, the caller should initiate capture, and then run |callback| once the
53 // video frame has been populated with its content.
54 bool ObserveEventAndDecideCapture(VideoCaptureOracle::Event event, 45 bool ObserveEventAndDecideCapture(VideoCaptureOracle::Event event,
55 const gfx::Rect& damage_rect, 46 const gfx::Rect& damage_rect,
56 base::TimeTicks event_time, 47 base::TimeTicks event_time,
57 scoped_refptr<VideoFrame>* storage, 48 scoped_refptr<VideoFrame>* storage,
58 CaptureFrameCallback* callback); 49 CaptureFrameCallback* callback);
59 50
60 // Attempt to re-send the last frame to the VideoCaptureDevice::Client.
61 // Returns true if successful. This can fail if the last frame is no longer
62 // available in the buffer pool, or if the VideoCaptureOracle decides to
63 // reject the "passive" refresh.
64 bool AttemptPassiveRefresh();
65
66 base::TimeDelta min_capture_period() const { 51 base::TimeDelta min_capture_period() const {
67 return oracle_.min_capture_period(); 52 return oracle_.min_capture_period();
68 } 53 }
69 54
70 base::TimeTicks last_time_animation_was_detected() const { 55 base::TimeTicks last_time_animation_was_detected() const {
71 return oracle_.last_time_animation_was_detected(); 56 return oracle_.last_time_animation_was_detected();
72 } 57 }
73 58
74 gfx::Size max_frame_size() const { 59 gfx::Size max_frame_size() const {
75 return params_.requested_format.frame_size; 60 return params_.requested_format.frame_size;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // Makes the decision to capture a frame. 101 // Makes the decision to capture a frame.
117 VideoCaptureOracle oracle_; 102 VideoCaptureOracle oracle_;
118 103
119 // The video capture parameters used to construct the oracle proxy. 104 // The video capture parameters used to construct the oracle proxy.
120 const VideoCaptureParams params_; 105 const VideoCaptureParams params_;
121 }; 106 };
122 107
123 } // namespace media 108 } // namespace media
124 109
125 #endif // MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ 110 #endif // MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_
OLDNEW
« no previous file with comments | « media/capture/content/smooth_event_sampler_unittest.cc ('k') | media/capture/content/thread_safe_capture_oracle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698