OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 static T MinPositive(T a, T b) { | 86 static T MinPositive(T a, T b) { |
87 if (a <= 0) { | 87 if (a <= 0) { |
88 return b; | 88 return b; |
89 } | 89 } |
90 if (b <= 0) { | 90 if (b <= 0) { |
91 return a; | 91 return a; |
92 } | 92 } |
93 return std::min(a, b); | 93 return std::min(a, b); |
94 } | 94 } |
95 | 95 |
| 96 template <typename T> |
| 97 static T MinNonNegative(T a, T b) { |
| 98 if (a < 0) { |
| 99 return b; |
| 100 } |
| 101 if (b < 0) { |
| 102 return a; |
| 103 } |
| 104 return std::min(a, b); |
| 105 } |
| 106 |
96 // Construction-time settings, passed to | 107 // Construction-time settings, passed to |
97 // MediaControllerInterface::Create, and passed on when creating | 108 // MediaControllerInterface::Create, and passed on when creating |
98 // MediaChannels. | 109 // MediaChannels. |
99 struct MediaConfig { | 110 struct MediaConfig { |
100 // Set DSCP value on packets. This flag comes from the | 111 // Set DSCP value on packets. This flag comes from the |
101 // PeerConnection constraint 'googDscp'. | 112 // PeerConnection constraint 'googDscp'. |
102 bool enable_dscp = false; | 113 bool enable_dscp = false; |
103 | 114 |
104 // Video-specific config. | 115 // Video-specific config. |
105 struct Video { | 116 struct Video { |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 // Signal when the media channel is ready to send the stream. Arguments are: | 1137 // Signal when the media channel is ready to send the stream. Arguments are: |
1127 // writable(bool) | 1138 // writable(bool) |
1128 sigslot::signal1<bool> SignalReadyToSend; | 1139 sigslot::signal1<bool> SignalReadyToSend; |
1129 // Signal for notifying that the remote side has closed the DataChannel. | 1140 // Signal for notifying that the remote side has closed the DataChannel. |
1130 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; | 1141 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; |
1131 }; | 1142 }; |
1132 | 1143 |
1133 } // namespace cricket | 1144 } // namespace cricket |
1134 | 1145 |
1135 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ | 1146 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ |
OLD | NEW |