Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 
| 3 * | 3 * | 
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license | 
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source | 
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found | 
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may | 
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. | 
| 9 */ | 9 */ | 
| 10 | 10 | 
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 } | 78 } | 
| 79 | 79 | 
| 80 namespace cricket { | 80 namespace cricket { | 
| 81 class WebRtcVideoDecoderFactory; | 81 class WebRtcVideoDecoderFactory; | 
| 82 class WebRtcVideoEncoderFactory; | 82 class WebRtcVideoEncoderFactory; | 
| 83 } | 83 } | 
| 84 | 84 | 
| 85 namespace webrtc { | 85 namespace webrtc { | 
| 86 class AudioDeviceModule; | 86 class AudioDeviceModule; | 
| 87 class MediaConstraintsInterface; | 87 class MediaConstraintsInterface; | 
| 88 typedef rtc::scoped_refptr<IceCandidateInterface> IceCandidateInterfaceRefPtr; | |
| 88 | 89 | 
| 89 // MediaStream container interface. | 90 // MediaStream container interface. | 
| 90 class StreamCollectionInterface : public rtc::RefCountInterface { | 91 class StreamCollectionInterface : public rtc::RefCountInterface { | 
| 91 public: | 92 public: | 
| 92 // TODO(ronghuawu): Update the function names to c++ style, e.g. find -> Find. | 93 // TODO(ronghuawu): Update the function names to c++ style, e.g. find -> Find. | 
| 93 virtual size_t count() = 0; | 94 virtual size_t count() = 0; | 
| 94 virtual MediaStreamInterface* at(size_t index) = 0; | 95 virtual MediaStreamInterface* at(size_t index) = 0; | 
| 95 virtual MediaStreamInterface* find(const std::string& label) = 0; | 96 virtual MediaStreamInterface* find(const std::string& label) = 0; | 
| 96 virtual MediaStreamTrackInterface* FindAudioTrack( | 97 virtual MediaStreamTrackInterface* FindAudioTrack( | 
| 97 const std::string& id) = 0; | 98 const std::string& id) = 0; | 
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 410 return false; | 411 return false; | 
| 411 } | 412 } | 
| 412 // Provides a remote candidate to the ICE Agent. | 413 // Provides a remote candidate to the ICE Agent. | 
| 413 // A copy of the |candidate| will be created and added to the remote | 414 // A copy of the |candidate| will be created and added to the remote | 
| 414 // description. So the caller of this method still has the ownership of the | 415 // description. So the caller of this method still has the ownership of the | 
| 415 // |candidate|. | 416 // |candidate|. | 
| 416 // TODO(ronghuawu): Consider to change this so that the AddIceCandidate will | 417 // TODO(ronghuawu): Consider to change this so that the AddIceCandidate will | 
| 417 // take the ownership of the |candidate|. | 418 // take the ownership of the |candidate|. | 
| 418 virtual bool AddIceCandidate(const IceCandidateInterface* candidate) = 0; | 419 virtual bool AddIceCandidate(const IceCandidateInterface* candidate) = 0; | 
| 419 | 420 | 
| 421 // Removes a group of remote candidates from the ICE agent. | |
| 422 // TODO(honghaiz): make it a pure virtual method once all the subclasses have | |
| 423 // implemented this method. | |
| 424 virtual bool RemoveIceCandidates( | |
| 425 const std::vector<IceCandidateInterfaceRefPtr>& candidates) { | |
| 426 return false; | |
| 427 } | |
| 428 | |
| 420 virtual void RegisterUMAObserver(UMAObserver* observer) = 0; | 429 virtual void RegisterUMAObserver(UMAObserver* observer) = 0; | 
| 421 | 430 | 
| 422 // Returns the current SignalingState. | 431 // Returns the current SignalingState. | 
| 423 virtual SignalingState signaling_state() = 0; | 432 virtual SignalingState signaling_state() = 0; | 
| 424 | 433 | 
| 425 // TODO(bemasc): Remove ice_state when callers are changed to | 434 // TODO(bemasc): Remove ice_state when callers are changed to | 
| 426 // IceConnection/GatheringState. | 435 // IceConnection/GatheringState. | 
| 427 // Returns the current IceState. | 436 // Returns the current IceState. | 
| 428 virtual IceState ice_state() = 0; | 437 virtual IceState ice_state() = 0; | 
| 429 virtual IceConnectionState ice_connection_state() = 0; | 438 virtual IceConnectionState ice_connection_state() = 0; | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 466 virtual void OnIceConnectionChange( | 475 virtual void OnIceConnectionChange( | 
| 467 PeerConnectionInterface::IceConnectionState new_state) = 0; | 476 PeerConnectionInterface::IceConnectionState new_state) = 0; | 
| 468 | 477 | 
| 469 // Called any time the IceGatheringState changes | 478 // Called any time the IceGatheringState changes | 
| 470 virtual void OnIceGatheringChange( | 479 virtual void OnIceGatheringChange( | 
| 471 PeerConnectionInterface::IceGatheringState new_state) = 0; | 480 PeerConnectionInterface::IceGatheringState new_state) = 0; | 
| 472 | 481 | 
| 473 // New Ice candidate have been found. | 482 // New Ice candidate have been found. | 
| 474 virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0; | 483 virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0; | 
| 475 | 484 | 
| 485 // Ice candidates have been removed. | |
| 486 // TODO(honghaiz): Make this a pure virtual method when all its subclasses | |
| 487 // implement it. | |
| 488 virtual void OnIceCandidatesRemoved( | |
| 489 const std::vector<IceCandidateInterfaceRefPtr>& candidates){}; | |
| 
 
pthatcher1
2016/03/01 23:51:53
Same here.  I don't understand why ref counting is
 
honghaiz3
2016/03/02 19:06:40
Since we need it in one place, I think we should j
 
 | |
| 490 | |
| 476 // Called when the ICE connection receiving status changes. | 491 // Called when the ICE connection receiving status changes. | 
| 477 virtual void OnIceConnectionReceivingChange(bool receiving) {} | 492 virtual void OnIceConnectionReceivingChange(bool receiving) {} | 
| 478 | 493 | 
| 479 protected: | 494 protected: | 
| 480 // Dtor protected as objects shouldn't be deleted via this interface. | 495 // Dtor protected as objects shouldn't be deleted via this interface. | 
| 481 ~PeerConnectionObserver() {} | 496 ~PeerConnectionObserver() {} | 
| 482 }; | 497 }; | 
| 483 | 498 | 
| 484 // PeerConnectionFactoryInterface is the factory interface use for creating | 499 // PeerConnectionFactoryInterface is the factory interface use for creating | 
| 485 // PeerConnection, MediaStream and media tracks. | 500 // PeerConnection, MediaStream and media tracks. | 
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 596 CreatePeerConnectionFactory( | 611 CreatePeerConnectionFactory( | 
| 597 rtc::Thread* worker_thread, | 612 rtc::Thread* worker_thread, | 
| 598 rtc::Thread* signaling_thread, | 613 rtc::Thread* signaling_thread, | 
| 599 AudioDeviceModule* default_adm, | 614 AudioDeviceModule* default_adm, | 
| 600 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 615 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 
| 601 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 616 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 
| 602 | 617 | 
| 603 } // namespace webrtc | 618 } // namespace webrtc | 
| 604 | 619 | 
| 605 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ | 620 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ | 
| OLD | NEW |