OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_PROTOCOL_SESSION_CONFIG_H_ | 5 #ifndef REMOTING_PROTOCOL_SESSION_CONFIG_H_ |
6 #define REMOTING_PROTOCOL_SESSION_CONFIG_H_ | 6 #define REMOTING_PROTOCOL_SESSION_CONFIG_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 const std::list<ChannelConfig>& audio_configs() const { | 132 const std::list<ChannelConfig>& audio_configs() const { |
133 return audio_configs_; | 133 return audio_configs_; |
134 } | 134 } |
135 | 135 |
136 std::list<ChannelConfig>* mutable_audio_configs() { | 136 std::list<ChannelConfig>* mutable_audio_configs() { |
137 return &audio_configs_; | 137 return &audio_configs_; |
138 } | 138 } |
139 | 139 |
140 // Selects session configuration that is supported by both participants. | 140 // Selects session configuration that is supported by both participants. |
141 // NULL is returned if such configuration doesn't exist. When selecting | 141 // nullptr is returned if such configuration doesn't exist. When selecting |
142 // channel configuration priority is given to the configs listed first | 142 // channel configuration priority is given to the configs listed first |
143 // in |client_config|. | 143 // in |client_config|. |
144 bool Select(const CandidateSessionConfig* client_config, | 144 bool Select(const CandidateSessionConfig* client_config, |
145 SessionConfig* result); | 145 SessionConfig* result); |
146 | 146 |
147 // Returns true if |config| is supported. | 147 // Returns true if |config| is supported. |
148 bool IsSupported(const SessionConfig& config) const; | 148 bool IsSupported(const SessionConfig& config) const; |
149 | 149 |
150 // Extracts final protocol configuration. Must be used for the description | 150 // Extracts final protocol configuration. Must be used for the description |
151 // received in the session-accept stanza. If the selection is ambiguous | 151 // received in the session-accept stanza. If the selection is ambiguous |
152 // (e.g. there is more than one configuration for one of the channel) | 152 // (e.g. there is more than one configuration for one of the channel) |
153 // or undefined (e.g. no configurations for a channel) then NULL is returned. | 153 // or undefined (e.g. no configurations for a channel) then nullptr is |
| 154 // returned. |
154 bool GetFinalConfig(SessionConfig* result) const; | 155 bool GetFinalConfig(SessionConfig* result) const; |
155 | 156 |
156 scoped_ptr<CandidateSessionConfig> Clone() const; | 157 scoped_ptr<CandidateSessionConfig> Clone() const; |
157 | 158 |
158 // Helpers for enabling/disabling specific features. | 159 // Helpers for enabling/disabling specific features. |
159 void DisableAudioChannel(); | 160 void DisableAudioChannel(); |
160 void EnableVideoCodec(ChannelConfig::Codec codec); | 161 void EnableVideoCodec(ChannelConfig::Codec codec); |
161 | 162 |
162 private: | 163 private: |
163 CandidateSessionConfig(); | 164 CandidateSessionConfig(); |
(...skipping 10 matching lines...) Expand all Loading... |
174 std::list<ChannelConfig> control_configs_; | 175 std::list<ChannelConfig> control_configs_; |
175 std::list<ChannelConfig> event_configs_; | 176 std::list<ChannelConfig> event_configs_; |
176 std::list<ChannelConfig> video_configs_; | 177 std::list<ChannelConfig> video_configs_; |
177 std::list<ChannelConfig> audio_configs_; | 178 std::list<ChannelConfig> audio_configs_; |
178 }; | 179 }; |
179 | 180 |
180 } // namespace protocol | 181 } // namespace protocol |
181 } // namespace remoting | 182 } // namespace remoting |
182 | 183 |
183 #endif // REMOTING_PROTOCOL_SESSION_CONFIG_H_ | 184 #endif // REMOTING_PROTOCOL_SESSION_CONFIG_H_ |
OLD | NEW |