Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 // 7. Once a candidate have been found PeerConnection will call the observer | 65 // 7. Once a candidate have been found PeerConnection will call the observer |
| 66 // function OnIceCandidate. Send these candidates to the remote peer. | 66 // function OnIceCandidate. Send these candidates to the remote peer. |
| 67 | 67 |
| 68 #ifndef TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ | 68 #ifndef TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ |
| 69 #define TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ | 69 #define TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ |
| 70 | 70 |
| 71 #include <string> | 71 #include <string> |
| 72 #include <vector> | 72 #include <vector> |
| 73 | 73 |
| 74 #include "talk/app/webrtc/datachannelinterface.h" | 74 #include "talk/app/webrtc/datachannelinterface.h" |
| 75 #include "talk/app/webrtc/dtlscertificate.h" | |
| 75 #include "talk/app/webrtc/dtlsidentitystore.h" | 76 #include "talk/app/webrtc/dtlsidentitystore.h" |
| 76 #include "talk/app/webrtc/dtmfsenderinterface.h" | 77 #include "talk/app/webrtc/dtmfsenderinterface.h" |
| 77 #include "talk/app/webrtc/jsep.h" | 78 #include "talk/app/webrtc/jsep.h" |
| 78 #include "talk/app/webrtc/mediastreaminterface.h" | 79 #include "talk/app/webrtc/mediastreaminterface.h" |
| 79 #include "talk/app/webrtc/statstypes.h" | 80 #include "talk/app/webrtc/statstypes.h" |
| 80 #include "talk/app/webrtc/umametrics.h" | 81 #include "talk/app/webrtc/umametrics.h" |
| 81 #include "webrtc/base/fileutils.h" | 82 #include "webrtc/base/fileutils.h" |
| 82 #include "webrtc/base/network.h" | 83 #include "webrtc/base/network.h" |
| 83 #include "webrtc/base/sslstreamadapter.h" | 84 #include "webrtc/base/sslstreamadapter.h" |
| 84 #include "webrtc/base/socketaddress.h" | 85 #include "webrtc/base/socketaddress.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 // TODO(hbos): Temporary CreatePeerConnection function while we transition | 537 // TODO(hbos): Temporary CreatePeerConnection function while we transition |
| 537 // from DTLSIdentityServiceInterface to DtlsIdentityStoreInterface. | 538 // from DTLSIdentityServiceInterface to DtlsIdentityStoreInterface. |
| 538 rtc::scoped_refptr<PeerConnectionInterface> | 539 rtc::scoped_refptr<PeerConnectionInterface> |
| 539 CreatePeerConnection( | 540 CreatePeerConnection( |
| 540 const PeerConnectionInterface::RTCConfiguration& configuration, | 541 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 541 const MediaConstraintsInterface* constraints, | 542 const MediaConstraintsInterface* constraints, |
| 542 PortAllocatorFactoryInterface* allocator_factory, | 543 PortAllocatorFactoryInterface* allocator_factory, |
| 543 DTLSIdentityServiceInterface* dtls_identity_service, | 544 DTLSIdentityServiceInterface* dtls_identity_service, |
| 544 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 545 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
| 545 PeerConnectionObserver* observer) { | 546 PeerConnectionObserver* observer) { |
| 547 rtc::scoped_refptr<DtlsCertificate> null_cert = nullptr; | |
| 546 return CreatePeerConnection(configuration, constraints, allocator_factory, | 548 return CreatePeerConnection(configuration, constraints, allocator_factory, |
| 547 dtls_identity_service, observer); | 549 dtls_identity_service, null_cert, observer); |
| 548 } | 550 } |
| 549 | 551 |
| 550 // This method takes the ownership of |dtls_identity_service|. | 552 // This method takes the ownership of |dtls_identity_service|. |
| 553 // TODO(hbos): Remove this version of CreatePeerConnection in favor of the | |
| 554 // one taking certificate when Chromium uses it. | |
| 555 rtc::scoped_refptr<PeerConnectionInterface> | |
| 556 CreatePeerConnection( | |
| 557 const PeerConnectionInterface::RTCConfiguration& configuration, | |
| 558 const MediaConstraintsInterface* constraints, | |
| 559 PortAllocatorFactoryInterface* allocator_factory, | |
| 560 DTLSIdentityServiceInterface* dtls_identity_service, | |
| 561 PeerConnectionObserver* observer) { | |
| 562 rtc::scoped_refptr<DtlsCertificate> null_cert = nullptr; | |
| 563 return CreatePeerConnection(configuration, constraints, allocator_factory, | |
| 564 dtls_identity_service, null_cert, observer); | |
| 565 } | |
| 566 | |
| 567 // This method takes the ownership of |dtls_identity_service|. | |
| 551 virtual rtc::scoped_refptr<PeerConnectionInterface> | 568 virtual rtc::scoped_refptr<PeerConnectionInterface> |
| 552 CreatePeerConnection( | 569 CreatePeerConnection( |
| 553 const PeerConnectionInterface::RTCConfiguration& configuration, | 570 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 554 const MediaConstraintsInterface* constraints, | 571 const MediaConstraintsInterface* constraints, |
| 555 PortAllocatorFactoryInterface* allocator_factory, | 572 PortAllocatorFactoryInterface* allocator_factory, |
| 556 DTLSIdentityServiceInterface* dtls_identity_service, | 573 DTLSIdentityServiceInterface* dtls_identity_service, |
| 574 rtc::scoped_refptr<DtlsCertificate> certificate, | |
| 557 PeerConnectionObserver* observer) = 0; | 575 PeerConnectionObserver* observer) = 0; |
|
hbos
2015/08/06 12:11:34
I should add a comment saying what |dtls_identity_
| |
| 558 | 576 |
| 559 // TODO(mallinath) : Remove below versions after clients are updated | 577 // TODO(mallinath) : Remove below versions after clients are updated |
| 560 // to above method. | 578 // to above method. |
| 561 // In latest W3C WebRTC draft, PC constructor will take RTCConfiguration, | 579 // In latest W3C WebRTC draft, PC constructor will take RTCConfiguration, |
| 562 // and not IceServers. RTCConfiguration is made up of ice servers and | 580 // and not IceServers. RTCConfiguration is made up of ice servers and |
| 563 // ice transport type. | 581 // ice transport type. |
| 564 // http://dev.w3.org/2011/webrtc/editor/webrtc.html | 582 // http://dev.w3.org/2011/webrtc/editor/webrtc.html |
| 565 inline rtc::scoped_refptr<PeerConnectionInterface> | 583 inline rtc::scoped_refptr<PeerConnectionInterface> |
| 566 CreatePeerConnection( | 584 CreatePeerConnection( |
| 567 const PeerConnectionInterface::IceServers& servers, | 585 const PeerConnectionInterface::IceServers& servers, |
| 568 const MediaConstraintsInterface* constraints, | 586 const MediaConstraintsInterface* constraints, |
| 569 PortAllocatorFactoryInterface* allocator_factory, | 587 PortAllocatorFactoryInterface* allocator_factory, |
| 570 DTLSIdentityServiceInterface* dtls_identity_service, | 588 DTLSIdentityServiceInterface* dtls_identity_service, |
| 571 PeerConnectionObserver* observer) { | 589 PeerConnectionObserver* observer) { |
| 572 PeerConnectionInterface::RTCConfiguration rtc_config; | 590 PeerConnectionInterface::RTCConfiguration rtc_config; |
| 573 rtc_config.servers = servers; | 591 rtc_config.servers = servers; |
| 592 rtc::scoped_refptr<DtlsCertificate> null_cert = nullptr; | |
| 574 return CreatePeerConnection(rtc_config, constraints, allocator_factory, | 593 return CreatePeerConnection(rtc_config, constraints, allocator_factory, |
| 575 dtls_identity_service, observer); | 594 dtls_identity_service, null_cert, observer); |
| 576 } | 595 } |
| 577 | 596 |
| 578 virtual rtc::scoped_refptr<MediaStreamInterface> | 597 virtual rtc::scoped_refptr<MediaStreamInterface> |
| 579 CreateLocalMediaStream(const std::string& label) = 0; | 598 CreateLocalMediaStream(const std::string& label) = 0; |
| 580 | 599 |
| 581 // Creates a AudioSourceInterface. | 600 // Creates a AudioSourceInterface. |
| 582 // |constraints| decides audio processing settings but can be NULL. | 601 // |constraints| decides audio processing settings but can be NULL. |
| 583 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( | 602 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( |
| 584 const MediaConstraintsInterface* constraints) = 0; | 603 const MediaConstraintsInterface* constraints) = 0; |
| 585 | 604 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 626 CreatePeerConnectionFactory( | 645 CreatePeerConnectionFactory( |
| 627 rtc::Thread* worker_thread, | 646 rtc::Thread* worker_thread, |
| 628 rtc::Thread* signaling_thread, | 647 rtc::Thread* signaling_thread, |
| 629 AudioDeviceModule* default_adm, | 648 AudioDeviceModule* default_adm, |
| 630 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 649 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
| 631 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 650 cricket::WebRtcVideoDecoderFactory* decoder_factory); |
| 632 | 651 |
| 633 } // namespace webrtc | 652 } // namespace webrtc |
| 634 | 653 |
| 635 #endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ | 654 #endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ |
| OLD | NEW |