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 25 matching lines...) Expand all Loading... |
36 { | 36 { |
37 if (_prepared) | 37 if (_prepared) |
38 { | 38 { |
39 _crit.Enter(); | 39 _crit.Enter(); |
40 ReleaseWindow(); | 40 ReleaseWindow(); |
41 _crit.Leave(); | 41 _crit.Leave(); |
42 } | 42 } |
43 delete &_crit; | 43 delete &_crit; |
44 } | 44 } |
45 | 45 |
46 int32_t VideoX11Channel::RenderFrame(const uint32_t streamId, | 46 void VideoX11Channel::OnFrame(const VideoFrame& videoFrame) { |
47 const VideoFrame& videoFrame) { | |
48 CriticalSectionScoped cs(&_crit); | 47 CriticalSectionScoped cs(&_crit); |
49 if (_width != videoFrame.width() || _height | 48 if (_width != videoFrame.width() || _height |
50 != videoFrame.height()) { | 49 != videoFrame.height()) { |
51 if (FrameSizeChange(videoFrame.width(), videoFrame.height(), 1) == -1) { | 50 if (FrameSizeChange(videoFrame.width(), videoFrame.height(), 1) == -1) { |
52 return -1; | 51 return; |
53 } | 52 } |
54 } | 53 } |
55 return DeliverFrame(videoFrame); | 54 DeliverFrame(videoFrame); |
56 } | 55 } |
57 | 56 |
58 int32_t VideoX11Channel::FrameSizeChange(int32_t width, | 57 int32_t VideoX11Channel::FrameSizeChange(int32_t width, |
59 int32_t height, | 58 int32_t height, |
60 int32_t /*numberOfStreams */) | 59 int32_t /*numberOfStreams */) |
61 { | 60 { |
62 CriticalSectionScoped cs(&_crit); | 61 CriticalSectionScoped cs(&_crit); |
63 if (_prepared) | 62 if (_prepared) |
64 { | 63 { |
65 RemoveRenderer(); | 64 RemoveRenderer(); |
66 } | 65 } |
67 if (CreateLocalRenderer(width, height) == -1) | 66 if (CreateLocalRenderer(width, height) == -1) |
68 { | 67 { |
69 return -1; | 68 return -1; |
70 } | 69 } |
71 | 70 |
72 return 0; | 71 return 0; |
73 } | 72 } |
74 | 73 |
| 74 // TODO(nisse): Delete return value? |
75 int32_t VideoX11Channel::DeliverFrame(const VideoFrame& videoFrame) { | 75 int32_t VideoX11Channel::DeliverFrame(const VideoFrame& videoFrame) { |
76 CriticalSectionScoped cs(&_crit); | 76 CriticalSectionScoped cs(&_crit); |
77 if (!_prepared) { | 77 if (!_prepared) { |
78 return 0; | 78 return 0; |
79 } | 79 } |
80 | 80 |
81 if (!dispArray[_dispCount]) { | 81 if (!dispArray[_dispCount]) { |
82 return -1; | 82 return -1; |
83 } | 83 } |
84 | 84 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 left = _left; | 306 left = _left; |
307 top = _top; | 307 top = _top; |
308 right = _right; | 308 right = _right; |
309 bottom = _bottom; | 309 bottom = _bottom; |
310 | 310 |
311 return 0; | 311 return 0; |
312 } | 312 } |
313 | 313 |
314 | 314 |
315 } // namespace webrtc | 315 } // namespace webrtc |
OLD | NEW |