return false;
}
- return UseCandidatesInSessionDescription(remote_desc_.get());
+ return UseCandidate(candidate);
}
bool WebRtcSession::GetTrackIdBySsrc(uint32 ssrc, std::string* id) {
voice_channel_->SetChannelOptions(options);
}
+void WebRtcSession::SetAudioPlayoutVolume(uint32 ssrc, double volume) {
+ ASSERT(signaling_thread()->IsCurrent());
+ ASSERT(volume >= 0 && volume <= 10);
+ if (!voice_channel_) {
+ LOG(LS_ERROR) << "SetAudioPlayoutVolume: No audio channel exists.";
+ return;
+ }
+
+ if (!voice_channel_->SetOutputScaling(ssrc, volume, volume))
+ ASSERT(false);
+}
+
bool WebRtcSession::SetCaptureDevice(uint32 ssrc,
cricket::VideoCapturer* camera) {
ASSERT(signaling_thread()->IsCurrent());
// TODO(bemasc): Expose more API from Transport to detect when
// candidate selection starts or stops, due to success or failure.
if (transport->all_channels_writable()) {
+ // By the time |SignalTransportWritable| arrives, the excess channels may
+ // already have been pruned, so that the Transport is Completed. The
+ // specification requires that transitions from Checking to Completed pass
+ // through Connected. This check enforces that requirement.
+ // (Direct transitions from Connected and Disconnected to Completed are
+ // allowed.)
if (ice_connection_state_ ==
- PeerConnectionInterface::kIceConnectionChecking ||
- ice_connection_state_ ==
- PeerConnectionInterface::kIceConnectionDisconnected) {
+ PeerConnectionInterface::kIceConnectionChecking) {
SetIceConnectionState(PeerConnectionInterface::kIceConnectionConnected);
}
+
+ SetIceConnectionState(transport->completed() ?
+ PeerConnectionInterface::kIceConnectionCompleted :
+ PeerConnectionInterface::kIceConnectionConnected);
} else if (transport->HasChannels()) {
// If the current state is Connected or Completed, then there were writable
// channels but now there are not, so the next state must be Disconnected.
}
}
+void WebRtcSession::OnTransportCompleted(cricket::Transport* transport) {
+ ASSERT(signaling_thread()->IsCurrent());
+ SetIceConnectionState(PeerConnectionInterface::kIceConnectionCompleted);
+}
+
+void WebRtcSession::OnTransportFailed(cricket::Transport* transport) {
+ ASSERT(signaling_thread()->IsCurrent());
+ SetIceConnectionState(PeerConnectionInterface::kIceConnectionFailed);
+}
+
void WebRtcSession::OnTransportProxyCandidatesReady(
cricket::TransportProxy* proxy, const cricket::Candidates& candidates) {
ASSERT(signaling_thread()->IsCurrent());