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/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 |
| 85 namespace rtc { | 86 namespace rtc { |
| 86 class SSLIdentity; | 87 class SSLIdentity; |
| 87 class Thread; | 88 class Thread; |
| 88 } | 89 } |
| 89 | 90 |
| 90 namespace cricket { | 91 namespace cricket { |
| 91 class PortAllocator; | 92 class PortAllocator; |
| 92 class WebRtcVideoDecoderFactory; | 93 class WebRtcVideoDecoderFactory; |
| 93 class WebRtcVideoEncoderFactory; | 94 class WebRtcVideoEncoderFactory; |
| 94 } | 95 } |
| 95 | 96 |
| 96 namespace webrtc { | 97 namespace webrtc { |
| 97 class AudioDeviceModule; | 98 class AudioDeviceModule; |
| 99 class DTLSIdentityRequestObserver; | |
|
hbos
2015/08/05 11:41:15
Oops, unnecessary, will remove.
| |
| 98 class MediaConstraintsInterface; | 100 class MediaConstraintsInterface; |
| 99 | 101 |
| 100 // MediaStream container interface. | 102 // MediaStream container interface. |
| 101 class StreamCollectionInterface : public rtc::RefCountInterface { | 103 class StreamCollectionInterface : public rtc::RefCountInterface { |
| 102 public: | 104 public: |
| 103 // TODO(ronghuawu): Update the function names to c++ style, e.g. find -> Find. | 105 // TODO(ronghuawu): Update the function names to c++ style, e.g. find -> Find. |
| 104 virtual size_t count() = 0; | 106 virtual size_t count() = 0; |
| 105 virtual MediaStreamInterface* at(size_t index) = 0; | 107 virtual MediaStreamInterface* at(size_t index) = 0; |
| 106 virtual MediaStreamInterface* find(const std::string& label) = 0; | 108 virtual MediaStreamInterface* find(const std::string& label) = 0; |
| 107 virtual MediaStreamTrackInterface* FindAudioTrack( | 109 virtual MediaStreamTrackInterface* FindAudioTrack( |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 459 // After this method is called, the port allocator should consider loopback | 461 // After this method is called, the port allocator should consider loopback |
| 460 // network interfaces as well. | 462 // network interfaces as well. |
| 461 virtual void SetNetworkIgnoreMask(int network_ignore_mask) { | 463 virtual void SetNetworkIgnoreMask(int network_ignore_mask) { |
| 462 } | 464 } |
| 463 | 465 |
| 464 protected: | 466 protected: |
| 465 PortAllocatorFactoryInterface() {} | 467 PortAllocatorFactoryInterface() {} |
| 466 ~PortAllocatorFactoryInterface() {} | 468 ~PortAllocatorFactoryInterface() {} |
| 467 }; | 469 }; |
| 468 | 470 |
| 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 { | 471 class DTLSIdentityServiceInterface { |
| 486 public: | 472 public: |
| 487 // Asynchronously request a DTLS identity, including a self-signed certificate | 473 // Asynchronously request a DTLS identity, including a self-signed certificate |
| 488 // and the private key used to sign the certificate, from the identity store | 474 // and the private key used to sign the certificate, from the identity store |
| 489 // for the given identity name. | 475 // for the given identity name. |
| 490 // DTLSIdentityRequestObserver::OnSuccess will be called with the identity if | 476 // DTLSIdentityRequestObserver::OnSuccess will be called with the identity if |
| 491 // the request succeeded; DTLSIdentityRequestObserver::OnFailure will be | 477 // the request succeeded; DTLSIdentityRequestObserver::OnFailure will be |
| 492 // called with an error code if the request failed. | 478 // called with an error code if the request failed. |
| 493 // | 479 // |
| 494 // Only one request can be made at a time. If a second request is called | 480 // 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; | 527 int network_ignore_mask; |
| 542 | 528 |
| 543 // Sets the maximum supported protocol version. The highest version | 529 // Sets the maximum supported protocol version. The highest version |
| 544 // supported by both ends will be used for the connection, i.e. if one | 530 // 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. | 531 // party supports DTLS 1.0 and the other DTLS 1.2, DTLS 1.0 will be used. |
| 546 rtc::SSLProtocolVersion ssl_max_version; | 532 rtc::SSLProtocolVersion ssl_max_version; |
| 547 }; | 533 }; |
| 548 | 534 |
| 549 virtual void SetOptions(const Options& options) = 0; | 535 virtual void SetOptions(const Options& options) = 0; |
| 550 | 536 |
| 537 // TODO(hbos): Temporary CreatePeerConnection function while we transition | |
| 538 // from DTLSIdentityServiceInterface to DtlsIdentityStoreInterface. | |
| 539 rtc::scoped_refptr<PeerConnectionInterface> | |
| 540 CreatePeerConnection( | |
| 541 const PeerConnectionInterface::RTCConfiguration& configuration, | |
| 542 const MediaConstraintsInterface* constraints, | |
| 543 PortAllocatorFactoryInterface* allocator_factory, | |
| 544 DTLSIdentityServiceInterface* dtls_identity_service, | |
| 545 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | |
| 546 PeerConnectionObserver* observer) { | |
| 547 return CreatePeerConnection(configuration, constraints, allocator_factory, | |
| 548 dtls_identity_service, observer); | |
| 549 } | |
| 550 | |
| 551 // This method takes the ownership of |dtls_identity_service|. | 551 // This method takes the ownership of |dtls_identity_service|. |
| 552 virtual rtc::scoped_refptr<PeerConnectionInterface> | 552 virtual rtc::scoped_refptr<PeerConnectionInterface> |
| 553 CreatePeerConnection( | 553 CreatePeerConnection( |
| 554 const PeerConnectionInterface::RTCConfiguration& configuration, | 554 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 555 const MediaConstraintsInterface* constraints, | 555 const MediaConstraintsInterface* constraints, |
| 556 PortAllocatorFactoryInterface* allocator_factory, | 556 PortAllocatorFactoryInterface* allocator_factory, |
| 557 DTLSIdentityServiceInterface* dtls_identity_service, | 557 DTLSIdentityServiceInterface* dtls_identity_service, |
| 558 PeerConnectionObserver* observer) = 0; | 558 PeerConnectionObserver* observer) = 0; |
| 559 | 559 |
| 560 // TODO(mallinath) : Remove below versions after clients are updated | 560 // TODO(mallinath) : Remove below versions after clients are updated |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 627 CreatePeerConnectionFactory( | 627 CreatePeerConnectionFactory( |
| 628 rtc::Thread* worker_thread, | 628 rtc::Thread* worker_thread, |
| 629 rtc::Thread* signaling_thread, | 629 rtc::Thread* signaling_thread, |
| 630 AudioDeviceModule* default_adm, | 630 AudioDeviceModule* default_adm, |
| 631 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 631 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
| 632 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 632 cricket::WebRtcVideoDecoderFactory* decoder_factory); |
| 633 | 633 |
| 634 } // namespace webrtc | 634 } // namespace webrtc |
| 635 | 635 |
| 636 #endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ | 636 #endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ |
| OLD | NEW |