Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: webrtc/pc/srtpfilter.cc

Issue 2437503004: Set actual transport overhead in rtp_rtcp (Closed)
Patch Set: Responde to comments. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2009 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2009 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 bool SrtpFilter::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) { 218 bool SrtpFilter::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) {
219 if (!IsActive()) { 219 if (!IsActive()) {
220 LOG(LS_WARNING) << "Failed to GetRtpAuthParams: SRTP not active"; 220 LOG(LS_WARNING) << "Failed to GetRtpAuthParams: SRTP not active";
221 return false; 221 return false;
222 } 222 }
223 223
224 RTC_CHECK(send_session_); 224 RTC_CHECK(send_session_);
225 return send_session_->GetRtpAuthParams(key, key_len, tag_len); 225 return send_session_->GetRtpAuthParams(key, key_len, tag_len);
226 } 226 }
227 227
228 bool SrtpFilter::GetSrtpOverhead(int* srtp_overhead) const {
229 if (!IsActive()) {
230 LOG(LS_WARNING) << "Failed to GetSrtpOverhead: SRTP not active";
231 return false;
232 }
233
234 RTC_CHECK(send_session_);
235 *srtp_overhead = send_session_->GetSrtpOverhead();
236 return true;
237 }
238
228 void SrtpFilter::set_signal_silent_time(int signal_silent_time_in_ms) { 239 void SrtpFilter::set_signal_silent_time(int signal_silent_time_in_ms) {
229 signal_silent_time_in_ms_ = signal_silent_time_in_ms; 240 signal_silent_time_in_ms_ = signal_silent_time_in_ms;
230 if (IsActive()) { 241 if (IsActive()) {
231 RTC_CHECK(send_session_); 242 RTC_CHECK(send_session_);
232 send_session_->set_signal_silent_time(signal_silent_time_in_ms); 243 send_session_->set_signal_silent_time(signal_silent_time_in_ms);
233 RTC_CHECK(recv_session_); 244 RTC_CHECK(recv_session_);
234 recv_session_->set_signal_silent_time(signal_silent_time_in_ms); 245 recv_session_->set_signal_silent_time(signal_silent_time_in_ms);
235 if (send_rtcp_session_) 246 if (send_rtcp_session_)
236 send_rtcp_session_->set_signal_silent_time(signal_silent_time_in_ms); 247 send_rtcp_session_->set_signal_silent_time(signal_silent_time_in_ms);
237 if (recv_rtcp_session_) 248 if (recv_rtcp_session_)
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 620
610 *key = external_hmac->key; 621 *key = external_hmac->key;
611 *key_len = external_hmac->key_length; 622 *key_len = external_hmac->key_length;
612 *tag_len = rtp_auth_tag_len_; 623 *tag_len = rtp_auth_tag_len_;
613 return true; 624 return true;
614 #else 625 #else
615 return false; 626 return false;
616 #endif 627 #endif
617 } 628 }
618 629
630 int SrtpSession::GetSrtpOverhead() const {
631 return rtp_auth_tag_len_;
632 }
633
619 bool SrtpSession::GetSendStreamPacketIndex(void* p, 634 bool SrtpSession::GetSendStreamPacketIndex(void* p,
620 int in_len, 635 int in_len,
621 int64_t* index) { 636 int64_t* index) {
622 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 637 RTC_DCHECK(thread_checker_.CalledOnValidThread());
623 srtp_hdr_t* hdr = reinterpret_cast<srtp_hdr_t*>(p); 638 srtp_hdr_t* hdr = reinterpret_cast<srtp_hdr_t*>(p);
624 srtp_stream_ctx_t* stream = srtp_get_stream(session_, hdr->ssrc); 639 srtp_stream_ctx_t* stream = srtp_get_stream(session_, hdr->ssrc);
625 if (!stream) { 640 if (!stream) {
626 return false; 641 return false;
627 } 642 }
628 643
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 SrtpNotAvailable(__FUNCTION__); 948 SrtpNotAvailable(__FUNCTION__);
934 } 949 }
935 950
936 void SrtpStat::HandleSrtpResult(const SrtpStat::FailureKey& key) { 951 void SrtpStat::HandleSrtpResult(const SrtpStat::FailureKey& key) {
937 SrtpNotAvailable(__FUNCTION__); 952 SrtpNotAvailable(__FUNCTION__);
938 } 953 }
939 954
940 #endif // HAVE_SRTP 955 #endif // HAVE_SRTP
941 956
942 } // namespace cricket 957 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698