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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #include "talk/app/webrtc/audiotrack.h" | 33 #include "talk/app/webrtc/audiotrack.h" |
34 #include "talk/app/webrtc/dtmfsender.h" | 34 #include "talk/app/webrtc/dtmfsender.h" |
35 #include "talk/app/webrtc/jsepicecandidate.h" | 35 #include "talk/app/webrtc/jsepicecandidate.h" |
36 #include "talk/app/webrtc/jsepsessiondescription.h" | 36 #include "talk/app/webrtc/jsepsessiondescription.h" |
37 #include "talk/app/webrtc/mediaconstraintsinterface.h" | 37 #include "talk/app/webrtc/mediaconstraintsinterface.h" |
38 #include "talk/app/webrtc/mediastream.h" | 38 #include "talk/app/webrtc/mediastream.h" |
39 #include "talk/app/webrtc/mediastreamproxy.h" | 39 #include "talk/app/webrtc/mediastreamproxy.h" |
40 #include "talk/app/webrtc/mediastreamtrackproxy.h" | 40 #include "talk/app/webrtc/mediastreamtrackproxy.h" |
41 #include "talk/app/webrtc/remoteaudiosource.h" | 41 #include "talk/app/webrtc/remoteaudiosource.h" |
42 #include "talk/app/webrtc/remoteaudiotrack.h" | |
43 #include "talk/app/webrtc/remotevideocapturer.h" | 42 #include "talk/app/webrtc/remotevideocapturer.h" |
44 #include "talk/app/webrtc/rtpreceiver.h" | 43 #include "talk/app/webrtc/rtpreceiver.h" |
45 #include "talk/app/webrtc/rtpsender.h" | 44 #include "talk/app/webrtc/rtpsender.h" |
46 #include "talk/app/webrtc/streamcollection.h" | 45 #include "talk/app/webrtc/streamcollection.h" |
47 #include "talk/app/webrtc/videosource.h" | 46 #include "talk/app/webrtc/videosource.h" |
48 #include "talk/app/webrtc/videotrack.h" | 47 #include "talk/app/webrtc/videotrack.h" |
49 #include "talk/media/sctp/sctpdataengine.h" | 48 #include "talk/media/sctp/sctpdataengine.h" |
50 #include "talk/session/media/channelmanager.h" | 49 #include "talk/session/media/channelmanager.h" |
51 #include "webrtc/base/arraysize.h" | 50 #include "webrtc/base/arraysize.h" |
52 #include "webrtc/base/logging.h" | 51 #include "webrtc/base/logging.h" |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 rtc::scoped_refptr<MediaStreamInterface> CreateMediaStream( | 445 rtc::scoped_refptr<MediaStreamInterface> CreateMediaStream( |
447 const std::string& stream_label) { | 446 const std::string& stream_label) { |
448 return MediaStreamProxy::Create(signaling_thread_, | 447 return MediaStreamProxy::Create(signaling_thread_, |
449 MediaStream::Create(stream_label)); | 448 MediaStream::Create(stream_label)); |
450 } | 449 } |
451 | 450 |
452 AudioTrackInterface* AddAudioTrack(uint32_t ssrc, | 451 AudioTrackInterface* AddAudioTrack(uint32_t ssrc, |
453 AudioProviderInterface* provider, | 452 AudioProviderInterface* provider, |
454 webrtc::MediaStreamInterface* stream, | 453 webrtc::MediaStreamInterface* stream, |
455 const std::string& track_id) { | 454 const std::string& track_id) { |
456 return AddTrack<AudioTrackInterface, RemoteAudioTrack, AudioTrackProxy>( | 455 return AddTrack<AudioTrackInterface, AudioTrack, AudioTrackProxy>( |
457 stream, track_id, RemoteAudioSource::Create(ssrc, provider)); | 456 stream, track_id, RemoteAudioSource::Create(ssrc, provider)); |
458 } | 457 } |
459 | 458 |
460 VideoTrackInterface* AddVideoTrack(webrtc::MediaStreamInterface* stream, | 459 VideoTrackInterface* AddVideoTrack(webrtc::MediaStreamInterface* stream, |
461 const std::string& track_id) { | 460 const std::string& track_id) { |
462 return AddTrack<VideoTrackInterface, VideoTrack, VideoTrackProxy>( | 461 return AddTrack<VideoTrackInterface, VideoTrack, VideoTrackProxy>( |
463 stream, track_id, | 462 stream, track_id, |
464 VideoSource::Create(channel_manager_, new RemoteVideoCapturer(), | 463 VideoSource::Create(channel_manager_, new RemoteVideoCapturer(), |
465 nullptr) | 464 nullptr, true) |
466 .get()); | 465 .get()); |
467 } | 466 } |
468 | 467 |
469 private: | 468 private: |
470 template <typename TI, typename T, typename TP, typename S> | 469 template <typename TI, typename T, typename TP, typename S> |
471 TI* AddTrack(MediaStreamInterface* stream, | 470 TI* AddTrack(MediaStreamInterface* stream, |
472 const std::string& track_id, | 471 const std::string& track_id, |
473 const S& source) { | 472 const S& source) { |
474 rtc::scoped_refptr<TI> track( | 473 rtc::scoped_refptr<TI> track( |
475 TP::Create(signaling_thread_, T::Create(track_id, source))); | 474 TP::Create(signaling_thread_, T::Create(track_id, source))); |
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2020 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { | 2019 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
2021 for (const auto& channel : sctp_data_channels_) { | 2020 for (const auto& channel : sctp_data_channels_) { |
2022 if (channel->id() == sid) { | 2021 if (channel->id() == sid) { |
2023 return channel; | 2022 return channel; |
2024 } | 2023 } |
2025 } | 2024 } |
2026 return nullptr; | 2025 return nullptr; |
2027 } | 2026 } |
2028 | 2027 |
2029 } // namespace webrtc | 2028 } // namespace webrtc |
OLD | NEW |