OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2004 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 bool CanInsertDtmf(); | 354 bool CanInsertDtmf(); |
355 // Send and/or play a DTMF |event| according to the |flags|. | 355 // Send and/or play a DTMF |event| according to the |flags|. |
356 // The DTMF out-of-band signal will be used on sending. | 356 // The DTMF out-of-band signal will be used on sending. |
357 // The |ssrc| should be either 0 or a valid send stream ssrc. | 357 // The |ssrc| should be either 0 or a valid send stream ssrc. |
358 // The valid value for the |event| are 0 which corresponding to DTMF | 358 // The valid value for the |event| are 0 which corresponding to DTMF |
359 // event 0-9, *, #, A-D. | 359 // event 0-9, *, #, A-D. |
360 bool InsertDtmf(uint32_t ssrc, int event_code, int duration); | 360 bool InsertDtmf(uint32_t ssrc, int event_code, int duration); |
361 bool SetOutputVolume(uint32_t ssrc, double volume); | 361 bool SetOutputVolume(uint32_t ssrc, double volume); |
362 void SetRawAudioSink(uint32_t ssrc, | 362 void SetRawAudioSink(uint32_t ssrc, |
363 std::unique_ptr<webrtc::AudioSinkInterface> sink); | 363 std::unique_ptr<webrtc::AudioSinkInterface> sink); |
| 364 webrtc::RtpParameters GetRtpParameters(uint32_t ssrc) const; |
| 365 bool SetRtpParameters(uint32_t ssrc, const webrtc::RtpParameters& parameters); |
364 | 366 |
365 // Get statistics about the current media session. | 367 // Get statistics about the current media session. |
366 bool GetStats(VoiceMediaInfo* stats); | 368 bool GetStats(VoiceMediaInfo* stats); |
367 | 369 |
368 // Monitoring functions | 370 // Monitoring functions |
369 sigslot::signal2<VoiceChannel*, const std::vector<ConnectionInfo>&> | 371 sigslot::signal2<VoiceChannel*, const std::vector<ConnectionInfo>&> |
370 SignalConnectionMonitor; | 372 SignalConnectionMonitor; |
371 | 373 |
372 void StartMediaMonitor(int cms); | 374 void StartMediaMonitor(int cms); |
373 void StopMediaMonitor(); | 375 void StopMediaMonitor(); |
374 sigslot::signal2<VoiceChannel*, const VoiceMediaInfo&> SignalMediaMonitor; | 376 sigslot::signal2<VoiceChannel*, const VoiceMediaInfo&> SignalMediaMonitor; |
375 | 377 |
376 void StartAudioMonitor(int cms); | 378 void StartAudioMonitor(int cms); |
377 void StopAudioMonitor(); | 379 void StopAudioMonitor(); |
378 bool IsAudioMonitorRunning() const; | 380 bool IsAudioMonitorRunning() const; |
379 sigslot::signal2<VoiceChannel*, const AudioInfo&> SignalAudioMonitor; | 381 sigslot::signal2<VoiceChannel*, const AudioInfo&> SignalAudioMonitor; |
380 | 382 |
381 int GetInputLevel_w(); | 383 int GetInputLevel_w(); |
382 int GetOutputLevel_w(); | 384 int GetOutputLevel_w(); |
383 void GetActiveStreams_w(AudioInfo::StreamList* actives); | 385 void GetActiveStreams_w(AudioInfo::StreamList* actives); |
| 386 webrtc::RtpParameters GetRtpParameters_w(uint32_t ssrc) const; |
| 387 bool SetRtpParameters_w(uint32_t ssrc, webrtc::RtpParameters parameters); |
384 | 388 |
385 private: | 389 private: |
386 // overrides from BaseChannel | 390 // overrides from BaseChannel |
387 virtual void OnChannelRead(TransportChannel* channel, | 391 virtual void OnChannelRead(TransportChannel* channel, |
388 const char* data, size_t len, | 392 const char* data, size_t len, |
389 const rtc::PacketTime& packet_time, | 393 const rtc::PacketTime& packet_time, |
390 int flags); | 394 int flags); |
391 virtual void ChangeState(); | 395 virtual void ChangeState(); |
392 virtual const ContentInfo* GetFirstContent(const SessionDescription* sdesc); | 396 virtual const ContentInfo* GetFirstContent(const SessionDescription* sdesc); |
393 virtual bool SetLocalContent_w(const MediaContentDescription* content, | 397 virtual bool SetLocalContent_w(const MediaContentDescription* content, |
394 ContentAction action, | 398 ContentAction action, |
395 std::string* error_desc); | 399 std::string* error_desc); |
396 virtual bool SetRemoteContent_w(const MediaContentDescription* content, | 400 virtual bool SetRemoteContent_w(const MediaContentDescription* content, |
397 ContentAction action, | 401 ContentAction action, |
398 std::string* error_desc); | 402 std::string* error_desc); |
399 void HandleEarlyMediaTimeout(); | 403 void HandleEarlyMediaTimeout(); |
400 bool InsertDtmf_w(uint32_t ssrc, int event, int duration); | 404 bool InsertDtmf_w(uint32_t ssrc, int event, int duration); |
401 bool SetOutputVolume_w(uint32_t ssrc, double volume); | 405 bool SetOutputVolume_w(uint32_t ssrc, double volume); |
402 bool GetStats_w(VoiceMediaInfo* stats); | 406 bool GetStats_w(VoiceMediaInfo* stats); |
403 | 407 |
404 virtual void OnMessage(rtc::Message* pmsg); | 408 virtual void OnMessage(rtc::Message* pmsg); |
405 virtual void GetSrtpCryptoSuites(std::vector<int>* crypto_suites) const; | 409 virtual void GetSrtpCryptoSuites(std::vector<int>* crypto_suites) const; |
406 virtual void OnConnectionMonitorUpdate( | 410 virtual void OnConnectionMonitorUpdate( |
407 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); | 411 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); |
408 virtual void OnMediaMonitorUpdate( | 412 virtual void OnMediaMonitorUpdate( |
409 VoiceMediaChannel* media_channel, const VoiceMediaInfo& info); | 413 VoiceMediaChannel* media_channel, const VoiceMediaInfo& info); |
410 void OnAudioMonitorUpdate(AudioMonitor* monitor, const AudioInfo& info); | 414 void OnAudioMonitorUpdate(AudioMonitor* monitor, const AudioInfo& info); |
| 415 bool ApplySendParameters(const AudioSendParameters& parameters); |
411 | 416 |
412 static const int kEarlyMediaTimeout = 1000; | 417 static const int kEarlyMediaTimeout = 1000; |
413 MediaEngineInterface* media_engine_; | 418 MediaEngineInterface* media_engine_; |
414 bool received_media_; | 419 bool received_media_; |
415 std::unique_ptr<VoiceMediaMonitor> media_monitor_; | 420 std::unique_ptr<VoiceMediaMonitor> media_monitor_; |
416 std::unique_ptr<AudioMonitor> audio_monitor_; | 421 std::unique_ptr<AudioMonitor> audio_monitor_; |
417 | 422 |
418 // Last AudioSendParameters sent down to the media_channel() via | 423 // Last AudioSendParameters sent down to the media_channel() via |
419 // SetSendParameters. | 424 // SetSendParameters. |
420 AudioSendParameters last_send_params_; | 425 AudioSendParameters last_send_params_; |
(...skipping 24 matching lines...) Expand all Loading... |
445 bool GetStats(VideoMediaInfo* stats); | 450 bool GetStats(VideoMediaInfo* stats); |
446 | 451 |
447 sigslot::signal2<VideoChannel*, const std::vector<ConnectionInfo>&> | 452 sigslot::signal2<VideoChannel*, const std::vector<ConnectionInfo>&> |
448 SignalConnectionMonitor; | 453 SignalConnectionMonitor; |
449 | 454 |
450 void StartMediaMonitor(int cms); | 455 void StartMediaMonitor(int cms); |
451 void StopMediaMonitor(); | 456 void StopMediaMonitor(); |
452 sigslot::signal2<VideoChannel*, const VideoMediaInfo&> SignalMediaMonitor; | 457 sigslot::signal2<VideoChannel*, const VideoMediaInfo&> SignalMediaMonitor; |
453 | 458 |
454 bool SetVideoSend(uint32_t ssrc, bool enable, const VideoOptions* options); | 459 bool SetVideoSend(uint32_t ssrc, bool enable, const VideoOptions* options); |
| 460 webrtc::RtpParameters GetRtpParameters(uint32_t ssrc) const; |
| 461 bool SetRtpParameters(uint32_t ssrc, const webrtc::RtpParameters& parameters); |
455 | 462 |
456 private: | 463 private: |
457 // overrides from BaseChannel | 464 // overrides from BaseChannel |
458 virtual void ChangeState(); | 465 virtual void ChangeState(); |
459 virtual const ContentInfo* GetFirstContent(const SessionDescription* sdesc); | 466 virtual const ContentInfo* GetFirstContent(const SessionDescription* sdesc); |
460 virtual bool SetLocalContent_w(const MediaContentDescription* content, | 467 virtual bool SetLocalContent_w(const MediaContentDescription* content, |
461 ContentAction action, | 468 ContentAction action, |
462 std::string* error_desc); | 469 std::string* error_desc); |
463 virtual bool SetRemoteContent_w(const MediaContentDescription* content, | 470 virtual bool SetRemoteContent_w(const MediaContentDescription* content, |
464 ContentAction action, | 471 ContentAction action, |
465 std::string* error_desc); | 472 std::string* error_desc); |
466 bool GetStats_w(VideoMediaInfo* stats); | 473 bool GetStats_w(VideoMediaInfo* stats); |
| 474 webrtc::RtpParameters GetRtpParameters_w(uint32_t ssrc) const; |
| 475 bool SetRtpParameters_w(uint32_t ssrc, webrtc::RtpParameters parameters); |
| 476 bool ApplySendParameters(const VideoSendParameters& parameters); |
467 | 477 |
468 virtual void OnMessage(rtc::Message* pmsg); | 478 virtual void OnMessage(rtc::Message* pmsg); |
469 virtual void GetSrtpCryptoSuites(std::vector<int>* crypto_suites) const; | 479 virtual void GetSrtpCryptoSuites(std::vector<int>* crypto_suites) const; |
470 virtual void OnConnectionMonitorUpdate( | 480 virtual void OnConnectionMonitorUpdate( |
471 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); | 481 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); |
472 virtual void OnMediaMonitorUpdate( | 482 virtual void OnMediaMonitorUpdate( |
473 VideoMediaChannel* media_channel, const VideoMediaInfo& info); | 483 VideoMediaChannel* media_channel, const VideoMediaInfo& info); |
474 | 484 |
475 std::unique_ptr<VideoMediaMonitor> media_monitor_; | 485 std::unique_ptr<VideoMediaMonitor> media_monitor_; |
476 | 486 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 // SetSendParameters. | 608 // SetSendParameters. |
599 DataSendParameters last_send_params_; | 609 DataSendParameters last_send_params_; |
600 // Last DataRecvParameters sent down to the media_channel() via | 610 // Last DataRecvParameters sent down to the media_channel() via |
601 // SetRecvParameters. | 611 // SetRecvParameters. |
602 DataRecvParameters last_recv_params_; | 612 DataRecvParameters last_recv_params_; |
603 }; | 613 }; |
604 | 614 |
605 } // namespace cricket | 615 } // namespace cricket |
606 | 616 |
607 #endif // WEBRTC_PC_CHANNEL_H_ | 617 #endif // WEBRTC_PC_CHANNEL_H_ |
OLD | NEW |