| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #if !defined(__has_feature) || !__has_feature(objc_arc) | 28 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 29 #error "This file requires ARC support." | 29 #error "This file requires ARC support." |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 #import "RTCOpenGLVideoRenderer.h" | 32 #import "RTCOpenGLVideoRenderer.h" |
| 33 | 33 |
| 34 #include <string.h> | 34 #include <string.h> |
| 35 | 35 |
| 36 #include "webrtc/base/scoped_ptr.h" | 36 #include <memory> |
| 37 | 37 |
| 38 #if TARGET_OS_IPHONE | 38 #if TARGET_OS_IPHONE |
| 39 #import <OpenGLES/ES3/gl.h> | 39 #import <OpenGLES/ES3/gl.h> |
| 40 #else | 40 #else |
| 41 #import <OpenGL/gl3.h> | 41 #import <OpenGL/gl3.h> |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 #import "RTCI420Frame.h" | 44 #import "RTCI420Frame.h" |
| 45 | 45 |
| 46 // TODO(tkchin): check and log openGL errors. Methods here return BOOLs in | 46 // TODO(tkchin): check and log openGL errors. Methods here return BOOLs in |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 GLuint _vertexArray; | 177 GLuint _vertexArray; |
| 178 #endif | 178 #endif |
| 179 GLuint _vertexBuffer; | 179 GLuint _vertexBuffer; |
| 180 GLint _position; | 180 GLint _position; |
| 181 GLint _texcoord; | 181 GLint _texcoord; |
| 182 GLint _ySampler; | 182 GLint _ySampler; |
| 183 GLint _uSampler; | 183 GLint _uSampler; |
| 184 GLint _vSampler; | 184 GLint _vSampler; |
| 185 // Used to create a non-padded plane for GPU upload when we receive padded | 185 // Used to create a non-padded plane for GPU upload when we receive padded |
| 186 // frames. | 186 // frames. |
| 187 rtc::scoped_ptr<uint8_t[]> _planeBuffer; | 187 std::unique_ptr<uint8_t[]> _planeBuffer; |
| 188 } | 188 } |
| 189 | 189 |
| 190 + (void)initialize { | 190 + (void)initialize { |
| 191 // Disable dithering for performance. | 191 // Disable dithering for performance. |
| 192 glDisable(GL_DITHER); | 192 glDisable(GL_DITHER); |
| 193 } | 193 } |
| 194 | 194 |
| 195 #if TARGET_OS_IPHONE | 195 #if TARGET_OS_IPHONE |
| 196 - (instancetype)initWithContext:(EAGLContext*)context { | 196 - (instancetype)initWithContext:(EAGLContext*)context { |
| 197 #else | 197 #else |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 GL_FLOAT, | 494 GL_FLOAT, |
| 495 GL_FALSE, | 495 GL_FALSE, |
| 496 4 * sizeof(GLfloat), | 496 4 * sizeof(GLfloat), |
| 497 (void*)(2 * sizeof(GLfloat))); | 497 (void*)(2 * sizeof(GLfloat))); |
| 498 glEnableVertexAttribArray(_texcoord); | 498 glEnableVertexAttribArray(_texcoord); |
| 499 | 499 |
| 500 return YES; | 500 return YES; |
| 501 } | 501 } |
| 502 | 502 |
| 503 @end | 503 @end |
| OLD | NEW |