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 #ifndef WEBRTC_VIDEO_VIE_RECEIVER_H_ | 11 #ifndef WEBRTC_VIDEO_RTP_STREAM_RECEIVER_H_ |
12 #define WEBRTC_VIDEO_VIE_RECEIVER_H_ | 12 #define WEBRTC_VIDEO_RTP_STREAM_RECEIVER_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
15 #include <memory> | 15 #include <memory> |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/base/constructormagic.h" | 19 #include "webrtc/base/constructormagic.h" |
20 #include "webrtc/base/criticalsection.h" | 20 #include "webrtc/base/criticalsection.h" |
21 #include "webrtc/engine_configurations.h" | 21 #include "webrtc/engine_configurations.h" |
22 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" | 22 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" |
(...skipping 14 matching lines...) Expand all Loading... |
37 class RtcpRttStats; | 37 class RtcpRttStats; |
38 class RtpHeaderParser; | 38 class RtpHeaderParser; |
39 class RTPPayloadRegistry; | 39 class RTPPayloadRegistry; |
40 class RtpReceiver; | 40 class RtpReceiver; |
41 class Transport; | 41 class Transport; |
42 | 42 |
43 namespace vcm { | 43 namespace vcm { |
44 class VideoReceiver; | 44 class VideoReceiver; |
45 } // namespace vcm | 45 } // namespace vcm |
46 | 46 |
47 class ViEReceiver : public RtpData { | 47 class RtpStreamReceiver : public RtpData, public RtpFeedback { |
48 public: | 48 public: |
49 ViEReceiver(vcm::VideoReceiver* video_receiver, | 49 RtpStreamReceiver(vcm::VideoReceiver* video_receiver, |
50 RemoteBitrateEstimator* remote_bitrate_estimator, | 50 RemoteBitrateEstimator* remote_bitrate_estimator, |
51 RtpFeedback* rtp_feedback, | 51 Transport* transport, |
52 Transport* transport, | 52 RtcpRttStats* rtt_stats, |
53 RtcpRttStats* rtt_stats, | 53 PacedSender* paced_sender, |
54 PacedSender* paced_sender, | 54 PacketRouter* packet_router); |
55 PacketRouter* packet_router); | 55 ~RtpStreamReceiver(); |
56 ~ViEReceiver(); | |
57 | 56 |
58 bool SetReceiveCodec(const VideoCodec& video_codec); | 57 bool SetReceiveCodec(const VideoCodec& video_codec); |
59 | 58 |
60 void SetNackStatus(bool enable, int max_nack_reordering_threshold); | 59 void SetNackStatus(bool enable, int max_nack_reordering_threshold); |
61 void SetRtxPayloadType(int payload_type, int associated_payload_type); | 60 void SetRtxPayloadType(int payload_type, int associated_payload_type); |
62 // If set to true, the RTX payload type mapping supplied in | 61 // If set to true, the RTX payload type mapping supplied in |
63 // |SetRtxPayloadType| will be used when restoring RTX packets. Without it, | 62 // |SetRtxPayloadType| will be used when restoring RTX packets. Without it, |
64 // RTX packets will always be restored to the last non-RTX packet payload type | 63 // RTX packets will always be restored to the last non-RTX packet payload type |
65 // received. | 64 // received. |
66 void SetUseRtxPayloadMappingOnRestore(bool val); | 65 void SetUseRtxPayloadMappingOnRestore(bool val); |
(...skipping 19 matching lines...) Expand all Loading... |
86 size_t rtp_packet_length, | 85 size_t rtp_packet_length, |
87 const PacketTime& packet_time); | 86 const PacketTime& packet_time); |
88 bool DeliverRtcp(const uint8_t* rtcp_packet, size_t rtcp_packet_length); | 87 bool DeliverRtcp(const uint8_t* rtcp_packet, size_t rtcp_packet_length); |
89 | 88 |
90 // Implements RtpData. | 89 // Implements RtpData. |
91 int32_t OnReceivedPayloadData(const uint8_t* payload_data, | 90 int32_t OnReceivedPayloadData(const uint8_t* payload_data, |
92 const size_t payload_size, | 91 const size_t payload_size, |
93 const WebRtcRTPHeader* rtp_header) override; | 92 const WebRtcRTPHeader* rtp_header) override; |
94 bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override; | 93 bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override; |
95 | 94 |
| 95 // Implements RtpFeedback. |
| 96 int32_t OnInitializeDecoder(const int8_t payload_type, |
| 97 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
| 98 const int frequency, |
| 99 const size_t channels, |
| 100 const uint32_t rate) override; |
| 101 void OnIncomingSSRCChanged(const uint32_t ssrc) override; |
| 102 void OnIncomingCSRCChanged(const uint32_t CSRC, const bool added) override {} |
| 103 |
96 ReceiveStatistics* GetReceiveStatistics() const; | 104 ReceiveStatistics* GetReceiveStatistics() const; |
97 | 105 |
98 template <class T> | 106 template <class T> |
99 class RegisterableCallback : public T { | 107 class RegisterableCallback : public T { |
100 public: | 108 public: |
101 RegisterableCallback() : callback_(nullptr) {} | 109 RegisterableCallback() : callback_(nullptr) {} |
102 | 110 |
103 void Set(T* callback) { | 111 void Set(T* callback) { |
104 rtc::CritScope lock(&critsect_); | 112 rtc::CritScope lock(&critsect_); |
105 callback_ = callback; | 113 callback_ = callback; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 bool receiving_ GUARDED_BY(receive_cs_); | 170 bool receiving_ GUARDED_BY(receive_cs_); |
163 uint8_t restored_packet_[IP_PACKET_SIZE] GUARDED_BY(receive_cs_); | 171 uint8_t restored_packet_[IP_PACKET_SIZE] GUARDED_BY(receive_cs_); |
164 bool restored_packet_in_use_ GUARDED_BY(receive_cs_); | 172 bool restored_packet_in_use_ GUARDED_BY(receive_cs_); |
165 int64_t last_packet_log_ms_ GUARDED_BY(receive_cs_); | 173 int64_t last_packet_log_ms_ GUARDED_BY(receive_cs_); |
166 | 174 |
167 const std::unique_ptr<RtpRtcp> rtp_rtcp_; | 175 const std::unique_ptr<RtpRtcp> rtp_rtcp_; |
168 }; | 176 }; |
169 | 177 |
170 } // namespace webrtc | 178 } // namespace webrtc |
171 | 179 |
172 #endif // WEBRTC_VIDEO_VIE_RECEIVER_H_ | 180 #endif // WEBRTC_VIDEO_RTP_STREAM_RECEIVER_H_ |
OLD | NEW |