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_coding/receiver.h" | 11 #include "webrtc/modules/video_coding/receiver.h" |
12 | 12 |
13 #include <assert.h> | 13 #include <assert.h> |
14 | 14 |
15 #include <cstdlib> | 15 #include <cstdlib> |
| 16 #include <utility> |
16 | 17 |
17 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
18 #include "webrtc/base/trace_event.h" | 19 #include "webrtc/base/trace_event.h" |
19 #include "webrtc/modules/video_coding/encoded_frame.h" | 20 #include "webrtc/modules/video_coding/encoded_frame.h" |
20 #include "webrtc/modules/video_coding/internal_defines.h" | 21 #include "webrtc/modules/video_coding/internal_defines.h" |
21 #include "webrtc/modules/video_coding/media_opt_util.h" | 22 #include "webrtc/modules/video_coding/media_opt_util.h" |
22 #include "webrtc/system_wrappers/include/clock.h" | 23 #include "webrtc/system_wrappers/include/clock.h" |
23 | 24 |
24 namespace webrtc { | 25 namespace webrtc { |
25 | 26 |
26 enum { kMaxReceiverDelayMs = 10000 }; | 27 enum { kMaxReceiverDelayMs = 10000 }; |
27 | 28 |
28 VCMReceiver::VCMReceiver(VCMTiming* timing, | 29 VCMReceiver::VCMReceiver(VCMTiming* timing, |
29 Clock* clock, | 30 Clock* clock, |
30 EventFactory* event_factory) | 31 EventFactory* event_factory) |
31 : VCMReceiver(timing, | 32 : VCMReceiver(timing, |
32 clock, | 33 clock, |
33 rtc::scoped_ptr<EventWrapper>(event_factory->CreateEvent()), | 34 rtc::scoped_ptr<EventWrapper>(event_factory->CreateEvent()), |
34 rtc::scoped_ptr<EventWrapper>(event_factory->CreateEvent())) { | 35 rtc::scoped_ptr<EventWrapper>(event_factory->CreateEvent())) { |
35 } | 36 } |
36 | 37 |
37 VCMReceiver::VCMReceiver(VCMTiming* timing, | 38 VCMReceiver::VCMReceiver(VCMTiming* timing, |
38 Clock* clock, | 39 Clock* clock, |
39 rtc::scoped_ptr<EventWrapper> receiver_event, | 40 rtc::scoped_ptr<EventWrapper> receiver_event, |
40 rtc::scoped_ptr<EventWrapper> jitter_buffer_event) | 41 rtc::scoped_ptr<EventWrapper> jitter_buffer_event) |
41 : crit_sect_(CriticalSectionWrapper::CreateCriticalSection()), | 42 : crit_sect_(CriticalSectionWrapper::CreateCriticalSection()), |
42 clock_(clock), | 43 clock_(clock), |
43 jitter_buffer_(clock_, jitter_buffer_event.Pass()), | 44 jitter_buffer_(clock_, std::move(jitter_buffer_event)), |
44 timing_(timing), | 45 timing_(timing), |
45 render_wait_event_(receiver_event.Pass()), | 46 render_wait_event_(std::move(receiver_event)), |
46 max_video_delay_ms_(kMaxVideoDelayMs) { | 47 max_video_delay_ms_(kMaxVideoDelayMs) { |
47 Reset(); | 48 Reset(); |
48 } | 49 } |
49 | 50 |
50 VCMReceiver::~VCMReceiver() { | 51 VCMReceiver::~VCMReceiver() { |
51 render_wait_event_->Set(); | 52 render_wait_event_->Set(); |
52 delete crit_sect_; | 53 delete crit_sect_; |
53 } | 54 } |
54 | 55 |
55 void VCMReceiver::Reset() { | 56 void VCMReceiver::Reset() { |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 uint32_t render_end = timing_->RenderTimeMs(timestamp_end, now_ms); | 260 uint32_t render_end = timing_->RenderTimeMs(timestamp_end, now_ms); |
260 return render_end - render_start; | 261 return render_end - render_start; |
261 } | 262 } |
262 | 263 |
263 void VCMReceiver::RegisterStatsCallback( | 264 void VCMReceiver::RegisterStatsCallback( |
264 VCMReceiveStatisticsCallback* callback) { | 265 VCMReceiveStatisticsCallback* callback) { |
265 jitter_buffer_.RegisterStatsCallback(callback); | 266 jitter_buffer_.RegisterStatsCallback(callback); |
266 } | 267 } |
267 | 268 |
268 } // namespace webrtc | 269 } // namespace webrtc |
OLD | NEW |