#include "talk/session/media/mediasession.h"
namespace cricket {
-
+class BaseChannel;
class ChannelManager;
class DataChannel;
class StatsReport;
class Transport;
class VideoCapturer;
-class BaseChannel;
class VideoChannel;
class VoiceChannel;
-
} // namespace cricket
namespace webrtc {
-
class IceRestartAnswerLatch;
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 kPushDownTDFailed[];
extern const char kSdpWithoutCrypto[];
-extern const char kSdpWithoutSdesAndDtlsDisabled[];
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 {
public:
+ IceObserver() {}
// Called any time the IceConnectionState changes
virtual void OnIceConnectionChange(
PeerConnectionInterface::IceConnectionState new_state) {}
protected:
~IceObserver() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(IceObserver);
};
class WebRtcSession : public cricket::BaseSession,
return data_channel_.get();
}
- void set_secure_policy(cricket::SecureMediaPolicy secure_policy);
- cricket::SecureMediaPolicy secure_policy() const;
+ void SetSecurePolicy(cricket::SecureMediaPolicy secure_policy);
+ cricket::SecureMediaPolicy SecurePolicy() const;
// Get current ssl role from transport.
bool GetSslRole(talk_base::SSLRole* role);
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,
cricket::SendDataResult* result) OVERRIDE;
virtual bool ConnectDataChannel(DataChannel* webrtc_data_channel) OVERRIDE;
virtual void DisconnectDataChannel(DataChannel* webrtc_data_channel) OVERRIDE;
- virtual void AddRtpDataStream(uint32 send_ssrc, uint32 recv_ssrc) OVERRIDE;
virtual void AddSctpDataStream(uint32 sid) OVERRIDE;
- virtual void RemoveRtpDataStream(uint32 send_ssrc, uint32 recv_ssrc) OVERRIDE;
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;
// 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);
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);
// 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);
// 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);
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_;
sigslot::signal0<> SignalVoiceChannelDestroyed;
sigslot::signal0<> SignalVideoChannelDestroyed;
sigslot::signal0<> SignalDataChannelDestroyed;
-};
+ DISALLOW_COPY_AND_ASSIGN(WebRtcSession);
+};
} // namespace webrtc
#endif // TALK_APP_WEBRTC_WEBRTCSESSION_H_