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 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 constexpr int kPacketBufferStartSize = 32; | 44 constexpr int kPacketBufferStartSize = 32; |
45 constexpr int kPacketBufferMaxSixe = 2048; | 45 constexpr int kPacketBufferMaxSixe = 2048; |
46 } | 46 } |
47 | 47 |
48 std::unique_ptr<RtpRtcp> CreateRtpRtcpModule( | 48 std::unique_ptr<RtpRtcp> CreateRtpRtcpModule( |
49 ReceiveStatistics* receive_statistics, | 49 ReceiveStatistics* receive_statistics, |
50 Transport* outgoing_transport, | 50 Transport* outgoing_transport, |
51 RtcpRttStats* rtt_stats, | 51 RtcpRttStats* rtt_stats, |
52 RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer, | 52 RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer, |
53 RemoteBitrateEstimator* remote_bitrate_estimator, | 53 RemoteBitrateEstimator* remote_bitrate_estimator, |
54 RtpPacketSender* paced_sender, | 54 TransportSequenceNumberAllocator* transport_sequence_number_allocator) { |
55 TransportSequenceNumberAllocator* transport_sequence_number_allocator, | |
56 RateLimiter* retransmission_rate_limiter) { | |
57 RtpRtcp::Configuration configuration; | 55 RtpRtcp::Configuration configuration; |
58 configuration.audio = false; | 56 configuration.audio = false; |
59 configuration.receiver_only = true; | 57 configuration.receiver_only = true; |
60 configuration.receive_statistics = receive_statistics; | 58 configuration.receive_statistics = receive_statistics; |
61 configuration.outgoing_transport = outgoing_transport; | 59 configuration.outgoing_transport = outgoing_transport; |
62 configuration.intra_frame_callback = nullptr; | 60 configuration.intra_frame_callback = nullptr; |
63 configuration.rtt_stats = rtt_stats; | 61 configuration.rtt_stats = rtt_stats; |
64 configuration.rtcp_packet_type_counter_observer = | 62 configuration.rtcp_packet_type_counter_observer = |
65 rtcp_packet_type_counter_observer; | 63 rtcp_packet_type_counter_observer; |
66 configuration.paced_sender = paced_sender; | |
67 configuration.transport_sequence_number_allocator = | 64 configuration.transport_sequence_number_allocator = |
68 transport_sequence_number_allocator; | 65 transport_sequence_number_allocator; |
69 configuration.send_bitrate_observer = nullptr; | 66 configuration.send_bitrate_observer = nullptr; |
70 configuration.send_frame_count_observer = nullptr; | 67 configuration.send_frame_count_observer = nullptr; |
71 configuration.send_side_delay_observer = nullptr; | 68 configuration.send_side_delay_observer = nullptr; |
72 configuration.send_packet_observer = nullptr; | 69 configuration.send_packet_observer = nullptr; |
73 configuration.bandwidth_callback = nullptr; | 70 configuration.bandwidth_callback = nullptr; |
74 configuration.transport_feedback_callback = nullptr; | 71 configuration.transport_feedback_callback = nullptr; |
75 configuration.retransmission_rate_limiter = retransmission_rate_limiter; | |
76 | 72 |
77 std::unique_ptr<RtpRtcp> rtp_rtcp(RtpRtcp::CreateRtpRtcp(configuration)); | 73 std::unique_ptr<RtpRtcp> rtp_rtcp(RtpRtcp::CreateRtpRtcp(configuration)); |
78 rtp_rtcp->SetSendingStatus(false); | 74 rtp_rtcp->SetSendingStatus(false); |
79 rtp_rtcp->SetSendingMediaStatus(false); | 75 rtp_rtcp->SetSendingMediaStatus(false); |
80 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound); | 76 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound); |
81 | 77 |
82 return rtp_rtcp; | 78 return rtp_rtcp; |
83 } | 79 } |
84 | 80 |
85 static const int kPacketLogIntervalMs = 10000; | 81 static const int kPacketLogIntervalMs = 10000; |
86 | 82 |
87 RtpStreamReceiver::RtpStreamReceiver( | 83 RtpStreamReceiver::RtpStreamReceiver( |
88 vcm::VideoReceiver* video_receiver, | 84 vcm::VideoReceiver* video_receiver, |
89 RemoteBitrateEstimator* remote_bitrate_estimator, | 85 RemoteBitrateEstimator* remote_bitrate_estimator, |
90 Transport* transport, | 86 Transport* transport, |
91 RtcpRttStats* rtt_stats, | 87 RtcpRttStats* rtt_stats, |
92 PacedSender* paced_sender, | |
93 PacketRouter* packet_router, | 88 PacketRouter* packet_router, |
94 VieRemb* remb, | 89 VieRemb* remb, |
95 const VideoReceiveStream::Config* config, | 90 const VideoReceiveStream::Config* config, |
96 ReceiveStatisticsProxy* receive_stats_proxy, | 91 ReceiveStatisticsProxy* receive_stats_proxy, |
97 ProcessThread* process_thread, | 92 ProcessThread* process_thread, |
98 RateLimiter* retransmission_rate_limiter, | |
99 NackSender* nack_sender, | 93 NackSender* nack_sender, |
100 KeyFrameRequestSender* keyframe_request_sender, | 94 KeyFrameRequestSender* keyframe_request_sender, |
101 video_coding::OnCompleteFrameCallback* complete_frame_callback, | 95 video_coding::OnCompleteFrameCallback* complete_frame_callback, |
102 VCMTiming* timing) | 96 VCMTiming* timing) |
103 : clock_(Clock::GetRealTimeClock()), | 97 : clock_(Clock::GetRealTimeClock()), |
104 config_(*config), | 98 config_(*config), |
105 video_receiver_(video_receiver), | 99 video_receiver_(video_receiver), |
106 remote_bitrate_estimator_(remote_bitrate_estimator), | 100 remote_bitrate_estimator_(remote_bitrate_estimator), |
107 packet_router_(packet_router), | 101 packet_router_(packet_router), |
108 remb_(remb), | 102 remb_(remb), |
109 process_thread_(process_thread), | 103 process_thread_(process_thread), |
110 ntp_estimator_(clock_), | 104 ntp_estimator_(clock_), |
111 rtp_header_parser_(RtpHeaderParser::Create()), | 105 rtp_header_parser_(RtpHeaderParser::Create()), |
112 rtp_receiver_(RtpReceiver::CreateVideoReceiver(clock_, | 106 rtp_receiver_(RtpReceiver::CreateVideoReceiver(clock_, |
113 this, | 107 this, |
114 this, | 108 this, |
115 &rtp_payload_registry_)), | 109 &rtp_payload_registry_)), |
116 rtp_receive_statistics_(ReceiveStatistics::Create(clock_)), | 110 rtp_receive_statistics_(ReceiveStatistics::Create(clock_)), |
117 ulpfec_receiver_(UlpfecReceiver::Create(this)), | 111 ulpfec_receiver_(UlpfecReceiver::Create(this)), |
118 receiving_(false), | 112 receiving_(false), |
119 restored_packet_in_use_(false), | 113 restored_packet_in_use_(false), |
120 last_packet_log_ms_(-1), | 114 last_packet_log_ms_(-1), |
121 rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_.get(), | 115 rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_.get(), |
122 transport, | 116 transport, |
123 rtt_stats, | 117 rtt_stats, |
124 receive_stats_proxy, | 118 receive_stats_proxy, |
125 remote_bitrate_estimator_, | 119 remote_bitrate_estimator_, |
126 paced_sender, | 120 packet_router)), |
127 packet_router, | |
128 retransmission_rate_limiter)), | |
129 complete_frame_callback_(complete_frame_callback), | 121 complete_frame_callback_(complete_frame_callback), |
130 keyframe_request_sender_(keyframe_request_sender), | 122 keyframe_request_sender_(keyframe_request_sender), |
131 timing_(timing) { | 123 timing_(timing) { |
132 packet_router_->AddRtpModule(rtp_rtcp_.get()); | 124 packet_router_->AddRtpModule(rtp_rtcp_.get()); |
133 rtp_receive_statistics_->RegisterRtpStatisticsCallback(receive_stats_proxy); | 125 rtp_receive_statistics_->RegisterRtpStatisticsCallback(receive_stats_proxy); |
134 rtp_receive_statistics_->RegisterRtcpStatisticsCallback(receive_stats_proxy); | 126 rtp_receive_statistics_->RegisterRtcpStatisticsCallback(receive_stats_proxy); |
135 | 127 |
136 RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff) | 128 RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff) |
137 << "A stream should not be configured with RTCP disabled. This value is " | 129 << "A stream should not be configured with RTCP disabled. This value is " |
138 "reserved for internal usage."; | 130 "reserved for internal usage."; |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 if (sprop_base64_it == codec_params_it->second.end()) | 673 if (sprop_base64_it == codec_params_it->second.end()) |
682 return; | 674 return; |
683 | 675 |
684 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second)) | 676 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second)) |
685 return; | 677 return; |
686 | 678 |
687 tracker_.InsertSpsPps(sprop_decoder.sps_nalu(), sprop_decoder.pps_nalu()); | 679 tracker_.InsertSpsPps(sprop_decoder.sps_nalu(), sprop_decoder.pps_nalu()); |
688 } | 680 } |
689 | 681 |
690 } // namespace webrtc | 682 } // namespace webrtc |
OLD | NEW |