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

Side by Side Diff: webrtc/pc/mediasession.h

Issue 1871993002: Only generate one CNAME per PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Move GenerateCname() to PeerConnect Created 4 years, 8 months 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 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 extern const char kMediaProtocolSctp[]; 70 extern const char kMediaProtocolSctp[];
71 extern const char kMediaProtocolDtlsSctp[]; 71 extern const char kMediaProtocolDtlsSctp[];
72 extern const char kMediaProtocolUdpDtlsSctp[]; 72 extern const char kMediaProtocolUdpDtlsSctp[];
73 extern const char kMediaProtocolTcpDtlsSctp[]; 73 extern const char kMediaProtocolTcpDtlsSctp[];
74 74
75 // Options to control how session descriptions are generated. 75 // Options to control how session descriptions are generated.
76 const int kAutoBandwidth = -1; 76 const int kAutoBandwidth = -1;
77 const int kBufferedModeDisabled = 0; 77 const int kBufferedModeDisabled = 0;
78 78
79 // Default CNAME for unit tests
80 const char kDefaultCname[] = "DefaultCnameVal";
Taylor Brandstetter 2016/04/13 23:03:06 nit: Can just be "DefaultCname"
81
79 struct MediaSessionOptions { 82 struct MediaSessionOptions {
80 MediaSessionOptions() : 83 MediaSessionOptions()
81 recv_audio(true), 84 : recv_audio(true),
82 recv_video(false), 85 recv_video(false),
83 data_channel_type(DCT_NONE), 86 data_channel_type(DCT_NONE),
84 is_muc(false), 87 is_muc(false),
85 vad_enabled(true), // When disabled, removes all CN codecs from SDP. 88 vad_enabled(true), // When disabled, removes all CN codecs from SDP.
86 rtcp_mux_enabled(true), 89 rtcp_mux_enabled(true),
87 bundle_enabled(false), 90 bundle_enabled(false),
88 video_bandwidth(kAutoBandwidth), 91 video_bandwidth(kAutoBandwidth),
89 data_bandwidth(kDataMaxBandwidth) { 92 data_bandwidth(kDataMaxBandwidth),
90 } 93 cname(kDefaultCname) {}
91 94
92 bool has_audio() const { 95 bool has_audio() const {
93 return recv_audio || HasSendMediaStream(MEDIA_TYPE_AUDIO); 96 return recv_audio || HasSendMediaStream(MEDIA_TYPE_AUDIO);
94 } 97 }
95 bool has_video() const { 98 bool has_video() const {
96 return recv_video || HasSendMediaStream(MEDIA_TYPE_VIDEO); 99 return recv_video || HasSendMediaStream(MEDIA_TYPE_VIDEO);
97 } 100 }
98 bool has_data() const { return data_channel_type != DCT_NONE; } 101 bool has_data() const { return data_channel_type != DCT_NONE; }
99 102
100 // Add a stream with MediaType type and id. 103 // Add a stream with MediaType type and id.
(...skipping 25 matching lines...) Expand all
126 DataChannelType data_channel_type; 129 DataChannelType data_channel_type;
127 bool is_muc; 130 bool is_muc;
128 bool vad_enabled; 131 bool vad_enabled;
129 bool rtcp_mux_enabled; 132 bool rtcp_mux_enabled;
130 bool bundle_enabled; 133 bool bundle_enabled;
131 // bps. -1 == auto. 134 // bps. -1 == auto.
132 int video_bandwidth; 135 int video_bandwidth;
133 int data_bandwidth; 136 int data_bandwidth;
134 // content name ("mid") => options. 137 // content name ("mid") => options.
135 std::map<std::string, TransportOptions> transport_options; 138 std::map<std::string, TransportOptions> transport_options;
139 // the CNAME of the PeerConnection
Taylor Brandstetter 2016/04/13 23:03:06 nit: Capitalize "The" and add period to end of com
140 std::string cname;
136 141
137 struct Stream { 142 struct Stream {
138 Stream(MediaType type, 143 Stream(MediaType type,
139 const std::string& id, 144 const std::string& id,
140 const std::string& sync_label, 145 const std::string& sync_label,
141 int num_sim_layers) 146 int num_sim_layers)
142 : type(type), id(id), sync_label(sync_label), 147 : type(type), id(id), sync_label(sync_label),
143 num_sim_layers(num_sim_layers) { 148 num_sim_layers(num_sim_layers) {
144 } 149 }
145 MediaType type; 150 MediaType type;
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 void GetSupportedVideoCryptoSuiteNames( 543 void GetSupportedVideoCryptoSuiteNames(
539 std::vector<std::string>* crypto_suite_names); 544 std::vector<std::string>* crypto_suite_names);
540 void GetSupportedDataCryptoSuiteNames( 545 void GetSupportedDataCryptoSuiteNames(
541 std::vector<std::string>* crypto_suite_names); 546 std::vector<std::string>* crypto_suite_names);
542 void GetDefaultSrtpCryptoSuiteNames( 547 void GetDefaultSrtpCryptoSuiteNames(
543 std::vector<std::string>* crypto_suite_names); 548 std::vector<std::string>* crypto_suite_names);
544 549
545 } // namespace cricket 550 } // namespace cricket
546 551
547 #endif // TALK_SESSION_MEDIA_MEDIASESSION_H_ 552 #endif // TALK_SESSION_MEDIA_MEDIASESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698