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/dtlsidentitystore.h" |
75 #include "talk/app/webrtc/dtmfsenderinterface.h" | 76 #include "talk/app/webrtc/dtmfsenderinterface.h" |
76 #include "talk/app/webrtc/jsep.h" | 77 #include "talk/app/webrtc/jsep.h" |
77 #include "talk/app/webrtc/mediastreaminterface.h" | 78 #include "talk/app/webrtc/mediastreaminterface.h" |
78 #include "talk/app/webrtc/statstypes.h" | 79 #include "talk/app/webrtc/statstypes.h" |
79 #include "talk/app/webrtc/umametrics.h" | 80 #include "talk/app/webrtc/umametrics.h" |
80 #include "webrtc/base/fileutils.h" | 81 #include "webrtc/base/fileutils.h" |
81 #include "webrtc/base/network.h" | 82 #include "webrtc/base/network.h" |
82 #include "webrtc/base/sslstreamadapter.h" | 83 #include "webrtc/base/sslstreamadapter.h" |
83 #include "webrtc/base/socketaddress.h" | 84 #include "webrtc/base/socketaddress.h" |
84 | 85 |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 // After this method is called, the port allocator should consider loopback | 460 // After this method is called, the port allocator should consider loopback |
460 // network interfaces as well. | 461 // network interfaces as well. |
461 virtual void SetNetworkIgnoreMask(int network_ignore_mask) { | 462 virtual void SetNetworkIgnoreMask(int network_ignore_mask) { |
462 } | 463 } |
463 | 464 |
464 protected: | 465 protected: |
465 PortAllocatorFactoryInterface() {} | 466 PortAllocatorFactoryInterface() {} |
466 ~PortAllocatorFactoryInterface() {} | 467 ~PortAllocatorFactoryInterface() {} |
467 }; | 468 }; |
468 | 469 |
469 // Used to receive callbacks of DTLS identity requests. | |
470 class DTLSIdentityRequestObserver : public rtc::RefCountInterface { | |
471 public: | |
472 virtual void OnFailure(int error) = 0; | |
473 // TODO(jiayl): Unify the OnSuccess method once Chrome code is updated. | |
474 virtual void OnSuccess(const std::string& der_cert, | |
475 const std::string& der_private_key) = 0; | |
476 // |identity| is a scoped_ptr because rtc::SSLIdentity is not copyable and the | |
477 // client has to get the ownership of the object to make use of it. | |
478 virtual void OnSuccessWithIdentityObj( | |
479 rtc::scoped_ptr<rtc::SSLIdentity> identity) = 0; | |
480 | |
481 protected: | |
482 virtual ~DTLSIdentityRequestObserver() {} | |
483 }; | |
484 | |
485 class DTLSIdentityServiceInterface { | 470 class DTLSIdentityServiceInterface { |
486 public: | 471 public: |
487 // Asynchronously request a DTLS identity, including a self-signed certificate | 472 // Asynchronously request a DTLS identity, including a self-signed certificate |
488 // and the private key used to sign the certificate, from the identity store | 473 // and the private key used to sign the certificate, from the identity store |
489 // for the given identity name. | 474 // for the given identity name. |
490 // DTLSIdentityRequestObserver::OnSuccess will be called with the identity if | 475 // DTLSIdentityRequestObserver::OnSuccess will be called with the identity if |
491 // the request succeeded; DTLSIdentityRequestObserver::OnFailure will be | 476 // the request succeeded; DTLSIdentityRequestObserver::OnFailure will be |
492 // called with an error code if the request failed. | 477 // called with an error code if the request failed. |
493 // | 478 // |
494 // Only one request can be made at a time. If a second request is called | 479 // Only one request can be made at a time. If a second request is called |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 int network_ignore_mask; | 526 int network_ignore_mask; |
542 | 527 |
543 // Sets the maximum supported protocol version. The highest version | 528 // Sets the maximum supported protocol version. The highest version |
544 // supported by both ends will be used for the connection, i.e. if one | 529 // supported by both ends will be used for the connection, i.e. if one |
545 // party supports DTLS 1.0 and the other DTLS 1.2, DTLS 1.0 will be used. | 530 // party supports DTLS 1.0 and the other DTLS 1.2, DTLS 1.0 will be used. |
546 rtc::SSLProtocolVersion ssl_max_version; | 531 rtc::SSLProtocolVersion ssl_max_version; |
547 }; | 532 }; |
548 | 533 |
549 virtual void SetOptions(const Options& options) = 0; | 534 virtual void SetOptions(const Options& options) = 0; |
550 | 535 |
| 536 // TODO(hbos): Temporary CreatePeerConnection function while we transition |
| 537 // from DTLSIdentityServiceInterface to DtlsIdentityStoreInterface. |
| 538 rtc::scoped_refptr<PeerConnectionInterface> |
| 539 CreatePeerConnection( |
| 540 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 541 const MediaConstraintsInterface* constraints, |
| 542 PortAllocatorFactoryInterface* allocator_factory, |
| 543 DTLSIdentityServiceInterface* dtls_identity_service, |
| 544 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
| 545 PeerConnectionObserver* observer) { |
| 546 return CreatePeerConnection(configuration, constraints, allocator_factory, |
| 547 dtls_identity_service, observer); |
| 548 } |
| 549 |
551 // This method takes the ownership of |dtls_identity_service|. | 550 // This method takes the ownership of |dtls_identity_service|. |
552 virtual rtc::scoped_refptr<PeerConnectionInterface> | 551 virtual rtc::scoped_refptr<PeerConnectionInterface> |
553 CreatePeerConnection( | 552 CreatePeerConnection( |
554 const PeerConnectionInterface::RTCConfiguration& configuration, | 553 const PeerConnectionInterface::RTCConfiguration& configuration, |
555 const MediaConstraintsInterface* constraints, | 554 const MediaConstraintsInterface* constraints, |
556 PortAllocatorFactoryInterface* allocator_factory, | 555 PortAllocatorFactoryInterface* allocator_factory, |
557 DTLSIdentityServiceInterface* dtls_identity_service, | 556 DTLSIdentityServiceInterface* dtls_identity_service, |
558 PeerConnectionObserver* observer) = 0; | 557 PeerConnectionObserver* observer) = 0; |
559 | 558 |
560 // TODO(mallinath) : Remove below versions after clients are updated | 559 // TODO(mallinath) : Remove below versions after clients are updated |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 CreatePeerConnectionFactory( | 626 CreatePeerConnectionFactory( |
628 rtc::Thread* worker_thread, | 627 rtc::Thread* worker_thread, |
629 rtc::Thread* signaling_thread, | 628 rtc::Thread* signaling_thread, |
630 AudioDeviceModule* default_adm, | 629 AudioDeviceModule* default_adm, |
631 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 630 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
632 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 631 cricket::WebRtcVideoDecoderFactory* decoder_factory); |
633 | 632 |
634 } // namespace webrtc | 633 } // namespace webrtc |
635 | 634 |
636 #endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ | 635 #endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ |
OLD | NEW |