Steve Anton | 296a0ce | 2018-03-22 15:17:27 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include "modules/rtp_rtcp/source/mid_oracle.h" |
| 12 | |
| 13 | namespace webrtc { |
| 14 | |
| 15 | MidOracle::MidOracle(const std::string& mid) : mid_(mid) {} |
| 16 | |
| 17 | MidOracle::~MidOracle() = default; |
| 18 | |
| 19 | void MidOracle::OnReceivedRtcpReportBlocks( |
| 20 | const ReportBlockList& report_blocks) { |
| 21 | if (!send_mid_) { |
| 22 | return; |
| 23 | } |
| 24 | for (const RTCPReportBlock& report_block : report_blocks) { |
| 25 | if (report_block.source_ssrc == ssrc_) { |
| 26 | send_mid_ = false; |
| 27 | break; |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | } // namespace webrtc |