OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 size_hints->min_aspect.y = size_hints->max_aspect.y = height_; | 137 size_hints->min_aspect.y = size_hints->max_aspect.y = height_; |
138 XSetWMNormalHints(display_, window_, size_hints); | 138 XSetWMNormalHints(display_, window_, size_hints); |
139 XFree(size_hints); | 139 XFree(size_hints); |
140 | 140 |
141 XWindowChanges wc; | 141 XWindowChanges wc; |
142 wc.width = static_cast<int>(width); | 142 wc.width = static_cast<int>(width); |
143 wc.height = static_cast<int>(height); | 143 wc.height = static_cast<int>(height); |
144 XConfigureWindow(display_, window_, CWWidth | CWHeight, &wc); | 144 XConfigureWindow(display_, window_, CWWidth | CWHeight, &wc); |
145 } | 145 } |
146 | 146 |
147 void GlxRenderer::RenderFrame(const webrtc::VideoFrame& frame, | 147 void GlxRenderer::OnFrame(const webrtc::VideoFrame& frame) { |
148 int /*render_delay_ms*/) { | |
149 if (static_cast<size_t>(frame.width()) != width_ || | 148 if (static_cast<size_t>(frame.width()) != width_ || |
150 static_cast<size_t>(frame.height()) != height_) { | 149 static_cast<size_t>(frame.height()) != height_) { |
151 Resize(static_cast<size_t>(frame.width()), | 150 Resize(static_cast<size_t>(frame.width()), |
152 static_cast<size_t>(frame.height())); | 151 static_cast<size_t>(frame.height())); |
153 } | 152 } |
154 | 153 |
155 XEvent event; | 154 XEvent event; |
156 if (!glXMakeCurrent(display_, window_, context_)) { | 155 if (!glXMakeCurrent(display_, window_, context_)) { |
157 abort(); | 156 abort(); |
158 } | 157 } |
159 while (XPending(display_)) { | 158 while (XPending(display_)) { |
160 XNextEvent(display_, &event); | 159 XNextEvent(display_, &event); |
161 switch (event.type) { | 160 switch (event.type) { |
162 case ConfigureNotify: | 161 case ConfigureNotify: |
163 GlRenderer::ResizeViewport(event.xconfigure.width, | 162 GlRenderer::ResizeViewport(event.xconfigure.width, |
164 event.xconfigure.height); | 163 event.xconfigure.height); |
165 break; | 164 break; |
166 default: | 165 default: |
167 break; | 166 break; |
168 } | 167 } |
169 } | 168 } |
170 | 169 |
171 GlRenderer::RenderFrame(frame, 0); | 170 GlRenderer::OnFrame(frame); |
172 glXSwapBuffers(display_, window_); | 171 glXSwapBuffers(display_, window_); |
173 | 172 |
174 if (!glXMakeCurrent(display_, None, NULL)) { | 173 if (!glXMakeCurrent(display_, None, NULL)) { |
175 abort(); | 174 abort(); |
176 } | 175 } |
177 } | 176 } |
178 } // test | 177 } // test |
179 } // webrtc | 178 } // webrtc |
OLD | NEW |