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 |
11 #include "webrtc/modules/video_render/android/video_render_android_impl.h" | 11 #include "webrtc/modules/video_render/android/video_render_android_impl.h" |
12 | 12 |
| 13 #include "webrtc/base/timeutils.h" |
13 #include "webrtc/modules/video_render/video_render_internal.h" | 14 #include "webrtc/modules/video_render/video_render_internal.h" |
14 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 15 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
15 #include "webrtc/system_wrappers/include/event_wrapper.h" | 16 #include "webrtc/system_wrappers/include/event_wrapper.h" |
16 #include "webrtc/system_wrappers/include/tick_util.h" | |
17 | 17 |
18 #ifdef ANDROID | 18 #ifdef ANDROID |
19 #include <android/log.h> | 19 #include <android/log.h> |
20 #include <stdio.h> | 20 #include <stdio.h> |
21 | 21 |
22 #undef WEBRTC_TRACE | 22 #undef WEBRTC_TRACE |
23 #define WEBRTC_TRACE(a,b,c,...) __android_log_print(ANDROID_LOG_DEBUG, "*WEBRTC
N*", __VA_ARGS__) | 23 #define WEBRTC_TRACE(a,b,c,...) __android_log_print(ANDROID_LOG_DEBUG, "*WEBRTC
N*", __VA_ARGS__) |
24 #else | 24 #else |
25 #include "webrtc/system_wrappers/include/trace.h" | 25 #include "webrtc/system_wrappers/include/trace.h" |
26 #endif | 26 #endif |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 CriticalSectionScoped cs(&_critSect); | 167 CriticalSectionScoped cs(&_critSect); |
168 _javaRenderThread->Stop(); | 168 _javaRenderThread->Stop(); |
169 _javaRenderThread.reset(); | 169 _javaRenderThread.reset(); |
170 | 170 |
171 return 0; | 171 return 0; |
172 } | 172 } |
173 | 173 |
174 void VideoRenderAndroid::ReDraw() { | 174 void VideoRenderAndroid::ReDraw() { |
175 CriticalSectionScoped cs(&_critSect); | 175 CriticalSectionScoped cs(&_critSect); |
176 // Allow redraw if it was more than 20ms since last. | 176 // Allow redraw if it was more than 20ms since last. |
177 if (_lastJavaRenderEvent < TickTime::MillisecondTimestamp() - 20) { | 177 if (_lastJavaRenderEvent < rtc::Time64() - 20) { |
178 _lastJavaRenderEvent = TickTime::MillisecondTimestamp(); | 178 _lastJavaRenderEvent = rtc::Time64(); |
179 _javaRenderEvent.Set(); | 179 _javaRenderEvent.Set(); |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 bool VideoRenderAndroid::JavaRenderThreadFun(void* obj) { | 183 bool VideoRenderAndroid::JavaRenderThreadFun(void* obj) { |
184 return static_cast<VideoRenderAndroid*> (obj)->JavaRenderThreadProcess(); | 184 return static_cast<VideoRenderAndroid*> (obj)->JavaRenderThreadProcess(); |
185 } | 185 } |
186 | 186 |
187 bool VideoRenderAndroid::JavaRenderThreadProcess() | 187 bool VideoRenderAndroid::JavaRenderThreadProcess() |
188 { | 188 { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 const void* colorKey, | 307 const void* colorKey, |
308 const float left, const float top, | 308 const float left, const float top, |
309 const float right, | 309 const float right, |
310 const float bottom) { | 310 const float bottom) { |
311 WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, | 311 WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, |
312 "%s - not supported on Android", __FUNCTION__); | 312 "%s - not supported on Android", __FUNCTION__); |
313 return -1; | 313 return -1; |
314 } | 314 } |
315 | 315 |
316 } // namespace webrtc | 316 } // namespace webrtc |
OLD | NEW |