| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 void GlRenderer::OnFrame(const webrtc::VideoFrame& frame) { | 73 void GlRenderer::OnFrame(const webrtc::VideoFrame& frame) { |
| 74 RTC_DCHECK(is_init_); | 74 RTC_DCHECK(is_init_); |
| 75 | 75 |
| 76 if (static_cast<size_t>(frame.width()) != width_ || | 76 if (static_cast<size_t>(frame.width()) != width_ || |
| 77 static_cast<size_t>(frame.height()) != height_) { | 77 static_cast<size_t>(frame.height()) != height_) { |
| 78 ResizeVideo(frame.width(), frame.height()); | 78 ResizeVideo(frame.width(), frame.height()); |
| 79 } | 79 } |
| 80 | 80 |
| 81 webrtc::ConvertFromI420(frame, kBGRA, 0, buffer_); | 81 webrtc::ConvertFromI420(frame, VideoType::kBGRA, 0, buffer_); |
| 82 | 82 |
| 83 glEnable(GL_TEXTURE_2D); | 83 glEnable(GL_TEXTURE_2D); |
| 84 glBindTexture(GL_TEXTURE_2D, texture_); | 84 glBindTexture(GL_TEXTURE_2D, texture_); |
| 85 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width_, height_, GL_BGRA, | 85 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width_, height_, GL_BGRA, |
| 86 GL_UNSIGNED_INT_8_8_8_8, buffer_); | 86 GL_UNSIGNED_INT_8_8_8_8, buffer_); |
| 87 | 87 |
| 88 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | 88 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
| 89 | 89 |
| 90 glLoadIdentity(); | 90 glLoadIdentity(); |
| 91 | 91 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 103 glTexCoord2f(1.0f, 0.0f); | 103 glTexCoord2f(1.0f, 0.0f); |
| 104 glVertex3f(1.0f, 0.0f, 0.0f); | 104 glVertex3f(1.0f, 0.0f, 0.0f); |
| 105 } | 105 } |
| 106 glEnd(); | 106 glEnd(); |
| 107 | 107 |
| 108 glBindTexture(GL_TEXTURE_2D, 0); | 108 glBindTexture(GL_TEXTURE_2D, 0); |
| 109 glFlush(); | 109 glFlush(); |
| 110 } | 110 } |
| 111 } // test | 111 } // test |
| 112 } // webrtc | 112 } // webrtc |
| OLD | NEW |