OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "remoting/client/plugin/pepper_video_renderer_2d.h" | 5 #include "remoting/client/plugin/pepper_video_renderer_2d.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 DCHECK(result) << "Couldn't bind the device context."; | 91 DCHECK(result) << "Couldn't bind the device context."; |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 void PepperVideoRenderer2D::EnableDebugDirtyRegion(bool enable) { | 95 void PepperVideoRenderer2D::EnableDebugDirtyRegion(bool enable) { |
96 debug_dirty_region_ = enable; | 96 debug_dirty_region_ = enable; |
97 } | 97 } |
98 | 98 |
99 bool PepperVideoRenderer2D::Initialize( | 99 bool PepperVideoRenderer2D::Initialize( |
100 const ClientContext& client_context, | 100 const ClientContext& client_context, |
101 protocol::PerformanceTracker* perf_tracker) { | 101 protocol::FrameStatsConsumer* stats_consumer) { |
102 DCHECK(thread_checker_.CalledOnValidThread()); | 102 DCHECK(thread_checker_.CalledOnValidThread()); |
103 | 103 |
104 return software_video_renderer_.Initialize(client_context, perf_tracker); | 104 return software_video_renderer_.Initialize(client_context, stats_consumer); |
105 } | 105 } |
106 | 106 |
107 void PepperVideoRenderer2D::OnSessionConfig( | 107 void PepperVideoRenderer2D::OnSessionConfig( |
108 const protocol::SessionConfig& config) { | 108 const protocol::SessionConfig& config) { |
109 DCHECK(thread_checker_.CalledOnValidThread()); | 109 DCHECK(thread_checker_.CalledOnValidThread()); |
110 | 110 |
111 software_video_renderer_.OnSessionConfig(config); | 111 software_video_renderer_.OnSessionConfig(config); |
112 } | 112 } |
113 | 113 |
114 protocol::VideoStub* PepperVideoRenderer2D::GetVideoStub() { | 114 protocol::VideoStub* PepperVideoRenderer2D::GetVideoStub() { |
115 DCHECK(thread_checker_.CalledOnValidThread()); | 115 DCHECK(thread_checker_.CalledOnValidThread()); |
116 | 116 |
117 return software_video_renderer_.GetVideoStub(); | 117 return software_video_renderer_.GetVideoStub(); |
118 } | 118 } |
119 | 119 |
120 protocol::FrameConsumer* PepperVideoRenderer2D::GetFrameConsumer() { | 120 protocol::FrameConsumer* PepperVideoRenderer2D::GetFrameConsumer() { |
121 DCHECK(thread_checker_.CalledOnValidThread()); | 121 DCHECK(thread_checker_.CalledOnValidThread()); |
122 | 122 |
123 return software_video_renderer_.GetFrameConsumer(); | 123 return software_video_renderer_.GetFrameConsumer(); |
124 } | 124 } |
125 | 125 |
| 126 protocol::FrameStatsConsumer* PepperVideoRenderer2D::GetFrameStatsConsumer() { |
| 127 DCHECK(thread_checker_.CalledOnValidThread()); |
| 128 |
| 129 return software_video_renderer_.GetFrameStatsConsumer(); |
| 130 } |
| 131 |
126 std::unique_ptr<webrtc::DesktopFrame> PepperVideoRenderer2D::AllocateFrame( | 132 std::unique_ptr<webrtc::DesktopFrame> PepperVideoRenderer2D::AllocateFrame( |
127 const webrtc::DesktopSize& size) { | 133 const webrtc::DesktopSize& size) { |
128 DCHECK(thread_checker_.CalledOnValidThread()); | 134 DCHECK(thread_checker_.CalledOnValidThread()); |
129 | 135 |
130 pp::ImageData buffer_data(instance_, PP_IMAGEDATAFORMAT_BGRA_PREMUL, | 136 pp::ImageData buffer_data(instance_, PP_IMAGEDATAFORMAT_BGRA_PREMUL, |
131 pp::Size(size.width(), size.height()), false); | 137 pp::Size(size.width(), size.height()), false); |
132 return base::WrapUnique(new PepperDesktopFrame(buffer_data)); | 138 return base::WrapUnique(new PepperDesktopFrame(buffer_data)); |
133 } | 139 } |
134 | 140 |
135 void PepperVideoRenderer2D::DrawFrame( | 141 void PepperVideoRenderer2D::DrawFrame( |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 flush_pending_ = false; | 216 flush_pending_ = false; |
211 | 217 |
212 // Call all callbacks for the frames we've just flushed. | 218 // Call all callbacks for the frames we've just flushed. |
213 flushing_frames_done_callbacks_.clear(); | 219 flushing_frames_done_callbacks_.clear(); |
214 | 220 |
215 // Flush again if necessary. | 221 // Flush again if necessary. |
216 Flush(); | 222 Flush(); |
217 } | 223 } |
218 | 224 |
219 } // namespace remoting | 225 } // namespace remoting |
OLD | NEW |