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_BLINK_VIDEO_FRAME_COMPOSITOR_H_ | 5 #ifndef MEDIA_BLINK_VIDEO_FRAME_COMPOSITOR_H_ |
6 #define MEDIA_BLINK_VIDEO_FRAME_COMPOSITOR_H_ | 6 #define MEDIA_BLINK_VIDEO_FRAME_COMPOSITOR_H_ |
7 | 7 |
| 8 #include <utility> |
| 9 |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
11 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
12 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
13 #include "base/time/tick_clock.h" | 15 #include "base/time/tick_clock.h" |
14 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
15 #include "cc/layers/video_frame_provider.h" | 17 #include "cc/layers/video_frame_provider.h" |
16 #include "media/base/video_renderer_sink.h" | 18 #include "media/base/video_renderer_sink.h" |
17 #include "media/blink/media_blink_export.h" | 19 #include "media/blink/media_blink_export.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // the frequency of canvas or WebGL paints requested via JavaScript. | 105 // the frequency of canvas or WebGL paints requested via JavaScript. |
104 scoped_refptr<VideoFrame> GetCurrentFrameAndUpdateIfStale(); | 106 scoped_refptr<VideoFrame> GetCurrentFrameAndUpdateIfStale(); |
105 | 107 |
106 // Returns the timestamp of the current (possibly stale) frame, or | 108 // Returns the timestamp of the current (possibly stale) frame, or |
107 // base::TimeDelta() if there is no current frame. This method may be called | 109 // base::TimeDelta() if there is no current frame. This method may be called |
108 // from the media thread as long as the VFC is stopped. (Assuming that | 110 // from the media thread as long as the VFC is stopped. (Assuming that |
109 // PaintFrameUsingOldRenderingPath() is not also called while stopped.) | 111 // PaintFrameUsingOldRenderingPath() is not also called while stopped.) |
110 base::TimeDelta GetCurrentFrameTimestamp() const; | 112 base::TimeDelta GetCurrentFrameTimestamp() const; |
111 | 113 |
112 void set_tick_clock_for_testing(scoped_ptr<base::TickClock> tick_clock) { | 114 void set_tick_clock_for_testing(scoped_ptr<base::TickClock> tick_clock) { |
113 tick_clock_ = tick_clock.Pass(); | 115 tick_clock_ = std::move(tick_clock); |
114 } | 116 } |
115 | 117 |
116 void clear_current_frame_for_testing() { current_frame_ = nullptr; } | 118 void clear_current_frame_for_testing() { current_frame_ = nullptr; } |
117 | 119 |
118 // Enables or disables background rendering. If |enabled|, |timeout| is the | 120 // Enables or disables background rendering. If |enabled|, |timeout| is the |
119 // amount of time to wait after the last Render() call before starting the | 121 // amount of time to wait after the last Render() call before starting the |
120 // background rendering mode. Note, this can not disable the background | 122 // background rendering mode. Note, this can not disable the background |
121 // rendering call issues when a sink is started. | 123 // rendering call issues when a sink is started. |
122 void set_background_rendering_for_testing(bool enabled) { | 124 void set_background_rendering_for_testing(bool enabled) { |
123 background_rendering_enabled_ = enabled; | 125 background_rendering_enabled_ = enabled; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 // These values are updated and read from the media and compositor threads. | 178 // These values are updated and read from the media and compositor threads. |
177 base::Lock callback_lock_; | 179 base::Lock callback_lock_; |
178 VideoRendererSink::RenderCallback* callback_; | 180 VideoRendererSink::RenderCallback* callback_; |
179 | 181 |
180 DISALLOW_COPY_AND_ASSIGN(VideoFrameCompositor); | 182 DISALLOW_COPY_AND_ASSIGN(VideoFrameCompositor); |
181 }; | 183 }; |
182 | 184 |
183 } // namespace media | 185 } // namespace media |
184 | 186 |
185 #endif // MEDIA_BLINK_VIDEO_FRAME_COMPOSITOR_H_ | 187 #endif // MEDIA_BLINK_VIDEO_FRAME_COMPOSITOR_H_ |
OLD | NEW |