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/dtlsidentitystore.h" | 78 #include "talk/app/webrtc/dtlsidentitystore.h" |
78 #include "talk/app/webrtc/jsep.h" | 79 #include "talk/app/webrtc/jsep.h" |
79 #include "talk/app/webrtc/mediastreaminterface.h" | 80 #include "talk/app/webrtc/mediastreaminterface.h" |
80 #include "talk/app/webrtc/statstypes.h" | 81 #include "talk/app/webrtc/statstypes.h" |
81 #include "talk/app/webrtc/umametrics.h" | 82 #include "talk/app/webrtc/umametrics.h" |
82 #include "webrtc/base/fileutils.h" | 83 #include "webrtc/base/fileutils.h" |
83 #include "webrtc/base/network.h" | 84 #include "webrtc/base/network.h" |
84 #include "webrtc/base/sslstreamadapter.h" | 85 #include "webrtc/base/sslstreamadapter.h" |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 548 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
548 PeerConnectionObserver* observer) { | 549 PeerConnectionObserver* observer) { |
549 if (dtls_identity_service) { | 550 if (dtls_identity_service) { |
550 // Store used instead of service, our ownership responsibility to delete. | 551 // Store used instead of service, our ownership responsibility to delete. |
551 delete dtls_identity_service; | 552 delete dtls_identity_service; |
552 } | 553 } |
553 return CreatePeerConnection(configuration, constraints, allocator_factory, | 554 return CreatePeerConnection(configuration, constraints, allocator_factory, |
554 dtls_identity_store.Pass(), observer); | 555 dtls_identity_store.Pass(), observer); |
555 } | 556 } |
556 | 557 |
| 558 // If a |dtls_identity_store| is provided it will be used for |
| 559 // SSLIdentity/DtlsCertificate generation, otherwise a default store will be |
| 560 // used. |
557 virtual rtc::scoped_refptr<PeerConnectionInterface> | 561 virtual rtc::scoped_refptr<PeerConnectionInterface> |
558 CreatePeerConnection( | 562 CreatePeerConnection( |
559 const PeerConnectionInterface::RTCConfiguration& configuration, | 563 const PeerConnectionInterface::RTCConfiguration& configuration, |
560 const MediaConstraintsInterface* constraints, | 564 const MediaConstraintsInterface* constraints, |
561 PortAllocatorFactoryInterface* allocator_factory, | 565 PortAllocatorFactoryInterface* allocator_factory, |
562 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 566 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
563 PeerConnectionObserver* observer) = 0; | 567 PeerConnectionObserver* observer) = 0; |
564 | 568 |
| 569 // With the |certificate| already generated, this version of |
| 570 // CreatePeerConnection can skip the need to generate |
| 571 // SSLIdentity/DtlsCertificate. |certificate| must not be a null reference. |
| 572 virtual rtc::scoped_refptr<PeerConnectionInterface> |
| 573 CreatePeerConnection( |
| 574 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 575 const MediaConstraintsInterface* constraints, |
| 576 PortAllocatorFactoryInterface* allocator_factory, |
| 577 const rtc::scoped_refptr<DtlsCertificate>& certificate, |
| 578 PeerConnectionObserver* observer) = 0; |
| 579 |
565 // TODO(hbos): Remove below version after clients are updated to above method. | 580 // TODO(hbos): Remove below version after clients are updated to above method. |
566 // In latest W3C WebRTC draft, PC constructor will take RTCConfiguration, | 581 // In latest W3C WebRTC draft, PC constructor will take RTCConfiguration, |
567 // and not IceServers. RTCConfiguration is made up of ice servers and | 582 // and not IceServers. RTCConfiguration is made up of ice servers and |
568 // ice transport type. | 583 // ice transport type. |
569 // http://dev.w3.org/2011/webrtc/editor/webrtc.html | 584 // http://dev.w3.org/2011/webrtc/editor/webrtc.html |
570 inline rtc::scoped_refptr<PeerConnectionInterface> | 585 inline rtc::scoped_refptr<PeerConnectionInterface> |
571 CreatePeerConnection( | 586 CreatePeerConnection( |
572 const PeerConnectionInterface::IceServers& servers, | 587 const PeerConnectionInterface::IceServers& servers, |
573 const MediaConstraintsInterface* constraints, | 588 const MediaConstraintsInterface* constraints, |
574 PortAllocatorFactoryInterface* allocator_factory, | 589 PortAllocatorFactoryInterface* allocator_factory, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 CreatePeerConnectionFactory( | 646 CreatePeerConnectionFactory( |
632 rtc::Thread* worker_thread, | 647 rtc::Thread* worker_thread, |
633 rtc::Thread* signaling_thread, | 648 rtc::Thread* signaling_thread, |
634 AudioDeviceModule* default_adm, | 649 AudioDeviceModule* default_adm, |
635 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 650 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
636 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 651 cricket::WebRtcVideoDecoderFactory* decoder_factory); |
637 | 652 |
638 } // namespace webrtc | 653 } // namespace webrtc |
639 | 654 |
640 #endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ | 655 #endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ |
OLD | NEW |