OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_ |
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_ |
13 | 13 |
14 #include <list> | |
14 #include <memory> | 15 #include <memory> |
16 #include <unordered_map> | |
17 #include <vector> | |
15 | 18 |
16 #include "webrtc/base/criticalsection.h" | 19 #include "webrtc/base/criticalsection.h" |
17 #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h" | 20 #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h" |
18 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
19 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" | 22 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" |
20 #include "webrtc/typedefs.h" | 23 #include "webrtc/typedefs.h" |
21 | 24 |
22 namespace webrtc { | 25 namespace webrtc { |
23 | 26 |
24 class RtpReceiverImpl : public RtpReceiver { | 27 class RtpReceiverImpl : public RtpReceiver { |
(...skipping 24 matching lines...) Expand all Loading... | |
49 bool LastReceivedTimeMs(int64_t* receive_time_ms) const override; | 52 bool LastReceivedTimeMs(int64_t* receive_time_ms) const override; |
50 | 53 |
51 uint32_t SSRC() const override; | 54 uint32_t SSRC() const override; |
52 | 55 |
53 int32_t CSRCs(uint32_t array_of_csrc[kRtpCsrcSize]) const override; | 56 int32_t CSRCs(uint32_t array_of_csrc[kRtpCsrcSize]) const override; |
54 | 57 |
55 int32_t Energy(uint8_t array_of_energy[kRtpCsrcSize]) const override; | 58 int32_t Energy(uint8_t array_of_energy[kRtpCsrcSize]) const override; |
56 | 59 |
57 TelephoneEventHandler* GetTelephoneEventHandler() override; | 60 TelephoneEventHandler* GetTelephoneEventHandler() override; |
58 | 61 |
62 const std::vector<RtpSource> GetSources() override; | |
hbos
2017/04/05 11:15:42
Make the return value non-const since it's returne
the sun
2017/04/05 14:58:30
+1 but make the function const:
std::vector<RtpSou
Zhi Huang
2017/04/06 03:09:50
Done.
| |
63 | |
59 private: | 64 private: |
60 bool HaveReceivedFrame() const; | 65 bool HaveReceivedFrame() const; |
61 | 66 |
62 void CheckSSRCChanged(const RTPHeader& rtp_header); | 67 void CheckSSRCChanged(const RTPHeader& rtp_header); |
63 void CheckCSRC(const WebRtcRTPHeader& rtp_header); | 68 void CheckCSRC(const WebRtcRTPHeader& rtp_header); |
64 int32_t CheckPayloadChanged(const RTPHeader& rtp_header, | 69 int32_t CheckPayloadChanged(const RTPHeader& rtp_header, |
65 const int8_t first_payload_byte, | 70 const int8_t first_payload_byte, |
66 bool* is_red, | 71 bool* is_red, |
67 PayloadUnion* payload); | 72 PayloadUnion* payload); |
68 | 73 |
74 void UpdateSources(); | |
75 void UpdateSourceLists(int64_t now); | |
76 | |
69 Clock* clock_; | 77 Clock* clock_; |
70 RTPPayloadRegistry* rtp_payload_registry_; | 78 RTPPayloadRegistry* rtp_payload_registry_; |
71 std::unique_ptr<RTPReceiverStrategy> rtp_media_receiver_; | 79 std::unique_ptr<RTPReceiverStrategy> rtp_media_receiver_; |
72 | 80 |
73 RtpFeedback* cb_rtp_feedback_; | 81 RtpFeedback* cb_rtp_feedback_; |
74 | 82 |
75 rtc::CriticalSection critical_section_rtp_receiver_; | 83 rtc::CriticalSection critical_section_rtp_receiver_; |
76 int64_t last_receive_time_; | 84 int64_t last_receive_time_; |
77 size_t last_received_payload_length_; | 85 size_t last_received_payload_length_; |
78 | 86 |
79 // SSRCs. | 87 // SSRCs. |
80 uint32_t ssrc_; | 88 uint32_t ssrc_; |
81 uint8_t num_csrcs_; | 89 uint8_t num_csrcs_; |
82 uint32_t current_remote_csrc_[kRtpCsrcSize]; | 90 uint32_t current_remote_csrc_[kRtpCsrcSize]; |
83 | 91 |
84 uint32_t last_received_timestamp_; | 92 uint32_t last_received_timestamp_; |
85 int64_t last_received_frame_time_ms_; | 93 int64_t last_received_frame_time_ms_; |
86 uint16_t last_received_sequence_number_; | 94 uint16_t last_received_sequence_number_; |
95 | |
96 std::unordered_map<uint32_t, std::list<RtpSource>::iterator> | |
97 iterator_by_csrc_; | |
98 std::list<RtpSource> csrc_sources_; | |
hbos
2017/04/05 11:15:42
Add a comment saying these are sorted chronologica
Zhi Huang
2017/04/06 03:09:50
Done.
| |
99 std::vector<RtpSource> ssrc_sources_; | |
87 }; | 100 }; |
88 } // namespace webrtc | 101 } // namespace webrtc |
89 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_ | 102 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_ |
OLD | NEW |