| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 if (_javaRenderThread) { | 135 if (_javaRenderThread) { |
| 136 // StartRender is called when this stream should start render. | 136 // StartRender is called when this stream should start render. |
| 137 // However StopRender is not called when the streams stop rendering. | 137 // However StopRender is not called when the streams stop rendering. |
| 138 // Thus the the thread is only deleted when the renderer is removed. | 138 // Thus the the thread is only deleted when the renderer is removed. |
| 139 WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, | 139 WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, |
| 140 "%s, Render thread already exist", __FUNCTION__); | 140 "%s, Render thread already exist", __FUNCTION__); |
| 141 return 0; | 141 return 0; |
| 142 } | 142 } |
| 143 | 143 |
| 144 _javaRenderThread = PlatformThread::CreateThread(JavaRenderThreadFun, this, | 144 _javaRenderThread.reset(new rtc::PlatformThread(JavaRenderThreadFun, this, |
| 145 "AndroidRenderThread"); | 145 "AndroidRenderThread")); |
| 146 | 146 |
| 147 if (_javaRenderThread->Start()) | 147 _javaRenderThread->Start(); |
| 148 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, | 148 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s: thread started", |
| 149 "%s: thread started", __FUNCTION__); | 149 __FUNCTION__); |
| 150 else { | 150 _javaRenderThread->SetPriority(rtc::kRealtimePriority); |
| 151 WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, | |
| 152 "%s: Could not start send thread", __FUNCTION__); | |
| 153 return -1; | |
| 154 } | |
| 155 _javaRenderThread->SetPriority(kRealtimePriority); | |
| 156 return 0; | 151 return 0; |
| 157 } | 152 } |
| 158 | 153 |
| 159 int32_t VideoRenderAndroid::StopRender() { | 154 int32_t VideoRenderAndroid::StopRender() { |
| 160 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s:", __FUNCTION__); | 155 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s:", __FUNCTION__); |
| 161 { | 156 { |
| 162 CriticalSectionScoped cs(&_critSect); | 157 CriticalSectionScoped cs(&_critSect); |
| 163 if (!_javaRenderThread) | 158 if (!_javaRenderThread) |
| 164 { | 159 { |
| 165 return -1; | 160 return -1; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 const void* colorKey, | 307 const void* colorKey, |
| 313 const float left, const float top, | 308 const float left, const float top, |
| 314 const float right, | 309 const float right, |
| 315 const float bottom) { | 310 const float bottom) { |
| 316 WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, | 311 WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, |
| 317 "%s - not supported on Android", __FUNCTION__); | 312 "%s - not supported on Android", __FUNCTION__); |
| 318 return -1; | 313 return -1; |
| 319 } | 314 } |
| 320 | 315 |
| 321 } // namespace webrtc | 316 } // namespace webrtc |
| OLD | NEW |