#include "talk/app/webrtc/jsep.h"
#include "talk/app/webrtc/mediastreaminterface.h"
#include "talk/app/webrtc/statstypes.h"
+#include "talk/app/webrtc/umametrics.h"
#include "talk/base/fileutils.h"
#include "talk/base/socketaddress.h"
virtual ~StatsObserver() {}
};
+class UMAObserver : public talk_base::RefCountInterface {
+ public:
+ virtual void IncrementCounter(UMAMetricsCounter type) = 0;
+ virtual void AddHistogramSample(UMAMetricsName type, int value) = 0;
+
+ protected:
+ virtual ~UMAObserver() {}
+};
+
class PeerConnectionInterface : public talk_base::RefCountInterface {
public:
// See http://dev.w3.org/2011/webrtc/editor/webrtc.html#state-definitions .
};
typedef std::vector<IceServer> IceServers;
+ enum IceTransportsType {
+ kNone,
+ kRelay,
+ kNoHost,
+ kAll
+ };
+
+ struct RTCConfiguration {
+ IceTransportsType type;
+ IceServers servers;
+
+ RTCConfiguration() : type(kAll) {}
+ explicit RTCConfiguration(IceTransportsType type) : type(type) {}
+ };
+
// Used by GetStats to decide which stats to include in the stats reports.
// |kStatsOutputLevelStandard| includes the standard stats for Javascript API;
// |kStatsOutputLevelDebug| includes both the standard stats and additional
// take the ownership of the |candidate|.
virtual bool AddIceCandidate(const IceCandidateInterface* candidate) = 0;
+ virtual void RegisterUMAObserver(UMAObserver* observer) = 0;
+
// Returns the current SignalingState.
virtual SignalingState signaling_state() = 0;
};
virtual void SetOptions(const Options& options) = 0;
- virtual talk_base::scoped_refptr<PeerConnectionInterface>
- CreatePeerConnection(
- const PeerConnectionInterface::IceServers& configuration,
- const MediaConstraintsInterface* constraints,
- DTLSIdentityServiceInterface* dtls_identity_service,
- PeerConnectionObserver* observer) = 0;
+
virtual talk_base::scoped_refptr<PeerConnectionInterface>
CreatePeerConnection(
- const PeerConnectionInterface::IceServers& configuration,
+ const PeerConnectionInterface::RTCConfiguration& configuration,
const MediaConstraintsInterface* constraints,
PortAllocatorFactoryInterface* allocator_factory,
DTLSIdentityServiceInterface* dtls_identity_service,
PeerConnectionObserver* observer) = 0;
+
+ // TODO(mallinath) : Remove below versions after clients are updated
+ // to above method.
+ // In latest W3C WebRTC draft, PC constructor will take RTCConfiguration,
+ // and not IceServers. RTCConfiguration is made up of ice servers and
+ // ice transport type.
+ // http://dev.w3.org/2011/webrtc/editor/webrtc.html
+ inline talk_base::scoped_refptr<PeerConnectionInterface>
+ CreatePeerConnection(
+ const PeerConnectionInterface::IceServers& configuration,
+ const MediaConstraintsInterface* constraints,
+ PortAllocatorFactoryInterface* allocator_factory,
+ DTLSIdentityServiceInterface* dtls_identity_service,
+ PeerConnectionObserver* observer) {
+ PeerConnectionInterface::RTCConfiguration rtc_config;
+ rtc_config.servers = configuration;
+ return CreatePeerConnection(rtc_config, constraints, allocator_factory,
+ dtls_identity_service, observer);
+ }
+
virtual talk_base::scoped_refptr<MediaStreamInterface>
CreateLocalMediaStream(const std::string& label) = 0;