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 12 matching lines...) Expand all Loading... |
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 #include "talk/app/webrtc/webrtcsession.h" | 28 #include "talk/app/webrtc/webrtcsession.h" |
29 | 29 |
30 #include <limits.h> | 30 #include <limits.h> |
31 | 31 |
32 #include <algorithm> | 32 #include <algorithm> |
| 33 #include <set> |
| 34 #include <utility> |
33 #include <vector> | 35 #include <vector> |
34 #include <set> | |
35 | 36 |
36 #include "talk/app/webrtc/jsepicecandidate.h" | 37 #include "talk/app/webrtc/jsepicecandidate.h" |
37 #include "talk/app/webrtc/jsepsessiondescription.h" | 38 #include "talk/app/webrtc/jsepsessiondescription.h" |
38 #include "talk/app/webrtc/mediaconstraintsinterface.h" | 39 #include "talk/app/webrtc/mediaconstraintsinterface.h" |
39 #include "talk/app/webrtc/peerconnectioninterface.h" | 40 #include "talk/app/webrtc/peerconnectioninterface.h" |
40 #include "talk/app/webrtc/sctputils.h" | 41 #include "talk/app/webrtc/sctputils.h" |
41 #include "talk/app/webrtc/webrtcsessiondescriptionfactory.h" | 42 #include "talk/app/webrtc/webrtcsessiondescriptionfactory.h" |
42 #include "talk/media/base/constants.h" | 43 #include "talk/media/base/constants.h" |
43 #include "talk/media/base/videocapturer.h" | 44 #include "talk/media/base/videocapturer.h" |
44 #include "talk/session/media/channel.h" | 45 #include "talk/session/media/channel.h" |
45 #include "talk/session/media/channelmanager.h" | 46 #include "talk/session/media/channelmanager.h" |
46 #include "talk/session/media/mediasession.h" | 47 #include "talk/session/media/mediasession.h" |
| 48 #include "webrtc/audio/audio_sink.h" |
47 #include "webrtc/base/basictypes.h" | 49 #include "webrtc/base/basictypes.h" |
48 #include "webrtc/base/checks.h" | 50 #include "webrtc/base/checks.h" |
49 #include "webrtc/base/helpers.h" | 51 #include "webrtc/base/helpers.h" |
50 #include "webrtc/base/logging.h" | 52 #include "webrtc/base/logging.h" |
51 #include "webrtc/base/stringencode.h" | 53 #include "webrtc/base/stringencode.h" |
52 #include "webrtc/base/stringutils.h" | 54 #include "webrtc/base/stringutils.h" |
53 #include "webrtc/call.h" | 55 #include "webrtc/call.h" |
54 #include "webrtc/p2p/base/portallocator.h" | 56 #include "webrtc/p2p/base/portallocator.h" |
55 #include "webrtc/p2p/base/transportchannel.h" | 57 #include "webrtc/p2p/base/transportchannel.h" |
56 | 58 |
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 if (!voice_channel_) { | 1317 if (!voice_channel_) { |
1316 LOG(LS_ERROR) << "SetAudioPlayoutVolume: No audio channel exists."; | 1318 LOG(LS_ERROR) << "SetAudioPlayoutVolume: No audio channel exists."; |
1317 return; | 1319 return; |
1318 } | 1320 } |
1319 | 1321 |
1320 if (!voice_channel_->SetOutputVolume(ssrc, volume)) { | 1322 if (!voice_channel_->SetOutputVolume(ssrc, volume)) { |
1321 ASSERT(false); | 1323 ASSERT(false); |
1322 } | 1324 } |
1323 } | 1325 } |
1324 | 1326 |
| 1327 void WebRtcSession::SetRawAudioSink(uint32_t ssrc, |
| 1328 rtc::scoped_ptr<AudioSinkInterface> sink) { |
| 1329 ASSERT(signaling_thread()->IsCurrent()); |
| 1330 if (!voice_channel_) |
| 1331 return; |
| 1332 |
| 1333 voice_channel_->SetRawAudioSink(ssrc, std::move(sink)); |
| 1334 } |
| 1335 |
1325 bool WebRtcSession::SetCaptureDevice(uint32_t ssrc, | 1336 bool WebRtcSession::SetCaptureDevice(uint32_t ssrc, |
1326 cricket::VideoCapturer* camera) { | 1337 cricket::VideoCapturer* camera) { |
1327 ASSERT(signaling_thread()->IsCurrent()); | 1338 ASSERT(signaling_thread()->IsCurrent()); |
1328 | 1339 |
1329 if (!video_channel_) { | 1340 if (!video_channel_) { |
1330 // |video_channel_| doesnt't exist. Probably because the remote end doesnt't | 1341 // |video_channel_| doesnt't exist. Probably because the remote end doesnt't |
1331 // support video. | 1342 // support video. |
1332 LOG(LS_WARNING) << "Video not used in this call."; | 1343 LOG(LS_WARNING) << "Video not used in this call."; |
1333 return false; | 1344 return false; |
1334 } | 1345 } |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2189 } | 2200 } |
2190 } | 2201 } |
2191 | 2202 |
2192 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2203 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
2193 const rtc::SentPacket& sent_packet) { | 2204 const rtc::SentPacket& sent_packet) { |
2194 RTC_DCHECK(worker_thread()->IsCurrent()); | 2205 RTC_DCHECK(worker_thread()->IsCurrent()); |
2195 media_controller_->call_w()->OnSentPacket(sent_packet); | 2206 media_controller_->call_w()->OnSentPacket(sent_packet); |
2196 } | 2207 } |
2197 | 2208 |
2198 } // namespace webrtc | 2209 } // namespace webrtc |
OLD | NEW |