| OLD | NEW |
| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 extern const char kMediaProtocolDtlsSavpf[]; | 66 extern const char kMediaProtocolDtlsSavpf[]; |
| 67 | 67 |
| 68 extern const char kMediaProtocolRtpPrefix[]; | 68 extern const char kMediaProtocolRtpPrefix[]; |
| 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; | |
| 77 const int kBufferedModeDisabled = 0; | 76 const int kBufferedModeDisabled = 0; |
| 78 | 77 |
| 79 struct MediaSessionOptions { | 78 struct MediaSessionOptions { |
| 80 MediaSessionOptions() : | 79 MediaSessionOptions() |
| 81 recv_audio(true), | 80 : recv_audio(true), |
| 82 recv_video(false), | 81 recv_video(false), |
| 83 data_channel_type(DCT_NONE), | 82 data_channel_type(DCT_NONE), |
| 84 is_muc(false), | 83 is_muc(false), |
| 85 vad_enabled(true), // When disabled, removes all CN codecs from SDP. | 84 vad_enabled(true), // When disabled, removes all CN codecs from SDP. |
| 86 rtcp_mux_enabled(true), | 85 rtcp_mux_enabled(true), |
| 87 bundle_enabled(false), | 86 bundle_enabled(false), |
| 88 video_bandwidth(kAutoBandwidth), | 87 video_bandwidth(rtc::Optional<int>()), |
| 89 data_bandwidth(kDataMaxBandwidth) { | 88 data_bandwidth(rtc::Optional<int>(kDataMaxBandwidth)) {} |
| 90 } | |
| 91 | 89 |
| 92 bool has_audio() const { | 90 bool has_audio() const { |
| 93 return recv_audio || HasSendMediaStream(MEDIA_TYPE_AUDIO); | 91 return recv_audio || HasSendMediaStream(MEDIA_TYPE_AUDIO); |
| 94 } | 92 } |
| 95 bool has_video() const { | 93 bool has_video() const { |
| 96 return recv_video || HasSendMediaStream(MEDIA_TYPE_VIDEO); | 94 return recv_video || HasSendMediaStream(MEDIA_TYPE_VIDEO); |
| 97 } | 95 } |
| 98 bool has_data() const { return data_channel_type != DCT_NONE; } | 96 bool has_data() const { return data_channel_type != DCT_NONE; } |
| 99 | 97 |
| 100 // Add a stream with MediaType type and id. | 98 // Add a stream with MediaType type and id. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 121 // structure (content name -> options). | 119 // structure (content name -> options). |
| 122 // MediaSessionDescriptionFactory assumes there will never be more than one | 120 // MediaSessionDescriptionFactory assumes there will never be more than one |
| 123 // audio/video/data content, but this will change with unified plan. | 121 // audio/video/data content, but this will change with unified plan. |
| 124 bool recv_audio; | 122 bool recv_audio; |
| 125 bool recv_video; | 123 bool recv_video; |
| 126 DataChannelType data_channel_type; | 124 DataChannelType data_channel_type; |
| 127 bool is_muc; | 125 bool is_muc; |
| 128 bool vad_enabled; | 126 bool vad_enabled; |
| 129 bool rtcp_mux_enabled; | 127 bool rtcp_mux_enabled; |
| 130 bool bundle_enabled; | 128 bool bundle_enabled; |
| 131 // bps. -1 == auto. | 129 // bps. not set == auto. |
| 132 int video_bandwidth; | 130 rtc::Optional<int> video_bandwidth; |
| 133 int data_bandwidth; | 131 rtc::Optional<int> data_bandwidth; |
| 134 // content name ("mid") => options. | 132 // content name ("mid") => options. |
| 135 std::map<std::string, TransportOptions> transport_options; | 133 std::map<std::string, TransportOptions> transport_options; |
| 136 | 134 |
| 137 struct Stream { | 135 struct Stream { |
| 138 Stream(MediaType type, | 136 Stream(MediaType type, |
| 139 const std::string& id, | 137 const std::string& id, |
| 140 const std::string& sync_label, | 138 const std::string& sync_label, |
| 141 int num_sim_layers) | 139 int num_sim_layers) |
| 142 : type(type), id(id), sync_label(sync_label), | 140 : type(type), id(id), sync_label(sync_label), |
| 143 num_sim_layers(num_sim_layers) { | 141 num_sim_layers(num_sim_layers) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 171 } | 169 } |
| 172 | 170 |
| 173 bool rtcp_mux() const { return rtcp_mux_; } | 171 bool rtcp_mux() const { return rtcp_mux_; } |
| 174 void set_rtcp_mux(bool mux) { rtcp_mux_ = mux; } | 172 void set_rtcp_mux(bool mux) { rtcp_mux_ = mux; } |
| 175 | 173 |
| 176 bool rtcp_reduced_size() const { return rtcp_reduced_size_; } | 174 bool rtcp_reduced_size() const { return rtcp_reduced_size_; } |
| 177 void set_rtcp_reduced_size(bool reduced_size) { | 175 void set_rtcp_reduced_size(bool reduced_size) { |
| 178 rtcp_reduced_size_ = reduced_size; | 176 rtcp_reduced_size_ = reduced_size; |
| 179 } | 177 } |
| 180 | 178 |
| 181 int bandwidth() const { return bandwidth_; } | 179 rtc::Optional<int> bandwidth() const { return bandwidth_; } |
| 182 void set_bandwidth(int bandwidth) { bandwidth_ = bandwidth; } | 180 void set_bandwidth(rtc::Optional<int> bandwidth) { bandwidth_ = bandwidth; } |
| 183 | 181 |
| 184 const std::vector<CryptoParams>& cryptos() const { return cryptos_; } | 182 const std::vector<CryptoParams>& cryptos() const { return cryptos_; } |
| 185 void AddCrypto(const CryptoParams& params) { | 183 void AddCrypto(const CryptoParams& params) { |
| 186 cryptos_.push_back(params); | 184 cryptos_.push_back(params); |
| 187 } | 185 } |
| 188 void set_cryptos(const std::vector<CryptoParams>& cryptos) { | 186 void set_cryptos(const std::vector<CryptoParams>& cryptos) { |
| 189 cryptos_ = cryptos; | 187 cryptos_ = cryptos; |
| 190 } | 188 } |
| 191 | 189 |
| 192 CryptoType crypto_required() const { return crypto_required_; } | 190 CryptoType crypto_required() const { return crypto_required_; } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 bool partial() const { return partial_; } | 267 bool partial() const { return partial_; } |
| 270 | 268 |
| 271 void set_buffered_mode_latency(int latency) { | 269 void set_buffered_mode_latency(int latency) { |
| 272 buffered_mode_latency_ = latency; | 270 buffered_mode_latency_ = latency; |
| 273 } | 271 } |
| 274 int buffered_mode_latency() const { return buffered_mode_latency_; } | 272 int buffered_mode_latency() const { return buffered_mode_latency_; } |
| 275 | 273 |
| 276 protected: | 274 protected: |
| 277 bool rtcp_mux_ = false; | 275 bool rtcp_mux_ = false; |
| 278 bool rtcp_reduced_size_ = false; | 276 bool rtcp_reduced_size_ = false; |
| 279 int bandwidth_ = kAutoBandwidth; | 277 rtc::Optional<int> bandwidth_ = rtc::Optional<int>(); |
| 280 std::string protocol_; | 278 std::string protocol_; |
| 281 std::vector<CryptoParams> cryptos_; | 279 std::vector<CryptoParams> cryptos_; |
| 282 CryptoType crypto_required_ = CT_NONE; | 280 CryptoType crypto_required_ = CT_NONE; |
| 283 std::vector<RtpHeaderExtension> rtp_header_extensions_; | 281 std::vector<RtpHeaderExtension> rtp_header_extensions_; |
| 284 bool rtp_header_extensions_set_ = false; | 282 bool rtp_header_extensions_set_ = false; |
| 285 bool multistream_ = false; | 283 bool multistream_ = false; |
| 286 StreamParamsVec streams_; | 284 StreamParamsVec streams_; |
| 287 bool conference_mode_ = false; | 285 bool conference_mode_ = false; |
| 288 bool partial_ = false; | 286 bool partial_ = false; |
| 289 int buffered_mode_latency_ = kBufferedModeDisabled; | 287 int buffered_mode_latency_ = kBufferedModeDisabled; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 void GetSupportedVideoCryptoSuiteNames( | 540 void GetSupportedVideoCryptoSuiteNames( |
| 543 std::vector<std::string>* crypto_suite_names); | 541 std::vector<std::string>* crypto_suite_names); |
| 544 void GetSupportedDataCryptoSuiteNames( | 542 void GetSupportedDataCryptoSuiteNames( |
| 545 std::vector<std::string>* crypto_suite_names); | 543 std::vector<std::string>* crypto_suite_names); |
| 546 void GetDefaultSrtpCryptoSuiteNames( | 544 void GetDefaultSrtpCryptoSuiteNames( |
| 547 std::vector<std::string>* crypto_suite_names); | 545 std::vector<std::string>* crypto_suite_names); |
| 548 | 546 |
| 549 } // namespace cricket | 547 } // namespace cricket |
| 550 | 548 |
| 551 #endif // TALK_SESSION_MEDIA_MEDIASESSION_H_ | 549 #endif // TALK_SESSION_MEDIA_MEDIASESSION_H_ |
| OLD | NEW |