diff options
author | ronghuawu@google.com <ronghuawu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-11 21:06:02 +0000 |
---|---|---|
committer | ronghuawu@google.com <ronghuawu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-11 21:06:02 +0000 |
commit | 03791c211eb64f360b965c1390442f56bdc1eb34 (patch) | |
tree | f8cfd40d1d7ea855fc56a6815bb7374beac95510 /content/renderer | |
parent | e850e923c7ff3d2d6d2aa6405a1d0f331b85afa3 (diff) | |
download | chromium_src-03791c211eb64f360b965c1390442f56bdc1eb34.zip chromium_src-03791c211eb64f360b965c1390442f56bdc1eb34.tar.gz chromium_src-03791c211eb64f360b965c1390442f56bdc1eb34.tar.bz2 |
Update libjingle 273:278.
TEST=apprtc
Review URL: https://codereview.chromium.org/12207107
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181755 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
11 files changed, 76 insertions, 39 deletions
diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc index d4f9ee9..cf77874f 100644 --- a/content/renderer/media/media_stream_dependency_factory.cc +++ b/content/renderer/media/media_stream_dependency_factory.cc @@ -373,7 +373,7 @@ bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() { scoped_refptr<webrtc::PeerConnectionInterface> MediaStreamDependencyFactory::CreatePeerConnection( - const webrtc::JsepInterface::IceServers& ice_servers, + const webrtc::PeerConnectionInterface::IceServers& ice_servers, const webrtc::MediaConstraintsInterface* constraints, WebKit::WebFrame* web_frame, webrtc::PeerConnectionObserver* observer) { @@ -481,9 +481,11 @@ MediaStreamDependencyFactory::CreateLocalAudioTrack( } webrtc::SessionDescriptionInterface* -MediaStreamDependencyFactory::CreateSessionDescription(const std::string& type, - const std::string& sdp) { - return webrtc::CreateSessionDescription(type, sdp); +MediaStreamDependencyFactory::CreateSessionDescription( + const std::string& type, + const std::string& sdp, + webrtc::SdpParseError* error) { + return webrtc::CreateSessionDescription(type, sdp, error); } webrtc::IceCandidateInterface* MediaStreamDependencyFactory::CreateIceCandidate( diff --git a/content/renderer/media/media_stream_dependency_factory.h b/content/renderer/media/media_stream_dependency_factory.h index 4cee7f3..fe75792 100644 --- a/content/renderer/media/media_stream_dependency_factory.h +++ b/content/renderer/media/media_stream_dependency_factory.h @@ -93,16 +93,18 @@ class CONTENT_EXPORT MediaStreamDependencyFactory // PeerConnection object. // The PeerConnection object is owned by PeerConnectionHandler. virtual scoped_refptr<webrtc::PeerConnectionInterface> - CreatePeerConnection(const webrtc::JsepInterface::IceServers& ice_servers, - const webrtc::MediaConstraintsInterface* constraints, - WebKit::WebFrame* web_frame, - webrtc::PeerConnectionObserver* observer); + CreatePeerConnection( + const webrtc::PeerConnectionInterface::IceServers& ice_servers, + const webrtc::MediaConstraintsInterface* constraints, + WebKit::WebFrame* web_frame, + webrtc::PeerConnectionObserver* observer); // Creates a libjingle representation of a Session description. Used by a // RTCPeerConnectionHandler instance. virtual webrtc::SessionDescriptionInterface* CreateSessionDescription( const std::string& type, - const std::string& sdp); + const std::string& sdp, + webrtc::SdpParseError* error); // Creates a libjingle representation of an ice candidate. virtual webrtc::IceCandidateInterface* CreateIceCandidate( diff --git a/content/renderer/media/mock_media_stream_dependency_factory.cc b/content/renderer/media/mock_media_stream_dependency_factory.cc index 4d5060d..0e7cc56 100644 --- a/content/renderer/media/mock_media_stream_dependency_factory.cc +++ b/content/renderer/media/mock_media_stream_dependency_factory.cc @@ -207,6 +207,11 @@ webrtc::MediaSourceInterface::SourceState MockVideoSource::state() const { return state_; } +const cricket::VideoOptions* MockVideoSource::options() const { + NOTIMPLEMENTED(); + return NULL; +} + MockLocalVideoTrack::MockLocalVideoTrack(std::string id, webrtc::VideoSourceInterface* source) : enabled_(false), @@ -470,8 +475,9 @@ MockMediaStreamDependencyFactory::CreateLocalAudioTrack( SessionDescriptionInterface* MockMediaStreamDependencyFactory::CreateSessionDescription( - const std::string& type, - const std::string& sdp) { + const std::string& type, + const std::string& sdp, + webrtc::SdpParseError* error) { return new MockSessionDescription(type, sdp); } diff --git a/content/renderer/media/mock_media_stream_dependency_factory.h b/content/renderer/media/mock_media_stream_dependency_factory.h index c2c6d96..2e5c585 100644 --- a/content/renderer/media/mock_media_stream_dependency_factory.h +++ b/content/renderer/media/mock_media_stream_dependency_factory.h @@ -23,6 +23,7 @@ class MockVideoSource : public webrtc::VideoSourceInterface { virtual cricket::VideoCapturer* GetVideoCapturer() OVERRIDE; virtual void AddSink(cricket::VideoRenderer* output) OVERRIDE; virtual void RemoveSink(cricket::VideoRenderer* output) OVERRIDE; + virtual const cricket::VideoOptions* options() const OVERRIDE; // Changes the state of the source to live and notifies the observer. void SetLive(); @@ -154,7 +155,8 @@ class MockMediaStreamDependencyFactory : public MediaStreamDependencyFactory { webrtc::AudioSourceInterface* source) OVERRIDE; virtual webrtc::SessionDescriptionInterface* CreateSessionDescription( const std::string& type, - const std::string& sdp) OVERRIDE; + const std::string& sdp, + webrtc::SdpParseError* error) OVERRIDE; virtual webrtc::IceCandidateInterface* CreateIceCandidate( const std::string& sdp_mid, int sdp_mline_index, diff --git a/content/renderer/media/mock_peer_connection_impl.cc b/content/renderer/media/mock_peer_connection_impl.cc index a414030..facf328 100644 --- a/content/renderer/media/mock_peer_connection_impl.cc +++ b/content/renderer/media/mock_peer_connection_impl.cc @@ -288,7 +288,8 @@ void MockPeerConnectionImpl::CreateOffer( const MediaConstraintsInterface* constraints) { DCHECK(observer); created_sessiondescription_.reset( - dependency_factory_->CreateSessionDescription("unknown", kDummyOffer)); + dependency_factory_->CreateSessionDescription("unknown", kDummyOffer, + NULL)); } void MockPeerConnectionImpl::CreateAnswer( @@ -296,7 +297,8 @@ void MockPeerConnectionImpl::CreateAnswer( const MediaConstraintsInterface* constraints) { DCHECK(observer); created_sessiondescription_.reset( - dependency_factory_->CreateSessionDescription("unknown", kDummyAnswer)); + dependency_factory_->CreateSessionDescription("unknown", kDummyAnswer, + NULL)); } void MockPeerConnectionImpl::SetLocalDescriptionWorker( @@ -330,4 +332,16 @@ PeerConnectionInterface::IceState MockPeerConnectionImpl::ice_state() { return ice_state_; } +PeerConnectionInterface::IceConnectionState + MockPeerConnectionImpl::ice_connection_state() { + NOTIMPLEMENTED(); + return PeerConnectionInterface::kIceConnectionNew; +} + +PeerConnectionInterface::IceGatheringState + MockPeerConnectionImpl::ice_gathering_state() { + NOTIMPLEMENTED(); + return PeerConnectionInterface::kIceGatheringNew; +} + } // namespace content diff --git a/content/renderer/media/mock_peer_connection_impl.h b/content/renderer/media/mock_peer_connection_impl.h index 6b2b837..95a50f6 100644 --- a/content/renderer/media/mock_peer_connection_impl.h +++ b/content/renderer/media/mock_peer_connection_impl.h @@ -70,6 +70,8 @@ class MockPeerConnectionImpl : public webrtc::PeerConnectionInterface { virtual bool AddIceCandidate( const webrtc::IceCandidateInterface* candidate) OVERRIDE; virtual IceState ice_state() OVERRIDE; + virtual IceConnectionState ice_connection_state() OVERRIDE; + virtual IceGatheringState ice_gathering_state() OVERRIDE; void AddRemoteStream(webrtc::MediaStreamInterface* stream); void SetSignalingState(SignalingState state) { signaling_state_ = state; } diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc index 22ac9a7..207168a 100644 --- a/content/renderer/media/peer_connection_tracker.cc +++ b/content/renderer/media/peer_connection_tracker.cc @@ -23,7 +23,7 @@ using WebKit::WebRTCPeerConnectionHandlerClient; namespace content { static string SerializeServers( - const std::vector<webrtc::JsepInterface::IceServer>& servers) { + const std::vector<webrtc::PeerConnectionInterface::IceServer>& servers) { string result = "["; for (size_t i = 0; i < servers.size(); ++i) { result += servers[i].uri; @@ -241,7 +241,7 @@ void PeerConnectionTracker::OnGetAllStats() { void PeerConnectionTracker::RegisterPeerConnection( RTCPeerConnectionHandler* pc_handler, - const std::vector<webrtc::JsepInterface::IceServer>& servers, + const std::vector<webrtc::PeerConnectionInterface::IceServer>& servers, const RTCMediaConstraints& constraints, const WebKit::WebFrame* frame) { DVLOG(1) << "PeerConnectionTracker::RegisterPeerConnection()"; @@ -310,7 +310,7 @@ void PeerConnectionTracker::TrackSetSessionDescription( void PeerConnectionTracker::TrackUpdateIce( RTCPeerConnectionHandler* pc_handler, - const std::vector<webrtc::JsepInterface::IceServer>& servers, + const std::vector<webrtc::PeerConnectionInterface::IceServer>& servers, const RTCMediaConstraints& options) { string servers_string = "servers: " + SerializeServers(servers); string constraints = diff --git a/content/renderer/media/peer_connection_tracker.h b/content/renderer/media/peer_connection_tracker.h index 72d9d5b..e98da6f 100644 --- a/content/renderer/media/peer_connection_tracker.h +++ b/content/renderer/media/peer_connection_tracker.h @@ -11,7 +11,7 @@ #include "content/public/renderer/render_process_observer.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebRTCPeerConnectionHandlerClient.h" -#include "third_party/libjingle/source/talk/app/webrtc/jsep.h" +#include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h" namespace WebKit { class WebFrame; @@ -66,7 +66,7 @@ class CONTENT_EXPORT PeerConnectionTracker : public RenderProcessObserver { // page in which the PeerConnection is created. void RegisterPeerConnection( RTCPeerConnectionHandler* pc_handler, - const std::vector<webrtc::JsepInterface::IceServer>& servers, + const std::vector<webrtc::PeerConnectionInterface::IceServer>& servers, const RTCMediaConstraints& constraints, const WebKit::WebFrame* frame); @@ -89,7 +89,7 @@ class CONTENT_EXPORT PeerConnectionTracker : public RenderProcessObserver { // Sends an update when Ice candidates are updated. virtual void TrackUpdateIce( RTCPeerConnectionHandler* pc_handler, - const std::vector<webrtc::JsepInterface::IceServer>& servers, + const std::vector<webrtc::PeerConnectionInterface::IceServer>& servers, const RTCMediaConstraints& options); // Sends an update when an Ice candidate is added. diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc index e25c16d..c55b145 100644 --- a/content/renderer/media/rtc_peer_connection_handler.cc +++ b/content/renderer/media/rtc_peer_connection_handler.cc @@ -106,11 +106,11 @@ CreateWebKitSessionDescription( static void GetNativeIceServers( const WebKit::WebRTCConfiguration& server_configuration, - webrtc::JsepInterface::IceServers* servers) { + webrtc::PeerConnectionInterface::IceServers* servers) { if (server_configuration.isNull() || !servers) return; for (size_t i = 0; i < server_configuration.numberOfServers(); ++i) { - webrtc::JsepInterface::IceServer server; + webrtc::PeerConnectionInterface::IceServer server; const WebKit::WebRTCICEServer& webkit_server = server_configuration.server(i); server.password = UTF16ToUTF8(webkit_server.credential()); @@ -335,7 +335,7 @@ bool RTCPeerConnectionHandler::initialize( peer_connection_tracker_ = RenderThreadImpl::current()->peer_connection_tracker(); - webrtc::JsepInterface::IceServers servers; + webrtc::PeerConnectionInterface::IceServers servers; GetNativeIceServers(server_configuration, &servers); RTCMediaConstraints constraints(options); @@ -357,7 +357,7 @@ bool RTCPeerConnectionHandler::InitializeForTest( const WebKit::WebRTCConfiguration& server_configuration, const WebKit::WebMediaConstraints& options, PeerConnectionTracker* peer_connection_tracker) { - webrtc::JsepInterface::IceServers servers; + webrtc::PeerConnectionInterface::IceServers servers; GetNativeIceServers(server_configuration, &servers); RTCMediaConstraints constraints(options); @@ -401,13 +401,16 @@ void RTCPeerConnectionHandler::createAnswer( void RTCPeerConnectionHandler::setLocalDescription( const WebKit::WebRTCVoidRequest& request, const WebKit::WebRTCSessionDescription& description) { + webrtc::SdpParseError error; webrtc::SessionDescriptionInterface* native_desc = - CreateNativeSessionDescription(description); + CreateNativeSessionDescription(description, &error); if (!native_desc) { - const char kReason[] = "Failed to parse SessionDescription."; - LOG(ERROR) << kReason; - WebKit::WebString reason(kReason); - request.requestFailed(reason); + std::string reason_str = "Failed to parse SessionDescription. "; + reason_str.append(error.line); + reason_str.append(" "); + reason_str.append(error.description); + LOG(ERROR) << reason_str; + request.requestFailed(WebKit::WebString::fromUTF8(reason_str)); return; } if (peer_connection_tracker_) @@ -423,13 +426,16 @@ void RTCPeerConnectionHandler::setLocalDescription( void RTCPeerConnectionHandler::setRemoteDescription( const WebKit::WebRTCVoidRequest& request, const WebKit::WebRTCSessionDescription& description) { + webrtc::SdpParseError error; webrtc::SessionDescriptionInterface* native_desc = - CreateNativeSessionDescription(description); + CreateNativeSessionDescription(description, &error); if (!native_desc) { - const char kReason[] = "Failed to parse SessionDescription."; - LOG(ERROR) << kReason; - WebKit::WebString reason(kReason); - request.requestFailed(reason); + std::string reason_str = "Failed to parse SessionDescription. "; + reason_str.append(error.line); + reason_str.append(" "); + reason_str.append(error.description); + LOG(ERROR) << reason_str; + request.requestFailed(WebKit::WebString::fromUTF8(reason_str)); return; } if (peer_connection_tracker_) @@ -463,7 +469,7 @@ RTCPeerConnectionHandler::remoteDescription() { bool RTCPeerConnectionHandler::updateICE( const WebKit::WebRTCConfiguration& server_configuration, const WebKit::WebMediaConstraints& options) { - webrtc::JsepInterface::IceServers servers; + webrtc::PeerConnectionInterface::IceServers servers; GetNativeIceServers(server_configuration, &servers); RTCMediaConstraints constraints(options); @@ -728,11 +734,12 @@ PeerConnectionTracker* RTCPeerConnectionHandler::peer_connection_tracker() { webrtc::SessionDescriptionInterface* RTCPeerConnectionHandler::CreateNativeSessionDescription( - const WebKit::WebRTCSessionDescription& description) { + const WebKit::WebRTCSessionDescription& description, + webrtc::SdpParseError* error) { std::string sdp = UTF16ToUTF8(description.sdp()); std::string type = UTF16ToUTF8(description.type()); webrtc::SessionDescriptionInterface* native_desc = - dependency_factory_->CreateSessionDescription(type, sdp); + dependency_factory_->CreateSessionDescription(type, sdp, error); LOG_IF(ERROR, !native_desc) << "Failed to create native session description." << " Type: " << type << " SDP: " << sdp; diff --git a/content/renderer/media/rtc_peer_connection_handler.h b/content/renderer/media/rtc_peer_connection_handler.h index 7d0a035..7aa5598 100644 --- a/content/renderer/media/rtc_peer_connection_handler.h +++ b/content/renderer/media/rtc_peer_connection_handler.h @@ -155,7 +155,8 @@ class CONTENT_EXPORT RTCPeerConnectionHandler PeerConnectionTracker* peer_connection_tracker(); private: webrtc::SessionDescriptionInterface* CreateNativeSessionDescription( - const WebKit::WebRTCSessionDescription& description); + const WebKit::WebRTCSessionDescription& description, + webrtc::SdpParseError* error); // |client_| is a weak pointer, and is valid until stop() has returned. WebKit::WebRTCPeerConnectionHandlerClient* client_; diff --git a/content/renderer/media/rtc_peer_connection_handler_unittest.cc b/content/renderer/media/rtc_peer_connection_handler_unittest.cc index a227438..2d58f61 100644 --- a/content/renderer/media/rtc_peer_connection_handler_unittest.cc +++ b/content/renderer/media/rtc_peer_connection_handler_unittest.cc @@ -143,7 +143,8 @@ class MockPeerConnectionTracker : public PeerConnectionTracker { MOCK_METHOD3( TrackUpdateIce, void(RTCPeerConnectionHandler* pc_handler, - const std::vector<webrtc::JsepInterface::IceServer>& servers, + const std::vector< + webrtc::PeerConnectionInterface::IceServer>& servers, const RTCMediaConstraints& options)); MOCK_METHOD3(TrackAddIceCandidate, void(RTCPeerConnectionHandler* pc_handler, |