summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/libjingle/source/talk/app/webrtc/webrtcsession.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/libjingle/source/talk/app/webrtc/webrtcsession.h')
-rw-r--r--chromium/third_party/libjingle/source/talk/app/webrtc/webrtcsession.h62
1 files changed, 38 insertions, 24 deletions
diff --git a/chromium/third_party/libjingle/source/talk/app/webrtc/webrtcsession.h b/chromium/third_party/libjingle/source/talk/app/webrtc/webrtcsession.h
index 4c83906ae98..3ffea8ffac5 100644
--- a/chromium/third_party/libjingle/source/talk/app/webrtc/webrtcsession.h
+++ b/chromium/third_party/libjingle/source/talk/app/webrtc/webrtcsession.h
@@ -42,6 +42,7 @@
#include "talk/session/media/mediasession.h"
namespace cricket {
+
class BaseChannel;
class ChannelManager;
class DataChannel;
@@ -50,28 +51,28 @@ class Transport;
class VideoCapturer;
class VideoChannel;
class VoiceChannel;
+
} // namespace cricket
namespace webrtc {
+
class IceRestartAnswerLatch;
+class JsepIceCandidate;
class MediaStreamSignaling;
class WebRtcSessionDescriptionFactory;
-extern const char kSetLocalSdpFailed[];
-extern const char kSetRemoteSdpFailed[];
-extern const char kCreateChannelFailed[];
extern const char kBundleWithoutRtcpMux[];
+extern const char kCreateChannelFailed[];
extern const char kInvalidCandidates[];
extern const char kInvalidSdp[];
extern const char kMlineMismatch[];
-extern const char kSdpWithoutCrypto[];
-extern const char kSdpWithoutSdesAndDtlsDisabled[];
+extern const char kPushDownTDFailed[];
+extern const char kSdpWithoutDtlsFingerprint[];
+extern const char kSdpWithoutSdesCrypto[];
extern const char kSdpWithoutIceUfragPwd[];
+extern const char kSdpWithoutSdesAndDtlsDisabled[];
extern const char kSessionError[];
-extern const char kUpdateStateFailed[];
-extern const char kPushDownOfferTDFailed[];
-extern const char kPushDownPranswerTDFailed[];
-extern const char kPushDownAnswerTDFailed[];
+extern const char kSessionErrorDesc[];
// ICE state callback interface.
class IceObserver {
@@ -113,7 +114,8 @@ class WebRtcSession : public cricket::BaseSession,
bool Initialize(const PeerConnectionFactoryInterface::Options& options,
const MediaConstraintsInterface* constraints,
- DTLSIdentityServiceInterface* dtls_identity_service);
+ DTLSIdentityServiceInterface* dtls_identity_service,
+ PeerConnectionInterface::IceTransportsType ice_transport);
// Deletes the voice, video and data channel and changes the session state
// to STATE_RECEIVEDTERMINATE.
void Terminate();
@@ -132,8 +134,8 @@ class WebRtcSession : public cricket::BaseSession,
return data_channel_.get();
}
- void SetSecurePolicy(cricket::SecureMediaPolicy secure_policy);
- cricket::SecureMediaPolicy SecurePolicy() const;
+ void SetSdesPolicy(cricket::SecurePolicy secure_policy);
+ cricket::SecurePolicy SdesPolicy() const;
// Get current ssl role from transport.
bool GetSslRole(talk_base::SSLRole* role);
@@ -153,6 +155,9 @@ class WebRtcSession : public cricket::BaseSession,
bool SetRemoteDescription(SessionDescriptionInterface* desc,
std::string* err_desc);
bool ProcessIceMessage(const IceCandidateInterface* ice_candidate);
+
+ bool UpdateIce(PeerConnectionInterface::IceTransportsType type);
+
const SessionDescriptionInterface* local_description() const {
return local_desc_.get();
}
@@ -161,7 +166,9 @@ class WebRtcSession : public cricket::BaseSession,
}
// Get the id used as a media stream track's "id" field from ssrc.
- virtual bool GetTrackIdBySsrc(uint32 ssrc, std::string* id);
+ virtual bool GetLocalTrackIdBySsrc(uint32 ssrc, std::string* track_id);
+ virtual bool GetRemoteTrackIdBySsrc(uint32 ssrc, std::string* track_id);
+
// AudioMediaProviderInterface implementation.
virtual void SetAudioPlayout(uint32 ssrc, bool enable,
@@ -169,6 +176,7 @@ class WebRtcSession : public cricket::BaseSession,
virtual void SetAudioSend(uint32 ssrc, bool enable,
const cricket::AudioOptions& options,
cricket::AudioRenderer* renderer) OVERRIDE;
+ virtual void SetAudioPlayoutVolume(uint32 ssrc, double volume) OVERRIDE;
// Implements VideoMediaProviderInterface.
virtual bool SetCaptureDevice(uint32 ssrc,
@@ -195,9 +203,10 @@ class WebRtcSession : public cricket::BaseSession,
virtual void RemoveSctpDataStream(uint32 sid) OVERRIDE;
virtual bool ReadyToSendData() const OVERRIDE;
+ // Implements DataChannelFactory.
talk_base::scoped_refptr<DataChannel> CreateDataChannel(
const std::string& label,
- const DataChannelInit* config);
+ const InternalDataChannelInit* config) OVERRIDE;
cricket::DataChannelType data_channel_type() const;
@@ -225,7 +234,6 @@ class WebRtcSession : public cricket::BaseSession,
// candidates allocation.
bool StartCandidatesAllocation();
bool UpdateSessionState(Action action, cricket::ContentSource source,
- const cricket::SessionDescription* desc,
std::string* err_desc);
static Action GetAction(const std::string& type);
@@ -233,6 +241,8 @@ class WebRtcSession : public cricket::BaseSession,
virtual void OnTransportRequestSignaling(cricket::Transport* transport);
virtual void OnTransportConnecting(cricket::Transport* transport);
virtual void OnTransportWritable(cricket::Transport* transport);
+ virtual void OnTransportCompleted(cricket::Transport* transport);
+ virtual void OnTransportFailed(cricket::Transport* transport);
virtual void OnTransportProxyCandidatesReady(
cricket::TransportProxy* proxy,
const cricket::Candidates& candidates);
@@ -275,13 +285,13 @@ class WebRtcSession : public cricket::BaseSession,
// The |saved_candidates_| will be cleared after this function call.
void CopySavedCandidates(SessionDescriptionInterface* dest_desc);
- void OnNewDataChannelReceived(const std::string& label,
- const DataChannelInit& init);
+ // Listens to SCTP CONTROL messages on unused SIDs and process them as OPEN
+ // messages.
+ void OnDataChannelMessageReceived(cricket::DataChannel* channel,
+ const cricket::ReceiveDataParams& params,
+ const talk_base::Buffer& payload);
- bool GetLocalTrackId(uint32 ssrc, std::string* track_id);
- bool GetRemoteTrackId(uint32 ssrc, std::string* track_id);
-
- std::string BadStateErrMsg(const std::string& type, State state);
+ std::string BadStateErrMsg(State state);
void SetIceConnectionState(PeerConnectionInterface::IceConnectionState state);
bool ValidateBundleSettings(const cricket::SessionDescription* desc);
@@ -289,7 +299,7 @@ class WebRtcSession : public cricket::BaseSession,
// Below methods are helper methods which verifies SDP.
bool ValidateSessionDescription(const SessionDescriptionInterface* sdesc,
cricket::ContentSource source,
- std::string* error_desc);
+ std::string* err_desc);
// Check if a call to SetLocalDescription is acceptable with |action|.
bool ExpectSetLocalDescription(Action action);
@@ -299,6 +309,8 @@ class WebRtcSession : public cricket::BaseSession,
bool ValidateDtlsSetupAttribute(const cricket::SessionDescription* desc,
Action action);
+ std::string GetSessionErrorMsg();
+
talk_base::scoped_ptr<cricket::VoiceChannel> voice_channel_;
talk_base::scoped_ptr<cricket::VideoChannel> video_channel_;
talk_base::scoped_ptr<cricket::DataChannel> data_channel_;
@@ -313,8 +325,6 @@ class WebRtcSession : public cricket::BaseSession,
// If the remote peer is using a older version of implementation.
bool older_version_remote_peer_;
bool dtls_enabled_;
- // Flag will be set based on the constraint value.
- bool dscp_enabled_;
// Specifies which kind of data channel is allowed. This is controlled
// by the chrome command-line flag and constraints:
// 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled,
@@ -332,6 +342,10 @@ class WebRtcSession : public cricket::BaseSession,
sigslot::signal0<> SignalVideoChannelDestroyed;
sigslot::signal0<> SignalDataChannelDestroyed;
+ // Member variables for caching global options.
+ cricket::AudioOptions audio_options_;
+ cricket::VideoOptions video_options_;
+
DISALLOW_COPY_AND_ASSIGN(WebRtcSession);
};
} // namespace webrtc