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/common_video/video_render_frames.h" | 11 #include "webrtc/common_video/video_render_frames.h" |
12 | 12 |
13 #include <assert.h> | |
14 | |
15 #include "webrtc/base/logging.h" | 13 #include "webrtc/base/logging.h" |
16 #include "webrtc/base/timeutils.h" | 14 #include "webrtc/base/timeutils.h" |
17 #include "webrtc/modules/include/module_common_types.h" | 15 #include "webrtc/modules/include/module_common_types.h" |
18 #include "webrtc/system_wrappers/include/trace.h" | 16 #include "webrtc/system_wrappers/include/trace.h" |
19 | 17 |
20 namespace webrtc { | 18 namespace webrtc { |
21 namespace { | 19 namespace { |
22 | 20 |
23 const uint32_t kEventMaxWaitTimeMs = 200; | 21 const uint32_t kEventMaxWaitTimeMs = 200; |
24 const uint32_t kMinRenderDelayMs = 10; | 22 const uint32_t kMinRenderDelayMs = 10; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 if (incoming_frames_.empty()) { | 76 if (incoming_frames_.empty()) { |
79 return kEventMaxWaitTimeMs; | 77 return kEventMaxWaitTimeMs; |
80 } | 78 } |
81 const int64_t time_to_release = incoming_frames_.front().render_time_ms() - | 79 const int64_t time_to_release = incoming_frames_.front().render_time_ms() - |
82 render_delay_ms_ - | 80 render_delay_ms_ - |
83 rtc::TimeMillis(); | 81 rtc::TimeMillis(); |
84 return time_to_release < 0 ? 0u : static_cast<uint32_t>(time_to_release); | 82 return time_to_release < 0 ? 0u : static_cast<uint32_t>(time_to_release); |
85 } | 83 } |
86 | 84 |
87 } // namespace webrtc | 85 } // namespace webrtc |
OLD | NEW |