OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 28 matching lines...) Expand all Loading... |
39 ss << ", rtp_header_extensions: ["; | 39 ss << ", rtp_header_extensions: ["; |
40 i = 0; | 40 i = 0; |
41 for (; i + 1 < rtp_header_extensions.size(); ++i) | 41 for (; i + 1 < rtp_header_extensions.size(); ++i) |
42 ss << rtp_header_extensions[i].ToString() << ", "; | 42 ss << rtp_header_extensions[i].ToString() << ", "; |
43 if (!rtp_header_extensions.empty()) | 43 if (!rtp_header_extensions.empty()) |
44 ss << rtp_header_extensions[i].ToString(); | 44 ss << rtp_header_extensions[i].ToString(); |
45 ss << "]}"; | 45 ss << "]}"; |
46 return ss.str(); | 46 return ss.str(); |
47 } | 47 } |
48 | 48 |
| 49 bool FlexfecReceiveStream::Config::IsCompleteAndEnabled() const { |
| 50 // Check if FlexFEC is enabled. |
| 51 if (payload_type < 0) |
| 52 return false; |
| 53 // Do we have the necessary SSRC information? |
| 54 if (remote_ssrc == 0) |
| 55 return false; |
| 56 // TODO(brandtr): Update this check when we support multistream protection. |
| 57 if (protected_media_ssrcs.size() != 1u) |
| 58 return false; |
| 59 return true; |
| 60 } |
| 61 |
49 namespace { | 62 namespace { |
50 | 63 |
51 // TODO(brandtr): Update this function when we support multistream protection. | 64 // TODO(brandtr): Update this function when we support multistream protection. |
52 std::unique_ptr<FlexfecReceiver> MaybeCreateFlexfecReceiver( | 65 std::unique_ptr<FlexfecReceiver> MaybeCreateFlexfecReceiver( |
53 const FlexfecReceiveStream::Config& config, | 66 const FlexfecReceiveStream::Config& config, |
54 RecoveredPacketReceiver* recovered_packet_receiver) { | 67 RecoveredPacketReceiver* recovered_packet_receiver) { |
55 if (config.payload_type < 0) { | 68 if (config.payload_type < 0) { |
56 LOG(LS_WARNING) << "Invalid FlexFEC payload type given. " | 69 LOG(LS_WARNING) << "Invalid FlexFEC payload type given. " |
57 << "This FlexfecReceiveStream will therefore be useless."; | 70 << "This FlexfecReceiveStream will therefore be useless."; |
58 return nullptr; | 71 return nullptr; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 started_ = false; | 136 started_ = false; |
124 } | 137 } |
125 | 138 |
126 // TODO(brandtr): Implement this member function when we have designed the | 139 // TODO(brandtr): Implement this member function when we have designed the |
127 // stats for FlexFEC. | 140 // stats for FlexFEC. |
128 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { | 141 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { |
129 return FlexfecReceiveStream::Stats(); | 142 return FlexfecReceiveStream::Stats(); |
130 } | 143 } |
131 | 144 |
132 } // namespace webrtc | 145 } // namespace webrtc |
OLD | NEW |