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 |
11 #ifndef WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ | 11 #ifndef WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ |
12 #define WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ | 12 #define WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ |
13 | 13 |
14 #include <algorithm> | |
15 #include <memory> | 14 #include <memory> |
16 #include <string> | 15 #include <string> |
17 #include <vector> | 16 #include <vector> |
18 | 17 |
19 #include "webrtc/api/rtpparameters.h" | 18 #include "webrtc/api/rtpparameters.h" |
20 #include "webrtc/base/basictypes.h" | 19 #include "webrtc/base/basictypes.h" |
21 #include "webrtc/base/buffer.h" | 20 #include "webrtc/base/buffer.h" |
22 #include "webrtc/base/copyonwritebuffer.h" | 21 #include "webrtc/base/copyonwritebuffer.h" |
23 #include "webrtc/base/dscp.h" | 22 #include "webrtc/base/dscp.h" |
24 #include "webrtc/base/logging.h" | 23 #include "webrtc/base/logging.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 for (size_t i = 0; i < vals.size(); ++i) { | 73 for (size_t i = 0; i < vals.size(); ++i) { |
75 if (i > 0) { | 74 if (i > 0) { |
76 ost << ", "; | 75 ost << ", "; |
77 } | 76 } |
78 ost << vals[i].ToString(); | 77 ost << vals[i].ToString(); |
79 } | 78 } |
80 ost << "]"; | 79 ost << "]"; |
81 return ost.str(); | 80 return ost.str(); |
82 } | 81 } |
83 | 82 |
84 template <typename T> | |
85 static T MinPositive(T a, T b) { | |
86 if (a <= 0) { | |
87 return b; | |
88 } | |
89 if (b <= 0) { | |
90 return a; | |
91 } | |
92 return std::min(a, b); | |
93 } | |
94 | |
95 // Construction-time settings, passed on when creating | 83 // Construction-time settings, passed on when creating |
96 // MediaChannels. | 84 // MediaChannels. |
97 struct MediaConfig { | 85 struct MediaConfig { |
98 // Set DSCP value on packets. This flag comes from the | 86 // Set DSCP value on packets. This flag comes from the |
99 // PeerConnection constraint 'googDscp'. | 87 // PeerConnection constraint 'googDscp'. |
100 bool enable_dscp = false; | 88 bool enable_dscp = false; |
101 | 89 |
102 // Video-specific config. | 90 // Video-specific config. |
103 struct Video { | 91 struct Video { |
104 // Enable WebRTC CPU Overuse Detection. This flag comes from the | 92 // Enable WebRTC CPU Overuse Detection. This flag comes from the |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 const char*, | 1203 const char*, |
1216 size_t> SignalDataReceived; | 1204 size_t> SignalDataReceived; |
1217 // Signal when the media channel is ready to send the stream. Arguments are: | 1205 // Signal when the media channel is ready to send the stream. Arguments are: |
1218 // writable(bool) | 1206 // writable(bool) |
1219 sigslot::signal1<bool> SignalReadyToSend; | 1207 sigslot::signal1<bool> SignalReadyToSend; |
1220 }; | 1208 }; |
1221 | 1209 |
1222 } // namespace cricket | 1210 } // namespace cricket |
1223 | 1211 |
1224 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ | 1212 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ |
OLD | NEW |