OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 left = _startWidth; | 83 left = _startWidth; |
84 top = _startHeight; | 84 top = _startHeight; |
85 right = _stopWidth; | 85 right = _stopWidth; |
86 bottom = _stopHeight; | 86 bottom = _stopHeight; |
87 | 87 |
88 _owner->UnlockAGLCntx(); | 88 _owner->UnlockAGLCntx(); |
89 return 0; | 89 return 0; |
90 } | 90 } |
91 | 91 |
92 int32_t VideoChannelNSOpenGL::RenderFrame(const uint32_t /*streamId*/, | 92 void VideoChannelNSOpenGL::OnFrame(const VideoFrame& videoFrame) { |
93 const VideoFrame& videoFrame) { | |
94 _owner->LockAGLCntx(); | 93 _owner->LockAGLCntx(); |
95 | 94 |
96 if(_width != videoFrame.width() || | 95 if(_width != videoFrame.width() || |
97 _height != videoFrame.height()) { | 96 _height != videoFrame.height()) { |
98 if(FrameSizeChange(videoFrame.width(), videoFrame.height(), 1) == -1) { | 97 if(FrameSizeChange(videoFrame.width(), videoFrame.height(), 1) == -1) { |
99 _owner->UnlockAGLCntx(); | 98 _owner->UnlockAGLCntx(); |
100 return -1; | 99 return; |
101 } | 100 } |
102 } | 101 } |
103 int ret = DeliverFrame(videoFrame); | 102 DeliverFrame(videoFrame); |
104 | |
105 _owner->UnlockAGLCntx(); | 103 _owner->UnlockAGLCntx(); |
106 return ret; | |
107 } | 104 } |
108 | 105 |
109 int VideoChannelNSOpenGL::UpdateSize(int width, int height) | 106 int VideoChannelNSOpenGL::UpdateSize(int width, int height) |
110 { | 107 { |
111 _owner->LockAGLCntx(); | 108 _owner->LockAGLCntx(); |
112 _width = width; | 109 _width = width; |
113 _height = height; | 110 _height = height; |
114 _owner->UnlockAGLCntx(); | 111 _owner->UnlockAGLCntx(); |
115 return 0; | 112 return 0; |
116 } | 113 } |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 } | 1235 } |
1239 | 1236 |
1240 | 1237 |
1241 | 1238 |
1242 */ | 1239 */ |
1243 | 1240 |
1244 | 1241 |
1245 } // namespace webrtc | 1242 } // namespace webrtc |
1246 | 1243 |
1247 #endif // COCOA_RENDERING | 1244 #endif // COCOA_RENDERING |
OLD | NEW |