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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // These are const to allow them to be called from const methods. | 146 // These are const to allow them to be called from const methods. |
147 rtc::Thread* signaling_thread() const { return signaling_thread_; } | 147 rtc::Thread* signaling_thread() const { return signaling_thread_; } |
148 rtc::Thread* worker_thread() const { return worker_thread_; } | 148 rtc::Thread* worker_thread() const { return worker_thread_; } |
149 cricket::PortAllocator* port_allocator() const { return port_allocator_; } | 149 cricket::PortAllocator* port_allocator() const { return port_allocator_; } |
150 | 150 |
151 // The ID of this session. | 151 // The ID of this session. |
152 const std::string& id() const { return sid_; } | 152 const std::string& id() const { return sid_; } |
153 | 153 |
154 bool Initialize( | 154 bool Initialize( |
155 const PeerConnectionFactoryInterface::Options& options, | 155 const PeerConnectionFactoryInterface::Options& options, |
156 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 156 std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
157 const PeerConnectionInterface::RTCConfiguration& rtc_configuration); | 157 const PeerConnectionInterface::RTCConfiguration& rtc_configuration); |
158 // Deletes the voice, video and data channel and changes the session state | 158 // Deletes the voice, video and data channel and changes the session state |
159 // to STATE_CLOSED. | 159 // to STATE_CLOSED. |
160 void Close(); | 160 void Close(); |
161 | 161 |
162 // Returns true if we were the initial offerer. | 162 // Returns true if we were the initial offerer. |
163 bool initial_offerer() const { return initial_offerer_; } | 163 bool initial_offerer() const { return initial_offerer_; } |
164 | 164 |
165 // Returns the current state of the session. See the enum above for details. | 165 // Returns the current state of the session. See the enum above for details. |
166 // Each time the state changes, we will fire this signal. | 166 // Each time the state changes, we will fire this signal. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 virtual bool GetRemoteTrackIdBySsrc(uint32_t ssrc, std::string* track_id); | 237 virtual bool GetRemoteTrackIdBySsrc(uint32_t ssrc, std::string* track_id); |
238 | 238 |
239 // AudioMediaProviderInterface implementation. | 239 // AudioMediaProviderInterface implementation. |
240 void SetAudioPlayout(uint32_t ssrc, bool enable) override; | 240 void SetAudioPlayout(uint32_t ssrc, bool enable) override; |
241 void SetAudioSend(uint32_t ssrc, | 241 void SetAudioSend(uint32_t ssrc, |
242 bool enable, | 242 bool enable, |
243 const cricket::AudioOptions& options, | 243 const cricket::AudioOptions& options, |
244 cricket::AudioSource* source) override; | 244 cricket::AudioSource* source) override; |
245 void SetAudioPlayoutVolume(uint32_t ssrc, double volume) override; | 245 void SetAudioPlayoutVolume(uint32_t ssrc, double volume) override; |
246 void SetRawAudioSink(uint32_t ssrc, | 246 void SetRawAudioSink(uint32_t ssrc, |
247 rtc::scoped_ptr<AudioSinkInterface> sink) override; | 247 std::unique_ptr<AudioSinkInterface> sink) override; |
248 | 248 |
249 RtpParameters GetAudioRtpParameters(uint32_t ssrc) const override; | 249 RtpParameters GetAudioRtpParameters(uint32_t ssrc) const override; |
250 bool SetAudioRtpParameters(uint32_t ssrc, | 250 bool SetAudioRtpParameters(uint32_t ssrc, |
251 const RtpParameters& parameters) override; | 251 const RtpParameters& parameters) override; |
252 | 252 |
253 // Implements VideoMediaProviderInterface. | 253 // Implements VideoMediaProviderInterface. |
254 bool SetSource( | 254 bool SetSource( |
255 uint32_t ssrc, | 255 uint32_t ssrc, |
256 rtc::VideoSourceInterface<cricket::VideoFrame>* source) override; | 256 rtc::VideoSourceInterface<cricket::VideoFrame>* source) override; |
257 void SetVideoPlayout( | 257 void SetVideoPlayout( |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 rtc::Thread* const worker_thread_; | 472 rtc::Thread* const worker_thread_; |
473 cricket::PortAllocator* const port_allocator_; | 473 cricket::PortAllocator* const port_allocator_; |
474 | 474 |
475 State state_ = STATE_INIT; | 475 State state_ = STATE_INIT; |
476 Error error_ = ERROR_NONE; | 476 Error error_ = ERROR_NONE; |
477 std::string error_desc_; | 477 std::string error_desc_; |
478 | 478 |
479 const std::string sid_; | 479 const std::string sid_; |
480 bool initial_offerer_ = false; | 480 bool initial_offerer_ = false; |
481 | 481 |
482 rtc::scoped_ptr<cricket::TransportController> transport_controller_; | 482 std::unique_ptr<cricket::TransportController> transport_controller_; |
483 MediaControllerInterface* media_controller_; | 483 MediaControllerInterface* media_controller_; |
484 rtc::scoped_ptr<cricket::VoiceChannel> voice_channel_; | 484 std::unique_ptr<cricket::VoiceChannel> voice_channel_; |
485 rtc::scoped_ptr<cricket::VideoChannel> video_channel_; | 485 std::unique_ptr<cricket::VideoChannel> video_channel_; |
486 rtc::scoped_ptr<cricket::DataChannel> data_channel_; | 486 std::unique_ptr<cricket::DataChannel> data_channel_; |
487 cricket::ChannelManager* channel_manager_; | 487 cricket::ChannelManager* channel_manager_; |
488 IceObserver* ice_observer_; | 488 IceObserver* ice_observer_; |
489 PeerConnectionInterface::IceConnectionState ice_connection_state_; | 489 PeerConnectionInterface::IceConnectionState ice_connection_state_; |
490 bool ice_connection_receiving_; | 490 bool ice_connection_receiving_; |
491 rtc::scoped_ptr<SessionDescriptionInterface> local_desc_; | 491 std::unique_ptr<SessionDescriptionInterface> local_desc_; |
492 rtc::scoped_ptr<SessionDescriptionInterface> remote_desc_; | 492 std::unique_ptr<SessionDescriptionInterface> remote_desc_; |
493 // If the remote peer is using a older version of implementation. | 493 // If the remote peer is using a older version of implementation. |
494 bool older_version_remote_peer_; | 494 bool older_version_remote_peer_; |
495 bool dtls_enabled_; | 495 bool dtls_enabled_; |
496 // Specifies which kind of data channel is allowed. This is controlled | 496 // Specifies which kind of data channel is allowed. This is controlled |
497 // by the chrome command-line flag and constraints: | 497 // by the chrome command-line flag and constraints: |
498 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled, | 498 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled, |
499 // constraint kEnableDtlsSrtp is true, and constaint kEnableRtpDataChannels is | 499 // constraint kEnableDtlsSrtp is true, and constaint kEnableRtpDataChannels is |
500 // not set or false, SCTP is allowed (DCT_SCTP); | 500 // not set or false, SCTP is allowed (DCT_SCTP); |
501 // 2. If constraint kEnableRtpDataChannels is true, RTP is allowed (DCT_RTP); | 501 // 2. If constraint kEnableRtpDataChannels is true, RTP is allowed (DCT_RTP); |
502 // 3. If both 1&2 are false, data channel is not allowed (DCT_NONE). | 502 // 3. If both 1&2 are false, data channel is not allowed (DCT_NONE). |
503 cricket::DataChannelType data_channel_type_; | 503 cricket::DataChannelType data_channel_type_; |
504 // List of content names for which the remote side triggered an ICE restart. | 504 // List of content names for which the remote side triggered an ICE restart. |
505 std::set<std::string> pending_ice_restarts_; | 505 std::set<std::string> pending_ice_restarts_; |
506 | 506 |
507 rtc::scoped_ptr<WebRtcSessionDescriptionFactory> | 507 std::unique_ptr<WebRtcSessionDescriptionFactory> webrtc_session_desc_factory_; |
508 webrtc_session_desc_factory_; | |
509 | 508 |
510 // Member variables for caching global options. | 509 // Member variables for caching global options. |
511 cricket::AudioOptions audio_options_; | 510 cricket::AudioOptions audio_options_; |
512 cricket::VideoOptions video_options_; | 511 cricket::VideoOptions video_options_; |
513 MetricsObserverInterface* metrics_observer_; | 512 MetricsObserverInterface* metrics_observer_; |
514 | 513 |
515 // Declares the bundle policy for the WebRTCSession. | 514 // Declares the bundle policy for the WebRTCSession. |
516 PeerConnectionInterface::BundlePolicy bundle_policy_; | 515 PeerConnectionInterface::BundlePolicy bundle_policy_; |
517 | 516 |
518 // Declares the RTCP mux policy for the WebRTCSession. | 517 // Declares the RTCP mux policy for the WebRTCSession. |
519 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; | 518 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; |
520 | 519 |
521 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); | 520 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); |
522 }; | 521 }; |
523 } // namespace webrtc | 522 } // namespace webrtc |
524 | 523 |
525 #endif // WEBRTC_API_WEBRTCSESSION_H_ | 524 #endif // WEBRTC_API_WEBRTCSESSION_H_ |
OLD | NEW |