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 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 | 1504 |
1505 void VoiceChannel::SetRawAudioSink( | 1505 void VoiceChannel::SetRawAudioSink( |
1506 uint32_t ssrc, | 1506 uint32_t ssrc, |
1507 std::unique_ptr<webrtc::AudioSinkInterface> sink) { | 1507 std::unique_ptr<webrtc::AudioSinkInterface> sink) { |
1508 // We need to work around Bind's lack of support for unique_ptr and ownership | 1508 // We need to work around Bind's lack of support for unique_ptr and ownership |
1509 // passing. So we invoke to our own little routine that gets a pointer to | 1509 // passing. So we invoke to our own little routine that gets a pointer to |
1510 // our local variable. This is OK since we're synchronously invoking. | 1510 // our local variable. This is OK since we're synchronously invoking. |
1511 InvokeOnWorker(Bind(&SetRawAudioSink_w, media_channel(), ssrc, &sink)); | 1511 InvokeOnWorker(Bind(&SetRawAudioSink_w, media_channel(), ssrc, &sink)); |
1512 } | 1512 } |
1513 | 1513 |
1514 webrtc::RtpParameters VoiceChannel::GetRtpParameters(uint32_t ssrc) const { | 1514 webrtc::RtpParameters VoiceChannel::GetRtpSendParameters(uint32_t ssrc) const { |
1515 return worker_thread()->Invoke<webrtc::RtpParameters>( | 1515 return worker_thread()->Invoke<webrtc::RtpParameters>( |
1516 Bind(&VoiceChannel::GetRtpParameters_w, this, ssrc)); | 1516 Bind(&VoiceChannel::GetRtpSendParameters_w, this, ssrc)); |
1517 } | 1517 } |
1518 | 1518 |
1519 webrtc::RtpParameters VoiceChannel::GetRtpParameters_w(uint32_t ssrc) const { | 1519 webrtc::RtpParameters VoiceChannel::GetRtpSendParameters_w( |
1520 return media_channel()->GetRtpParameters(ssrc); | 1520 uint32_t ssrc) const { |
| 1521 return media_channel()->GetRtpSendParameters(ssrc); |
1521 } | 1522 } |
1522 | 1523 |
1523 bool VoiceChannel::SetRtpParameters(uint32_t ssrc, | 1524 bool VoiceChannel::SetRtpSendParameters( |
1524 const webrtc::RtpParameters& parameters) { | 1525 uint32_t ssrc, |
| 1526 const webrtc::RtpParameters& parameters) { |
1525 return InvokeOnWorker( | 1527 return InvokeOnWorker( |
1526 Bind(&VoiceChannel::SetRtpParameters_w, this, ssrc, parameters)); | 1528 Bind(&VoiceChannel::SetRtpSendParameters_w, this, ssrc, parameters)); |
1527 } | 1529 } |
1528 | 1530 |
1529 bool VoiceChannel::SetRtpParameters_w(uint32_t ssrc, | 1531 bool VoiceChannel::SetRtpSendParameters_w(uint32_t ssrc, |
1530 webrtc::RtpParameters parameters) { | 1532 webrtc::RtpParameters parameters) { |
1531 return media_channel()->SetRtpParameters(ssrc, parameters); | 1533 return media_channel()->SetRtpSendParameters(ssrc, parameters); |
| 1534 } |
| 1535 |
| 1536 webrtc::RtpParameters VoiceChannel::GetRtpReceiveParameters( |
| 1537 uint32_t ssrc) const { |
| 1538 return worker_thread()->Invoke<webrtc::RtpParameters>( |
| 1539 Bind(&VoiceChannel::GetRtpReceiveParameters_w, this, ssrc)); |
| 1540 } |
| 1541 |
| 1542 webrtc::RtpParameters VoiceChannel::GetRtpReceiveParameters_w( |
| 1543 uint32_t ssrc) const { |
| 1544 return media_channel()->GetRtpReceiveParameters(ssrc); |
| 1545 } |
| 1546 |
| 1547 bool VoiceChannel::SetRtpReceiveParameters( |
| 1548 uint32_t ssrc, |
| 1549 const webrtc::RtpParameters& parameters) { |
| 1550 return InvokeOnWorker( |
| 1551 Bind(&VoiceChannel::SetRtpReceiveParameters_w, this, ssrc, parameters)); |
| 1552 } |
| 1553 |
| 1554 bool VoiceChannel::SetRtpReceiveParameters_w(uint32_t ssrc, |
| 1555 webrtc::RtpParameters parameters) { |
| 1556 return media_channel()->SetRtpReceiveParameters(ssrc, parameters); |
1532 } | 1557 } |
1533 | 1558 |
1534 bool VoiceChannel::GetStats(VoiceMediaInfo* stats) { | 1559 bool VoiceChannel::GetStats(VoiceMediaInfo* stats) { |
1535 return InvokeOnWorker(Bind(&VoiceMediaChannel::GetStats, | 1560 return InvokeOnWorker(Bind(&VoiceMediaChannel::GetStats, |
1536 media_channel(), stats)); | 1561 media_channel(), stats)); |
1537 } | 1562 } |
1538 | 1563 |
1539 void VoiceChannel::StartMediaMonitor(int cms) { | 1564 void VoiceChannel::StartMediaMonitor(int cms) { |
1540 media_monitor_.reset(new VoiceMediaMonitor(media_channel(), worker_thread(), | 1565 media_monitor_.reset(new VoiceMediaMonitor(media_channel(), worker_thread(), |
1541 rtc::Thread::Current())); | 1566 rtc::Thread::Current())); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1814 Bind(&VideoMediaChannel::SetSource, media_channel(), ssrc, source)); | 1839 Bind(&VideoMediaChannel::SetSource, media_channel(), ssrc, source)); |
1815 } | 1840 } |
1816 | 1841 |
1817 bool VideoChannel::SetVideoSend(uint32_t ssrc, | 1842 bool VideoChannel::SetVideoSend(uint32_t ssrc, |
1818 bool mute, | 1843 bool mute, |
1819 const VideoOptions* options) { | 1844 const VideoOptions* options) { |
1820 return InvokeOnWorker(Bind(&VideoMediaChannel::SetVideoSend, media_channel(), | 1845 return InvokeOnWorker(Bind(&VideoMediaChannel::SetVideoSend, media_channel(), |
1821 ssrc, mute, options)); | 1846 ssrc, mute, options)); |
1822 } | 1847 } |
1823 | 1848 |
1824 webrtc::RtpParameters VideoChannel::GetRtpParameters(uint32_t ssrc) const { | 1849 webrtc::RtpParameters VideoChannel::GetRtpSendParameters(uint32_t ssrc) const { |
1825 return worker_thread()->Invoke<webrtc::RtpParameters>( | 1850 return worker_thread()->Invoke<webrtc::RtpParameters>( |
1826 Bind(&VideoChannel::GetRtpParameters_w, this, ssrc)); | 1851 Bind(&VideoChannel::GetRtpSendParameters_w, this, ssrc)); |
1827 } | 1852 } |
1828 | 1853 |
1829 webrtc::RtpParameters VideoChannel::GetRtpParameters_w(uint32_t ssrc) const { | 1854 webrtc::RtpParameters VideoChannel::GetRtpSendParameters_w( |
1830 return media_channel()->GetRtpParameters(ssrc); | 1855 uint32_t ssrc) const { |
| 1856 return media_channel()->GetRtpSendParameters(ssrc); |
1831 } | 1857 } |
1832 | 1858 |
1833 bool VideoChannel::SetRtpParameters(uint32_t ssrc, | 1859 bool VideoChannel::SetRtpSendParameters( |
1834 const webrtc::RtpParameters& parameters) { | 1860 uint32_t ssrc, |
| 1861 const webrtc::RtpParameters& parameters) { |
1835 return InvokeOnWorker( | 1862 return InvokeOnWorker( |
1836 Bind(&VideoChannel::SetRtpParameters_w, this, ssrc, parameters)); | 1863 Bind(&VideoChannel::SetRtpSendParameters_w, this, ssrc, parameters)); |
1837 } | 1864 } |
1838 | 1865 |
1839 bool VideoChannel::SetRtpParameters_w(uint32_t ssrc, | 1866 bool VideoChannel::SetRtpSendParameters_w(uint32_t ssrc, |
1840 webrtc::RtpParameters parameters) { | 1867 webrtc::RtpParameters parameters) { |
1841 return media_channel()->SetRtpParameters(ssrc, parameters); | 1868 return media_channel()->SetRtpSendParameters(ssrc, parameters); |
| 1869 } |
| 1870 |
| 1871 webrtc::RtpParameters VideoChannel::GetRtpReceiveParameters( |
| 1872 uint32_t ssrc) const { |
| 1873 return worker_thread()->Invoke<webrtc::RtpParameters>( |
| 1874 Bind(&VideoChannel::GetRtpReceiveParameters_w, this, ssrc)); |
| 1875 } |
| 1876 |
| 1877 webrtc::RtpParameters VideoChannel::GetRtpReceiveParameters_w( |
| 1878 uint32_t ssrc) const { |
| 1879 return media_channel()->GetRtpReceiveParameters(ssrc); |
| 1880 } |
| 1881 |
| 1882 bool VideoChannel::SetRtpReceiveParameters( |
| 1883 uint32_t ssrc, |
| 1884 const webrtc::RtpParameters& parameters) { |
| 1885 return InvokeOnWorker( |
| 1886 Bind(&VideoChannel::SetRtpReceiveParameters_w, this, ssrc, parameters)); |
| 1887 } |
| 1888 |
| 1889 bool VideoChannel::SetRtpReceiveParameters_w(uint32_t ssrc, |
| 1890 webrtc::RtpParameters parameters) { |
| 1891 return media_channel()->SetRtpReceiveParameters(ssrc, parameters); |
1842 } | 1892 } |
1843 | 1893 |
1844 void VideoChannel::ChangeState_w() { | 1894 void VideoChannel::ChangeState_w() { |
1845 // Send outgoing data if we're the active call, we have the remote content, | 1895 // Send outgoing data if we're the active call, we have the remote content, |
1846 // and we have had some form of connectivity. | 1896 // and we have had some form of connectivity. |
1847 bool send = IsReadyToSend_w(); | 1897 bool send = IsReadyToSend_w(); |
1848 if (!media_channel()->SetSend(send)) { | 1898 if (!media_channel()->SetSend(send)) { |
1849 LOG(LS_ERROR) << "Failed to SetSend on video channel"; | 1899 LOG(LS_ERROR) << "Failed to SetSend on video channel"; |
1850 // TODO(gangji): Report error back to server. | 1900 // TODO(gangji): Report error back to server. |
1851 } | 1901 } |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2323 return data_channel_type_ == DCT_RTP && BaseChannel::ShouldSetupDtlsSrtp_n(); | 2373 return data_channel_type_ == DCT_RTP && BaseChannel::ShouldSetupDtlsSrtp_n(); |
2324 } | 2374 } |
2325 | 2375 |
2326 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { | 2376 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { |
2327 rtc::TypedMessageData<uint32_t>* message = | 2377 rtc::TypedMessageData<uint32_t>* message = |
2328 new rtc::TypedMessageData<uint32_t>(sid); | 2378 new rtc::TypedMessageData<uint32_t>(sid); |
2329 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); | 2379 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); |
2330 } | 2380 } |
2331 | 2381 |
2332 } // namespace cricket | 2382 } // namespace cricket |
OLD | NEW |