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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 padding_index_(static_cast<size_t>(-1)), // Start padding at first child. | 94 padding_index_(static_cast<size_t>(-1)), // Start padding at first child. |
95 nack_method_(kNackOff), | 95 nack_method_(kNackOff), |
96 nack_last_time_sent_full_(0), | 96 nack_last_time_sent_full_(0), |
97 nack_last_time_sent_full_prev_(0), | 97 nack_last_time_sent_full_prev_(0), |
98 nack_last_seq_number_sent_(0), | 98 nack_last_seq_number_sent_(0), |
99 key_frame_req_method_(kKeyFrameReqPliRtcp), | 99 key_frame_req_method_(kKeyFrameReqPliRtcp), |
100 remote_bitrate_(configuration.remote_bitrate_estimator), | 100 remote_bitrate_(configuration.remote_bitrate_estimator), |
101 rtt_stats_(configuration.rtt_stats), | 101 rtt_stats_(configuration.rtt_stats), |
102 critical_section_rtt_(CriticalSectionWrapper::CreateCriticalSection()), | 102 critical_section_rtt_(CriticalSectionWrapper::CreateCriticalSection()), |
103 rtt_ms_(0) { | 103 rtt_ms_(0) { |
104 send_video_codec_.codecType = kVideoCodecUnknown; | |
105 | |
106 // Make sure that RTCP objects are aware of our SSRC. | 104 // Make sure that RTCP objects are aware of our SSRC. |
107 uint32_t SSRC = rtp_sender_.SSRC(); | 105 uint32_t SSRC = rtp_sender_.SSRC(); |
108 rtcp_sender_.SetSSRC(SSRC); | 106 rtcp_sender_.SetSSRC(SSRC); |
109 SetRtcpReceiverSsrcs(SSRC); | 107 SetRtcpReceiverSsrcs(SSRC); |
110 } | 108 } |
111 | 109 |
112 // Returns the number of milliseconds until the module want a worker thread | 110 // Returns the number of milliseconds until the module want a worker thread |
113 // to call Process. | 111 // to call Process. |
114 int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() { | 112 int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() { |
115 const int64_t now = clock_->TimeInMilliseconds(); | 113 const int64_t now = clock_->TimeInMilliseconds(); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 const CodecInst& voice_codec) { | 243 const CodecInst& voice_codec) { |
246 return rtp_sender_.RegisterPayload( | 244 return rtp_sender_.RegisterPayload( |
247 voice_codec.plname, | 245 voice_codec.plname, |
248 voice_codec.pltype, | 246 voice_codec.pltype, |
249 voice_codec.plfreq, | 247 voice_codec.plfreq, |
250 voice_codec.channels, | 248 voice_codec.channels, |
251 (voice_codec.rate < 0) ? 0 : voice_codec.rate); | 249 (voice_codec.rate < 0) ? 0 : voice_codec.rate); |
252 } | 250 } |
253 | 251 |
254 int32_t ModuleRtpRtcpImpl::RegisterSendPayload(const VideoCodec& video_codec) { | 252 int32_t ModuleRtpRtcpImpl::RegisterSendPayload(const VideoCodec& video_codec) { |
255 send_video_codec_ = video_codec; | |
256 return rtp_sender_.RegisterPayload(video_codec.plName, video_codec.plType, | 253 return rtp_sender_.RegisterPayload(video_codec.plName, video_codec.plType, |
257 90000, 0, 0); | 254 90000, 0, 0); |
258 } | 255 } |
259 | 256 |
| 257 void ModuleRtpRtcpImpl::RegisterVideoSendPayload(int payload_type, |
| 258 const char* payload_name) { |
| 259 RTC_CHECK_EQ( |
| 260 0, rtp_sender_.RegisterPayload(payload_name, payload_type, 90000, 0, 0)); |
| 261 } |
| 262 |
260 int32_t ModuleRtpRtcpImpl::DeRegisterSendPayload(const int8_t payload_type) { | 263 int32_t ModuleRtpRtcpImpl::DeRegisterSendPayload(const int8_t payload_type) { |
261 return rtp_sender_.DeRegisterSendPayload(payload_type); | 264 return rtp_sender_.DeRegisterSendPayload(payload_type); |
262 } | 265 } |
263 | 266 |
264 int8_t ModuleRtpRtcpImpl::SendPayloadType() const { | 267 int8_t ModuleRtpRtcpImpl::SendPayloadType() const { |
265 return rtp_sender_.SendPayloadType(); | 268 return rtp_sender_.SendPayloadType(); |
266 } | 269 } |
267 | 270 |
268 uint32_t ModuleRtpRtcpImpl::StartTimestamp() const { | 271 uint32_t ModuleRtpRtcpImpl::StartTimestamp() const { |
269 return rtp_sender_.StartTimestamp(); | 272 return rtp_sender_.StartTimestamp(); |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 980 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
978 StreamDataCountersCallback* callback) { | 981 StreamDataCountersCallback* callback) { |
979 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 982 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
980 } | 983 } |
981 | 984 |
982 StreamDataCountersCallback* | 985 StreamDataCountersCallback* |
983 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 986 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
984 return rtp_sender_.GetRtpStatisticsCallback(); | 987 return rtp_sender_.GetRtpStatisticsCallback(); |
985 } | 988 } |
986 } // namespace webrtc | 989 } // namespace webrtc |
OLD | NEW |